--- /srv/reproducible-results/rbuild-debian/r-b-build.jt1tzWXh/b1/opensubdiv_3.5.0-2_arm64.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.jt1tzWXh/b2/opensubdiv_3.5.0-2_arm64.changes ├── Files │ @@ -1,9 +1,9 @@ │ │ f27a1ac0b15db3275ada096999438b11 143932 libdevel optional libosd-dev_3.5.0-2_arm64.deb │ - 34d7c6867193288110bdf0466c2f0765 31483760 doc optional libosd-doc_3.5.0-2_all.deb │ + db5bcfd7a6db8920f146907dad527aa9 31482380 doc optional libosd-doc_3.5.0-2_all.deb │ 110c6c1efd0261852cf497d7af61418e 3420132 debug optional libosdcpu3.5.0-dbgsym_3.5.0-2_arm64.deb │ e550ae331ef1e82b29c4f5bde86ceba3 282740 libs optional libosdcpu3.5.0_3.5.0-2_arm64.deb │ 2241c63d557b45faa0001f67ea4d0df8 536528 debug optional libosdgpu3.5.0-dbgsym_3.5.0-2_arm64.deb │ 0b347c5b1172f1d439a5bd646abd2a98 132620 libs optional libosdgpu3.5.0_3.5.0-2_arm64.deb │ 7ede7399c6aa4ac27b606428998177ad 11879280 debug optional opensubdiv-tools-dbgsym_3.5.0-2_arm64.deb │ df3839ae13bba2d9d152a8b79c2f8975 553556 graphics optional opensubdiv-tools_3.5.0-2_arm64.deb ├── libosd-doc_3.5.0-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2022-12-11 09:52:28.000000 debian-binary │ │ --rw-r--r-- 0 0 0 27980 2022-12-11 09:52:28.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 31455588 2022-12-11 09:52:28.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 28000 2022-12-11 09:52:28.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 31454188 2022-12-11 09:52:28.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ │ │ │ ├── line order │ │ │ │ │ @@ -113,29 +113,32 @@ │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00770.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00770.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00770_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00773.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00773.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00773_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00776.html │ │ │ │ │ -usr/share/doc/opensubdiv/doxy_html/a00776.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00776_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00779.html │ │ │ │ │ +usr/share/doc/opensubdiv/doxy_html/a00779.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00779_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00782.html │ │ │ │ │ +usr/share/doc/opensubdiv/doxy_html/a00782.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00782_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00785.html │ │ │ │ │ +usr/share/doc/opensubdiv/doxy_html/a00785.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00785_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00788.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00788.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00788_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00791.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00791.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00791_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00794.html │ │ │ │ │ +usr/share/doc/opensubdiv/doxy_html/a00794.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00794_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00797.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00797.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00797_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00800.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00800.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00800_source.html │ │ │ │ │ @@ -199,15 +202,14 @@ │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00860.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00860.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00860_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00863.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00863.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00863_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00866.html │ │ │ │ │ -usr/share/doc/opensubdiv/doxy_html/a00866.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00866_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00869.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00869.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00869_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00872.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00872.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00872_source.html │ │ │ │ │ @@ -217,32 +219,30 @@ │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00878.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00878.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00878_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00881.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00881.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00881_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00884.html │ │ │ │ │ +usr/share/doc/opensubdiv/doxy_html/a00884.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00884_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00887.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00887.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00887_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00890.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00890.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00890_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00893.html │ │ │ │ │ -usr/share/doc/opensubdiv/doxy_html/a00893.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00893_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00896.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00896.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00896_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00899.html │ │ │ │ │ -usr/share/doc/opensubdiv/doxy_html/a00899.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00899_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00902.html │ │ │ │ │ -usr/share/doc/opensubdiv/doxy_html/a00902.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00902_source.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00905.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00905.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00906.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00906.js │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00907.html │ │ │ │ │ usr/share/doc/opensubdiv/doxy_html/a00907.js │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -27,23 +27,23 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1660 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/css/doxy.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 27698 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/css/flavor.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5321 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/css/pygments.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3011 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/css/renderman-university.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12971 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/css/rst.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 14488 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/downloads.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6364 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 74786 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7099 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 195 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26635 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7173 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 123 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 64467 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7173 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 123 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 64467 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00674_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6364 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 74786 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00677_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7099 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 195 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26635 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00680_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6346 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00683.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 78 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00683.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 34622 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00683_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7292 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00686.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 127 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00686.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 87199 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00686_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6863 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00689.html │ │ │ │ @@ -54,20 +54,20 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 39771 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00692_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6224 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00695.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00695.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 44798 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00695_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6175 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00698.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 55 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00698.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13613 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00698_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7781 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 205 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73225 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7625 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 222 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 143889 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7625 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 222 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 143889 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00704_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7781 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 205 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73225 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00707_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6486 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00710.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 66 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00710.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 65952 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00710_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6924 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00713.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 139 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00713.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 37530 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00713_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 9256 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00716.html │ │ │ │ @@ -81,176 +81,176 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 18965 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00722_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8011 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00725.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 130 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00725.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 210952 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00725_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7601 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00728.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 201 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00728.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 66897 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00728_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7124 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00731.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6533 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00731.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 123 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00731.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 156950 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00731_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6533 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00734.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41643 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00731_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7124 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00734.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 123 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00734.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41643 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00734_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 156950 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00734_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7604 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00737.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 314 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00737.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 49522 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00737_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6977 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00740.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 160 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00740.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 52341 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00740_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 11046 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00743.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1173 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00743.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 22461 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00743_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5687 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00746.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21734 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00746_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5432 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00749.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37914 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00749_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5432 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00746.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37914 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00746_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5687 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00749.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21734 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00749_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5870 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00752.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 85578 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00752_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5990 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00755.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 163100 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00755_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6077 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00758.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 23929 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00758_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6055 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00761.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 81111 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00761_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5902 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00764.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 28747 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00764_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6225 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00767.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 121 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00767.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 45393 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00767_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6086 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 60 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37854 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7368 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 153 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 134755 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6262 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00776.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 59 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00776.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 52972 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00776_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5615 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00779.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 99219 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00779_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5624 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00782.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 88720 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00782_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5541 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00785.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37229 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00785_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6581 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 33086 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6899 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 115 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 127471 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4308 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00794.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10202 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00794_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6213 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23232 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6671 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 65 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 33708 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6948 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 115 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 249312 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5949 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 63 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13628 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6253 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 99 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12331 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6097 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19929 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6592 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34882 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6240 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 79 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24609 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6826 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 124 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 221456 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6034 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 71 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21842 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6265 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 101 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12448 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6104 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16387 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6146 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22400 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6540 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 68 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27167 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6145 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 81 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26150 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6791 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 128 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49005 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6198 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22190 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6999 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 126 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 221754 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6973 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 121 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 236475 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6104 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16709 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6247 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12412 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6274 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19505 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6233 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 78 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22701 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6519 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00866.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 65 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00866.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45624 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00866_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6285 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20583 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9743 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 424 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28840 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 109731 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7905 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 262 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20880 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 109537 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4304 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00884.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12502 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00884_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13417 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 2496 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 177843 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6158 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 68 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18797 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6685 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00893.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00893.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42717 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00893_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 109206 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6475 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00899.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00899.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26583 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00899_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6163 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00902.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00902.js │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19559 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00902_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6581 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 33086 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00770_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6899 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 115 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 127471 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00773_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4308 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00776.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10202 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00776_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6213 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00779.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00779.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23232 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00779_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6671 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00782.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 65 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00782.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 33708 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00782_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6948 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00785.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 115 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00785.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 249312 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00785_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5949 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 63 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13628 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00788_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6097 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19929 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00791_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6253 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00794.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 99 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00794.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12331 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00794_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6592 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34882 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00797_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6240 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 79 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24609 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00800_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6826 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 124 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 221456 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00803_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6034 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 71 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21842 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00806_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6104 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16387 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00809_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6265 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 101 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12448 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00812_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6146 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22400 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00815_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6540 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 68 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27167 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00818_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6145 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 81 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26150 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00821_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6198 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22190 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00824_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6791 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 128 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49005 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00827_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6973 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 121 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 236475 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00830_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6999 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 126 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 221754 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00833_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6104 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16709 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00836_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6247 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 98 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12412 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00839_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6519 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 65 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45624 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00842_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6274 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19505 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00845_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6233 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 78 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22701 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00848_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6285 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20583 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00851_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9743 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 424 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28840 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00854_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 109731 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00857_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7905 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 262 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20880 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00860_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 109537 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00863_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4304 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00866.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12502 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00866_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13417 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 2496 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 177843 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00869_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6685 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42717 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00872_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6158 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 68 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18797 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00875_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6169 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 61 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 109206 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00878_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6475 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26583 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00881_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6163 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00884.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00884.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19559 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00884_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7368 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 153 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 134755 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00887_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6086 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 60 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37854 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00890_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5615 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00893.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 99219 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00893_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6262 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 59 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 52972 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00896_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5541 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00899.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37229 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00899_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5624 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00902.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 88720 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00902_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4475 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00905.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 71 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00905.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5652 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00906.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 216 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00906.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 10649 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00907.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 607 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00907.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 44742 2022-12-11 09:52:28.000000 ./usr/share/doc/opensubdiv/doxy_html/a00908.html │ │ │ ├── ./usr/share/doc/opensubdiv/additional_resources.html │ │ │ │ @@ -234,15 +234,15 @@ │ │ │ │ surfaces helps artists be more productive, and how this code is open │ │ │ │ source and engineered for ease of integration.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -101,14 +101,14 @@ │ │ │ │ │ meet_the_experts_autodesk2013.png] │ │ │ │ │ Join special guests, Bill Polson, Dirk Van Gelder, Manuel Kraemer, Takahito │ │ │ │ │ Tejima, David G. Yu and Dale Ruffolo, from Pixar Animation Studios' GPU team, │ │ │ │ │ as they show how real time display of subdivision surfaces helps artists be │ │ │ │ │ more productive, and how this code is open source and engineered for ease of │ │ │ │ │ integration. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/api_overview.html │ │ │ │ @@ -455,15 +455,15 @@ │ │ │ │
│ │ │ │

Tutorials and Examples

│ │ │ │

For more use cases, please see Tutorials and Examples

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -247,14 +247,14 @@ │ │ │ │ │ glDrawElements(GL_PATCHES, patch.GetNumPatches() * numVertsPerPatch, │ │ │ │ │ GL_UNSIGNED_INT, 0); │ │ │ │ │ 1. As the mesh animates, repeat from step 3 to update positions, refine, and │ │ │ │ │ draw. See glViewer and other examples for more complete usage. │ │ │ │ │ **** Tutorials and Examples **** │ │ │ │ │ For more use cases, please see Tutorials and Examples │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_overview.html │ │ │ │ @@ -1260,15 +1260,15 @@ │ │ │ │ worth simplifying the template complexity here if only one precision is │ │ │ │ ever required.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -808,14 +808,14 @@ │ │ │ │ │ MeshPrimvar const & meshPrimvar, │ │ │ │ │ Surface * surface); │ │ │ │ │ which would then determine the nature of the MeshPrimvar data (interpolated as │ │ │ │ │ vertex, varying or face-varying) and act accordingly. It may also be worth │ │ │ │ │ simplifying the template complexity here if only one precision is ever │ │ │ │ │ required. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_1_1.html │ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -307,14 +307,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_1_2.html │ │ │ │ @@ -436,15 +436,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -317,14 +317,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_1_3.html │ │ │ │ @@ -507,15 +507,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -389,14 +389,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_1_4.html │ │ │ │ @@ -559,15 +559,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -440,14 +440,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_1_5.html │ │ │ │ @@ -468,15 +468,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -349,14 +349,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_2_1.html │ │ │ │ @@ -558,15 +558,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -441,14 +441,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_2_2.html │ │ │ │ @@ -641,15 +641,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -522,14 +522,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_3_1.html │ │ │ │ @@ -509,15 +509,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -391,14 +391,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/bfr_tutorial_3_2.html │ │ │ │ @@ -565,15 +565,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -447,14 +447,14 @@ │ │ │ │ │ delete meshTopology; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/cmake_build.html │ │ │ │ @@ -500,15 +500,15 @@ │ │ │ │ warning in both gcc and Clang. It is recommended to turn the warning off with the │ │ │ │ -Wno-invalid-offsetof flag.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -282,14 +282,14 @@ │ │ │ │ │ link /nologo /out:myapp.exe /LIBPATH:"%OPENSUBDIV%\lib" libosdGPU.lib │ │ │ │ │ libosdCPU.lib myapp.obj │ │ │ │ │ Note: │ │ │ │ │ HBR uses the offsetof macro on a templated struct, which appears to spurriously │ │ │ │ │ set off a warning in both gcc and Clang. It is recommended to turn the warning │ │ │ │ │ off with the -Wno-invalid-offsetof flag. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/code_examples.html │ │ │ │ @@ -290,15 +290,15 @@ │ │ │ │ w : switch display mode │ │ │ │ q : quit │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -114,14 +114,14 @@ │ │ │ │ │ level │ │ │ │ │ +, - : increase / decrease tessellation │ │ │ │ │ Tab : toggle full-screen │ │ │ │ │ Esc : turn on / off the HUD │ │ │ │ │ w : switch display mode │ │ │ │ │ q : quit │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/compatibility.html │ │ │ │ @@ -569,15 +569,15 @@ │ │ │ │ not go undetected. Whether or not this can lead to visual artifacts is │ │ │ │ unclear.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -363,14 +363,14 @@ │ │ │ │ │ coefficient first in the Hbr implementation. With extremely high valence │ │ │ │ │ vertices, a difference in magnitude between the most and least significant │ │ │ │ │ coefficients of several orders of magnitude is likely, and that has a │ │ │ │ │ significant impact on the single-precision floating point computations. │ │ │ │ │ The improved accuracy of OpenSubdiv 3.0 can reach a magnitude that will not go │ │ │ │ │ undetected. Whether or not this can lead to visual artifacts is unclear. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/contributing.html │ │ │ │ @@ -304,15 +304,15 @@ │ │ │ │

Once the change is clean, push your changes to "origin" and go to the GitHub │ │ │ │ website to submit your pull request.

│ │ │ │

Be sure to submit your request against the "dev" branch.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -141,14 +141,14 @@ │ │ │ │ │ If you've followed the steps above, your pending change should already be │ │ │ │ │ queued up as required. If you have not, you may need to rebase and squash │ │ │ │ │ changes at this point. │ │ │ │ │ Once the change is clean, push your changes to "origin" and go to the GitHub │ │ │ │ │ website to submit your pull request. │ │ │ │ │ Be sure to submit your request against the "dev" branch. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/downloads.html │ │ │ │ @@ -299,15 +299,15 @@ │ │ │ │

│ │ │ │ │ │ │ │

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -103,14 +103,14 @@ │ │ │ │ │ Unless required by applicable law or agreed to in writing, software │ │ │ │ │ distributed under the Apache License with the above modification is │ │ │ │ │ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ language governing permissions and limitations under the Apache License. │ │ │ │ │ Accept │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00674.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/vertexDescriptor.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/bfr/tessellation.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,26 +83,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
vertexDescriptor.h File Reference
│ │ │ │ +
tessellation.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../vtr/stackBuffer.h"
│ │ │ │ +#include "../bfr/parameterization.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  VertexDescriptor
 Simple class used by subclasses of SurfaceFactory to describe a vertex. More...
class  Tessellation
 Encapsulates a specific tessellation pattern of a Parameterization. More...
 
class  Tessellation::Options
 Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -111,13 +114,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -vertexDescriptor.h File Reference │ │ │ │ │ +tessellation.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../vtr/stackBuffer.h" │ │ │ │ │ +#include "../bfr/parameterization.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  VertexDescriptor │ │ │ │ │ -  Simple class used by subclasses of SurfaceFactory to describe a vertex. │ │ │ │ │ +class  Tessellation │ │ │ │ │ +  Encapsulates a specific tessellation pattern of a Parameterization. │ │ │ │ │ More... │ │ │ │ │   │ │ │ │ │ +class  Tessellation::Options │ │ │ │ │ + Options configure a Tessellation to specify the nature of both its │ │ │ │ │ +  results and the structure of the coordinate and facet index arrays that │ │ │ │ │ + its methods will populate. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Bfr │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * vertexDescriptor.h │ │ │ │ │ + * tessellation.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00674.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ │ var a00674 = [ │ │ │ │ │ - ["VertexDescriptor", "a00969.html", "a00969"] │ │ │ │ │ + ["Tessellation", "a00961.html", "a00961"], │ │ │ │ │ + ["Tessellation::Options", "a00965.html", "a00965"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00674_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/vertexDescriptor.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/bfr/tessellation.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
vertexDescriptor.h
│ │ │ │ +
tessellation.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2021 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,385 +107,263 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H
│ │ │ │ -
26#define OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_BFR_TESSELLATION_H
│ │ │ │ +
26#define OPENSUBDIV3_BFR_TESSELLATION_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../vtr/stackBuffer.h"
│ │ │ │ +
30#include "../bfr/parameterization.h"
│ │ │ │
31
│ │ │ │
32namespace OpenSubdiv {
│ │ │ │
33namespace OPENSUBDIV_VERSION {
│ │ │ │
34
│ │ │ │
35namespace Bfr {
│ │ │ │
36
│ │ │ │ -
50//
│ │ │ │ -
51// WIP - need to migrate some of these comments into Doxygen
│ │ │ │ -
52// - others will be moved to the external documentation
│ │ │ │ -
53//
│ │ │ │ -
54// It is used by subclasses of SurfaceFactory to provide a complete
│ │ │ │ -
55// topological description for each vertex of a face, i.e. invoked via
│ │ │ │ -
56// the virtual method:
│ │ │ │ -
57//
│ │ │ │ -
58// int populateFaceVertexDescriptor(Index baseFace,
│ │ │ │ -
59// int cornerVertex,
│ │ │ │ -
60// VertexDescriptor & v) const;
│ │ │ │ -
61//
│ │ │ │ -
62// Assignment of the full topology can be involved in the presence of
│ │ │ │ -
63// irregular faces, non-manifold topology or creasing around a vertex, but
│ │ │ │ -
64// many cases will be simple. For example, to specify a regular boundary
│ │ │ │ -
65// vertex of a Catmark mesh without any optional sharpness:
│ │ │ │ -
66//
│ │ │ │ -
67// int numIncidentFaces = 2;
│ │ │ │ -
68// bool vertexOnBoundary = true;
│ │ │ │ -
69//
│ │ │ │ -
70// vd.Initialize(numIncidentFaces);
│ │ │ │ -
71// vd.SetManifold(true);
│ │ │ │ -
72// vd.SetBoundary(vertexOnBoundary);
│ │ │ │ -
73// vd.ClearIncidentFaceSizes();
│ │ │ │ -
74// vd.Finalize();
│ │ │ │ -
75//
│ │ │ │ -
76// For a more general example, to assign a vertex of some valence whose
│ │ │ │ -
77// incident faces are of different sizes (e.g. required when triangles
│ │ │ │ -
78// appear around a vertex in an otherwise quad-dominant Catmark mesh):
│ │ │ │ -
79//
│ │ │ │ -
80// int numIncidentFaces = meshVertex.GetNumIncidentFaces();
│ │ │ │ -
81// bool vertexOnBoundary = meshVertex.IsBoundar();
│ │ │ │ -
82//
│ │ │ │ -
83// vd.Initialize(numIncidentFaces);
│ │ │ │ -
84// vd.SetManifold(true);
│ │ │ │ -
85// vd.SetBoundary(vertexOnBoundary);
│ │ │ │ -
86//
│ │ │ │ -
87// for (int i = 0; i < numIncidentFaces; ++i) {
│ │ │ │ -
88// vd.SetIncidentFaceSize(i, meshVertex.GetIncidentFaceSize(i));
│ │ │ │ -
89// }
│ │ │ │ -
90// vd.Finalize();
│ │ │ │ -
91//
│ │ │ │ -
92// These examples specify the incident faces as forming a manifold ring
│ │ │ │ -
93// (or half-ring) around the vertex, i.e. they can be specified as a
│ │ │ │ -
94// continuous, connected sequence in counter-clockwise order (and also
│ │ │ │ -
95// without degeneracies). In the case of a boundary vertex, the first
│ │ │ │ -
96// face must be on the leading edge of the boundary while the last is on
│ │ │ │ -
97// the trailing edge. For an interior vertex, which face is specified
│ │ │ │ -
98// first does not matter (since the set is periodic).
│ │ │ │ -
99//
│ │ │ │ -
100// In both cases, the location of the base face in this sequence -- the
│ │ │ │ -
101// face whose corner vertex is being described here -- must be specified
│ │ │ │ -
102// in the return value to populateFaceVertexDescriptor() (e.g. when a
│ │ │ │ -
103// boundary vertex has 3 incident faces, a return value of 0, 1 or 2
│ │ │ │ -
104// will indicate which is the base face).
│ │ │ │ -
105//
│ │ │ │ -
106// The corresponding methods to specify mesh control vertex indices (or
│ │ │ │ -
107// face-varying indices) complete the specification of the neighborhood:
│ │ │ │ -
108//
│ │ │ │ -
109// int getFaceCornerVertexIndices(Index baseFace, int cornerVertex,
│ │ │ │ -
110// Index vertexIndices[]) const;
│ │ │ │ -
111//
│ │ │ │ -
112// int getFaceCornerFVarValueIndices(Index baseFace, int cornerVertex,
│ │ │ │ -
113// Index fvarValueIndices[],
│ │ │ │ -
114// int fvarChannel) const;
│ │ │ │ -
115//
│ │ │ │ -
116// and are invoked by the Factory when needed.
│ │ │ │ -
117//
│ │ │ │ -
118// For each incident face, the indices for all vertices of that face are
│ │ │ │ -
119// to be specified (not the one-ring or some other subset). These indices
│ │ │ │ -
120// must also be specified in an orientation relative to the vertex, i.e.
│ │ │ │ -
121// for a vertex A and an incident face with face-vertices that may be
│ │ │ │ -
122// stored internally as {D, C, A, B}, they must be specified with A first
│ │ │ │ -
123// as {A, B, C, D}. This may seem a bit cumbersome, but it has clear
│ │ │ │ -
124// advantages when dealing with face-varying indices and unordered faces.
│ │ │ │ -
125//
│ │ │ │ -
126// More compact ways of specifying vertex indices for ordered, manifold
│ │ │ │ -
127// cases may be worth exploring in future, but face-varying indices and
│ │ │ │ -
128// non-manifold (unordered) vertices will always require such a full set,
│ │ │ │ -
129// so both methods will need to co-exist.
│ │ │ │ -
130//
│ │ │ │ - │ │ │ │ -
132public:
│ │ │ │ -
133 // The full declaration must be enclosed by calls to these methods:
│ │ │ │ -
134 //
│ │ │ │ -
135 // Note that vertex valences or face sizes in excess of those defined
│ │ │ │ -
136 // in Bfr::Limits (typically 16-bits) are not valid. When specifying
│ │ │ │ -
137 // values in excess of these limits, initialization will fail and/or
│ │ │ │ -
138 // the descriptor will be marked invalid and finalization will fail.
│ │ │ │ -
139 //
│ │ │ │ -
140
│ │ │ │ -
142
│ │ │ │ -
149
│ │ │ │ -
151 bool Initialize(int numIncidentFaces);
│ │ │ │ -
152
│ │ │ │ -
154 bool Finalize();
│ │ │ │ -
155
│ │ │ │ -
157 bool IsValid() const;
│ │ │ │ -
159
│ │ │ │ -
160 //
│ │ │ │ -
161 // WIP - need to migrate these comments into Doxygen
│ │ │ │ -
162 //
│ │ │ │ -
163 // Three groups of methods describe the topology around a vertex:
│ │ │ │ -
164 // - simple properties (vertex is a boundary, manifold, etc.)
│ │ │ │ -
165 // - sizes of incident faces (constant or size for each face)
│ │ │ │ -
166 // - sharpness of the vertex and its incident edges (optional)
│ │ │ │ -
167 //
│ │ │ │ -
168
│ │ │ │ -
169 // Manifold and boundary conditions:
│ │ │ │ -
170 //
│ │ │ │ -
171 // The manifold property is a strict condition but preferred for
│ │ │ │ -
172 // efficiency and is usually available from common connected mesh
│ │ │ │ -
173 // representations. When declaring the topology as "manifold",
│ │ │ │ -
174 // the Factory assumes the following:
│ │ │ │ -
175 //
│ │ │ │ -
176 // - all incident faces are "ordered" (counter-clockwise)
│ │ │ │ -
177 // - all incident faces are consistently oriented
│ │ │ │ -
178 // - all incident edges are non-degenerate
│ │ │ │ -
179 //
│ │ │ │ -
180 // If not certain that all of these conditions are met, it is best
│ │ │ │ -
181 // to not declare manifold -- leaving the Factory to make sense of
│ │ │ │ -
182 // the set of incident faces from the face-vertex indices that are
│ │ │ │ -
183 // provided elsewhere.
│ │ │ │ -
184 //
│ │ │ │ -
185
│ │ │ │ -
187
│ │ │ │ -
191
│ │ │ │ -
193 void SetManifold(bool isManifold);
│ │ │ │ -
194
│ │ │ │ -
196 void SetBoundary(bool isOnBoundary);
│ │ │ │ -
197
│ │ │ │ -
199 void SetIncidentFaceSize(int faceIndex, int faceSize);
│ │ │ │ -
200
│ │ │ │ - │ │ │ │ + │ │ │ │ +
52public:
│ │ │ │ +
65 class Options {
│ │ │ │ +
66 public:
│ │ │ │ +
67 Options() : _preserveQuads(false), _facetSize4(false),
│ │ │ │ +
68 _coordStride(0), _facetStride(0) { }
│ │ │ │ +
69
│ │ │ │ +
72 Options & PreserveQuads(bool on);
│ │ │ │ +
74 bool PreserveQuads() const { return _preserveQuads; }
│ │ │ │ +
75
│ │ │ │ +
78 Options & SetFacetSize(int numIndices);
│ │ │ │ +
79 // @brief Return the number of indices per facet
│ │ │ │ +
80 int GetFacetSize() const { return 3 + (int)_facetSize4; }
│ │ │ │ +
81
│ │ │ │ +
83 Options & SetFacetStride(int stride);
│ │ │ │ +
85 int GetFacetStride() const { return _facetStride; }
│ │ │ │ +
86
│ │ │ │ +
88 Options & SetCoordStride(int stride);
│ │ │ │ +
90 int GetCoordStride() const { return _coordStride; }
│ │ │ │ +
91
│ │ │ │ +
92 private:
│ │ │ │ +
93 unsigned int _preserveQuads : 1;
│ │ │ │ +
94 unsigned int _facetSize4 : 1;
│ │ │ │ +
95
│ │ │ │ +
96 short _coordStride;
│ │ │ │ +
97 short _facetStride;
│ │ │ │ +
98 };
│ │ │ │ +
99
│ │ │ │ +
100public:
│ │ │ │ +
102
│ │ │ │ +
111
│ │ │ │ +
118 Tessellation(Parameterization const & p, int uniformRate,
│ │ │ │ +
119 Options const & options = Options());
│ │ │ │ +
120
│ │ │ │ +
158 Tessellation(Parameterization const & p, int numRates, int const rates[],
│ │ │ │ +
159 Options const & options = Options());
│ │ │ │ +
160
│ │ │ │ +
162 bool IsValid() const { return _isValid; }
│ │ │ │ +
163
│ │ │ │ +
165 Tessellation() = delete;
│ │ │ │ +
166
│ │ │ │ +
167 Tessellation(Tessellation const &) = delete;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
171
│ │ │ │ +
173
│ │ │ │ +
177
│ │ │ │ +
179 Parameterization GetParameterization() const { return _param; }
│ │ │ │ +
180
│ │ │ │ +
182 int GetFaceSize() const { return _param.GetFaceSize(); }
│ │ │ │ +
183
│ │ │ │ +
185 int GetRates(int rates[]) const;
│ │ │ │ +
186
│ │ │ │ +
188 bool IsUniform() const { return _isUniform; }
│ │ │ │ +
190
│ │ │ │ +
192
│ │ │ │
203
│ │ │ │ -
205 void SetVertexSharpness(float sharpness);
│ │ │ │ +
205 int GetNumCoords() const { return _numInteriorPoints + _numBoundaryPoints; }
│ │ │ │
206
│ │ │ │ - │ │ │ │ +
208 int GetCoordStride() const { return _coordStride; }
│ │ │ │
209
│ │ │ │ -
221 void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness);
│ │ │ │ -
222
│ │ │ │ -
238 void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp,
│ │ │ │ -
239 float trailingEdgeSharp);
│ │ │ │ -
240
│ │ │ │ -
242 void ClearEdgeSharpness();
│ │ │ │ -
244
│ │ │ │ -
246
│ │ │ │ -
251
│ │ │ │ -
253 bool IsManifold() const;
│ │ │ │ -
254
│ │ │ │ -
256 bool IsBoundary() const;
│ │ │ │ -
257
│ │ │ │ -
259 bool HasIncidentFaceSizes() const;
│ │ │ │ -
260
│ │ │ │ -
262 int GetIncidentFaceSize(int faceIndex) const;
│ │ │ │ -
263
│ │ │ │ -
265 bool HasVertexSharpness() const;
│ │ │ │ +
211 int GetNumBoundaryCoords() const { return _numBoundaryPoints; }
│ │ │ │ +
212
│ │ │ │ +
214 int GetNumInteriorCoords() const { return _numInteriorPoints; }
│ │ │ │ +
215
│ │ │ │ +
218 int GetNumEdgeCoords(int edge) const { return _outerRates[edge] - 1; }
│ │ │ │ +
219
│ │ │ │ +
221 template <typename REAL>
│ │ │ │ +
222 int GetCoords(REAL coordTuples[]) const;
│ │ │ │ +
223
│ │ │ │ +
225 template <typename REAL>
│ │ │ │ +
226 int GetBoundaryCoords(REAL coordTuples[]) const;
│ │ │ │ +
227
│ │ │ │ +
229 template <typename REAL>
│ │ │ │ +
230 int GetInteriorCoords(REAL coordTuples[]) const;
│ │ │ │ +
231
│ │ │ │ +
233 template <typename REAL>
│ │ │ │ +
234 int GetVertexCoord(int vertex, REAL coordTuples[]) const;
│ │ │ │ +
235
│ │ │ │ +
238 template <typename REAL>
│ │ │ │ +
239 int GetEdgeCoords(int edge, REAL coordTuples[]) const;
│ │ │ │ +
241
│ │ │ │ +
243
│ │ │ │ +
253
│ │ │ │ +
255 int GetNumFacets() const { return _numFacets; }
│ │ │ │ +
256
│ │ │ │ +
258 int GetFacetSize() const { return _facetSize; }
│ │ │ │ +
259
│ │ │ │ +
261 int GetFacetStride() const { return _facetStride; }
│ │ │ │ +
262
│ │ │ │ +
264 int GetFacets(int facetTuples[]) const;
│ │ │ │
266
│ │ │ │ -
268 float GetVertexSharpness() const;
│ │ │ │ -
269
│ │ │ │ -
271 bool HasEdgeSharpness() const;
│ │ │ │ -
272
│ │ │ │ -
274 float GetManifoldEdgeSharpness(int edgeIndex) const;
│ │ │ │ -
275
│ │ │ │ -
277 void GetIncidentFaceEdgeSharpness(int faceIndex,
│ │ │ │ -
278 float * leadingEdgeSharp, float * trailingEdgeSharp) const;
│ │ │ │ -
280
│ │ │ │ -
281protected:
│ │ │ │ -
283 friend class FaceVertex;
│ │ │ │ -
284
│ │ │ │ -
285 VertexDescriptor() { }
│ │ │ │ - │ │ │ │ -
287
│ │ │ │ -
288 typedef Vtr::internal::StackBuffer<int,8,true> IntBuffer;
│ │ │ │ -
289 typedef Vtr::internal::StackBuffer<float,16,true> FloatBuffer;
│ │ │ │ -
290
│ │ │ │ -
291 void initFaceSizes();
│ │ │ │ -
292 void initEdgeSharpness();
│ │ │ │ -
294
│ │ │ │ -
295protected:
│ │ │ │ -
297 // Member variables assigned through the above interface:
│ │ │ │ -
298 unsigned short _isValid : 1;
│ │ │ │ -
299 unsigned short _isInitialized : 1;
│ │ │ │ -
300 unsigned short _isFinalized : 1;
│ │ │ │ -
301
│ │ │ │ -
302 unsigned short _isManifold : 1;
│ │ │ │ -
303 unsigned short _isBoundary : 1;
│ │ │ │ -
304
│ │ │ │ -
305 unsigned short _hasFaceSizes : 1;
│ │ │ │ -
306 unsigned short _hasEdgeSharpness : 1;
│ │ │ │ -
307
│ │ │ │ -
308 short _numFaces;
│ │ │ │ -
309 float _vertSharpness;
│ │ │ │ -
310
│ │ │ │ -
311 FloatBuffer _faceEdgeSharpness;
│ │ │ │ -
312 IntBuffer _faceSizeOffsets;
│ │ │ │ -
314};
│ │ │ │ -
315
│ │ │ │ -
316//
│ │ │ │ -
317// Public inline methods for simple assignment:
│ │ │ │ -
318//
│ │ │ │ -
319inline bool
│ │ │ │ - │ │ │ │ -
321 return _isValid;
│ │ │ │ -
322}
│ │ │ │ -
323
│ │ │ │ -
324inline void
│ │ │ │ - │ │ │ │ -
326 _isManifold = isManifold;
│ │ │ │ -
327}
│ │ │ │ -
328inline bool
│ │ │ │ - │ │ │ │ -
330 return _isManifold;
│ │ │ │ -
331}
│ │ │ │ -
332
│ │ │ │ -
333inline void
│ │ │ │ - │ │ │ │ -
335 _isBoundary = isBoundary;
│ │ │ │ -
336}
│ │ │ │ -
337inline bool
│ │ │ │ - │ │ │ │ -
339 return _isBoundary;
│ │ │ │ -
340}
│ │ │ │ -
341
│ │ │ │ -
342//
│ │ │ │ -
343// Public inline methods involving sizes of incident faces:
│ │ │ │ -
344//
│ │ │ │ -
345inline bool
│ │ │ │ - │ │ │ │ -
347 return _hasFaceSizes;
│ │ │ │ -
348}
│ │ │ │ -
349inline void
│ │ │ │ - │ │ │ │ -
351 _hasFaceSizes = false;
│ │ │ │ -
352}
│ │ │ │ -
353
│ │ │ │ -
354inline void
│ │ │ │ -
355VertexDescriptor::SetIncidentFaceSize(int incFaceIndex, int faceSize) {
│ │ │ │ -
356
│ │ │ │ -
357 if (!_hasFaceSizes) initFaceSizes();
│ │ │ │ -
358
│ │ │ │ -
359 _faceSizeOffsets[incFaceIndex] = faceSize;
│ │ │ │ -
360}
│ │ │ │ -
361inline int
│ │ │ │ - │ │ │ │ -
363
│ │ │ │ -
364 return _isFinalized ?
│ │ │ │ -
365 (_faceSizeOffsets[incFaceIndex+1] - _faceSizeOffsets[incFaceIndex]) :
│ │ │ │ -
366 _faceSizeOffsets[incFaceIndex];
│ │ │ │ -
367}
│ │ │ │ -
368
│ │ │ │ -
369//
│ │ │ │ -
370// Public inline methods involving vertex sharpness:
│ │ │ │ -
371//
│ │ │ │ -
372inline bool
│ │ │ │ - │ │ │ │ -
374 return _vertSharpness > 0.0f;
│ │ │ │ -
375}
│ │ │ │ -
376inline void
│ │ │ │ - │ │ │ │ -
378 _vertSharpness = 0.0f;
│ │ │ │ -
379}
│ │ │ │ -
380
│ │ │ │ -
381inline void
│ │ │ │ - │ │ │ │ -
383 _vertSharpness = vertSharpness;
│ │ │ │ -
384}
│ │ │ │ -
385inline float
│ │ │ │ - │ │ │ │ -
387 return _vertSharpness;
│ │ │ │ -
388}
│ │ │ │ -
389
│ │ │ │ -
390//
│ │ │ │ -
391// Public inline methods involving vertex sharpness:
│ │ │ │ -
392//
│ │ │ │ -
393inline bool
│ │ │ │ - │ │ │ │ -
395 return _hasEdgeSharpness;
│ │ │ │ -
396}
│ │ │ │ -
397inline void
│ │ │ │ - │ │ │ │ -
399 _hasEdgeSharpness = false;
│ │ │ │ -
400}
│ │ │ │ -
401
│ │ │ │ -
402inline void
│ │ │ │ -
403VertexDescriptor::SetManifoldEdgeSharpness(int edgeIndex, float sharpness) {
│ │ │ │ -
404
│ │ │ │ -
405 if (!_hasEdgeSharpness) initEdgeSharpness();
│ │ │ │ -
406
│ │ │ │ -
407 // Assign the leading edge of the face after the edge (even index):
│ │ │ │ -
408 if (edgeIndex < _numFaces) {
│ │ │ │ -
409 _faceEdgeSharpness[2*edgeIndex] = sharpness;
│ │ │ │ -
410 }
│ │ │ │ -
411
│ │ │ │ -
412 // Assign the trailing edge of the face before the edge (odd index):
│ │ │ │ -
413 if (edgeIndex > 0) {
│ │ │ │ -
414 _faceEdgeSharpness[2*edgeIndex-1] = sharpness;
│ │ │ │ -
415 } else if (!IsBoundary()) {
│ │ │ │ -
416 _faceEdgeSharpness[2*_numFaces-1] = sharpness;
│ │ │ │ -
417 }
│ │ │ │ -
418}
│ │ │ │ -
419inline float
│ │ │ │ - │ │ │ │ -
421
│ │ │ │ -
422 // All edges are first of the pair (even index) except last of boundary
│ │ │ │ -
423 return _faceEdgeSharpness[2*edgeIndex - (edgeIndex == _numFaces)];
│ │ │ │ -
424}
│ │ │ │ -
425
│ │ │ │ -
426inline void
│ │ │ │ - │ │ │ │ -
428 float leadingEdgeSharpness, float trailingEdgeSharpness) {
│ │ │ │ -
429
│ │ │ │ -
430 if (!_hasEdgeSharpness) initEdgeSharpness();
│ │ │ │ -
431
│ │ │ │ -
432 _faceEdgeSharpness[2*faceIndex ] = leadingEdgeSharpness;
│ │ │ │ -
433 _faceEdgeSharpness[2*faceIndex+1] = trailingEdgeSharpness;
│ │ │ │ -
434}
│ │ │ │ -
435inline void
│ │ │ │ - │ │ │ │ -
437 float * leadingEdgeSharpness, float * trailingEdgeSharpness) const {
│ │ │ │ -
438
│ │ │ │ -
439 *leadingEdgeSharpness = _faceEdgeSharpness[2*faceIndex];
│ │ │ │ -
440 *trailingEdgeSharpness = _faceEdgeSharpness[2*faceIndex+1];
│ │ │ │ -
441}
│ │ │ │ -
442
│ │ │ │ -
443} // end namespace Bfr
│ │ │ │ -
444
│ │ │ │ -
445} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
446using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
447} // end namespace OpenSubdiv
│ │ │ │ -
448
│ │ │ │ -
449#endif /* OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H */
│ │ │ │ +
268
│ │ │ │ +
283
│ │ │ │ +
285 void TransformFacetCoordIndices(int facetTuples[], int commonOffset);
│ │ │ │ +
286
│ │ │ │ +
289 void TransformFacetCoordIndices(int facetTuples[],
│ │ │ │ +
290 int const boundaryIndices[],
│ │ │ │ +
291 int interiorOffset);
│ │ │ │ +
292
│ │ │ │ +
294 void TransformFacetCoordIndices(int facetTuples[],
│ │ │ │ +
295 int const boundaryIndices[],
│ │ │ │ +
296 int const interiorIndices[]);
│ │ │ │ +
298
│ │ │ │ +
299private:
│ │ │ │ +
300 // Private initialization methods:
│ │ │ │ +
301 bool validateArguments(Parameterization const & p,
│ │ │ │ +
302 int nRates, int const rates[], Options const & options);
│ │ │ │ +
303
│ │ │ │ +
304 void initialize(Parameterization const & p,
│ │ │ │ +
305 int nRates, int const rates[], Options const & options);
│ │ │ │ +
306
│ │ │ │ +
307 void initializeDefaults();
│ │ │ │ +
308 int initializeRates(int nRates, int const rates[]);
│ │ │ │ +
309 void initializeInventoryForParamTri(int sumOfOuterRates);
│ │ │ │ +
310 void initializeInventoryForParamQuad(int sumOfOuterRates);
│ │ │ │ +
311 void initializeInventoryForParamQPoly(int sumOfOuterRates);
│ │ │ │ +
312
│ │ │ │ +
313private:
│ │ │ │ +
314 // Private members:
│ │ │ │ +
315 Parameterization _param;
│ │ │ │ +
316
│ │ │ │ +
317 unsigned short _isValid : 1;
│ │ │ │ +
318 unsigned short _isUniform : 1;
│ │ │ │ +
319 unsigned short _triangulate : 1;
│ │ │ │ +
320 unsigned short _singleFace : 1;
│ │ │ │ +
321 unsigned short _segmentedFace : 1;
│ │ │ │ +
322 unsigned short _triangleFan : 1;
│ │ │ │ +
323 unsigned short _splitQuad : 1;
│ │ │ │ +
324
│ │ │ │ +
325 short _facetSize;
│ │ │ │ +
326 int _facetStride;
│ │ │ │ +
327 int _coordStride;
│ │ │ │ +
328
│ │ │ │ +
329 int _numGivenRates;
│ │ │ │ +
330 int _numBoundaryPoints;
│ │ │ │ +
331 int _numInteriorPoints;
│ │ │ │ +
332 int _numFacets;
│ │ │ │ +
333
│ │ │ │ +
334 int _innerRates[2];
│ │ │ │ +
335 int* _outerRates;
│ │ │ │ +
336 int _outerRatesLocal[4];
│ │ │ │ +
337};
│ │ │ │ +
338
│ │ │ │ +
339//
│ │ │ │ +
340// Inline implementations:
│ │ │ │ +
341//
│ │ │ │ + │ │ │ │ + │ │ │ │ +
344 _preserveQuads = on;
│ │ │ │ +
345 return *this;
│ │ │ │ +
346}
│ │ │ │ + │ │ │ │ + │ │ │ │ +
349 _facetSize4 = (numIndices == 4);
│ │ │ │ +
350 return *this;
│ │ │ │ +
351}
│ │ │ │ + │ │ │ │ + │ │ │ │ +
354 _facetStride = (short) stride;
│ │ │ │ +
355 return *this;
│ │ │ │ +
356}
│ │ │ │ + │ │ │ │ + │ │ │ │ +
359 _coordStride = (short) stride;
│ │ │ │ +
360 return *this;
│ │ │ │ +
361}
│ │ │ │ +
362
│ │ │ │ +
363template <typename REAL>
│ │ │ │ +
364inline int
│ │ │ │ +
365Tessellation::GetVertexCoord(int vertex, REAL coord[]) const {
│ │ │ │ +
366 _param.GetVertexCoord(vertex, coord);
│ │ │ │ +
367 return 1;
│ │ │ │ +
368}
│ │ │ │ +
369
│ │ │ │ +
370template <typename REAL>
│ │ │ │ +
371inline int
│ │ │ │ +
372Tessellation::GetCoords(REAL coordTuples[]) const {
│ │ │ │ +
373 int nCoords = GetBoundaryCoords(coordTuples);
│ │ │ │ +
374 nCoords += GetInteriorCoords(coordTuples + nCoords * _coordStride);
│ │ │ │ +
375 return nCoords;
│ │ │ │ +
376}
│ │ │ │ +
377
│ │ │ │ +
378} // end namespace Bfr
│ │ │ │ +
379
│ │ │ │ +
380} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
381using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
382
│ │ │ │ +
383} // end namespace OpenSubdiv
│ │ │ │ +
384
│ │ │ │ +
385#endif /* OPENSUBDIV3_BFR_TESSELLATION */
│ │ │ │ │ │ │ │ -
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ -
float GetVertexSharpness() const
Return the sharpness of the vertex.
│ │ │ │ -
bool Finalize()
Terminate the sequence of specifications.
│ │ │ │ -
void SetManifold(bool isManifold)
Declare the vertex neighborhood as manifold (ordered)
│ │ │ │ -
bool Initialize(int numIncidentFaces)
Initialize specification with the number of incident faces.
│ │ │ │ -
bool IsManifold() const
Return if vertex neighborhood is manifold.
│ │ │ │ -
bool HasEdgeSharpness() const
Return if sharpness was assigned to the incident edges.
│ │ │ │ -
int GetIncidentFaceSize(int faceIndex) const
Return the size of an incident face.
│ │ │ │ -
float GetManifoldEdgeSharpness(int edgeIndex) const
Return the sharpness assigned to a manifold edge.
│ │ │ │ -
void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, float trailingEdgeSharp)
Assign sharpness to the edges of an incident face.
│ │ │ │ -
bool HasVertexSharpness() const
Return if sharpness was assigned to the vertex.
│ │ │ │ -
void ClearIncidentFaceSizes()
Remove any assigned sizes of incident faces.
│ │ │ │ -
void SetVertexSharpness(float sharpness)
Assign sharpness to the vertex.
│ │ │ │ -
void ClearVertexSharpness()
Remove any sharpness assigned to the vertex.
│ │ │ │ -
void ClearEdgeSharpness()
Remove any sharpness assigned to the incident edges.
│ │ │ │ -
void GetIncidentFaceEdgeSharpness(int faceIndex, float *leadingEdgeSharp, float *trailingEdgeSharp) const
Return the sharpness assigned to edges of an incident face.
│ │ │ │ -
bool IsBoundary() const
Return if vertex neighborhood is on a boundary.
│ │ │ │ -
bool IsValid() const
Return if instance is valid.
│ │ │ │ -
bool HasIncidentFaceSizes() const
Return if the sizes of incident faces are assigned.
│ │ │ │ -
void SetBoundary(bool isOnBoundary)
Declare the vertex neighborhood as being on a boundary.
│ │ │ │ -
void SetIncidentFaceSize(int faceIndex, int faceSize)
Assign the size of an incident face.
│ │ │ │ -
void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness)
Assign sharpness to the edge of a manifold neighborhood.
│ │ │ │ +
Simple class defining the 2D parameterization of a face.
│ │ │ │ +
int GetFaceSize() const
Returns the size (number of vertices) of the corresponding face.
│ │ │ │ +
void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const
Returns the (u,v) coordinate of a given vertex.
│ │ │ │ +
Encapsulates a specific tessellation pattern of a Parameterization.
Definition: tessellation.h:51
│ │ │ │ +
int GetFaceSize() const
Return the size of the face.
Definition: tessellation.h:182
│ │ │ │ +
int GetNumBoundaryCoords() const
Return the number of boundary coordinates.
Definition: tessellation.h:211
│ │ │ │ + │ │ │ │ +
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int const interiorIndices[])
Reassign all facet coordinate indices.
│ │ │ │ +
int GetCoordStride() const
Return the number of elements between each coordinate.
Definition: tessellation.h:208
│ │ │ │ +
int GetNumEdgeCoords(int edge) const
Return the number of coordinates within a given edge (excluding those at its end vertices)
Definition: tessellation.h:218
│ │ │ │ +
int GetInteriorCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
│ │ │ │ +
int GetFacetStride() const
Return the number of elements between each facet.
Definition: tessellation.h:261
│ │ │ │ +
bool IsUniform() const
Return if the pattern is uniform.
Definition: tessellation.h:188
│ │ │ │ +
int GetNumCoords() const
Return the number of coordinates in the entire pattern.
Definition: tessellation.h:205
│ │ │ │ +
int GetCoords(REAL coordTuples[]) const
Retrieve the coordinates for the entire pattern.
Definition: tessellation.h:372
│ │ │ │ +
void TransformFacetCoordIndices(int facetTuples[], int commonOffset)
Apply a common offset to all facet coordinate indices.
│ │ │ │ +
Tessellation(Parameterization const &p, int numRates, int const rates[], Options const &options=Options())
General constructor providing multiple tessellation rates for a non-uniform tessellation.
│ │ │ │ +
Parameterization GetParameterization() const
Return the Parameterization.
Definition: tessellation.h:179
│ │ │ │ +
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int interiorOffset)
Reassign indices of boundary coordinates while offseting those of interior coordinates.
│ │ │ │ +
int GetFacetSize() const
Return the number of indices assigned to each facet.
Definition: tessellation.h:258
│ │ │ │ +
Tessellation()=delete
Default construction is unavailable.
│ │ │ │ +
Tessellation(Parameterization const &p, int uniformRate, Options const &options=Options())
Simple constructor providing a single uniform tessellation rate.
│ │ │ │ +
int GetFacets(int facetTuples[]) const
Retrieve the facet indices for the entire pattern.
│ │ │ │ +
int GetNumFacets() const
Return the number of facets in the entire pattern.
Definition: tessellation.h:255
│ │ │ │ +
int GetNumInteriorCoords() const
Return the number of interior coordinates.
Definition: tessellation.h:214
│ │ │ │ +
int GetVertexCoord(int vertex, REAL coordTuples[]) const
Retrieve the coordinate for a given vertex of the face.
Definition: tessellation.h:365
│ │ │ │ +
int GetBoundaryCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
│ │ │ │ + │ │ │ │ +
int GetRates(int rates[]) const
Retrieve the rates assigned.
│ │ │ │ +
bool IsValid() const
Return true if correctly initialized.
Definition: tessellation.h:162
│ │ │ │ +
Tessellation & operator=(Tessellation const &)=delete
│ │ │ │ +
int GetEdgeCoords(int edge, REAL coordTuples[]) const
Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)
│ │ │ │ +
Options configure a Tessellation to specify the nature of both its results and the structure of the c...
Definition: tessellation.h:65
│ │ │ │ + │ │ │ │ +
int GetCoordStride() const
Return the stride between (u,v) pairs.
Definition: tessellation.h:90
│ │ │ │ +
Options & SetFacetSize(int numIndices)
Assign the number of indices per facet (must be 3 or 4, default is 3)
Definition: tessellation.h:348
│ │ │ │ +
int GetFacetStride() const
Return the stride between facets.
Definition: tessellation.h:85
│ │ │ │ + │ │ │ │ +
Options & SetCoordStride(int stride)
Assign the stride between (u,v) pairs (default is 2)
Definition: tessellation.h:358
│ │ │ │ +
Options & SetFacetStride(int stride)
Assign the stride between facets (default is facet size)
Definition: tessellation.h:353
│ │ │ │ +
bool PreserveQuads() const
Return if preservation of quads is set.
Definition: tessellation.h:74
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -vertexDescriptor.h │ │ │ │ │ +tessellation.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2021 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,446 +30,367 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_BFR_TESSELLATION_H │ │ │ │ │ + 26#define OPENSUBDIV3_BFR_TESSELLATION_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../vtr/stackBuffer.h" │ │ │ │ │ + 30#include "../bfr/parameterization.h" │ │ │ │ │ 31 │ │ │ │ │ 32namespace OpenSubdiv { │ │ │ │ │ 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ 34 │ │ │ │ │ 35namespace Bfr { │ │ │ │ │ 36 │ │ │ │ │ - 50// │ │ │ │ │ - 51// WIP - need to migrate some of these comments into Doxygen │ │ │ │ │ - 52// - others will be moved to the external documentation │ │ │ │ │ - 53// │ │ │ │ │ - 54// It is used by subclasses of SurfaceFactory to provide a complete │ │ │ │ │ - 55// topological description for each vertex of a face, i.e. invoked via │ │ │ │ │ - 56// the virtual method: │ │ │ │ │ - 57// │ │ │ │ │ - 58// int populateFaceVertexDescriptor(Index baseFace, │ │ │ │ │ - 59// int cornerVertex, │ │ │ │ │ - 60// VertexDescriptor & v) const; │ │ │ │ │ - 61// │ │ │ │ │ - 62// Assignment of the full topology can be involved in the presence of │ │ │ │ │ - 63// irregular faces, non-manifold topology or creasing around a vertex, but │ │ │ │ │ - 64// many cases will be simple. For example, to specify a regular boundary │ │ │ │ │ - 65// vertex of a Catmark mesh without any optional sharpness: │ │ │ │ │ - 66// │ │ │ │ │ - 67// int numIncidentFaces = 2; │ │ │ │ │ - 68// bool vertexOnBoundary = true; │ │ │ │ │ - 69// │ │ │ │ │ - 70// vd.Initialize(numIncidentFaces); │ │ │ │ │ - 71// vd.SetManifold(true); │ │ │ │ │ - 72// vd.SetBoundary(vertexOnBoundary); │ │ │ │ │ - 73// vd.ClearIncidentFaceSizes(); │ │ │ │ │ - 74// vd.Finalize(); │ │ │ │ │ - 75// │ │ │ │ │ - 76// For a more general example, to assign a vertex of some valence whose │ │ │ │ │ - 77// incident faces are of different sizes (e.g. required when triangles │ │ │ │ │ - 78// appear around a vertex in an otherwise quad-dominant Catmark mesh): │ │ │ │ │ - 79// │ │ │ │ │ - 80// int numIncidentFaces = meshVertex.GetNumIncidentFaces(); │ │ │ │ │ - 81// bool vertexOnBoundary = meshVertex.IsBoundar(); │ │ │ │ │ - 82// │ │ │ │ │ - 83// vd.Initialize(numIncidentFaces); │ │ │ │ │ - 84// vd.SetManifold(true); │ │ │ │ │ - 85// vd.SetBoundary(vertexOnBoundary); │ │ │ │ │ - 86// │ │ │ │ │ - 87// for (int i = 0; i < numIncidentFaces; ++i) { │ │ │ │ │ - 88// vd.SetIncidentFaceSize(i, meshVertex.GetIncidentFaceSize(i)); │ │ │ │ │ - 89// } │ │ │ │ │ - 90// vd.Finalize(); │ │ │ │ │ - 91// │ │ │ │ │ - 92// These examples specify the incident faces as forming a manifold ring │ │ │ │ │ - 93// (or half-ring) around the vertex, i.e. they can be specified as a │ │ │ │ │ - 94// continuous, connected sequence in counter-clockwise order (and also │ │ │ │ │ - 95// without degeneracies). In the case of a boundary vertex, the first │ │ │ │ │ - 96// face must be on the leading edge of the boundary while the last is on │ │ │ │ │ - 97// the trailing edge. For an interior vertex, which face is specified │ │ │ │ │ - 98// first does not matter (since the set is periodic). │ │ │ │ │ - 99// │ │ │ │ │ - 100// In both cases, the location of the base face in this sequence -- the │ │ │ │ │ - 101// face whose corner vertex is being described here -- must be specified │ │ │ │ │ - 102// in the return value to populateFaceVertexDescriptor() (e.g. when a │ │ │ │ │ - 103// boundary vertex has 3 incident faces, a return value of 0, 1 or 2 │ │ │ │ │ - 104// will indicate which is the base face). │ │ │ │ │ - 105// │ │ │ │ │ - 106// The corresponding methods to specify mesh control vertex indices (or │ │ │ │ │ - 107// face-varying indices) complete the specification of the neighborhood: │ │ │ │ │ - 108// │ │ │ │ │ - 109// int getFaceCornerVertexIndices(Index baseFace, int cornerVertex, │ │ │ │ │ - 110// Index vertexIndices[]) const; │ │ │ │ │ - 111// │ │ │ │ │ - 112// int getFaceCornerFVarValueIndices(Index baseFace, int cornerVertex, │ │ │ │ │ - 113// Index fvarValueIndices[], │ │ │ │ │ - 114// int fvarChannel) const; │ │ │ │ │ - 115// │ │ │ │ │ - 116// and are invoked by the Factory when needed. │ │ │ │ │ - 117// │ │ │ │ │ - 118// For each incident face, the indices for all vertices of that face are │ │ │ │ │ - 119// to be specified (not the one-ring or some other subset). These indices │ │ │ │ │ - 120// must also be specified in an orientation relative to the vertex, i.e. │ │ │ │ │ - 121// for a vertex A and an incident face with face-vertices that may be │ │ │ │ │ - 122// stored internally as {D, C, A, B}, they must be specified with A first │ │ │ │ │ - 123// as {A, B, C, D}. This may seem a bit cumbersome, but it has clear │ │ │ │ │ - 124// advantages when dealing with face-varying indices and unordered faces. │ │ │ │ │ - 125// │ │ │ │ │ - 126// More compact ways of specifying vertex indices for ordered, manifold │ │ │ │ │ - 127// cases may be worth exploring in future, but face-varying indices and │ │ │ │ │ - 128// non-manifold (unordered) vertices will always require such a full set, │ │ │ │ │ - 129// so both methods will need to co-exist. │ │ │ │ │ - 130// │ │ │ │ │ -131class VertexDescriptor { │ │ │ │ │ - 132public: │ │ │ │ │ - 133 // The full declaration must be enclosed by calls to these methods: │ │ │ │ │ - 134 // │ │ │ │ │ - 135 // Note that vertex valences or face sizes in excess of those defined │ │ │ │ │ - 136 // in Bfr::Limits (typically 16-bits) are not valid. When specifying │ │ │ │ │ - 137 // values in excess of these limits, initialization will fail and/or │ │ │ │ │ - 138 // the descriptor will be marked invalid and finalization will fail. │ │ │ │ │ - 139 // │ │ │ │ │ - 140 │ │ │ │ │ - 142 │ │ │ │ │ - 149 │ │ │ │ │ -151 bool Initialize(int numIncidentFaces); │ │ │ │ │ - 152 │ │ │ │ │ -154 bool Finalize(); │ │ │ │ │ - 155 │ │ │ │ │ - 157 bool IsValid() const; │ │ │ │ │ - 159 │ │ │ │ │ - 160 // │ │ │ │ │ - 161 // WIP - need to migrate these comments into Doxygen │ │ │ │ │ - 162 // │ │ │ │ │ - 163 // Three groups of methods describe the topology around a vertex: │ │ │ │ │ - 164 // - simple properties (vertex is a boundary, manifold, etc.) │ │ │ │ │ - 165 // - sizes of incident faces (constant or size for each face) │ │ │ │ │ - 166 // - sharpness of the vertex and its incident edges (optional) │ │ │ │ │ - 167 // │ │ │ │ │ - 168 │ │ │ │ │ - 169 // Manifold and boundary conditions: │ │ │ │ │ - 170 // │ │ │ │ │ - 171 // The manifold property is a strict condition but preferred for │ │ │ │ │ - 172 // efficiency and is usually available from common connected mesh │ │ │ │ │ - 173 // representations. When declaring the topology as "manifold", │ │ │ │ │ - 174 // the Factory assumes the following: │ │ │ │ │ - 175 // │ │ │ │ │ - 176 // - all incident faces are "ordered" (counter-clockwise) │ │ │ │ │ - 177 // - all incident faces are consistently oriented │ │ │ │ │ - 178 // - all incident edges are non-degenerate │ │ │ │ │ - 179 // │ │ │ │ │ - 180 // If not certain that all of these conditions are met, it is best │ │ │ │ │ - 181 // to not declare manifold -- leaving the Factory to make sense of │ │ │ │ │ - 182 // the set of incident faces from the face-vertex indices that are │ │ │ │ │ - 183 // provided elsewhere. │ │ │ │ │ - 184 // │ │ │ │ │ - 185 │ │ │ │ │ - 187 │ │ │ │ │ - 191 │ │ │ │ │ - 193 void SetManifold(bool isManifold); │ │ │ │ │ - 194 │ │ │ │ │ - 196 void SetBoundary(bool isOnBoundary); │ │ │ │ │ - 197 │ │ │ │ │ - 199 void SetIncidentFaceSize(int faceIndex, int faceSize); │ │ │ │ │ - 200 │ │ │ │ │ - 202 void ClearIncidentFaceSizes(); │ │ │ │ │ +51class Tessellation { │ │ │ │ │ + 52public: │ │ │ │ │ +65 class Options { │ │ │ │ │ + 66 public: │ │ │ │ │ +67 Options() : _preserveQuads(false), _facetSize4(false), │ │ │ │ │ + 68 _coordStride(0), _facetStride(0) { } │ │ │ │ │ + 69 │ │ │ │ │ + 72 Options & PreserveQuads(bool on); │ │ │ │ │ +74 bool PreserveQuads() const { return _preserveQuads; } │ │ │ │ │ + 75 │ │ │ │ │ + 78 Options & SetFacetSize(int numIndices); │ │ │ │ │ + 79 // @brief Return the number of indices per facet │ │ │ │ │ +80 int GetFacetSize() const { return 3 + (int)_facetSize4; } │ │ │ │ │ + 81 │ │ │ │ │ + 83 Options & SetFacetStride(int stride); │ │ │ │ │ +85 int GetFacetStride() const { return _facetStride; } │ │ │ │ │ + 86 │ │ │ │ │ + 88 Options & SetCoordStride(int stride); │ │ │ │ │ +90 int GetCoordStride() const { return _coordStride; } │ │ │ │ │ + 91 │ │ │ │ │ + 92 private: │ │ │ │ │ + 93 unsigned int _preserveQuads : 1; │ │ │ │ │ + 94 unsigned int _facetSize4 : 1; │ │ │ │ │ + 95 │ │ │ │ │ + 96 short _coordStride; │ │ │ │ │ + 97 short _facetStride; │ │ │ │ │ + 98 }; │ │ │ │ │ + 99 │ │ │ │ │ + 100public: │ │ │ │ │ + 102 │ │ │ │ │ + 111 │ │ │ │ │ +118 Tessellation(Parameterization const & p, int uniformRate, │ │ │ │ │ + 119 Options const & options = Options()); │ │ │ │ │ + 120 │ │ │ │ │ +158 Tessellation(Parameterization const & p, int numRates, int const rates[], │ │ │ │ │ + 159 Options const & options = Options()); │ │ │ │ │ + 160 │ │ │ │ │ +162 bool IsValid() const { return _isValid; } │ │ │ │ │ + 163 │ │ │ │ │ +165 Tessellation() = delete; │ │ │ │ │ + 166 │ │ │ │ │ +167 Tessellation(Tessellation const &) = delete; │ │ │ │ │ +168 Tessellation & operator=(Tessellation const &) = delete; │ │ │ │ │ +169 ~Tessellation(); │ │ │ │ │ + 171 │ │ │ │ │ + 173 │ │ │ │ │ + 177 │ │ │ │ │ +179 Parameterization GetParameterization() const { return _param; } │ │ │ │ │ + 180 │ │ │ │ │ +182 int GetFaceSize() const { return _param.GetFaceSize(); } │ │ │ │ │ + 183 │ │ │ │ │ +185 int GetRates(int rates[]) const; │ │ │ │ │ + 186 │ │ │ │ │ +188 bool IsUniform() const { return _isUniform; } │ │ │ │ │ + 190 │ │ │ │ │ + 192 │ │ │ │ │ 203 │ │ │ │ │ - 205 void SetVertexSharpness(float sharpness); │ │ │ │ │ +205 int GetNumCoords() const { return _numInteriorPoints + _numBoundaryPoints; │ │ │ │ │ +} │ │ │ │ │ 206 │ │ │ │ │ - 208 void ClearVertexSharpness(); │ │ │ │ │ +208 int GetCoordStride() const { return _coordStride; } │ │ │ │ │ 209 │ │ │ │ │ - 221 void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness); │ │ │ │ │ - 222 │ │ │ │ │ - 238 void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, │ │ │ │ │ - 239 float trailingEdgeSharp); │ │ │ │ │ - 240 │ │ │ │ │ - 242 void ClearEdgeSharpness(); │ │ │ │ │ - 244 │ │ │ │ │ - 246 │ │ │ │ │ - 251 │ │ │ │ │ - 253 bool IsManifold() const; │ │ │ │ │ - 254 │ │ │ │ │ - 256 bool IsBoundary() const; │ │ │ │ │ - 257 │ │ │ │ │ - 259 bool HasIncidentFaceSizes() const; │ │ │ │ │ - 260 │ │ │ │ │ - 262 int GetIncidentFaceSize(int faceIndex) const; │ │ │ │ │ - 263 │ │ │ │ │ - 265 bool HasVertexSharpness() const; │ │ │ │ │ +211 int GetNumBoundaryCoords() const { return _numBoundaryPoints; } │ │ │ │ │ + 212 │ │ │ │ │ +214 int GetNumInteriorCoords() const { return _numInteriorPoints; } │ │ │ │ │ + 215 │ │ │ │ │ +218 int GetNumEdgeCoords(int edge) const { return _outerRates[edge] - 1; } │ │ │ │ │ + 219 │ │ │ │ │ + 221 template │ │ │ │ │ + 222 int GetCoords(REAL coordTuples[]) const; │ │ │ │ │ + 223 │ │ │ │ │ + 225 template │ │ │ │ │ +226 int GetBoundaryCoords(REAL coordTuples[]) const; │ │ │ │ │ + 227 │ │ │ │ │ + 229 template │ │ │ │ │ +230 int GetInteriorCoords(REAL coordTuples[]) const; │ │ │ │ │ + 231 │ │ │ │ │ + 233 template │ │ │ │ │ + 234 int GetVertexCoord(int vertex, REAL coordTuples[]) const; │ │ │ │ │ + 235 │ │ │ │ │ + 238 template │ │ │ │ │ +239 int GetEdgeCoords(int edge, REAL coordTuples[]) const; │ │ │ │ │ + 241 │ │ │ │ │ + 243 │ │ │ │ │ + 253 │ │ │ │ │ +255 int GetNumFacets() const { return _numFacets; } │ │ │ │ │ + 256 │ │ │ │ │ +258 int GetFacetSize() const { return _facetSize; } │ │ │ │ │ + 259 │ │ │ │ │ +261 int GetFacetStride() const { return _facetStride; } │ │ │ │ │ + 262 │ │ │ │ │ +264 int GetFacets(int facetTuples[]) const; │ │ │ │ │ 266 │ │ │ │ │ - 268 float GetVertexSharpness() const; │ │ │ │ │ - 269 │ │ │ │ │ - 271 bool HasEdgeSharpness() const; │ │ │ │ │ - 272 │ │ │ │ │ - 274 float GetManifoldEdgeSharpness(int edgeIndex) const; │ │ │ │ │ - 275 │ │ │ │ │ - 277 void GetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ - 278 float * leadingEdgeSharp, float * trailingEdgeSharp) const; │ │ │ │ │ - 280 │ │ │ │ │ - 281protected: │ │ │ │ │ - 283 friend class FaceVertex; │ │ │ │ │ - 284 │ │ │ │ │ - 285 VertexDescriptor() { } │ │ │ │ │ - 286 ~VertexDescriptor() { } │ │ │ │ │ - 287 │ │ │ │ │ - 288 typedef Vtr::internal::StackBuffer IntBuffer; │ │ │ │ │ - 289 typedef Vtr::internal::StackBuffer FloatBuffer; │ │ │ │ │ - 290 │ │ │ │ │ - 291 void initFaceSizes(); │ │ │ │ │ - 292 void initEdgeSharpness(); │ │ │ │ │ - 294 │ │ │ │ │ - 295protected: │ │ │ │ │ - 297 // Member variables assigned through the above interface: │ │ │ │ │ - 298 unsigned short _isValid : 1; │ │ │ │ │ - 299 unsigned short _isInitialized : 1; │ │ │ │ │ - 300 unsigned short _isFinalized : 1; │ │ │ │ │ - 301 │ │ │ │ │ - 302 unsigned short _isManifold : 1; │ │ │ │ │ - 303 unsigned short _isBoundary : 1; │ │ │ │ │ - 304 │ │ │ │ │ - 305 unsigned short _hasFaceSizes : 1; │ │ │ │ │ - 306 unsigned short _hasEdgeSharpness : 1; │ │ │ │ │ - 307 │ │ │ │ │ - 308 short _numFaces; │ │ │ │ │ - 309 float _vertSharpness; │ │ │ │ │ - 310 │ │ │ │ │ - 311 FloatBuffer _faceEdgeSharpness; │ │ │ │ │ - 312 IntBuffer _faceSizeOffsets; │ │ │ │ │ - 314}; │ │ │ │ │ - 315 │ │ │ │ │ - 316// │ │ │ │ │ - 317// Public inline methods for simple assignment: │ │ │ │ │ - 318// │ │ │ │ │ - 319inline bool │ │ │ │ │ -320VertexDescriptor::IsValid() const { │ │ │ │ │ - 321 return _isValid; │ │ │ │ │ - 322} │ │ │ │ │ - 323 │ │ │ │ │ - 324inline void │ │ │ │ │ -325VertexDescriptor::SetManifold(bool isManifold) { │ │ │ │ │ - 326 _isManifold = isManifold; │ │ │ │ │ - 327} │ │ │ │ │ - 328inline bool │ │ │ │ │ -329VertexDescriptor::IsManifold() const { │ │ │ │ │ - 330 return _isManifold; │ │ │ │ │ - 331} │ │ │ │ │ - 332 │ │ │ │ │ - 333inline void │ │ │ │ │ -334VertexDescriptor::SetBoundary(bool isBoundary) { │ │ │ │ │ - 335 _isBoundary = isBoundary; │ │ │ │ │ - 336} │ │ │ │ │ - 337inline bool │ │ │ │ │ -338VertexDescriptor::IsBoundary() const { │ │ │ │ │ - 339 return _isBoundary; │ │ │ │ │ - 340} │ │ │ │ │ - 341 │ │ │ │ │ - 342// │ │ │ │ │ - 343// Public inline methods involving sizes of incident faces: │ │ │ │ │ - 344// │ │ │ │ │ - 345inline bool │ │ │ │ │ -346VertexDescriptor::HasIncidentFaceSizes() const { │ │ │ │ │ - 347 return _hasFaceSizes; │ │ │ │ │ - 348} │ │ │ │ │ - 349inline void │ │ │ │ │ -350VertexDescriptor::ClearIncidentFaceSizes() { │ │ │ │ │ - 351 _hasFaceSizes = false; │ │ │ │ │ - 352} │ │ │ │ │ - 353 │ │ │ │ │ - 354inline void │ │ │ │ │ -355VertexDescriptor::SetIncidentFaceSize(int incFaceIndex, int faceSize) { │ │ │ │ │ - 356 │ │ │ │ │ - 357 if (!_hasFaceSizes) initFaceSizes(); │ │ │ │ │ - 358 │ │ │ │ │ - 359 _faceSizeOffsets[incFaceIndex] = faceSize; │ │ │ │ │ - 360} │ │ │ │ │ - 361inline int │ │ │ │ │ -362VertexDescriptor::GetIncidentFaceSize(int incFaceIndex) const { │ │ │ │ │ - 363 │ │ │ │ │ - 364 return _isFinalized ? │ │ │ │ │ - 365 (_faceSizeOffsets[incFaceIndex+1] - _faceSizeOffsets[incFaceIndex]) : │ │ │ │ │ - 366 _faceSizeOffsets[incFaceIndex]; │ │ │ │ │ - 367} │ │ │ │ │ - 368 │ │ │ │ │ - 369// │ │ │ │ │ - 370// Public inline methods involving vertex sharpness: │ │ │ │ │ - 371// │ │ │ │ │ - 372inline bool │ │ │ │ │ -373VertexDescriptor::HasVertexSharpness() const { │ │ │ │ │ - 374 return _vertSharpness > 0.0f; │ │ │ │ │ - 375} │ │ │ │ │ - 376inline void │ │ │ │ │ -377VertexDescriptor::ClearVertexSharpness() { │ │ │ │ │ - 378 _vertSharpness = 0.0f; │ │ │ │ │ - 379} │ │ │ │ │ - 380 │ │ │ │ │ - 381inline void │ │ │ │ │ -382VertexDescriptor::SetVertexSharpness(float vertSharpness) { │ │ │ │ │ - 383 _vertSharpness = vertSharpness; │ │ │ │ │ - 384} │ │ │ │ │ - 385inline float │ │ │ │ │ -386VertexDescriptor::GetVertexSharpness() const { │ │ │ │ │ - 387 return _vertSharpness; │ │ │ │ │ - 388} │ │ │ │ │ - 389 │ │ │ │ │ - 390// │ │ │ │ │ - 391// Public inline methods involving vertex sharpness: │ │ │ │ │ - 392// │ │ │ │ │ - 393inline bool │ │ │ │ │ -394VertexDescriptor::HasEdgeSharpness() const { │ │ │ │ │ - 395 return _hasEdgeSharpness; │ │ │ │ │ - 396} │ │ │ │ │ - 397inline void │ │ │ │ │ -398VertexDescriptor::ClearEdgeSharpness() { │ │ │ │ │ - 399 _hasEdgeSharpness = false; │ │ │ │ │ - 400} │ │ │ │ │ - 401 │ │ │ │ │ - 402inline void │ │ │ │ │ -403VertexDescriptor::SetManifoldEdgeSharpness(int edgeIndex, float sharpness) { │ │ │ │ │ - 404 │ │ │ │ │ - 405 if (!_hasEdgeSharpness) initEdgeSharpness(); │ │ │ │ │ - 406 │ │ │ │ │ - 407 // Assign the leading edge of the face after the edge (even index): │ │ │ │ │ - 408 if (edgeIndex < _numFaces) { │ │ │ │ │ - 409 _faceEdgeSharpness[2*edgeIndex] = sharpness; │ │ │ │ │ - 410 } │ │ │ │ │ - 411 │ │ │ │ │ - 412 // Assign the trailing edge of the face before the edge (odd index): │ │ │ │ │ - 413 if (edgeIndex > 0) { │ │ │ │ │ - 414 _faceEdgeSharpness[2*edgeIndex-1] = sharpness; │ │ │ │ │ - 415 } else if (!IsBoundary()) { │ │ │ │ │ - 416 _faceEdgeSharpness[2*_numFaces-1] = sharpness; │ │ │ │ │ - 417 } │ │ │ │ │ - 418} │ │ │ │ │ - 419inline float │ │ │ │ │ -420VertexDescriptor::GetManifoldEdgeSharpness(int edgeIndex) const { │ │ │ │ │ - 421 │ │ │ │ │ - 422 // All edges are first of the pair (even index) except last of boundary │ │ │ │ │ - 423 return _faceEdgeSharpness[2*edgeIndex - (edgeIndex == _numFaces)]; │ │ │ │ │ - 424} │ │ │ │ │ - 425 │ │ │ │ │ - 426inline void │ │ │ │ │ -427VertexDescriptor::SetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ - 428 float leadingEdgeSharpness, float trailingEdgeSharpness) { │ │ │ │ │ - 429 │ │ │ │ │ - 430 if (!_hasEdgeSharpness) initEdgeSharpness(); │ │ │ │ │ - 431 │ │ │ │ │ - 432 _faceEdgeSharpness[2*faceIndex ] = leadingEdgeSharpness; │ │ │ │ │ - 433 _faceEdgeSharpness[2*faceIndex+1] = trailingEdgeSharpness; │ │ │ │ │ - 434} │ │ │ │ │ - 435inline void │ │ │ │ │ -436VertexDescriptor::GetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ - 437 float * leadingEdgeSharpness, float * trailingEdgeSharpness) const { │ │ │ │ │ - 438 │ │ │ │ │ - 439 *leadingEdgeSharpness = _faceEdgeSharpness[2*faceIndex]; │ │ │ │ │ - 440 *trailingEdgeSharpness = _faceEdgeSharpness[2*faceIndex+1]; │ │ │ │ │ - 441} │ │ │ │ │ - 442 │ │ │ │ │ - 443} // end namespace Bfr │ │ │ │ │ - 444 │ │ │ │ │ - 445} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 446using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 447} // end namespace OpenSubdiv │ │ │ │ │ - 448 │ │ │ │ │ - 449#endif /* OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H */ │ │ │ │ │ + 268 │ │ │ │ │ + 283 │ │ │ │ │ +285 void TransformFacetCoordIndices(int facetTuples[], int commonOffset); │ │ │ │ │ + 286 │ │ │ │ │ +289 void TransformFacetCoordIndices(int facetTuples[], │ │ │ │ │ + 290 int const boundaryIndices[], │ │ │ │ │ + 291 int interiorOffset); │ │ │ │ │ + 292 │ │ │ │ │ +294 void TransformFacetCoordIndices(int facetTuples[], │ │ │ │ │ + 295 int const boundaryIndices[], │ │ │ │ │ + 296 int const interiorIndices[]); │ │ │ │ │ + 298 │ │ │ │ │ + 299private: │ │ │ │ │ + 300 // Private initialization methods: │ │ │ │ │ + 301 bool validateArguments(Parameterization const & p, │ │ │ │ │ + 302 int nRates, int const rates[], Options const & options); │ │ │ │ │ + 303 │ │ │ │ │ + 304 void initialize(Parameterization const & p, │ │ │ │ │ + 305 int nRates, int const rates[], Options const & options); │ │ │ │ │ + 306 │ │ │ │ │ + 307 void initializeDefaults(); │ │ │ │ │ + 308 int initializeRates(int nRates, int const rates[]); │ │ │ │ │ + 309 void initializeInventoryForParamTri(int sumOfOuterRates); │ │ │ │ │ + 310 void initializeInventoryForParamQuad(int sumOfOuterRates); │ │ │ │ │ + 311 void initializeInventoryForParamQPoly(int sumOfOuterRates); │ │ │ │ │ + 312 │ │ │ │ │ + 313private: │ │ │ │ │ + 314 // Private members: │ │ │ │ │ + 315 Parameterization _param; │ │ │ │ │ + 316 │ │ │ │ │ + 317 unsigned short _isValid : 1; │ │ │ │ │ + 318 unsigned short _isUniform : 1; │ │ │ │ │ + 319 unsigned short _triangulate : 1; │ │ │ │ │ + 320 unsigned short _singleFace : 1; │ │ │ │ │ + 321 unsigned short _segmentedFace : 1; │ │ │ │ │ + 322 unsigned short _triangleFan : 1; │ │ │ │ │ + 323 unsigned short _splitQuad : 1; │ │ │ │ │ + 324 │ │ │ │ │ + 325 short _facetSize; │ │ │ │ │ + 326 int _facetStride; │ │ │ │ │ + 327 int _coordStride; │ │ │ │ │ + 328 │ │ │ │ │ + 329 int _numGivenRates; │ │ │ │ │ + 330 int _numBoundaryPoints; │ │ │ │ │ + 331 int _numInteriorPoints; │ │ │ │ │ + 332 int _numFacets; │ │ │ │ │ + 333 │ │ │ │ │ + 334 int _innerRates[2]; │ │ │ │ │ + 335 int* _outerRates; │ │ │ │ │ + 336 int _outerRatesLocal[4]; │ │ │ │ │ + 337}; │ │ │ │ │ + 338 │ │ │ │ │ + 339// │ │ │ │ │ + 340// Inline implementations: │ │ │ │ │ + 341// │ │ │ │ │ + 342inline Tessellation::Options & │ │ │ │ │ +343Tessellation::Options::PreserveQuads(bool on) { │ │ │ │ │ + 344 _preserveQuads = on; │ │ │ │ │ + 345 return *this; │ │ │ │ │ + 346} │ │ │ │ │ + 347inline Tessellation::Options & │ │ │ │ │ +348Tessellation::Options::SetFacetSize(int numIndices) { │ │ │ │ │ + 349 _facetSize4 = (numIndices == 4); │ │ │ │ │ + 350 return *this; │ │ │ │ │ + 351} │ │ │ │ │ + 352inline Tessellation::Options & │ │ │ │ │ +353Tessellation::Options::SetFacetStride(int stride) { │ │ │ │ │ + 354 _facetStride = (short) stride; │ │ │ │ │ + 355 return *this; │ │ │ │ │ + 356} │ │ │ │ │ + 357inline Tessellation::Options & │ │ │ │ │ +358Tessellation::Options::SetCoordStride(int stride) { │ │ │ │ │ + 359 _coordStride = (short) stride; │ │ │ │ │ + 360 return *this; │ │ │ │ │ + 361} │ │ │ │ │ + 362 │ │ │ │ │ + 363template │ │ │ │ │ + 364inline int │ │ │ │ │ +365Tessellation::GetVertexCoord(int vertex, REAL coord[]) const { │ │ │ │ │ + 366 _param.GetVertexCoord(vertex, coord); │ │ │ │ │ + 367 return 1; │ │ │ │ │ + 368} │ │ │ │ │ + 369 │ │ │ │ │ + 370template │ │ │ │ │ + 371inline int │ │ │ │ │ +372Tessellation::GetCoords(REAL coordTuples[]) const { │ │ │ │ │ + 373 int nCoords = GetBoundaryCoords(coordTuples); │ │ │ │ │ + 374 nCoords += GetInteriorCoords(coordTuples + nCoords * _coordStride); │ │ │ │ │ + 375 return nCoords; │ │ │ │ │ + 376} │ │ │ │ │ + 377 │ │ │ │ │ + 378} // end namespace Bfr │ │ │ │ │ + 379 │ │ │ │ │ + 380} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 381using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 382 │ │ │ │ │ + 383} // end namespace OpenSubdiv │ │ │ │ │ + 384 │ │ │ │ │ + 385#endif /* OPENSUBDIV3_BFR_TESSELLATION */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor │ │ │ │ │ -Simple class used by subclasses of SurfaceFactory to describe a vertex. │ │ │ │ │ -Definition: vertexDescriptor.h:131 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetVertexSharpness │ │ │ │ │ -float GetVertexSharpness() const │ │ │ │ │ -Return the sharpness of the vertex. │ │ │ │ │ -Definition: vertexDescriptor.h:386 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::Finalize │ │ │ │ │ -bool Finalize() │ │ │ │ │ -Terminate the sequence of specifications. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetManifold │ │ │ │ │ -void SetManifold(bool isManifold) │ │ │ │ │ -Declare the vertex neighborhood as manifold (ordered) │ │ │ │ │ -Definition: vertexDescriptor.h:325 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::Initialize │ │ │ │ │ -bool Initialize(int numIncidentFaces) │ │ │ │ │ -Initialize specification with the number of incident faces. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsManifold │ │ │ │ │ -bool IsManifold() const │ │ │ │ │ -Return if vertex neighborhood is manifold. │ │ │ │ │ -Definition: vertexDescriptor.h:329 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasEdgeSharpness │ │ │ │ │ -bool HasEdgeSharpness() const │ │ │ │ │ -Return if sharpness was assigned to the incident edges. │ │ │ │ │ -Definition: vertexDescriptor.h:394 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetIncidentFaceSize │ │ │ │ │ -int GetIncidentFaceSize(int faceIndex) const │ │ │ │ │ -Return the size of an incident face. │ │ │ │ │ -Definition: vertexDescriptor.h:362 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetManifoldEdgeSharpness │ │ │ │ │ -float GetManifoldEdgeSharpness(int edgeIndex) const │ │ │ │ │ -Return the sharpness assigned to a manifold edge. │ │ │ │ │ -Definition: vertexDescriptor.h:420 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor:: │ │ │ │ │ -SetIncidentFaceEdgeSharpness │ │ │ │ │ -void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, float │ │ │ │ │ -trailingEdgeSharp) │ │ │ │ │ -Assign sharpness to the edges of an incident face. │ │ │ │ │ -Definition: vertexDescriptor.h:427 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasVertexSharpness │ │ │ │ │ -bool HasVertexSharpness() const │ │ │ │ │ -Return if sharpness was assigned to the vertex. │ │ │ │ │ -Definition: vertexDescriptor.h:373 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearIncidentFaceSizes │ │ │ │ │ -void ClearIncidentFaceSizes() │ │ │ │ │ -Remove any assigned sizes of incident faces. │ │ │ │ │ -Definition: vertexDescriptor.h:350 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetVertexSharpness │ │ │ │ │ -void SetVertexSharpness(float sharpness) │ │ │ │ │ -Assign sharpness to the vertex. │ │ │ │ │ -Definition: vertexDescriptor.h:382 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearVertexSharpness │ │ │ │ │ -void ClearVertexSharpness() │ │ │ │ │ -Remove any sharpness assigned to the vertex. │ │ │ │ │ -Definition: vertexDescriptor.h:377 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearEdgeSharpness │ │ │ │ │ -void ClearEdgeSharpness() │ │ │ │ │ -Remove any sharpness assigned to the incident edges. │ │ │ │ │ -Definition: vertexDescriptor.h:398 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor:: │ │ │ │ │ -GetIncidentFaceEdgeSharpness │ │ │ │ │ -void GetIncidentFaceEdgeSharpness(int faceIndex, float *leadingEdgeSharp, float │ │ │ │ │ -*trailingEdgeSharp) const │ │ │ │ │ -Return the sharpness assigned to edges of an incident face. │ │ │ │ │ -Definition: vertexDescriptor.h:436 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsBoundary │ │ │ │ │ -bool IsBoundary() const │ │ │ │ │ -Return if vertex neighborhood is on a boundary. │ │ │ │ │ -Definition: vertexDescriptor.h:338 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsValid │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization │ │ │ │ │ +Simple class defining the 2D parameterization of a face. │ │ │ │ │ +Definition: parameterization.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization::GetFaceSize │ │ │ │ │ +int GetFaceSize() const │ │ │ │ │ +Returns the size (number of vertices) of the corresponding face. │ │ │ │ │ +Definition: parameterization.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization::GetVertexCoord │ │ │ │ │ +void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const │ │ │ │ │ +Returns the (u,v) coordinate of a given vertex. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation │ │ │ │ │ +Encapsulates a specific tessellation pattern of a Parameterization. │ │ │ │ │ +Definition: tessellation.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFaceSize │ │ │ │ │ +int GetFaceSize() const │ │ │ │ │ +Return the size of the face. │ │ │ │ │ +Definition: tessellation.h:182 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumBoundaryCoords │ │ │ │ │ +int GetNumBoundaryCoords() const │ │ │ │ │ +Return the number of boundary coordinates. │ │ │ │ │ +Definition: tessellation.h:211 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::~Tessellation │ │ │ │ │ +~Tessellation() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ +void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], │ │ │ │ │ +int const interiorIndices[]) │ │ │ │ │ +Reassign all facet coordinate indices. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetCoordStride │ │ │ │ │ +int GetCoordStride() const │ │ │ │ │ +Return the number of elements between each coordinate. │ │ │ │ │ +Definition: tessellation.h:208 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumEdgeCoords │ │ │ │ │ +int GetNumEdgeCoords(int edge) const │ │ │ │ │ +Return the number of coordinates within a given edge (excluding those at its │ │ │ │ │ +end vertices) │ │ │ │ │ +Definition: tessellation.h:218 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetInteriorCoords │ │ │ │ │ +int GetInteriorCoords(REAL coordTuples[]) const │ │ │ │ │ +Retrieve the coordinates for the boundary. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacetStride │ │ │ │ │ +int GetFacetStride() const │ │ │ │ │ +Return the number of elements between each facet. │ │ │ │ │ +Definition: tessellation.h:261 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::IsUniform │ │ │ │ │ +bool IsUniform() const │ │ │ │ │ +Return if the pattern is uniform. │ │ │ │ │ +Definition: tessellation.h:188 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumCoords │ │ │ │ │ +int GetNumCoords() const │ │ │ │ │ +Return the number of coordinates in the entire pattern. │ │ │ │ │ +Definition: tessellation.h:205 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetCoords │ │ │ │ │ +int GetCoords(REAL coordTuples[]) const │ │ │ │ │ +Retrieve the coordinates for the entire pattern. │ │ │ │ │ +Definition: tessellation.h:372 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ +void TransformFacetCoordIndices(int facetTuples[], int commonOffset) │ │ │ │ │ +Apply a common offset to all facet coordinate indices. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ +Tessellation(Parameterization const &p, int numRates, int const rates[], │ │ │ │ │ +Options const &options=Options()) │ │ │ │ │ +General constructor providing multiple tessellation rates for a non-uniform │ │ │ │ │ +tessellation. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetParameterization │ │ │ │ │ +Parameterization GetParameterization() const │ │ │ │ │ +Return the Parameterization. │ │ │ │ │ +Definition: tessellation.h:179 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ +void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], │ │ │ │ │ +int interiorOffset) │ │ │ │ │ +Reassign indices of boundary coordinates while offseting those of interior │ │ │ │ │ +coordinates. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacetSize │ │ │ │ │ +int GetFacetSize() const │ │ │ │ │ +Return the number of indices assigned to each facet. │ │ │ │ │ +Definition: tessellation.h:258 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ +Tessellation()=delete │ │ │ │ │ +Default construction is unavailable. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ +Tessellation(Parameterization const &p, int uniformRate, Options const │ │ │ │ │ +&options=Options()) │ │ │ │ │ +Simple constructor providing a single uniform tessellation rate. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacets │ │ │ │ │ +int GetFacets(int facetTuples[]) const │ │ │ │ │ +Retrieve the facet indices for the entire pattern. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumFacets │ │ │ │ │ +int GetNumFacets() const │ │ │ │ │ +Return the number of facets in the entire pattern. │ │ │ │ │ +Definition: tessellation.h:255 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumInteriorCoords │ │ │ │ │ +int GetNumInteriorCoords() const │ │ │ │ │ +Return the number of interior coordinates. │ │ │ │ │ +Definition: tessellation.h:214 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetVertexCoord │ │ │ │ │ +int GetVertexCoord(int vertex, REAL coordTuples[]) const │ │ │ │ │ +Retrieve the coordinate for a given vertex of the face. │ │ │ │ │ +Definition: tessellation.h:365 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetBoundaryCoords │ │ │ │ │ +int GetBoundaryCoords(REAL coordTuples[]) const │ │ │ │ │ +Retrieve the coordinates for the boundary. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ +Tessellation(Tessellation const &)=delete │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetRates │ │ │ │ │ +int GetRates(int rates[]) const │ │ │ │ │ +Retrieve the rates assigned. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::IsValid │ │ │ │ │ bool IsValid() const │ │ │ │ │ -Return if instance is valid. │ │ │ │ │ -Definition: vertexDescriptor.h:320 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasIncidentFaceSizes │ │ │ │ │ -bool HasIncidentFaceSizes() const │ │ │ │ │ -Return if the sizes of incident faces are assigned. │ │ │ │ │ -Definition: vertexDescriptor.h:346 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetBoundary │ │ │ │ │ -void SetBoundary(bool isOnBoundary) │ │ │ │ │ -Declare the vertex neighborhood as being on a boundary. │ │ │ │ │ -Definition: vertexDescriptor.h:334 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetIncidentFaceSize │ │ │ │ │ -void SetIncidentFaceSize(int faceIndex, int faceSize) │ │ │ │ │ -Assign the size of an incident face. │ │ │ │ │ -Definition: vertexDescriptor.h:355 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetManifoldEdgeSharpness │ │ │ │ │ -void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness) │ │ │ │ │ -Assign sharpness to the edge of a manifold neighborhood. │ │ │ │ │ -Definition: vertexDescriptor.h:403 │ │ │ │ │ +Return true if correctly initialized. │ │ │ │ │ +Definition: tessellation.h:162 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::operator= │ │ │ │ │ +Tessellation & operator=(Tessellation const &)=delete │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetEdgeCoords │ │ │ │ │ +int GetEdgeCoords(int edge, REAL coordTuples[]) const │ │ │ │ │ +Retrieve the coordinates for a given edge of the face (excluding those at its │ │ │ │ │ +end vertices) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options │ │ │ │ │ +Options configure a Tessellation to specify the nature of both its results and │ │ │ │ │ +the structure of the c... │ │ │ │ │ +Definition: tessellation.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::Options │ │ │ │ │ +Options() │ │ │ │ │ +Definition: tessellation.h:67 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetCoordStride │ │ │ │ │ +int GetCoordStride() const │ │ │ │ │ +Return the stride between (u,v) pairs. │ │ │ │ │ +Definition: tessellation.h:90 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetFacetSize │ │ │ │ │ +Options & SetFacetSize(int numIndices) │ │ │ │ │ +Assign the number of indices per facet (must be 3 or 4, default is 3) │ │ │ │ │ +Definition: tessellation.h:348 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetFacetStride │ │ │ │ │ +int GetFacetStride() const │ │ │ │ │ +Return the stride between facets. │ │ │ │ │ +Definition: tessellation.h:85 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetFacetSize │ │ │ │ │ +int GetFacetSize() const │ │ │ │ │ +Definition: tessellation.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetCoordStride │ │ │ │ │ +Options & SetCoordStride(int stride) │ │ │ │ │ +Assign the stride between (u,v) pairs (default is 2) │ │ │ │ │ +Definition: tessellation.h:358 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetFacetStride │ │ │ │ │ +Options & SetFacetStride(int stride) │ │ │ │ │ +Assign the stride between facets (default is facet size) │ │ │ │ │ +Definition: tessellation.h:353 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::PreserveQuads │ │ │ │ │ +bool PreserveQuads() const │ │ │ │ │ +Return if preservation of quads is set. │ │ │ │ │ +Definition: tessellation.h:74 │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * vertexDescriptor.h │ │ │ │ │ + * tessellation.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00677.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/surfaceFactoryCache.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/bfr/vertexDescriptor.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,31 +83,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
surfaceFactoryCache.h File Reference
│ │ │ │ +
vertexDescriptor.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../bfr/irregularPatchType.h"
│ │ │ │ -#include <map>
│ │ │ │ -#include <cstdint>
│ │ │ │ +#include "../vtr/stackBuffer.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  SurfaceFactoryCache
 Container used internally by SurfaceFactory to store reusable information. More...
 
class  SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE >
 Template for declaring thread-safe subclasses of SurfaceFactoryCache. More...
class  VertexDescriptor
 Simple class used by subclasses of SurfaceFactory to describe a vertex. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -116,13 +111,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,34 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -surfaceFactoryCache.h File Reference │ │ │ │ │ +vertexDescriptor.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../bfr/irregularPatchType.h" │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include "../vtr/stackBuffer.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  SurfaceFactoryCache │ │ │ │ │ -  Container used internally by SurfaceFactory to store reusable │ │ │ │ │ - information. More... │ │ │ │ │ -  │ │ │ │ │ -class  SurfaceFactoryCacheThreaded<_MUTEX_TYPE,_READ_LOCK_GUARD_TYPE, │ │ │ │ │ - WRITE_LOCK_GUARD_TYPE_> │ │ │ │ │ -  Template for declaring thread-safe subclasses of SurfaceFactoryCache. │ │ │ │ │ +class  VertexDescriptor │ │ │ │ │ +  Simple class used by subclasses of SurfaceFactory to describe a vertex. │ │ │ │ │ More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Bfr │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * surfaceFactoryCache.h │ │ │ │ │ + * vertexDescriptor.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00677.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00677 = [ │ │ │ │ │ - ["SurfaceFactoryCache", "a00949.html", "a00949"], │ │ │ │ │ - ["SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE >", "a00953.html", "a00953"] │ │ │ │ │ + ["VertexDescriptor", "a00969.html", "a00969"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00677_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/surfaceFactoryCache.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/bfr/vertexDescriptor.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
surfaceFactoryCache.h
│ │ │ │ +
vertexDescriptor.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2021 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,122 +107,385 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H
│ │ │ │ -
26#define OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H
│ │ │ │ +
26#define OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../bfr/irregularPatchType.h"
│ │ │ │ +
30#include "../vtr/stackBuffer.h"
│ │ │ │
31
│ │ │ │ -
32#include <map>
│ │ │ │ -
33#include <cstdint>
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │
34
│ │ │ │ -
35namespace OpenSubdiv {
│ │ │ │ -
36namespace OPENSUBDIV_VERSION {
│ │ │ │ -
37
│ │ │ │ -
38namespace Bfr {
│ │ │ │ -
39
│ │ │ │ -
52//
│ │ │ │ -
53// Initial/expected use requires simple searches of and additions to the
│ │ │ │ -
54// cache by the SurfaceFactory or its Builders. Longer term, with the
│ │ │ │ -
55// possibility of instances of caches being shared between meshes and
│ │ │ │ -
56// factories, additional options and/or public methods may be warranted
│ │ │ │ -
57// to limit what is cached or to prune the cache if it gets too large.
│ │ │ │ -
58//
│ │ │ │ - │ │ │ │ -
60public:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
63
│ │ │ │ - │ │ │ │ - │ │ │ │ -
66
│ │ │ │ -
67protected:
│ │ │ │ -
69 // Access restricted to the Factory, its Builders, etc.
│ │ │ │ -
70 friend class SurfaceFactory;
│ │ │ │ -
71
│ │ │ │ -
72 typedef std::uint64_t KeyType;
│ │ │ │ -
73 typedef internal::IrregularPatchSharedPtr DataType;
│ │ │ │ -
75
│ │ │ │ -
76protected:
│ │ │ │ -
78 size_t Size() const { return _map.size(); }
│ │ │ │ -
79
│ │ │ │ -
80 //
│ │ │ │ -
81 // Potential overrides by subclasses for thread-safety:
│ │ │ │ -
82 //
│ │ │ │ -
83 virtual DataType Find(KeyType const & key) const;
│ │ │ │ -
84 virtual DataType Add(KeyType const & key, DataType const & data);
│ │ │ │ -
85
│ │ │ │ -
86 //
│ │ │ │ -
87 // Common implementation used by all subclasses:
│ │ │ │ -
88 //
│ │ │ │ -
89 DataType find(KeyType const & key) const;
│ │ │ │ -
90 DataType add(KeyType const & key, DataType const & data);
│ │ │ │ -
92
│ │ │ │ -
93private:
│ │ │ │ -
94 typedef std::map<KeyType, DataType> MapType;
│ │ │ │ -
95
│ │ │ │ -
96 MapType _map;
│ │ │ │ -
97};
│ │ │ │ -
98
│ │ │ │ -
113// Separate read and write locks are provided to support mutex types
│ │ │ │ -
114// allowing shared (read) or exclusive (write) access.
│ │ │ │ -
115//
│ │ │ │ -
116template <class MUTEX_TYPE, class READ_LOCK_GUARD_TYPE,
│ │ │ │ -
117 class WRITE_LOCK_GUARD_TYPE>
│ │ │ │ - │ │ │ │ -
119public:
│ │ │ │ - │ │ │ │ -
121 ~SurfaceFactoryCacheThreaded() override = default;
│ │ │ │ -
122
│ │ │ │ -
123protected:
│ │ │ │ -
125 //
│ │ │ │ -
126 // Virtual overrides from base:
│ │ │ │ -
127 //
│ │ │ │ -
128 DataType Find(KeyType const & key) const override {
│ │ │ │ -
129 READ_LOCK_GUARD_TYPE lockGuard(_mutex);
│ │ │ │ -
130 return find(key);
│ │ │ │ -
131 }
│ │ │ │ -
132
│ │ │ │ -
133 DataType Add(KeyType const & key, DataType const & data) override {
│ │ │ │ -
134 WRITE_LOCK_GUARD_TYPE lockGuard(_mutex);
│ │ │ │ -
135 return add(key, data);
│ │ │ │ -
136 }
│ │ │ │ -
138
│ │ │ │ -
139private:
│ │ │ │ -
140 MUTEX_TYPE mutable _mutex;
│ │ │ │ -
141};
│ │ │ │ +
35namespace Bfr {
│ │ │ │ +
36
│ │ │ │ +
50//
│ │ │ │ +
51// WIP - need to migrate some of these comments into Doxygen
│ │ │ │ +
52// - others will be moved to the external documentation
│ │ │ │ +
53//
│ │ │ │ +
54// It is used by subclasses of SurfaceFactory to provide a complete
│ │ │ │ +
55// topological description for each vertex of a face, i.e. invoked via
│ │ │ │ +
56// the virtual method:
│ │ │ │ +
57//
│ │ │ │ +
58// int populateFaceVertexDescriptor(Index baseFace,
│ │ │ │ +
59// int cornerVertex,
│ │ │ │ +
60// VertexDescriptor & v) const;
│ │ │ │ +
61//
│ │ │ │ +
62// Assignment of the full topology can be involved in the presence of
│ │ │ │ +
63// irregular faces, non-manifold topology or creasing around a vertex, but
│ │ │ │ +
64// many cases will be simple. For example, to specify a regular boundary
│ │ │ │ +
65// vertex of a Catmark mesh without any optional sharpness:
│ │ │ │ +
66//
│ │ │ │ +
67// int numIncidentFaces = 2;
│ │ │ │ +
68// bool vertexOnBoundary = true;
│ │ │ │ +
69//
│ │ │ │ +
70// vd.Initialize(numIncidentFaces);
│ │ │ │ +
71// vd.SetManifold(true);
│ │ │ │ +
72// vd.SetBoundary(vertexOnBoundary);
│ │ │ │ +
73// vd.ClearIncidentFaceSizes();
│ │ │ │ +
74// vd.Finalize();
│ │ │ │ +
75//
│ │ │ │ +
76// For a more general example, to assign a vertex of some valence whose
│ │ │ │ +
77// incident faces are of different sizes (e.g. required when triangles
│ │ │ │ +
78// appear around a vertex in an otherwise quad-dominant Catmark mesh):
│ │ │ │ +
79//
│ │ │ │ +
80// int numIncidentFaces = meshVertex.GetNumIncidentFaces();
│ │ │ │ +
81// bool vertexOnBoundary = meshVertex.IsBoundar();
│ │ │ │ +
82//
│ │ │ │ +
83// vd.Initialize(numIncidentFaces);
│ │ │ │ +
84// vd.SetManifold(true);
│ │ │ │ +
85// vd.SetBoundary(vertexOnBoundary);
│ │ │ │ +
86//
│ │ │ │ +
87// for (int i = 0; i < numIncidentFaces; ++i) {
│ │ │ │ +
88// vd.SetIncidentFaceSize(i, meshVertex.GetIncidentFaceSize(i));
│ │ │ │ +
89// }
│ │ │ │ +
90// vd.Finalize();
│ │ │ │ +
91//
│ │ │ │ +
92// These examples specify the incident faces as forming a manifold ring
│ │ │ │ +
93// (or half-ring) around the vertex, i.e. they can be specified as a
│ │ │ │ +
94// continuous, connected sequence in counter-clockwise order (and also
│ │ │ │ +
95// without degeneracies). In the case of a boundary vertex, the first
│ │ │ │ +
96// face must be on the leading edge of the boundary while the last is on
│ │ │ │ +
97// the trailing edge. For an interior vertex, which face is specified
│ │ │ │ +
98// first does not matter (since the set is periodic).
│ │ │ │ +
99//
│ │ │ │ +
100// In both cases, the location of the base face in this sequence -- the
│ │ │ │ +
101// face whose corner vertex is being described here -- must be specified
│ │ │ │ +
102// in the return value to populateFaceVertexDescriptor() (e.g. when a
│ │ │ │ +
103// boundary vertex has 3 incident faces, a return value of 0, 1 or 2
│ │ │ │ +
104// will indicate which is the base face).
│ │ │ │ +
105//
│ │ │ │ +
106// The corresponding methods to specify mesh control vertex indices (or
│ │ │ │ +
107// face-varying indices) complete the specification of the neighborhood:
│ │ │ │ +
108//
│ │ │ │ +
109// int getFaceCornerVertexIndices(Index baseFace, int cornerVertex,
│ │ │ │ +
110// Index vertexIndices[]) const;
│ │ │ │ +
111//
│ │ │ │ +
112// int getFaceCornerFVarValueIndices(Index baseFace, int cornerVertex,
│ │ │ │ +
113// Index fvarValueIndices[],
│ │ │ │ +
114// int fvarChannel) const;
│ │ │ │ +
115//
│ │ │ │ +
116// and are invoked by the Factory when needed.
│ │ │ │ +
117//
│ │ │ │ +
118// For each incident face, the indices for all vertices of that face are
│ │ │ │ +
119// to be specified (not the one-ring or some other subset). These indices
│ │ │ │ +
120// must also be specified in an orientation relative to the vertex, i.e.
│ │ │ │ +
121// for a vertex A and an incident face with face-vertices that may be
│ │ │ │ +
122// stored internally as {D, C, A, B}, they must be specified with A first
│ │ │ │ +
123// as {A, B, C, D}. This may seem a bit cumbersome, but it has clear
│ │ │ │ +
124// advantages when dealing with face-varying indices and unordered faces.
│ │ │ │ +
125//
│ │ │ │ +
126// More compact ways of specifying vertex indices for ordered, manifold
│ │ │ │ +
127// cases may be worth exploring in future, but face-varying indices and
│ │ │ │ +
128// non-manifold (unordered) vertices will always require such a full set,
│ │ │ │ +
129// so both methods will need to co-exist.
│ │ │ │ +
130//
│ │ │ │ + │ │ │ │ +
132public:
│ │ │ │ +
133 // The full declaration must be enclosed by calls to these methods:
│ │ │ │ +
134 //
│ │ │ │ +
135 // Note that vertex valences or face sizes in excess of those defined
│ │ │ │ +
136 // in Bfr::Limits (typically 16-bits) are not valid. When specifying
│ │ │ │ +
137 // values in excess of these limits, initialization will fail and/or
│ │ │ │ +
138 // the descriptor will be marked invalid and finalization will fail.
│ │ │ │ +
139 //
│ │ │ │ +
140
│ │ │ │
142
│ │ │ │ -
143} // end namespace Bfr
│ │ │ │ -
144
│ │ │ │ -
145} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
146using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
147
│ │ │ │ -
148} // end namespace OpenSubdiv
│ │ │ │
149
│ │ │ │ -
150#endif /* OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H */
│ │ │ │ +
151 bool Initialize(int numIncidentFaces);
│ │ │ │ +
152
│ │ │ │ +
154 bool Finalize();
│ │ │ │ +
155
│ │ │ │ +
157 bool IsValid() const;
│ │ │ │ +
159
│ │ │ │ +
160 //
│ │ │ │ +
161 // WIP - need to migrate these comments into Doxygen
│ │ │ │ +
162 //
│ │ │ │ +
163 // Three groups of methods describe the topology around a vertex:
│ │ │ │ +
164 // - simple properties (vertex is a boundary, manifold, etc.)
│ │ │ │ +
165 // - sizes of incident faces (constant or size for each face)
│ │ │ │ +
166 // - sharpness of the vertex and its incident edges (optional)
│ │ │ │ +
167 //
│ │ │ │ +
168
│ │ │ │ +
169 // Manifold and boundary conditions:
│ │ │ │ +
170 //
│ │ │ │ +
171 // The manifold property is a strict condition but preferred for
│ │ │ │ +
172 // efficiency and is usually available from common connected mesh
│ │ │ │ +
173 // representations. When declaring the topology as "manifold",
│ │ │ │ +
174 // the Factory assumes the following:
│ │ │ │ +
175 //
│ │ │ │ +
176 // - all incident faces are "ordered" (counter-clockwise)
│ │ │ │ +
177 // - all incident faces are consistently oriented
│ │ │ │ +
178 // - all incident edges are non-degenerate
│ │ │ │ +
179 //
│ │ │ │ +
180 // If not certain that all of these conditions are met, it is best
│ │ │ │ +
181 // to not declare manifold -- leaving the Factory to make sense of
│ │ │ │ +
182 // the set of incident faces from the face-vertex indices that are
│ │ │ │ +
183 // provided elsewhere.
│ │ │ │ +
184 //
│ │ │ │ +
185
│ │ │ │ +
187
│ │ │ │ +
191
│ │ │ │ +
193 void SetManifold(bool isManifold);
│ │ │ │ +
194
│ │ │ │ +
196 void SetBoundary(bool isOnBoundary);
│ │ │ │ +
197
│ │ │ │ +
199 void SetIncidentFaceSize(int faceIndex, int faceSize);
│ │ │ │ +
200
│ │ │ │ + │ │ │ │ +
203
│ │ │ │ +
205 void SetVertexSharpness(float sharpness);
│ │ │ │ +
206
│ │ │ │ + │ │ │ │ +
209
│ │ │ │ +
221 void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness);
│ │ │ │ +
222
│ │ │ │ +
238 void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp,
│ │ │ │ +
239 float trailingEdgeSharp);
│ │ │ │ +
240
│ │ │ │ +
242 void ClearEdgeSharpness();
│ │ │ │ +
244
│ │ │ │ +
246
│ │ │ │ +
251
│ │ │ │ +
253 bool IsManifold() const;
│ │ │ │ +
254
│ │ │ │ +
256 bool IsBoundary() const;
│ │ │ │ +
257
│ │ │ │ +
259 bool HasIncidentFaceSizes() const;
│ │ │ │ +
260
│ │ │ │ +
262 int GetIncidentFaceSize(int faceIndex) const;
│ │ │ │ +
263
│ │ │ │ +
265 bool HasVertexSharpness() const;
│ │ │ │ +
266
│ │ │ │ +
268 float GetVertexSharpness() const;
│ │ │ │ +
269
│ │ │ │ +
271 bool HasEdgeSharpness() const;
│ │ │ │ +
272
│ │ │ │ +
274 float GetManifoldEdgeSharpness(int edgeIndex) const;
│ │ │ │ +
275
│ │ │ │ +
277 void GetIncidentFaceEdgeSharpness(int faceIndex,
│ │ │ │ +
278 float * leadingEdgeSharp, float * trailingEdgeSharp) const;
│ │ │ │ +
280
│ │ │ │ +
281protected:
│ │ │ │ +
283 friend class FaceVertex;
│ │ │ │ +
284
│ │ │ │ +
285 VertexDescriptor() { }
│ │ │ │ + │ │ │ │ +
287
│ │ │ │ +
288 typedef Vtr::internal::StackBuffer<int,8,true> IntBuffer;
│ │ │ │ +
289 typedef Vtr::internal::StackBuffer<float,16,true> FloatBuffer;
│ │ │ │ +
290
│ │ │ │ +
291 void initFaceSizes();
│ │ │ │ +
292 void initEdgeSharpness();
│ │ │ │ +
294
│ │ │ │ +
295protected:
│ │ │ │ +
297 // Member variables assigned through the above interface:
│ │ │ │ +
298 unsigned short _isValid : 1;
│ │ │ │ +
299 unsigned short _isInitialized : 1;
│ │ │ │ +
300 unsigned short _isFinalized : 1;
│ │ │ │ +
301
│ │ │ │ +
302 unsigned short _isManifold : 1;
│ │ │ │ +
303 unsigned short _isBoundary : 1;
│ │ │ │ +
304
│ │ │ │ +
305 unsigned short _hasFaceSizes : 1;
│ │ │ │ +
306 unsigned short _hasEdgeSharpness : 1;
│ │ │ │ +
307
│ │ │ │ +
308 short _numFaces;
│ │ │ │ +
309 float _vertSharpness;
│ │ │ │ +
310
│ │ │ │ +
311 FloatBuffer _faceEdgeSharpness;
│ │ │ │ +
312 IntBuffer _faceSizeOffsets;
│ │ │ │ +
314};
│ │ │ │ +
315
│ │ │ │ +
316//
│ │ │ │ +
317// Public inline methods for simple assignment:
│ │ │ │ +
318//
│ │ │ │ +
319inline bool
│ │ │ │ + │ │ │ │ +
321 return _isValid;
│ │ │ │ +
322}
│ │ │ │ +
323
│ │ │ │ +
324inline void
│ │ │ │ + │ │ │ │ +
326 _isManifold = isManifold;
│ │ │ │ +
327}
│ │ │ │ +
328inline bool
│ │ │ │ + │ │ │ │ +
330 return _isManifold;
│ │ │ │ +
331}
│ │ │ │ +
332
│ │ │ │ +
333inline void
│ │ │ │ + │ │ │ │ +
335 _isBoundary = isBoundary;
│ │ │ │ +
336}
│ │ │ │ +
337inline bool
│ │ │ │ + │ │ │ │ +
339 return _isBoundary;
│ │ │ │ +
340}
│ │ │ │ +
341
│ │ │ │ +
342//
│ │ │ │ +
343// Public inline methods involving sizes of incident faces:
│ │ │ │ +
344//
│ │ │ │ +
345inline bool
│ │ │ │ + │ │ │ │ +
347 return _hasFaceSizes;
│ │ │ │ +
348}
│ │ │ │ +
349inline void
│ │ │ │ + │ │ │ │ +
351 _hasFaceSizes = false;
│ │ │ │ +
352}
│ │ │ │ +
353
│ │ │ │ +
354inline void
│ │ │ │ +
355VertexDescriptor::SetIncidentFaceSize(int incFaceIndex, int faceSize) {
│ │ │ │ +
356
│ │ │ │ +
357 if (!_hasFaceSizes) initFaceSizes();
│ │ │ │ +
358
│ │ │ │ +
359 _faceSizeOffsets[incFaceIndex] = faceSize;
│ │ │ │ +
360}
│ │ │ │ +
361inline int
│ │ │ │ + │ │ │ │ +
363
│ │ │ │ +
364 return _isFinalized ?
│ │ │ │ +
365 (_faceSizeOffsets[incFaceIndex+1] - _faceSizeOffsets[incFaceIndex]) :
│ │ │ │ +
366 _faceSizeOffsets[incFaceIndex];
│ │ │ │ +
367}
│ │ │ │ +
368
│ │ │ │ +
369//
│ │ │ │ +
370// Public inline methods involving vertex sharpness:
│ │ │ │ +
371//
│ │ │ │ +
372inline bool
│ │ │ │ + │ │ │ │ +
374 return _vertSharpness > 0.0f;
│ │ │ │ +
375}
│ │ │ │ +
376inline void
│ │ │ │ + │ │ │ │ +
378 _vertSharpness = 0.0f;
│ │ │ │ +
379}
│ │ │ │ +
380
│ │ │ │ +
381inline void
│ │ │ │ + │ │ │ │ +
383 _vertSharpness = vertSharpness;
│ │ │ │ +
384}
│ │ │ │ +
385inline float
│ │ │ │ + │ │ │ │ +
387 return _vertSharpness;
│ │ │ │ +
388}
│ │ │ │ +
389
│ │ │ │ +
390//
│ │ │ │ +
391// Public inline methods involving vertex sharpness:
│ │ │ │ +
392//
│ │ │ │ +
393inline bool
│ │ │ │ + │ │ │ │ +
395 return _hasEdgeSharpness;
│ │ │ │ +
396}
│ │ │ │ +
397inline void
│ │ │ │ + │ │ │ │ +
399 _hasEdgeSharpness = false;
│ │ │ │ +
400}
│ │ │ │ +
401
│ │ │ │ +
402inline void
│ │ │ │ +
403VertexDescriptor::SetManifoldEdgeSharpness(int edgeIndex, float sharpness) {
│ │ │ │ +
404
│ │ │ │ +
405 if (!_hasEdgeSharpness) initEdgeSharpness();
│ │ │ │ +
406
│ │ │ │ +
407 // Assign the leading edge of the face after the edge (even index):
│ │ │ │ +
408 if (edgeIndex < _numFaces) {
│ │ │ │ +
409 _faceEdgeSharpness[2*edgeIndex] = sharpness;
│ │ │ │ +
410 }
│ │ │ │ +
411
│ │ │ │ +
412 // Assign the trailing edge of the face before the edge (odd index):
│ │ │ │ +
413 if (edgeIndex > 0) {
│ │ │ │ +
414 _faceEdgeSharpness[2*edgeIndex-1] = sharpness;
│ │ │ │ +
415 } else if (!IsBoundary()) {
│ │ │ │ +
416 _faceEdgeSharpness[2*_numFaces-1] = sharpness;
│ │ │ │ +
417 }
│ │ │ │ +
418}
│ │ │ │ +
419inline float
│ │ │ │ + │ │ │ │ +
421
│ │ │ │ +
422 // All edges are first of the pair (even index) except last of boundary
│ │ │ │ +
423 return _faceEdgeSharpness[2*edgeIndex - (edgeIndex == _numFaces)];
│ │ │ │ +
424}
│ │ │ │ +
425
│ │ │ │ +
426inline void
│ │ │ │ + │ │ │ │ +
428 float leadingEdgeSharpness, float trailingEdgeSharpness) {
│ │ │ │ +
429
│ │ │ │ +
430 if (!_hasEdgeSharpness) initEdgeSharpness();
│ │ │ │ +
431
│ │ │ │ +
432 _faceEdgeSharpness[2*faceIndex ] = leadingEdgeSharpness;
│ │ │ │ +
433 _faceEdgeSharpness[2*faceIndex+1] = trailingEdgeSharpness;
│ │ │ │ +
434}
│ │ │ │ +
435inline void
│ │ │ │ + │ │ │ │ +
437 float * leadingEdgeSharpness, float * trailingEdgeSharpness) const {
│ │ │ │ +
438
│ │ │ │ +
439 *leadingEdgeSharpness = _faceEdgeSharpness[2*faceIndex];
│ │ │ │ +
440 *trailingEdgeSharpness = _faceEdgeSharpness[2*faceIndex+1];
│ │ │ │ +
441}
│ │ │ │ +
442
│ │ │ │ +
443} // end namespace Bfr
│ │ │ │ +
444
│ │ │ │ +
445} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
446using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
447} // end namespace OpenSubdiv
│ │ │ │ +
448
│ │ │ │ +
449#endif /* OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H */
│ │ │ │ │ │ │ │ -
Base class providing initialization of a Surface for each face of a mesh.
│ │ │ │ -
Container used internally by SurfaceFactory to store reusable information.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
SurfaceFactoryCache(SurfaceFactoryCache const &)=delete
│ │ │ │ -
SurfaceFactoryCache & operator=(SurfaceFactoryCache const &)=delete
│ │ │ │ -
Template for declaring thread-safe subclasses of SurfaceFactoryCache.
│ │ │ │ - │ │ │ │ - │ │ │ │ +
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ +
float GetVertexSharpness() const
Return the sharpness of the vertex.
│ │ │ │ +
bool Finalize()
Terminate the sequence of specifications.
│ │ │ │ +
void SetManifold(bool isManifold)
Declare the vertex neighborhood as manifold (ordered)
│ │ │ │ +
bool Initialize(int numIncidentFaces)
Initialize specification with the number of incident faces.
│ │ │ │ +
bool IsManifold() const
Return if vertex neighborhood is manifold.
│ │ │ │ +
bool HasEdgeSharpness() const
Return if sharpness was assigned to the incident edges.
│ │ │ │ +
int GetIncidentFaceSize(int faceIndex) const
Return the size of an incident face.
│ │ │ │ +
float GetManifoldEdgeSharpness(int edgeIndex) const
Return the sharpness assigned to a manifold edge.
│ │ │ │ +
void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, float trailingEdgeSharp)
Assign sharpness to the edges of an incident face.
│ │ │ │ +
bool HasVertexSharpness() const
Return if sharpness was assigned to the vertex.
│ │ │ │ +
void ClearIncidentFaceSizes()
Remove any assigned sizes of incident faces.
│ │ │ │ +
void SetVertexSharpness(float sharpness)
Assign sharpness to the vertex.
│ │ │ │ +
void ClearVertexSharpness()
Remove any sharpness assigned to the vertex.
│ │ │ │ +
void ClearEdgeSharpness()
Remove any sharpness assigned to the incident edges.
│ │ │ │ +
void GetIncidentFaceEdgeSharpness(int faceIndex, float *leadingEdgeSharp, float *trailingEdgeSharp) const
Return the sharpness assigned to edges of an incident face.
│ │ │ │ +
bool IsBoundary() const
Return if vertex neighborhood is on a boundary.
│ │ │ │ +
bool IsValid() const
Return if instance is valid.
│ │ │ │ +
bool HasIncidentFaceSizes() const
Return if the sizes of incident faces are assigned.
│ │ │ │ +
void SetBoundary(bool isOnBoundary)
Declare the vertex neighborhood as being on a boundary.
│ │ │ │ +
void SetIncidentFaceSize(int faceIndex, int faceSize)
Assign the size of an incident face.
│ │ │ │ +
void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness)
Assign sharpness to the edge of a manifold neighborhood.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -surfaceFactoryCache.h │ │ │ │ │ +vertexDescriptor.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2021 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,131 +30,446 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H │ │ │ │ │ - 26#define OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../bfr/irregularPatchType.h" │ │ │ │ │ + 30#include "../vtr/stackBuffer.h" │ │ │ │ │ 31 │ │ │ │ │ - 32#include │ │ │ │ │ - 33#include │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ 34 │ │ │ │ │ - 35namespace OpenSubdiv { │ │ │ │ │ - 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 37 │ │ │ │ │ - 38namespace Bfr { │ │ │ │ │ - 39 │ │ │ │ │ - 52// │ │ │ │ │ - 53// Initial/expected use requires simple searches of and additions to the │ │ │ │ │ - 54// cache by the SurfaceFactory or its Builders. Longer term, with the │ │ │ │ │ - 55// possibility of instances of caches being shared between meshes and │ │ │ │ │ - 56// factories, additional options and/or public methods may be warranted │ │ │ │ │ - 57// to limit what is cached or to prune the cache if it gets too large. │ │ │ │ │ - 58// │ │ │ │ │ -59class SurfaceFactoryCache { │ │ │ │ │ - 60public: │ │ │ │ │ -61 SurfaceFactoryCache(); │ │ │ │ │ -62 virtual ~SurfaceFactoryCache(); │ │ │ │ │ - 63 │ │ │ │ │ -64 SurfaceFactoryCache(SurfaceFactoryCache const &) = delete; │ │ │ │ │ -65 SurfaceFactoryCache & operator=(SurfaceFactoryCache const &) = delete; │ │ │ │ │ - 66 │ │ │ │ │ - 67protected: │ │ │ │ │ - 69 // Access restricted to the Factory, its Builders, etc. │ │ │ │ │ - 70 friend class SurfaceFactory; │ │ │ │ │ - 71 │ │ │ │ │ - 72 typedef std::uint64_t KeyType; │ │ │ │ │ - 73 typedef internal::IrregularPatchSharedPtr DataType; │ │ │ │ │ - 75 │ │ │ │ │ - 76protected: │ │ │ │ │ - 78 size_t Size() const { return _map.size(); } │ │ │ │ │ - 79 │ │ │ │ │ - 80 // │ │ │ │ │ - 81 // Potential overrides by subclasses for thread-safety: │ │ │ │ │ - 82 // │ │ │ │ │ - 83 virtual DataType Find(KeyType const & key) const; │ │ │ │ │ - 84 virtual DataType Add(KeyType const & key, DataType const & data); │ │ │ │ │ - 85 │ │ │ │ │ - 86 // │ │ │ │ │ - 87 // Common implementation used by all subclasses: │ │ │ │ │ - 88 // │ │ │ │ │ - 89 DataType find(KeyType const & key) const; │ │ │ │ │ - 90 DataType add(KeyType const & key, DataType const & data); │ │ │ │ │ - 92 │ │ │ │ │ - 93private: │ │ │ │ │ - 94 typedef std::map MapType; │ │ │ │ │ - 95 │ │ │ │ │ - 96 MapType _map; │ │ │ │ │ - 97}; │ │ │ │ │ - 98 │ │ │ │ │ - 113// Separate read and write locks are provided to support mutex types │ │ │ │ │ - 114// allowing shared (read) or exclusive (write) access. │ │ │ │ │ + 35namespace Bfr { │ │ │ │ │ + 36 │ │ │ │ │ + 50// │ │ │ │ │ + 51// WIP - need to migrate some of these comments into Doxygen │ │ │ │ │ + 52// - others will be moved to the external documentation │ │ │ │ │ + 53// │ │ │ │ │ + 54// It is used by subclasses of SurfaceFactory to provide a complete │ │ │ │ │ + 55// topological description for each vertex of a face, i.e. invoked via │ │ │ │ │ + 56// the virtual method: │ │ │ │ │ + 57// │ │ │ │ │ + 58// int populateFaceVertexDescriptor(Index baseFace, │ │ │ │ │ + 59// int cornerVertex, │ │ │ │ │ + 60// VertexDescriptor & v) const; │ │ │ │ │ + 61// │ │ │ │ │ + 62// Assignment of the full topology can be involved in the presence of │ │ │ │ │ + 63// irregular faces, non-manifold topology or creasing around a vertex, but │ │ │ │ │ + 64// many cases will be simple. For example, to specify a regular boundary │ │ │ │ │ + 65// vertex of a Catmark mesh without any optional sharpness: │ │ │ │ │ + 66// │ │ │ │ │ + 67// int numIncidentFaces = 2; │ │ │ │ │ + 68// bool vertexOnBoundary = true; │ │ │ │ │ + 69// │ │ │ │ │ + 70// vd.Initialize(numIncidentFaces); │ │ │ │ │ + 71// vd.SetManifold(true); │ │ │ │ │ + 72// vd.SetBoundary(vertexOnBoundary); │ │ │ │ │ + 73// vd.ClearIncidentFaceSizes(); │ │ │ │ │ + 74// vd.Finalize(); │ │ │ │ │ + 75// │ │ │ │ │ + 76// For a more general example, to assign a vertex of some valence whose │ │ │ │ │ + 77// incident faces are of different sizes (e.g. required when triangles │ │ │ │ │ + 78// appear around a vertex in an otherwise quad-dominant Catmark mesh): │ │ │ │ │ + 79// │ │ │ │ │ + 80// int numIncidentFaces = meshVertex.GetNumIncidentFaces(); │ │ │ │ │ + 81// bool vertexOnBoundary = meshVertex.IsBoundar(); │ │ │ │ │ + 82// │ │ │ │ │ + 83// vd.Initialize(numIncidentFaces); │ │ │ │ │ + 84// vd.SetManifold(true); │ │ │ │ │ + 85// vd.SetBoundary(vertexOnBoundary); │ │ │ │ │ + 86// │ │ │ │ │ + 87// for (int i = 0; i < numIncidentFaces; ++i) { │ │ │ │ │ + 88// vd.SetIncidentFaceSize(i, meshVertex.GetIncidentFaceSize(i)); │ │ │ │ │ + 89// } │ │ │ │ │ + 90// vd.Finalize(); │ │ │ │ │ + 91// │ │ │ │ │ + 92// These examples specify the incident faces as forming a manifold ring │ │ │ │ │ + 93// (or half-ring) around the vertex, i.e. they can be specified as a │ │ │ │ │ + 94// continuous, connected sequence in counter-clockwise order (and also │ │ │ │ │ + 95// without degeneracies). In the case of a boundary vertex, the first │ │ │ │ │ + 96// face must be on the leading edge of the boundary while the last is on │ │ │ │ │ + 97// the trailing edge. For an interior vertex, which face is specified │ │ │ │ │ + 98// first does not matter (since the set is periodic). │ │ │ │ │ + 99// │ │ │ │ │ + 100// In both cases, the location of the base face in this sequence -- the │ │ │ │ │ + 101// face whose corner vertex is being described here -- must be specified │ │ │ │ │ + 102// in the return value to populateFaceVertexDescriptor() (e.g. when a │ │ │ │ │ + 103// boundary vertex has 3 incident faces, a return value of 0, 1 or 2 │ │ │ │ │ + 104// will indicate which is the base face). │ │ │ │ │ + 105// │ │ │ │ │ + 106// The corresponding methods to specify mesh control vertex indices (or │ │ │ │ │ + 107// face-varying indices) complete the specification of the neighborhood: │ │ │ │ │ + 108// │ │ │ │ │ + 109// int getFaceCornerVertexIndices(Index baseFace, int cornerVertex, │ │ │ │ │ + 110// Index vertexIndices[]) const; │ │ │ │ │ + 111// │ │ │ │ │ + 112// int getFaceCornerFVarValueIndices(Index baseFace, int cornerVertex, │ │ │ │ │ + 113// Index fvarValueIndices[], │ │ │ │ │ + 114// int fvarChannel) const; │ │ │ │ │ 115// │ │ │ │ │ - 116template │ │ │ │ │ -118class SurfaceFactoryCacheThreaded : public SurfaceFactoryCache { │ │ │ │ │ - 119public: │ │ │ │ │ -120 SurfaceFactoryCacheThreaded() : SurfaceFactoryCache() { } │ │ │ │ │ -121 ~SurfaceFactoryCacheThreaded() override = default; │ │ │ │ │ - 122 │ │ │ │ │ - 123protected: │ │ │ │ │ - 125 // │ │ │ │ │ - 126 // Virtual overrides from base: │ │ │ │ │ - 127 // │ │ │ │ │ - 128 DataType Find(KeyType const & key) const override { │ │ │ │ │ - 129 READ_LOCK_GUARD_TYPE lockGuard(_mutex); │ │ │ │ │ - 130 return find(key); │ │ │ │ │ - 131 } │ │ │ │ │ - 132 │ │ │ │ │ - 133 DataType Add(KeyType const & key, DataType const & data) override { │ │ │ │ │ - 134 WRITE_LOCK_GUARD_TYPE lockGuard(_mutex); │ │ │ │ │ - 135 return add(key, data); │ │ │ │ │ - 136 } │ │ │ │ │ - 138 │ │ │ │ │ - 139private: │ │ │ │ │ - 140 MUTEX_TYPE mutable _mutex; │ │ │ │ │ - 141}; │ │ │ │ │ + 116// and are invoked by the Factory when needed. │ │ │ │ │ + 117// │ │ │ │ │ + 118// For each incident face, the indices for all vertices of that face are │ │ │ │ │ + 119// to be specified (not the one-ring or some other subset). These indices │ │ │ │ │ + 120// must also be specified in an orientation relative to the vertex, i.e. │ │ │ │ │ + 121// for a vertex A and an incident face with face-vertices that may be │ │ │ │ │ + 122// stored internally as {D, C, A, B}, they must be specified with A first │ │ │ │ │ + 123// as {A, B, C, D}. This may seem a bit cumbersome, but it has clear │ │ │ │ │ + 124// advantages when dealing with face-varying indices and unordered faces. │ │ │ │ │ + 125// │ │ │ │ │ + 126// More compact ways of specifying vertex indices for ordered, manifold │ │ │ │ │ + 127// cases may be worth exploring in future, but face-varying indices and │ │ │ │ │ + 128// non-manifold (unordered) vertices will always require such a full set, │ │ │ │ │ + 129// so both methods will need to co-exist. │ │ │ │ │ + 130// │ │ │ │ │ +131class VertexDescriptor { │ │ │ │ │ + 132public: │ │ │ │ │ + 133 // The full declaration must be enclosed by calls to these methods: │ │ │ │ │ + 134 // │ │ │ │ │ + 135 // Note that vertex valences or face sizes in excess of those defined │ │ │ │ │ + 136 // in Bfr::Limits (typically 16-bits) are not valid. When specifying │ │ │ │ │ + 137 // values in excess of these limits, initialization will fail and/or │ │ │ │ │ + 138 // the descriptor will be marked invalid and finalization will fail. │ │ │ │ │ + 139 // │ │ │ │ │ + 140 │ │ │ │ │ 142 │ │ │ │ │ - 143} // end namespace Bfr │ │ │ │ │ - 144 │ │ │ │ │ - 145} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 146using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 147 │ │ │ │ │ - 148} // end namespace OpenSubdiv │ │ │ │ │ 149 │ │ │ │ │ - 150#endif /* OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H */ │ │ │ │ │ +151 bool Initialize(int numIncidentFaces); │ │ │ │ │ + 152 │ │ │ │ │ +154 bool Finalize(); │ │ │ │ │ + 155 │ │ │ │ │ + 157 bool IsValid() const; │ │ │ │ │ + 159 │ │ │ │ │ + 160 // │ │ │ │ │ + 161 // WIP - need to migrate these comments into Doxygen │ │ │ │ │ + 162 // │ │ │ │ │ + 163 // Three groups of methods describe the topology around a vertex: │ │ │ │ │ + 164 // - simple properties (vertex is a boundary, manifold, etc.) │ │ │ │ │ + 165 // - sizes of incident faces (constant or size for each face) │ │ │ │ │ + 166 // - sharpness of the vertex and its incident edges (optional) │ │ │ │ │ + 167 // │ │ │ │ │ + 168 │ │ │ │ │ + 169 // Manifold and boundary conditions: │ │ │ │ │ + 170 // │ │ │ │ │ + 171 // The manifold property is a strict condition but preferred for │ │ │ │ │ + 172 // efficiency and is usually available from common connected mesh │ │ │ │ │ + 173 // representations. When declaring the topology as "manifold", │ │ │ │ │ + 174 // the Factory assumes the following: │ │ │ │ │ + 175 // │ │ │ │ │ + 176 // - all incident faces are "ordered" (counter-clockwise) │ │ │ │ │ + 177 // - all incident faces are consistently oriented │ │ │ │ │ + 178 // - all incident edges are non-degenerate │ │ │ │ │ + 179 // │ │ │ │ │ + 180 // If not certain that all of these conditions are met, it is best │ │ │ │ │ + 181 // to not declare manifold -- leaving the Factory to make sense of │ │ │ │ │ + 182 // the set of incident faces from the face-vertex indices that are │ │ │ │ │ + 183 // provided elsewhere. │ │ │ │ │ + 184 // │ │ │ │ │ + 185 │ │ │ │ │ + 187 │ │ │ │ │ + 191 │ │ │ │ │ + 193 void SetManifold(bool isManifold); │ │ │ │ │ + 194 │ │ │ │ │ + 196 void SetBoundary(bool isOnBoundary); │ │ │ │ │ + 197 │ │ │ │ │ + 199 void SetIncidentFaceSize(int faceIndex, int faceSize); │ │ │ │ │ + 200 │ │ │ │ │ + 202 void ClearIncidentFaceSizes(); │ │ │ │ │ + 203 │ │ │ │ │ + 205 void SetVertexSharpness(float sharpness); │ │ │ │ │ + 206 │ │ │ │ │ + 208 void ClearVertexSharpness(); │ │ │ │ │ + 209 │ │ │ │ │ + 221 void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness); │ │ │ │ │ + 222 │ │ │ │ │ + 238 void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, │ │ │ │ │ + 239 float trailingEdgeSharp); │ │ │ │ │ + 240 │ │ │ │ │ + 242 void ClearEdgeSharpness(); │ │ │ │ │ + 244 │ │ │ │ │ + 246 │ │ │ │ │ + 251 │ │ │ │ │ + 253 bool IsManifold() const; │ │ │ │ │ + 254 │ │ │ │ │ + 256 bool IsBoundary() const; │ │ │ │ │ + 257 │ │ │ │ │ + 259 bool HasIncidentFaceSizes() const; │ │ │ │ │ + 260 │ │ │ │ │ + 262 int GetIncidentFaceSize(int faceIndex) const; │ │ │ │ │ + 263 │ │ │ │ │ + 265 bool HasVertexSharpness() const; │ │ │ │ │ + 266 │ │ │ │ │ + 268 float GetVertexSharpness() const; │ │ │ │ │ + 269 │ │ │ │ │ + 271 bool HasEdgeSharpness() const; │ │ │ │ │ + 272 │ │ │ │ │ + 274 float GetManifoldEdgeSharpness(int edgeIndex) const; │ │ │ │ │ + 275 │ │ │ │ │ + 277 void GetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ + 278 float * leadingEdgeSharp, float * trailingEdgeSharp) const; │ │ │ │ │ + 280 │ │ │ │ │ + 281protected: │ │ │ │ │ + 283 friend class FaceVertex; │ │ │ │ │ + 284 │ │ │ │ │ + 285 VertexDescriptor() { } │ │ │ │ │ + 286 ~VertexDescriptor() { } │ │ │ │ │ + 287 │ │ │ │ │ + 288 typedef Vtr::internal::StackBuffer IntBuffer; │ │ │ │ │ + 289 typedef Vtr::internal::StackBuffer FloatBuffer; │ │ │ │ │ + 290 │ │ │ │ │ + 291 void initFaceSizes(); │ │ │ │ │ + 292 void initEdgeSharpness(); │ │ │ │ │ + 294 │ │ │ │ │ + 295protected: │ │ │ │ │ + 297 // Member variables assigned through the above interface: │ │ │ │ │ + 298 unsigned short _isValid : 1; │ │ │ │ │ + 299 unsigned short _isInitialized : 1; │ │ │ │ │ + 300 unsigned short _isFinalized : 1; │ │ │ │ │ + 301 │ │ │ │ │ + 302 unsigned short _isManifold : 1; │ │ │ │ │ + 303 unsigned short _isBoundary : 1; │ │ │ │ │ + 304 │ │ │ │ │ + 305 unsigned short _hasFaceSizes : 1; │ │ │ │ │ + 306 unsigned short _hasEdgeSharpness : 1; │ │ │ │ │ + 307 │ │ │ │ │ + 308 short _numFaces; │ │ │ │ │ + 309 float _vertSharpness; │ │ │ │ │ + 310 │ │ │ │ │ + 311 FloatBuffer _faceEdgeSharpness; │ │ │ │ │ + 312 IntBuffer _faceSizeOffsets; │ │ │ │ │ + 314}; │ │ │ │ │ + 315 │ │ │ │ │ + 316// │ │ │ │ │ + 317// Public inline methods for simple assignment: │ │ │ │ │ + 318// │ │ │ │ │ + 319inline bool │ │ │ │ │ +320VertexDescriptor::IsValid() const { │ │ │ │ │ + 321 return _isValid; │ │ │ │ │ + 322} │ │ │ │ │ + 323 │ │ │ │ │ + 324inline void │ │ │ │ │ +325VertexDescriptor::SetManifold(bool isManifold) { │ │ │ │ │ + 326 _isManifold = isManifold; │ │ │ │ │ + 327} │ │ │ │ │ + 328inline bool │ │ │ │ │ +329VertexDescriptor::IsManifold() const { │ │ │ │ │ + 330 return _isManifold; │ │ │ │ │ + 331} │ │ │ │ │ + 332 │ │ │ │ │ + 333inline void │ │ │ │ │ +334VertexDescriptor::SetBoundary(bool isBoundary) { │ │ │ │ │ + 335 _isBoundary = isBoundary; │ │ │ │ │ + 336} │ │ │ │ │ + 337inline bool │ │ │ │ │ +338VertexDescriptor::IsBoundary() const { │ │ │ │ │ + 339 return _isBoundary; │ │ │ │ │ + 340} │ │ │ │ │ + 341 │ │ │ │ │ + 342// │ │ │ │ │ + 343// Public inline methods involving sizes of incident faces: │ │ │ │ │ + 344// │ │ │ │ │ + 345inline bool │ │ │ │ │ +346VertexDescriptor::HasIncidentFaceSizes() const { │ │ │ │ │ + 347 return _hasFaceSizes; │ │ │ │ │ + 348} │ │ │ │ │ + 349inline void │ │ │ │ │ +350VertexDescriptor::ClearIncidentFaceSizes() { │ │ │ │ │ + 351 _hasFaceSizes = false; │ │ │ │ │ + 352} │ │ │ │ │ + 353 │ │ │ │ │ + 354inline void │ │ │ │ │ +355VertexDescriptor::SetIncidentFaceSize(int incFaceIndex, int faceSize) { │ │ │ │ │ + 356 │ │ │ │ │ + 357 if (!_hasFaceSizes) initFaceSizes(); │ │ │ │ │ + 358 │ │ │ │ │ + 359 _faceSizeOffsets[incFaceIndex] = faceSize; │ │ │ │ │ + 360} │ │ │ │ │ + 361inline int │ │ │ │ │ +362VertexDescriptor::GetIncidentFaceSize(int incFaceIndex) const { │ │ │ │ │ + 363 │ │ │ │ │ + 364 return _isFinalized ? │ │ │ │ │ + 365 (_faceSizeOffsets[incFaceIndex+1] - _faceSizeOffsets[incFaceIndex]) : │ │ │ │ │ + 366 _faceSizeOffsets[incFaceIndex]; │ │ │ │ │ + 367} │ │ │ │ │ + 368 │ │ │ │ │ + 369// │ │ │ │ │ + 370// Public inline methods involving vertex sharpness: │ │ │ │ │ + 371// │ │ │ │ │ + 372inline bool │ │ │ │ │ +373VertexDescriptor::HasVertexSharpness() const { │ │ │ │ │ + 374 return _vertSharpness > 0.0f; │ │ │ │ │ + 375} │ │ │ │ │ + 376inline void │ │ │ │ │ +377VertexDescriptor::ClearVertexSharpness() { │ │ │ │ │ + 378 _vertSharpness = 0.0f; │ │ │ │ │ + 379} │ │ │ │ │ + 380 │ │ │ │ │ + 381inline void │ │ │ │ │ +382VertexDescriptor::SetVertexSharpness(float vertSharpness) { │ │ │ │ │ + 383 _vertSharpness = vertSharpness; │ │ │ │ │ + 384} │ │ │ │ │ + 385inline float │ │ │ │ │ +386VertexDescriptor::GetVertexSharpness() const { │ │ │ │ │ + 387 return _vertSharpness; │ │ │ │ │ + 388} │ │ │ │ │ + 389 │ │ │ │ │ + 390// │ │ │ │ │ + 391// Public inline methods involving vertex sharpness: │ │ │ │ │ + 392// │ │ │ │ │ + 393inline bool │ │ │ │ │ +394VertexDescriptor::HasEdgeSharpness() const { │ │ │ │ │ + 395 return _hasEdgeSharpness; │ │ │ │ │ + 396} │ │ │ │ │ + 397inline void │ │ │ │ │ +398VertexDescriptor::ClearEdgeSharpness() { │ │ │ │ │ + 399 _hasEdgeSharpness = false; │ │ │ │ │ + 400} │ │ │ │ │ + 401 │ │ │ │ │ + 402inline void │ │ │ │ │ +403VertexDescriptor::SetManifoldEdgeSharpness(int edgeIndex, float sharpness) { │ │ │ │ │ + 404 │ │ │ │ │ + 405 if (!_hasEdgeSharpness) initEdgeSharpness(); │ │ │ │ │ + 406 │ │ │ │ │ + 407 // Assign the leading edge of the face after the edge (even index): │ │ │ │ │ + 408 if (edgeIndex < _numFaces) { │ │ │ │ │ + 409 _faceEdgeSharpness[2*edgeIndex] = sharpness; │ │ │ │ │ + 410 } │ │ │ │ │ + 411 │ │ │ │ │ + 412 // Assign the trailing edge of the face before the edge (odd index): │ │ │ │ │ + 413 if (edgeIndex > 0) { │ │ │ │ │ + 414 _faceEdgeSharpness[2*edgeIndex-1] = sharpness; │ │ │ │ │ + 415 } else if (!IsBoundary()) { │ │ │ │ │ + 416 _faceEdgeSharpness[2*_numFaces-1] = sharpness; │ │ │ │ │ + 417 } │ │ │ │ │ + 418} │ │ │ │ │ + 419inline float │ │ │ │ │ +420VertexDescriptor::GetManifoldEdgeSharpness(int edgeIndex) const { │ │ │ │ │ + 421 │ │ │ │ │ + 422 // All edges are first of the pair (even index) except last of boundary │ │ │ │ │ + 423 return _faceEdgeSharpness[2*edgeIndex - (edgeIndex == _numFaces)]; │ │ │ │ │ + 424} │ │ │ │ │ + 425 │ │ │ │ │ + 426inline void │ │ │ │ │ +427VertexDescriptor::SetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ + 428 float leadingEdgeSharpness, float trailingEdgeSharpness) { │ │ │ │ │ + 429 │ │ │ │ │ + 430 if (!_hasEdgeSharpness) initEdgeSharpness(); │ │ │ │ │ + 431 │ │ │ │ │ + 432 _faceEdgeSharpness[2*faceIndex ] = leadingEdgeSharpness; │ │ │ │ │ + 433 _faceEdgeSharpness[2*faceIndex+1] = trailingEdgeSharpness; │ │ │ │ │ + 434} │ │ │ │ │ + 435inline void │ │ │ │ │ +436VertexDescriptor::GetIncidentFaceEdgeSharpness(int faceIndex, │ │ │ │ │ + 437 float * leadingEdgeSharpness, float * trailingEdgeSharpness) const { │ │ │ │ │ + 438 │ │ │ │ │ + 439 *leadingEdgeSharpness = _faceEdgeSharpness[2*faceIndex]; │ │ │ │ │ + 440 *trailingEdgeSharpness = _faceEdgeSharpness[2*faceIndex+1]; │ │ │ │ │ + 441} │ │ │ │ │ + 442 │ │ │ │ │ + 443} // end namespace Bfr │ │ │ │ │ + 444 │ │ │ │ │ + 445} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 446using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 447} // end namespace OpenSubdiv │ │ │ │ │ + 448 │ │ │ │ │ + 449#endif /* OPENSUBDIV3_BFR_VERTEX_DESCRIPTOR_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactory │ │ │ │ │ -Base class providing initialization of a Surface for each face of a mesh. │ │ │ │ │ -Definition: surfaceFactory.h:103 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache │ │ │ │ │ -Container used internally by SurfaceFactory to store reusable information. │ │ │ │ │ -Definition: surfaceFactoryCache.h:59 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::SurfaceFactoryCache │ │ │ │ │ -SurfaceFactoryCache() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::~SurfaceFactoryCache │ │ │ │ │ -virtual ~SurfaceFactoryCache() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::SurfaceFactoryCache │ │ │ │ │ -SurfaceFactoryCache(SurfaceFactoryCache const &)=delete │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::operator= │ │ │ │ │ -SurfaceFactoryCache & operator=(SurfaceFactoryCache const &)=delete │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded │ │ │ │ │ -Template for declaring thread-safe subclasses of SurfaceFactoryCache. │ │ │ │ │ -Definition: surfaceFactoryCache.h:118 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded:: │ │ │ │ │ -SurfaceFactoryCacheThreaded │ │ │ │ │ -SurfaceFactoryCacheThreaded() │ │ │ │ │ -Definition: surfaceFactoryCache.h:120 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded:: │ │ │ │ │ -~SurfaceFactoryCacheThreaded │ │ │ │ │ -~SurfaceFactoryCacheThreaded() override=default │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor │ │ │ │ │ +Simple class used by subclasses of SurfaceFactory to describe a vertex. │ │ │ │ │ +Definition: vertexDescriptor.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetVertexSharpness │ │ │ │ │ +float GetVertexSharpness() const │ │ │ │ │ +Return the sharpness of the vertex. │ │ │ │ │ +Definition: vertexDescriptor.h:386 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::Finalize │ │ │ │ │ +bool Finalize() │ │ │ │ │ +Terminate the sequence of specifications. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetManifold │ │ │ │ │ +void SetManifold(bool isManifold) │ │ │ │ │ +Declare the vertex neighborhood as manifold (ordered) │ │ │ │ │ +Definition: vertexDescriptor.h:325 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::Initialize │ │ │ │ │ +bool Initialize(int numIncidentFaces) │ │ │ │ │ +Initialize specification with the number of incident faces. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsManifold │ │ │ │ │ +bool IsManifold() const │ │ │ │ │ +Return if vertex neighborhood is manifold. │ │ │ │ │ +Definition: vertexDescriptor.h:329 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasEdgeSharpness │ │ │ │ │ +bool HasEdgeSharpness() const │ │ │ │ │ +Return if sharpness was assigned to the incident edges. │ │ │ │ │ +Definition: vertexDescriptor.h:394 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetIncidentFaceSize │ │ │ │ │ +int GetIncidentFaceSize(int faceIndex) const │ │ │ │ │ +Return the size of an incident face. │ │ │ │ │ +Definition: vertexDescriptor.h:362 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::GetManifoldEdgeSharpness │ │ │ │ │ +float GetManifoldEdgeSharpness(int edgeIndex) const │ │ │ │ │ +Return the sharpness assigned to a manifold edge. │ │ │ │ │ +Definition: vertexDescriptor.h:420 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor:: │ │ │ │ │ +SetIncidentFaceEdgeSharpness │ │ │ │ │ +void SetIncidentFaceEdgeSharpness(int faceIndex, float leadingEdgeSharp, float │ │ │ │ │ +trailingEdgeSharp) │ │ │ │ │ +Assign sharpness to the edges of an incident face. │ │ │ │ │ +Definition: vertexDescriptor.h:427 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasVertexSharpness │ │ │ │ │ +bool HasVertexSharpness() const │ │ │ │ │ +Return if sharpness was assigned to the vertex. │ │ │ │ │ +Definition: vertexDescriptor.h:373 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearIncidentFaceSizes │ │ │ │ │ +void ClearIncidentFaceSizes() │ │ │ │ │ +Remove any assigned sizes of incident faces. │ │ │ │ │ +Definition: vertexDescriptor.h:350 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetVertexSharpness │ │ │ │ │ +void SetVertexSharpness(float sharpness) │ │ │ │ │ +Assign sharpness to the vertex. │ │ │ │ │ +Definition: vertexDescriptor.h:382 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearVertexSharpness │ │ │ │ │ +void ClearVertexSharpness() │ │ │ │ │ +Remove any sharpness assigned to the vertex. │ │ │ │ │ +Definition: vertexDescriptor.h:377 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::ClearEdgeSharpness │ │ │ │ │ +void ClearEdgeSharpness() │ │ │ │ │ +Remove any sharpness assigned to the incident edges. │ │ │ │ │ +Definition: vertexDescriptor.h:398 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor:: │ │ │ │ │ +GetIncidentFaceEdgeSharpness │ │ │ │ │ +void GetIncidentFaceEdgeSharpness(int faceIndex, float *leadingEdgeSharp, float │ │ │ │ │ +*trailingEdgeSharp) const │ │ │ │ │ +Return the sharpness assigned to edges of an incident face. │ │ │ │ │ +Definition: vertexDescriptor.h:436 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsBoundary │ │ │ │ │ +bool IsBoundary() const │ │ │ │ │ +Return if vertex neighborhood is on a boundary. │ │ │ │ │ +Definition: vertexDescriptor.h:338 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::IsValid │ │ │ │ │ +bool IsValid() const │ │ │ │ │ +Return if instance is valid. │ │ │ │ │ +Definition: vertexDescriptor.h:320 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::HasIncidentFaceSizes │ │ │ │ │ +bool HasIncidentFaceSizes() const │ │ │ │ │ +Return if the sizes of incident faces are assigned. │ │ │ │ │ +Definition: vertexDescriptor.h:346 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetBoundary │ │ │ │ │ +void SetBoundary(bool isOnBoundary) │ │ │ │ │ +Declare the vertex neighborhood as being on a boundary. │ │ │ │ │ +Definition: vertexDescriptor.h:334 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetIncidentFaceSize │ │ │ │ │ +void SetIncidentFaceSize(int faceIndex, int faceSize) │ │ │ │ │ +Assign the size of an incident face. │ │ │ │ │ +Definition: vertexDescriptor.h:355 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::VertexDescriptor::SetManifoldEdgeSharpness │ │ │ │ │ +void SetManifoldEdgeSharpness(int edgeIndex, float edgeSharpness) │ │ │ │ │ +Assign sharpness to the edge of a manifold neighborhood. │ │ │ │ │ +Definition: vertexDescriptor.h:403 │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * surfaceFactoryCache.h │ │ │ │ │ + * vertexDescriptor.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00680.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/tessellation.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/bfr/surfaceFactoryCache.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,29 +83,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
tessellation.h File Reference
│ │ │ │ +
surfaceFactoryCache.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../bfr/parameterization.h"
│ │ │ │ +#include "../bfr/irregularPatchType.h"
│ │ │ │ +#include <map>
│ │ │ │ +#include <cstdint>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Tessellation
 Encapsulates a specific tessellation pattern of a Parameterization. More...
class  SurfaceFactoryCache
 Container used internally by SurfaceFactory to store reusable information. More...
 
class  Tessellation::Options
 Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate. More...
class  SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE >
 Template for declaring thread-safe subclasses of SurfaceFactoryCache. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -114,13 +116,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,34 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -tessellation.h File Reference │ │ │ │ │ +surfaceFactoryCache.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../bfr/parameterization.h" │ │ │ │ │ +#include "../bfr/irregularPatchType.h" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Tessellation │ │ │ │ │ -  Encapsulates a specific tessellation pattern of a Parameterization. │ │ │ │ │ - More... │ │ │ │ │ +class  SurfaceFactoryCache │ │ │ │ │ +  Container used internally by SurfaceFactory to store reusable │ │ │ │ │ + information. More... │ │ │ │ │   │ │ │ │ │ -class  Tessellation::Options │ │ │ │ │ - Options configure a Tessellation to specify the nature of both its │ │ │ │ │ -  results and the structure of the coordinate and facet index arrays that │ │ │ │ │ - its methods will populate. More... │ │ │ │ │ +class  SurfaceFactoryCacheThreaded<_MUTEX_TYPE,_READ_LOCK_GUARD_TYPE, │ │ │ │ │ + WRITE_LOCK_GUARD_TYPE_> │ │ │ │ │ +  Template for declaring thread-safe subclasses of SurfaceFactoryCache. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Bfr │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * tessellation.h │ │ │ │ │ + * surfaceFactoryCache.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00680.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ │ var a00680 = [ │ │ │ │ │ - ["Tessellation", "a00961.html", "a00961"], │ │ │ │ │ - ["Tessellation::Options", "a00965.html", "a00965"] │ │ │ │ │ + ["SurfaceFactoryCache", "a00949.html", "a00949"], │ │ │ │ │ + ["SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE >", "a00953.html", "a00953"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00680_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/bfr/tessellation.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/bfr/surfaceFactoryCache.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
tessellation.h
│ │ │ │ +
surfaceFactoryCache.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2021 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,263 +107,122 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_BFR_TESSELLATION_H
│ │ │ │ -
26#define OPENSUBDIV3_BFR_TESSELLATION_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H
│ │ │ │ +
26#define OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../bfr/parameterization.h"
│ │ │ │ +
30#include "../bfr/irregularPatchType.h"
│ │ │ │
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
32#include <map>
│ │ │ │ +
33#include <cstdint>
│ │ │ │
34
│ │ │ │ -
35namespace Bfr {
│ │ │ │ -
36
│ │ │ │ - │ │ │ │ -
52public:
│ │ │ │ -
65 class Options {
│ │ │ │ -
66 public:
│ │ │ │ -
67 Options() : _preserveQuads(false), _facetSize4(false),
│ │ │ │ -
68 _coordStride(0), _facetStride(0) { }
│ │ │ │ -
69
│ │ │ │ -
72 Options & PreserveQuads(bool on);
│ │ │ │ -
74 bool PreserveQuads() const { return _preserveQuads; }
│ │ │ │ +
35namespace OpenSubdiv {
│ │ │ │ +
36namespace OPENSUBDIV_VERSION {
│ │ │ │ +
37
│ │ │ │ +
38namespace Bfr {
│ │ │ │ +
39
│ │ │ │ +
52//
│ │ │ │ +
53// Initial/expected use requires simple searches of and additions to the
│ │ │ │ +
54// cache by the SurfaceFactory or its Builders. Longer term, with the
│ │ │ │ +
55// possibility of instances of caches being shared between meshes and
│ │ │ │ +
56// factories, additional options and/or public methods may be warranted
│ │ │ │ +
57// to limit what is cached or to prune the cache if it gets too large.
│ │ │ │ +
58//
│ │ │ │ + │ │ │ │ +
60public:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
63
│ │ │ │ + │ │ │ │ + │ │ │ │ +
66
│ │ │ │ +
67protected:
│ │ │ │ +
69 // Access restricted to the Factory, its Builders, etc.
│ │ │ │ +
70 friend class SurfaceFactory;
│ │ │ │ +
71
│ │ │ │ +
72 typedef std::uint64_t KeyType;
│ │ │ │ +
73 typedef internal::IrregularPatchSharedPtr DataType;
│ │ │ │
75
│ │ │ │ -
78 Options & SetFacetSize(int numIndices);
│ │ │ │ -
79 // @brief Return the number of indices per facet
│ │ │ │ -
80 int GetFacetSize() const { return 3 + (int)_facetSize4; }
│ │ │ │ -
81
│ │ │ │ -
83 Options & SetFacetStride(int stride);
│ │ │ │ -
85 int GetFacetStride() const { return _facetStride; }
│ │ │ │ -
86
│ │ │ │ -
88 Options & SetCoordStride(int stride);
│ │ │ │ -
90 int GetCoordStride() const { return _coordStride; }
│ │ │ │ -
91
│ │ │ │ -
92 private:
│ │ │ │ -
93 unsigned int _preserveQuads : 1;
│ │ │ │ -
94 unsigned int _facetSize4 : 1;
│ │ │ │ +
76protected:
│ │ │ │ +
78 size_t Size() const { return _map.size(); }
│ │ │ │ +
79
│ │ │ │ +
80 //
│ │ │ │ +
81 // Potential overrides by subclasses for thread-safety:
│ │ │ │ +
82 //
│ │ │ │ +
83 virtual DataType Find(KeyType const & key) const;
│ │ │ │ +
84 virtual DataType Add(KeyType const & key, DataType const & data);
│ │ │ │ +
85
│ │ │ │ +
86 //
│ │ │ │ +
87 // Common implementation used by all subclasses:
│ │ │ │ +
88 //
│ │ │ │ +
89 DataType find(KeyType const & key) const;
│ │ │ │ +
90 DataType add(KeyType const & key, DataType const & data);
│ │ │ │ +
92
│ │ │ │ +
93private:
│ │ │ │ +
94 typedef std::map<KeyType, DataType> MapType;
│ │ │ │
95
│ │ │ │ -
96 short _coordStride;
│ │ │ │ -
97 short _facetStride;
│ │ │ │ -
98 };
│ │ │ │ -
99
│ │ │ │ -
100public:
│ │ │ │ -
102
│ │ │ │ -
111
│ │ │ │ -
118 Tessellation(Parameterization const & p, int uniformRate,
│ │ │ │ -
119 Options const & options = Options());
│ │ │ │ -
120
│ │ │ │ -
158 Tessellation(Parameterization const & p, int numRates, int const rates[],
│ │ │ │ -
159 Options const & options = Options());
│ │ │ │ -
160
│ │ │ │ -
162 bool IsValid() const { return _isValid; }
│ │ │ │ -
163
│ │ │ │ -
165 Tessellation() = delete;
│ │ │ │ -
166
│ │ │ │ -
167 Tessellation(Tessellation const &) = delete;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
171
│ │ │ │ -
173
│ │ │ │ -
177
│ │ │ │ -
179 Parameterization GetParameterization() const { return _param; }
│ │ │ │ -
180
│ │ │ │ -
182 int GetFaceSize() const { return _param.GetFaceSize(); }
│ │ │ │ -
183
│ │ │ │ -
185 int GetRates(int rates[]) const;
│ │ │ │ -
186
│ │ │ │ -
188 bool IsUniform() const { return _isUniform; }
│ │ │ │ -
190
│ │ │ │ -
192
│ │ │ │ -
203
│ │ │ │ -
205 int GetNumCoords() const { return _numInteriorPoints + _numBoundaryPoints; }
│ │ │ │ -
206
│ │ │ │ -
208 int GetCoordStride() const { return _coordStride; }
│ │ │ │ -
209
│ │ │ │ -
211 int GetNumBoundaryCoords() const { return _numBoundaryPoints; }
│ │ │ │ -
212
│ │ │ │ -
214 int GetNumInteriorCoords() const { return _numInteriorPoints; }
│ │ │ │ -
215
│ │ │ │ -
218 int GetNumEdgeCoords(int edge) const { return _outerRates[edge] - 1; }
│ │ │ │ -
219
│ │ │ │ -
221 template <typename REAL>
│ │ │ │ -
222 int GetCoords(REAL coordTuples[]) const;
│ │ │ │ -
223
│ │ │ │ -
225 template <typename REAL>
│ │ │ │ -
226 int GetBoundaryCoords(REAL coordTuples[]) const;
│ │ │ │ -
227
│ │ │ │ -
229 template <typename REAL>
│ │ │ │ -
230 int GetInteriorCoords(REAL coordTuples[]) const;
│ │ │ │ -
231
│ │ │ │ -
233 template <typename REAL>
│ │ │ │ -
234 int GetVertexCoord(int vertex, REAL coordTuples[]) const;
│ │ │ │ -
235
│ │ │ │ -
238 template <typename REAL>
│ │ │ │ -
239 int GetEdgeCoords(int edge, REAL coordTuples[]) const;
│ │ │ │ -
241
│ │ │ │ -
243
│ │ │ │ -
253
│ │ │ │ -
255 int GetNumFacets() const { return _numFacets; }
│ │ │ │ -
256
│ │ │ │ -
258 int GetFacetSize() const { return _facetSize; }
│ │ │ │ -
259
│ │ │ │ -
261 int GetFacetStride() const { return _facetStride; }
│ │ │ │ -
262
│ │ │ │ -
264 int GetFacets(int facetTuples[]) const;
│ │ │ │ -
266
│ │ │ │ -
268
│ │ │ │ -
283
│ │ │ │ -
285 void TransformFacetCoordIndices(int facetTuples[], int commonOffset);
│ │ │ │ -
286
│ │ │ │ -
289 void TransformFacetCoordIndices(int facetTuples[],
│ │ │ │ -
290 int const boundaryIndices[],
│ │ │ │ -
291 int interiorOffset);
│ │ │ │ -
292
│ │ │ │ -
294 void TransformFacetCoordIndices(int facetTuples[],
│ │ │ │ -
295 int const boundaryIndices[],
│ │ │ │ -
296 int const interiorIndices[]);
│ │ │ │ -
298
│ │ │ │ -
299private:
│ │ │ │ -
300 // Private initialization methods:
│ │ │ │ -
301 bool validateArguments(Parameterization const & p,
│ │ │ │ -
302 int nRates, int const rates[], Options const & options);
│ │ │ │ -
303
│ │ │ │ -
304 void initialize(Parameterization const & p,
│ │ │ │ -
305 int nRates, int const rates[], Options const & options);
│ │ │ │ -
306
│ │ │ │ -
307 void initializeDefaults();
│ │ │ │ -
308 int initializeRates(int nRates, int const rates[]);
│ │ │ │ -
309 void initializeInventoryForParamTri(int sumOfOuterRates);
│ │ │ │ -
310 void initializeInventoryForParamQuad(int sumOfOuterRates);
│ │ │ │ -
311 void initializeInventoryForParamQPoly(int sumOfOuterRates);
│ │ │ │ -
312
│ │ │ │ -
313private:
│ │ │ │ -
314 // Private members:
│ │ │ │ -
315 Parameterization _param;
│ │ │ │ -
316
│ │ │ │ -
317 unsigned short _isValid : 1;
│ │ │ │ -
318 unsigned short _isUniform : 1;
│ │ │ │ -
319 unsigned short _triangulate : 1;
│ │ │ │ -
320 unsigned short _singleFace : 1;
│ │ │ │ -
321 unsigned short _segmentedFace : 1;
│ │ │ │ -
322 unsigned short _triangleFan : 1;
│ │ │ │ -
323 unsigned short _splitQuad : 1;
│ │ │ │ -
324
│ │ │ │ -
325 short _facetSize;
│ │ │ │ -
326 int _facetStride;
│ │ │ │ -
327 int _coordStride;
│ │ │ │ -
328
│ │ │ │ -
329 int _numGivenRates;
│ │ │ │ -
330 int _numBoundaryPoints;
│ │ │ │ -
331 int _numInteriorPoints;
│ │ │ │ -
332 int _numFacets;
│ │ │ │ -
333
│ │ │ │ -
334 int _innerRates[2];
│ │ │ │ -
335 int* _outerRates;
│ │ │ │ -
336 int _outerRatesLocal[4];
│ │ │ │ -
337};
│ │ │ │ -
338
│ │ │ │ -
339//
│ │ │ │ -
340// Inline implementations:
│ │ │ │ -
341//
│ │ │ │ - │ │ │ │ - │ │ │ │ -
344 _preserveQuads = on;
│ │ │ │ -
345 return *this;
│ │ │ │ -
346}
│ │ │ │ - │ │ │ │ - │ │ │ │ -
349 _facetSize4 = (numIndices == 4);
│ │ │ │ -
350 return *this;
│ │ │ │ -
351}
│ │ │ │ - │ │ │ │ - │ │ │ │ -
354 _facetStride = (short) stride;
│ │ │ │ -
355 return *this;
│ │ │ │ -
356}
│ │ │ │ - │ │ │ │ - │ │ │ │ -
359 _coordStride = (short) stride;
│ │ │ │ -
360 return *this;
│ │ │ │ -
361}
│ │ │ │ -
362
│ │ │ │ -
363template <typename REAL>
│ │ │ │ -
364inline int
│ │ │ │ -
365Tessellation::GetVertexCoord(int vertex, REAL coord[]) const {
│ │ │ │ -
366 _param.GetVertexCoord(vertex, coord);
│ │ │ │ -
367 return 1;
│ │ │ │ -
368}
│ │ │ │ -
369
│ │ │ │ -
370template <typename REAL>
│ │ │ │ -
371inline int
│ │ │ │ -
372Tessellation::GetCoords(REAL coordTuples[]) const {
│ │ │ │ -
373 int nCoords = GetBoundaryCoords(coordTuples);
│ │ │ │ -
374 nCoords += GetInteriorCoords(coordTuples + nCoords * _coordStride);
│ │ │ │ -
375 return nCoords;
│ │ │ │ -
376}
│ │ │ │ -
377
│ │ │ │ -
378} // end namespace Bfr
│ │ │ │ -
379
│ │ │ │ -
380} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
381using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
382
│ │ │ │ -
383} // end namespace OpenSubdiv
│ │ │ │ -
384
│ │ │ │ -
385#endif /* OPENSUBDIV3_BFR_TESSELLATION */
│ │ │ │ +
96 MapType _map;
│ │ │ │ +
97};
│ │ │ │ +
98
│ │ │ │ +
113// Separate read and write locks are provided to support mutex types
│ │ │ │ +
114// allowing shared (read) or exclusive (write) access.
│ │ │ │ +
115//
│ │ │ │ +
116template <class MUTEX_TYPE, class READ_LOCK_GUARD_TYPE,
│ │ │ │ +
117 class WRITE_LOCK_GUARD_TYPE>
│ │ │ │ + │ │ │ │ +
119public:
│ │ │ │ + │ │ │ │ +
121 ~SurfaceFactoryCacheThreaded() override = default;
│ │ │ │ +
122
│ │ │ │ +
123protected:
│ │ │ │ +
125 //
│ │ │ │ +
126 // Virtual overrides from base:
│ │ │ │ +
127 //
│ │ │ │ +
128 DataType Find(KeyType const & key) const override {
│ │ │ │ +
129 READ_LOCK_GUARD_TYPE lockGuard(_mutex);
│ │ │ │ +
130 return find(key);
│ │ │ │ +
131 }
│ │ │ │ +
132
│ │ │ │ +
133 DataType Add(KeyType const & key, DataType const & data) override {
│ │ │ │ +
134 WRITE_LOCK_GUARD_TYPE lockGuard(_mutex);
│ │ │ │ +
135 return add(key, data);
│ │ │ │ +
136 }
│ │ │ │ +
138
│ │ │ │ +
139private:
│ │ │ │ +
140 MUTEX_TYPE mutable _mutex;
│ │ │ │ +
141};
│ │ │ │ +
142
│ │ │ │ +
143} // end namespace Bfr
│ │ │ │ +
144
│ │ │ │ +
145} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
146using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
147
│ │ │ │ +
148} // end namespace OpenSubdiv
│ │ │ │ +
149
│ │ │ │ +
150#endif /* OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H */
│ │ │ │ │ │ │ │ -
Simple class defining the 2D parameterization of a face.
│ │ │ │ -
int GetFaceSize() const
Returns the size (number of vertices) of the corresponding face.
│ │ │ │ -
void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const
Returns the (u,v) coordinate of a given vertex.
│ │ │ │ -
Encapsulates a specific tessellation pattern of a Parameterization.
Definition: tessellation.h:51
│ │ │ │ -
int GetFaceSize() const
Return the size of the face.
Definition: tessellation.h:182
│ │ │ │ -
int GetNumBoundaryCoords() const
Return the number of boundary coordinates.
Definition: tessellation.h:211
│ │ │ │ - │ │ │ │ -
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int const interiorIndices[])
Reassign all facet coordinate indices.
│ │ │ │ -
int GetCoordStride() const
Return the number of elements between each coordinate.
Definition: tessellation.h:208
│ │ │ │ -
int GetNumEdgeCoords(int edge) const
Return the number of coordinates within a given edge (excluding those at its end vertices)
Definition: tessellation.h:218
│ │ │ │ -
int GetInteriorCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
│ │ │ │ -
int GetFacetStride() const
Return the number of elements between each facet.
Definition: tessellation.h:261
│ │ │ │ -
bool IsUniform() const
Return if the pattern is uniform.
Definition: tessellation.h:188
│ │ │ │ -
int GetNumCoords() const
Return the number of coordinates in the entire pattern.
Definition: tessellation.h:205
│ │ │ │ -
int GetCoords(REAL coordTuples[]) const
Retrieve the coordinates for the entire pattern.
Definition: tessellation.h:372
│ │ │ │ -
void TransformFacetCoordIndices(int facetTuples[], int commonOffset)
Apply a common offset to all facet coordinate indices.
│ │ │ │ -
Tessellation(Parameterization const &p, int numRates, int const rates[], Options const &options=Options())
General constructor providing multiple tessellation rates for a non-uniform tessellation.
│ │ │ │ -
Parameterization GetParameterization() const
Return the Parameterization.
Definition: tessellation.h:179
│ │ │ │ -
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int interiorOffset)
Reassign indices of boundary coordinates while offseting those of interior coordinates.
│ │ │ │ -
int GetFacetSize() const
Return the number of indices assigned to each facet.
Definition: tessellation.h:258
│ │ │ │ -
Tessellation()=delete
Default construction is unavailable.
│ │ │ │ -
Tessellation(Parameterization const &p, int uniformRate, Options const &options=Options())
Simple constructor providing a single uniform tessellation rate.
│ │ │ │ -
int GetFacets(int facetTuples[]) const
Retrieve the facet indices for the entire pattern.
│ │ │ │ -
int GetNumFacets() const
Return the number of facets in the entire pattern.
Definition: tessellation.h:255
│ │ │ │ -
int GetNumInteriorCoords() const
Return the number of interior coordinates.
Definition: tessellation.h:214
│ │ │ │ -
int GetVertexCoord(int vertex, REAL coordTuples[]) const
Retrieve the coordinate for a given vertex of the face.
Definition: tessellation.h:365
│ │ │ │ -
int GetBoundaryCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
│ │ │ │ - │ │ │ │ -
int GetRates(int rates[]) const
Retrieve the rates assigned.
│ │ │ │ -
bool IsValid() const
Return true if correctly initialized.
Definition: tessellation.h:162
│ │ │ │ -
Tessellation & operator=(Tessellation const &)=delete
│ │ │ │ -
int GetEdgeCoords(int edge, REAL coordTuples[]) const
Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)
│ │ │ │ -
Options configure a Tessellation to specify the nature of both its results and the structure of the c...
Definition: tessellation.h:65
│ │ │ │ - │ │ │ │ -
int GetCoordStride() const
Return the stride between (u,v) pairs.
Definition: tessellation.h:90
│ │ │ │ -
Options & SetFacetSize(int numIndices)
Assign the number of indices per facet (must be 3 or 4, default is 3)
Definition: tessellation.h:348
│ │ │ │ -
int GetFacetStride() const
Return the stride between facets.
Definition: tessellation.h:85
│ │ │ │ - │ │ │ │ -
Options & SetCoordStride(int stride)
Assign the stride between (u,v) pairs (default is 2)
Definition: tessellation.h:358
│ │ │ │ -
Options & SetFacetStride(int stride)
Assign the stride between facets (default is facet size)
Definition: tessellation.h:353
│ │ │ │ -
bool PreserveQuads() const
Return if preservation of quads is set.
Definition: tessellation.h:74
│ │ │ │ +
Base class providing initialization of a Surface for each face of a mesh.
│ │ │ │ +
Container used internally by SurfaceFactory to store reusable information.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
SurfaceFactoryCache(SurfaceFactoryCache const &)=delete
│ │ │ │ +
SurfaceFactoryCache & operator=(SurfaceFactoryCache const &)=delete
│ │ │ │ +
Template for declaring thread-safe subclasses of SurfaceFactoryCache.
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -tessellation.h │ │ │ │ │ +surfaceFactoryCache.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2021 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,367 +30,131 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_BFR_TESSELLATION_H │ │ │ │ │ - 26#define OPENSUBDIV3_BFR_TESSELLATION_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H │ │ │ │ │ + 26#define OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../bfr/parameterization.h" │ │ │ │ │ + 30#include "../bfr/irregularPatchType.h" │ │ │ │ │ 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 32#include │ │ │ │ │ + 33#include │ │ │ │ │ 34 │ │ │ │ │ - 35namespace Bfr { │ │ │ │ │ - 36 │ │ │ │ │ -51class Tessellation { │ │ │ │ │ - 52public: │ │ │ │ │ -65 class Options { │ │ │ │ │ - 66 public: │ │ │ │ │ -67 Options() : _preserveQuads(false), _facetSize4(false), │ │ │ │ │ - 68 _coordStride(0), _facetStride(0) { } │ │ │ │ │ - 69 │ │ │ │ │ - 72 Options & PreserveQuads(bool on); │ │ │ │ │ -74 bool PreserveQuads() const { return _preserveQuads; } │ │ │ │ │ + 35namespace OpenSubdiv { │ │ │ │ │ + 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace Bfr { │ │ │ │ │ + 39 │ │ │ │ │ + 52// │ │ │ │ │ + 53// Initial/expected use requires simple searches of and additions to the │ │ │ │ │ + 54// cache by the SurfaceFactory or its Builders. Longer term, with the │ │ │ │ │ + 55// possibility of instances of caches being shared between meshes and │ │ │ │ │ + 56// factories, additional options and/or public methods may be warranted │ │ │ │ │ + 57// to limit what is cached or to prune the cache if it gets too large. │ │ │ │ │ + 58// │ │ │ │ │ +59class SurfaceFactoryCache { │ │ │ │ │ + 60public: │ │ │ │ │ +61 SurfaceFactoryCache(); │ │ │ │ │ +62 virtual ~SurfaceFactoryCache(); │ │ │ │ │ + 63 │ │ │ │ │ +64 SurfaceFactoryCache(SurfaceFactoryCache const &) = delete; │ │ │ │ │ +65 SurfaceFactoryCache & operator=(SurfaceFactoryCache const &) = delete; │ │ │ │ │ + 66 │ │ │ │ │ + 67protected: │ │ │ │ │ + 69 // Access restricted to the Factory, its Builders, etc. │ │ │ │ │ + 70 friend class SurfaceFactory; │ │ │ │ │ + 71 │ │ │ │ │ + 72 typedef std::uint64_t KeyType; │ │ │ │ │ + 73 typedef internal::IrregularPatchSharedPtr DataType; │ │ │ │ │ 75 │ │ │ │ │ - 78 Options & SetFacetSize(int numIndices); │ │ │ │ │ - 79 // @brief Return the number of indices per facet │ │ │ │ │ -80 int GetFacetSize() const { return 3 + (int)_facetSize4; } │ │ │ │ │ - 81 │ │ │ │ │ - 83 Options & SetFacetStride(int stride); │ │ │ │ │ -85 int GetFacetStride() const { return _facetStride; } │ │ │ │ │ - 86 │ │ │ │ │ - 88 Options & SetCoordStride(int stride); │ │ │ │ │ -90 int GetCoordStride() const { return _coordStride; } │ │ │ │ │ - 91 │ │ │ │ │ - 92 private: │ │ │ │ │ - 93 unsigned int _preserveQuads : 1; │ │ │ │ │ - 94 unsigned int _facetSize4 : 1; │ │ │ │ │ + 76protected: │ │ │ │ │ + 78 size_t Size() const { return _map.size(); } │ │ │ │ │ + 79 │ │ │ │ │ + 80 // │ │ │ │ │ + 81 // Potential overrides by subclasses for thread-safety: │ │ │ │ │ + 82 // │ │ │ │ │ + 83 virtual DataType Find(KeyType const & key) const; │ │ │ │ │ + 84 virtual DataType Add(KeyType const & key, DataType const & data); │ │ │ │ │ + 85 │ │ │ │ │ + 86 // │ │ │ │ │ + 87 // Common implementation used by all subclasses: │ │ │ │ │ + 88 // │ │ │ │ │ + 89 DataType find(KeyType const & key) const; │ │ │ │ │ + 90 DataType add(KeyType const & key, DataType const & data); │ │ │ │ │ + 92 │ │ │ │ │ + 93private: │ │ │ │ │ + 94 typedef std::map MapType; │ │ │ │ │ 95 │ │ │ │ │ - 96 short _coordStride; │ │ │ │ │ - 97 short _facetStride; │ │ │ │ │ - 98 }; │ │ │ │ │ - 99 │ │ │ │ │ - 100public: │ │ │ │ │ - 102 │ │ │ │ │ - 111 │ │ │ │ │ -118 Tessellation(Parameterization const & p, int uniformRate, │ │ │ │ │ - 119 Options const & options = Options()); │ │ │ │ │ - 120 │ │ │ │ │ -158 Tessellation(Parameterization const & p, int numRates, int const rates[], │ │ │ │ │ - 159 Options const & options = Options()); │ │ │ │ │ - 160 │ │ │ │ │ -162 bool IsValid() const { return _isValid; } │ │ │ │ │ - 163 │ │ │ │ │ -165 Tessellation() = delete; │ │ │ │ │ - 166 │ │ │ │ │ -167 Tessellation(Tessellation const &) = delete; │ │ │ │ │ -168 Tessellation & operator=(Tessellation const &) = delete; │ │ │ │ │ -169 ~Tessellation(); │ │ │ │ │ - 171 │ │ │ │ │ - 173 │ │ │ │ │ - 177 │ │ │ │ │ -179 Parameterization GetParameterization() const { return _param; } │ │ │ │ │ - 180 │ │ │ │ │ -182 int GetFaceSize() const { return _param.GetFaceSize(); } │ │ │ │ │ - 183 │ │ │ │ │ -185 int GetRates(int rates[]) const; │ │ │ │ │ - 186 │ │ │ │ │ -188 bool IsUniform() const { return _isUniform; } │ │ │ │ │ - 190 │ │ │ │ │ - 192 │ │ │ │ │ - 203 │ │ │ │ │ -205 int GetNumCoords() const { return _numInteriorPoints + _numBoundaryPoints; │ │ │ │ │ -} │ │ │ │ │ - 206 │ │ │ │ │ -208 int GetCoordStride() const { return _coordStride; } │ │ │ │ │ - 209 │ │ │ │ │ -211 int GetNumBoundaryCoords() const { return _numBoundaryPoints; } │ │ │ │ │ - 212 │ │ │ │ │ -214 int GetNumInteriorCoords() const { return _numInteriorPoints; } │ │ │ │ │ - 215 │ │ │ │ │ -218 int GetNumEdgeCoords(int edge) const { return _outerRates[edge] - 1; } │ │ │ │ │ - 219 │ │ │ │ │ - 221 template │ │ │ │ │ - 222 int GetCoords(REAL coordTuples[]) const; │ │ │ │ │ - 223 │ │ │ │ │ - 225 template │ │ │ │ │ -226 int GetBoundaryCoords(REAL coordTuples[]) const; │ │ │ │ │ - 227 │ │ │ │ │ - 229 template │ │ │ │ │ -230 int GetInteriorCoords(REAL coordTuples[]) const; │ │ │ │ │ - 231 │ │ │ │ │ - 233 template │ │ │ │ │ - 234 int GetVertexCoord(int vertex, REAL coordTuples[]) const; │ │ │ │ │ - 235 │ │ │ │ │ - 238 template │ │ │ │ │ -239 int GetEdgeCoords(int edge, REAL coordTuples[]) const; │ │ │ │ │ - 241 │ │ │ │ │ - 243 │ │ │ │ │ - 253 │ │ │ │ │ -255 int GetNumFacets() const { return _numFacets; } │ │ │ │ │ - 256 │ │ │ │ │ -258 int GetFacetSize() const { return _facetSize; } │ │ │ │ │ - 259 │ │ │ │ │ -261 int GetFacetStride() const { return _facetStride; } │ │ │ │ │ - 262 │ │ │ │ │ -264 int GetFacets(int facetTuples[]) const; │ │ │ │ │ - 266 │ │ │ │ │ - 268 │ │ │ │ │ - 283 │ │ │ │ │ -285 void TransformFacetCoordIndices(int facetTuples[], int commonOffset); │ │ │ │ │ - 286 │ │ │ │ │ -289 void TransformFacetCoordIndices(int facetTuples[], │ │ │ │ │ - 290 int const boundaryIndices[], │ │ │ │ │ - 291 int interiorOffset); │ │ │ │ │ - 292 │ │ │ │ │ -294 void TransformFacetCoordIndices(int facetTuples[], │ │ │ │ │ - 295 int const boundaryIndices[], │ │ │ │ │ - 296 int const interiorIndices[]); │ │ │ │ │ - 298 │ │ │ │ │ - 299private: │ │ │ │ │ - 300 // Private initialization methods: │ │ │ │ │ - 301 bool validateArguments(Parameterization const & p, │ │ │ │ │ - 302 int nRates, int const rates[], Options const & options); │ │ │ │ │ - 303 │ │ │ │ │ - 304 void initialize(Parameterization const & p, │ │ │ │ │ - 305 int nRates, int const rates[], Options const & options); │ │ │ │ │ - 306 │ │ │ │ │ - 307 void initializeDefaults(); │ │ │ │ │ - 308 int initializeRates(int nRates, int const rates[]); │ │ │ │ │ - 309 void initializeInventoryForParamTri(int sumOfOuterRates); │ │ │ │ │ - 310 void initializeInventoryForParamQuad(int sumOfOuterRates); │ │ │ │ │ - 311 void initializeInventoryForParamQPoly(int sumOfOuterRates); │ │ │ │ │ - 312 │ │ │ │ │ - 313private: │ │ │ │ │ - 314 // Private members: │ │ │ │ │ - 315 Parameterization _param; │ │ │ │ │ - 316 │ │ │ │ │ - 317 unsigned short _isValid : 1; │ │ │ │ │ - 318 unsigned short _isUniform : 1; │ │ │ │ │ - 319 unsigned short _triangulate : 1; │ │ │ │ │ - 320 unsigned short _singleFace : 1; │ │ │ │ │ - 321 unsigned short _segmentedFace : 1; │ │ │ │ │ - 322 unsigned short _triangleFan : 1; │ │ │ │ │ - 323 unsigned short _splitQuad : 1; │ │ │ │ │ - 324 │ │ │ │ │ - 325 short _facetSize; │ │ │ │ │ - 326 int _facetStride; │ │ │ │ │ - 327 int _coordStride; │ │ │ │ │ - 328 │ │ │ │ │ - 329 int _numGivenRates; │ │ │ │ │ - 330 int _numBoundaryPoints; │ │ │ │ │ - 331 int _numInteriorPoints; │ │ │ │ │ - 332 int _numFacets; │ │ │ │ │ - 333 │ │ │ │ │ - 334 int _innerRates[2]; │ │ │ │ │ - 335 int* _outerRates; │ │ │ │ │ - 336 int _outerRatesLocal[4]; │ │ │ │ │ - 337}; │ │ │ │ │ - 338 │ │ │ │ │ - 339// │ │ │ │ │ - 340// Inline implementations: │ │ │ │ │ - 341// │ │ │ │ │ - 342inline Tessellation::Options & │ │ │ │ │ -343Tessellation::Options::PreserveQuads(bool on) { │ │ │ │ │ - 344 _preserveQuads = on; │ │ │ │ │ - 345 return *this; │ │ │ │ │ - 346} │ │ │ │ │ - 347inline Tessellation::Options & │ │ │ │ │ -348Tessellation::Options::SetFacetSize(int numIndices) { │ │ │ │ │ - 349 _facetSize4 = (numIndices == 4); │ │ │ │ │ - 350 return *this; │ │ │ │ │ - 351} │ │ │ │ │ - 352inline Tessellation::Options & │ │ │ │ │ -353Tessellation::Options::SetFacetStride(int stride) { │ │ │ │ │ - 354 _facetStride = (short) stride; │ │ │ │ │ - 355 return *this; │ │ │ │ │ - 356} │ │ │ │ │ - 357inline Tessellation::Options & │ │ │ │ │ -358Tessellation::Options::SetCoordStride(int stride) { │ │ │ │ │ - 359 _coordStride = (short) stride; │ │ │ │ │ - 360 return *this; │ │ │ │ │ - 361} │ │ │ │ │ - 362 │ │ │ │ │ - 363template │ │ │ │ │ - 364inline int │ │ │ │ │ -365Tessellation::GetVertexCoord(int vertex, REAL coord[]) const { │ │ │ │ │ - 366 _param.GetVertexCoord(vertex, coord); │ │ │ │ │ - 367 return 1; │ │ │ │ │ - 368} │ │ │ │ │ - 369 │ │ │ │ │ - 370template │ │ │ │ │ - 371inline int │ │ │ │ │ -372Tessellation::GetCoords(REAL coordTuples[]) const { │ │ │ │ │ - 373 int nCoords = GetBoundaryCoords(coordTuples); │ │ │ │ │ - 374 nCoords += GetInteriorCoords(coordTuples + nCoords * _coordStride); │ │ │ │ │ - 375 return nCoords; │ │ │ │ │ - 376} │ │ │ │ │ - 377 │ │ │ │ │ - 378} // end namespace Bfr │ │ │ │ │ - 379 │ │ │ │ │ - 380} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 381using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 382 │ │ │ │ │ - 383} // end namespace OpenSubdiv │ │ │ │ │ - 384 │ │ │ │ │ - 385#endif /* OPENSUBDIV3_BFR_TESSELLATION */ │ │ │ │ │ + 96 MapType _map; │ │ │ │ │ + 97}; │ │ │ │ │ + 98 │ │ │ │ │ + 113// Separate read and write locks are provided to support mutex types │ │ │ │ │ + 114// allowing shared (read) or exclusive (write) access. │ │ │ │ │ + 115// │ │ │ │ │ + 116template │ │ │ │ │ +118class SurfaceFactoryCacheThreaded : public SurfaceFactoryCache { │ │ │ │ │ + 119public: │ │ │ │ │ +120 SurfaceFactoryCacheThreaded() : SurfaceFactoryCache() { } │ │ │ │ │ +121 ~SurfaceFactoryCacheThreaded() override = default; │ │ │ │ │ + 122 │ │ │ │ │ + 123protected: │ │ │ │ │ + 125 // │ │ │ │ │ + 126 // Virtual overrides from base: │ │ │ │ │ + 127 // │ │ │ │ │ + 128 DataType Find(KeyType const & key) const override { │ │ │ │ │ + 129 READ_LOCK_GUARD_TYPE lockGuard(_mutex); │ │ │ │ │ + 130 return find(key); │ │ │ │ │ + 131 } │ │ │ │ │ + 132 │ │ │ │ │ + 133 DataType Add(KeyType const & key, DataType const & data) override { │ │ │ │ │ + 134 WRITE_LOCK_GUARD_TYPE lockGuard(_mutex); │ │ │ │ │ + 135 return add(key, data); │ │ │ │ │ + 136 } │ │ │ │ │ + 138 │ │ │ │ │ + 139private: │ │ │ │ │ + 140 MUTEX_TYPE mutable _mutex; │ │ │ │ │ + 141}; │ │ │ │ │ + 142 │ │ │ │ │ + 143} // end namespace Bfr │ │ │ │ │ + 144 │ │ │ │ │ + 145} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 146using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 147 │ │ │ │ │ + 148} // end namespace OpenSubdiv │ │ │ │ │ + 149 │ │ │ │ │ + 150#endif /* OPENSUBDIV3_BFR_SURFACE_FACTORY_CACHE_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization │ │ │ │ │ -Simple class defining the 2D parameterization of a face. │ │ │ │ │ -Definition: parameterization.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization::GetFaceSize │ │ │ │ │ -int GetFaceSize() const │ │ │ │ │ -Returns the size (number of vertices) of the corresponding face. │ │ │ │ │ -Definition: parameterization.h:101 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Parameterization::GetVertexCoord │ │ │ │ │ -void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const │ │ │ │ │ -Returns the (u,v) coordinate of a given vertex. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation │ │ │ │ │ -Encapsulates a specific tessellation pattern of a Parameterization. │ │ │ │ │ -Definition: tessellation.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFaceSize │ │ │ │ │ -int GetFaceSize() const │ │ │ │ │ -Return the size of the face. │ │ │ │ │ -Definition: tessellation.h:182 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumBoundaryCoords │ │ │ │ │ -int GetNumBoundaryCoords() const │ │ │ │ │ -Return the number of boundary coordinates. │ │ │ │ │ -Definition: tessellation.h:211 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::~Tessellation │ │ │ │ │ -~Tessellation() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ -void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], │ │ │ │ │ -int const interiorIndices[]) │ │ │ │ │ -Reassign all facet coordinate indices. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetCoordStride │ │ │ │ │ -int GetCoordStride() const │ │ │ │ │ -Return the number of elements between each coordinate. │ │ │ │ │ -Definition: tessellation.h:208 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumEdgeCoords │ │ │ │ │ -int GetNumEdgeCoords(int edge) const │ │ │ │ │ -Return the number of coordinates within a given edge (excluding those at its │ │ │ │ │ -end vertices) │ │ │ │ │ -Definition: tessellation.h:218 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetInteriorCoords │ │ │ │ │ -int GetInteriorCoords(REAL coordTuples[]) const │ │ │ │ │ -Retrieve the coordinates for the boundary. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacetStride │ │ │ │ │ -int GetFacetStride() const │ │ │ │ │ -Return the number of elements between each facet. │ │ │ │ │ -Definition: tessellation.h:261 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::IsUniform │ │ │ │ │ -bool IsUniform() const │ │ │ │ │ -Return if the pattern is uniform. │ │ │ │ │ -Definition: tessellation.h:188 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumCoords │ │ │ │ │ -int GetNumCoords() const │ │ │ │ │ -Return the number of coordinates in the entire pattern. │ │ │ │ │ -Definition: tessellation.h:205 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetCoords │ │ │ │ │ -int GetCoords(REAL coordTuples[]) const │ │ │ │ │ -Retrieve the coordinates for the entire pattern. │ │ │ │ │ -Definition: tessellation.h:372 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ -void TransformFacetCoordIndices(int facetTuples[], int commonOffset) │ │ │ │ │ -Apply a common offset to all facet coordinate indices. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ -Tessellation(Parameterization const &p, int numRates, int const rates[], │ │ │ │ │ -Options const &options=Options()) │ │ │ │ │ -General constructor providing multiple tessellation rates for a non-uniform │ │ │ │ │ -tessellation. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetParameterization │ │ │ │ │ -Parameterization GetParameterization() const │ │ │ │ │ -Return the Parameterization. │ │ │ │ │ -Definition: tessellation.h:179 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::TransformFacetCoordIndices │ │ │ │ │ -void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], │ │ │ │ │ -int interiorOffset) │ │ │ │ │ -Reassign indices of boundary coordinates while offseting those of interior │ │ │ │ │ -coordinates. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacetSize │ │ │ │ │ -int GetFacetSize() const │ │ │ │ │ -Return the number of indices assigned to each facet. │ │ │ │ │ -Definition: tessellation.h:258 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ -Tessellation()=delete │ │ │ │ │ -Default construction is unavailable. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ -Tessellation(Parameterization const &p, int uniformRate, Options const │ │ │ │ │ -&options=Options()) │ │ │ │ │ -Simple constructor providing a single uniform tessellation rate. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetFacets │ │ │ │ │ -int GetFacets(int facetTuples[]) const │ │ │ │ │ -Retrieve the facet indices for the entire pattern. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumFacets │ │ │ │ │ -int GetNumFacets() const │ │ │ │ │ -Return the number of facets in the entire pattern. │ │ │ │ │ -Definition: tessellation.h:255 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetNumInteriorCoords │ │ │ │ │ -int GetNumInteriorCoords() const │ │ │ │ │ -Return the number of interior coordinates. │ │ │ │ │ -Definition: tessellation.h:214 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetVertexCoord │ │ │ │ │ -int GetVertexCoord(int vertex, REAL coordTuples[]) const │ │ │ │ │ -Retrieve the coordinate for a given vertex of the face. │ │ │ │ │ -Definition: tessellation.h:365 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetBoundaryCoords │ │ │ │ │ -int GetBoundaryCoords(REAL coordTuples[]) const │ │ │ │ │ -Retrieve the coordinates for the boundary. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Tessellation │ │ │ │ │ -Tessellation(Tessellation const &)=delete │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetRates │ │ │ │ │ -int GetRates(int rates[]) const │ │ │ │ │ -Retrieve the rates assigned. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::IsValid │ │ │ │ │ -bool IsValid() const │ │ │ │ │ -Return true if correctly initialized. │ │ │ │ │ -Definition: tessellation.h:162 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::operator= │ │ │ │ │ -Tessellation & operator=(Tessellation const &)=delete │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::GetEdgeCoords │ │ │ │ │ -int GetEdgeCoords(int edge, REAL coordTuples[]) const │ │ │ │ │ -Retrieve the coordinates for a given edge of the face (excluding those at its │ │ │ │ │ -end vertices) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options │ │ │ │ │ -Options configure a Tessellation to specify the nature of both its results and │ │ │ │ │ -the structure of the c... │ │ │ │ │ -Definition: tessellation.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::Options │ │ │ │ │ -Options() │ │ │ │ │ -Definition: tessellation.h:67 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetCoordStride │ │ │ │ │ -int GetCoordStride() const │ │ │ │ │ -Return the stride between (u,v) pairs. │ │ │ │ │ -Definition: tessellation.h:90 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetFacetSize │ │ │ │ │ -Options & SetFacetSize(int numIndices) │ │ │ │ │ -Assign the number of indices per facet (must be 3 or 4, default is 3) │ │ │ │ │ -Definition: tessellation.h:348 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetFacetStride │ │ │ │ │ -int GetFacetStride() const │ │ │ │ │ -Return the stride between facets. │ │ │ │ │ -Definition: tessellation.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::GetFacetSize │ │ │ │ │ -int GetFacetSize() const │ │ │ │ │ -Definition: tessellation.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetCoordStride │ │ │ │ │ -Options & SetCoordStride(int stride) │ │ │ │ │ -Assign the stride between (u,v) pairs (default is 2) │ │ │ │ │ -Definition: tessellation.h:358 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::SetFacetStride │ │ │ │ │ -Options & SetFacetStride(int stride) │ │ │ │ │ -Assign the stride between facets (default is facet size) │ │ │ │ │ -Definition: tessellation.h:353 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Tessellation::Options::PreserveQuads │ │ │ │ │ -bool PreserveQuads() const │ │ │ │ │ -Return if preservation of quads is set. │ │ │ │ │ -Definition: tessellation.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactory │ │ │ │ │ +Base class providing initialization of a Surface for each face of a mesh. │ │ │ │ │ +Definition: surfaceFactory.h:103 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache │ │ │ │ │ +Container used internally by SurfaceFactory to store reusable information. │ │ │ │ │ +Definition: surfaceFactoryCache.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::SurfaceFactoryCache │ │ │ │ │ +SurfaceFactoryCache() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::~SurfaceFactoryCache │ │ │ │ │ +virtual ~SurfaceFactoryCache() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::SurfaceFactoryCache │ │ │ │ │ +SurfaceFactoryCache(SurfaceFactoryCache const &)=delete │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCache::operator= │ │ │ │ │ +SurfaceFactoryCache & operator=(SurfaceFactoryCache const &)=delete │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded │ │ │ │ │ +Template for declaring thread-safe subclasses of SurfaceFactoryCache. │ │ │ │ │ +Definition: surfaceFactoryCache.h:118 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded:: │ │ │ │ │ +SurfaceFactoryCacheThreaded │ │ │ │ │ +SurfaceFactoryCacheThreaded() │ │ │ │ │ +Definition: surfaceFactoryCache.h:120 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Bfr::SurfaceFactoryCacheThreaded:: │ │ │ │ │ +~SurfaceFactoryCacheThreaded │ │ │ │ │ +~SurfaceFactoryCacheThreaded() override=default │ │ │ │ │ * opensubdiv │ │ │ │ │ * bfr │ │ │ │ │ - * tessellation.h │ │ │ │ │ + * surfaceFactoryCache.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00683_source.html │ │ │ │ @@ -231,15 +231,15 @@ │ │ │ │
virtual int populateFaceVertexDescriptor(Index faceIndex, int faceVertex, VertexDescriptor *vertexDescriptor) const =0
Describe the topology of incident faces around a face-vertex.
│ │ │ │
virtual bool getFaceNeighborhoodVertexIndicesIfRegular(Index faceIndex, Index vertexIndices[]) const
│ │ │ │
virtual bool getFaceNeighborhoodFVarValueIndicesIfRegular(Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const
│ │ │ │
virtual int getFaceFVarValueIndices(Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const =0
Gather the face-varying indices of the face's vertices.
│ │ │ │
virtual int getFaceVertexIndices(Index faceIndex, Index vertexIndices[]) const =0
Gather the indices of the face's vertices.
│ │ │ │
virtual bool isFaceHole(Index faceIndex) const =0
Returns if a face is a hole.
│ │ │ │
std::intptr_t FVarID
Type used to identify and specify face-varying primvars.
│ │ │ │ -
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ +
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
surfaceFactory.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../bfr/surface.h"
│ │ │ │ #include "../bfr/surfaceFactoryMeshAdapter.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ #include <cstdint>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00686_source.html │ │ │ │ @@ -462,19 +462,19 @@ │ │ │ │ │ │ │ │
bool IsCachingEnabled() const
Return if caching is enable.
│ │ │ │
Options & SetDefaultFVarID(FVarID id)
Assign the default face-varying ID (none assigned by default)
│ │ │ │
Options & SetApproxLevelSharp(int level)
Assign maximum refinement level for sharp features.
│ │ │ │
FVarID GetDefaultFVarID() const
Return the default face-varying ID.
│ │ │ │
int GetApproxLevelSharp() const
Return maximum refinement level for sharp features.
│ │ │ │
SurfaceFactoryCache * GetExternalCache() const
Return any assigned external cache.
│ │ │ │ -
Container used internally by SurfaceFactory to store reusable information.
│ │ │ │ +
Container used internally by SurfaceFactory to store reusable information.
│ │ │ │
Abstract interface adapting SurfaceFactory to a connected mesh representation.
│ │ │ │ │ │ │ │
std::intptr_t FVarID
Type used to identify and specify face-varying primvars.
│ │ │ │ -
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ +
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
refinerSurfaceFactory.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../bfr/surfaceFactory.h"
│ │ │ │ -#include "../bfr/surfaceFactoryCache.h"
│ │ │ │ +#include "../bfr/surfaceFactoryCache.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00692_source.html │ │ │ │ @@ -242,16 +242,16 @@ │ │ │ │
virtual int populateFaceVertexDescriptor(Index faceIndex, int faceVertex, VertexDescriptor *vertexDescriptor) const =0
Describe the topology of incident faces around a face-vertex.
│ │ │ │
virtual bool getFaceNeighborhoodVertexIndicesIfRegular(Index faceIndex, Index vertexIndices[]) const
│ │ │ │
virtual bool getFaceNeighborhoodFVarValueIndicesIfRegular(Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const
│ │ │ │
virtual int getFaceFVarValueIndices(Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const =0
Gather the face-varying indices of the face's vertices.
│ │ │ │
virtual int getFaceVertexIndices(Index faceIndex, Index vertexIndices[]) const =0
Gather the indices of the face's vertices.
│ │ │ │
virtual bool isFaceHole(Index faceIndex) const =0
Returns if a face is a hole.
│ │ │ │
std::intptr_t FVarID
Type used to identify and specify face-varying primvars.
│ │ │ │ -
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ +
Simple class used by subclasses of SurfaceFactory to describe a vertex.
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
topologyRefiner.h File Reference
│ │ │ │ +
topologyRefinerFactory.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../sdc/types.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ -#include "../far/types.h"
│ │ │ │ -#include "../far/topologyLevel.h"
│ │ │ │ -#include <vector>
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/error.h"
│ │ │ │ +#include <cassert>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

class  RefinerSurfaceFactoryBase
 Intermediate subclass of SurfaceFactory with Far::TopologyRefiner as the mesh. More...
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  TopologyRefiner
 Stores topology data for a specified set of refinement options. More...
class  TopologyRefinerFactoryBase
 Private base class of Factories for constructing TopologyRefiners. More...
 
struct  TopologyRefiner::UniformOptions
 Uniform refinement options. More...
class  TopologyRefinerFactory< MESH >
 Factory for constructing TopologyRefiners from specific mesh classes. More...
 
struct  TopologyRefiner::AdaptiveOptions
 Adaptive refinement options. More...
struct  TopologyRefinerFactory< MESH >::Options
 Options related to the construction of each TopologyRefiner. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,39 +5,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -topologyRefiner.h File Reference │ │ │ │ │ +topologyRefinerFactory.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../sdc/types.h" │ │ │ │ │ -#include "../sdc/options.h" │ │ │ │ │ -#include "../far/types.h" │ │ │ │ │ -#include "../far/topologyLevel.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../far/topologyRefiner.h" │ │ │ │ │ +#include "../far/error.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  TopologyRefiner │ │ │ │ │ -  Stores topology data for a specified set of refinement options. │ │ │ │ │ + class  TopologyRefinerFactoryBase │ │ │ │ │ +  Private base class of Factories for constructing TopologyRefiners. │ │ │ │ │ More... │ │ │ │ │   │ │ │ │ │ -struct  TopologyRefiner::UniformOptions │ │ │ │ │ -  Uniform refinement options. More... │ │ │ │ │ + class  TopologyRefinerFactory<_MESH_> │ │ │ │ │ +  Factory for constructing TopologyRefiners from specific mesh classes. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ -struct  TopologyRefiner::AdaptiveOptions │ │ │ │ │ -  Adaptive refinement options. More... │ │ │ │ │ +struct  TopologyRefinerFactory<_MESH_>::Options │ │ │ │ │ +  Options related to the construction of each TopologyRefiner. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * topologyRefiner.h │ │ │ │ │ + * topologyRefinerFactory.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00704.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,5 +1,5 @@ │ │ │ │ │ var a00704 = [ │ │ │ │ │ - ["TopologyRefiner", "a01113.html", "a01113"], │ │ │ │ │ - ["TopologyRefiner::UniformOptions", "a01117.html", "a01117"], │ │ │ │ │ - ["TopologyRefiner::AdaptiveOptions", "a01121.html", "a01121"] │ │ │ │ │ + ["TopologyRefinerFactoryBase", "a01125.html", "a01125"], │ │ │ │ │ + ["TopologyRefinerFactory< MESH >", "a01109.html", "a01109"], │ │ │ │ │ + ["TopologyRefinerFactory< MESH >::Options", "a01129.html", "a01129"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00704_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/topologyRefiner.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/far/topologyRefinerFactory.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
topologyRefiner.h
│ │ │ │ +
topologyRefinerFactory.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -106,291 +106,616 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
│ │ │ │ -
25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
│ │ │ │ +
24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
│ │ │ │ +
25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
│ │ │ │
26
│ │ │ │
27#include "../version.h"
│ │ │ │
28
│ │ │ │ -
29#include "../sdc/types.h"
│ │ │ │ -
30#include "../sdc/options.h"
│ │ │ │ -
31#include "../far/types.h"
│ │ │ │ -
32#include "../far/topologyLevel.h"
│ │ │ │ +
29#include "../far/topologyRefiner.h"
│ │ │ │ +
30#include "../far/error.h"
│ │ │ │ +
31
│ │ │ │ +
32#include <cassert>
│ │ │ │
33
│ │ │ │ -
34#include <vector>
│ │ │ │ -
35
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │ -
37namespace OpenSubdiv {
│ │ │ │ -
38namespace OPENSUBDIV_VERSION {
│ │ │ │ -
39
│ │ │ │ -
40namespace Vtr { namespace internal { class SparseSelector; } }
│ │ │ │ -
41namespace Far { namespace internal { class FeatureMask; } }
│ │ │ │ -
42
│ │ │ │ -
43namespace Far {
│ │ │ │ -
44
│ │ │ │ -
45template <typename REAL> class PrimvarRefinerReal;
│ │ │ │ -
46template <class MESH> class TopologyRefinerFactory;
│ │ │ │ -
47
│ │ │ │ - │ │ │ │ -
52
│ │ │ │ -
53public:
│ │ │ │ -
54
│ │ │ │ - │ │ │ │ -
57
│ │ │ │ - │ │ │ │ -
60
│ │ │ │ -
62 Sdc::SchemeType GetSchemeType() const { return _subdivType; }
│ │ │ │ +
37namespace Far {
│ │ │ │ +
38
│ │ │ │ +
46//
│ │ │ │ + │ │ │ │ +
48protected:
│ │ │ │ +
49
│ │ │ │ +
50 //
│ │ │ │ +
51 // Protected methods invoked by the subclass template to verify and process each
│ │ │ │ +
52 // stage of construction implemented by the subclass:
│ │ │ │ +
53 //
│ │ │ │ +
54 typedef Vtr::internal::Level::ValidationCallback TopologyCallback;
│ │ │ │ +
55
│ │ │ │ + │ │ │ │ +
57 static bool prepareComponentTopologyAssignment(TopologyRefiner& refiner, bool fullValidation,
│ │ │ │ +
58 TopologyCallback callback, void const * callbackData);
│ │ │ │ + │ │ │ │ + │ │ │ │ +
61};
│ │ │ │ +
62
│ │ │ │
63
│ │ │ │ -
65 Sdc::Options GetSchemeOptions() const { return _subdivOptions; }
│ │ │ │ -
66
│ │ │ │ -
68 bool IsUniform() const { return _isUniform; }
│ │ │ │ -
69
│ │ │ │ -
71 int GetNumLevels() const { return (int)_farLevels.size(); }
│ │ │ │ -
72
│ │ │ │ -
74 int GetMaxLevel() const { return _maxLevel; }
│ │ │ │ -
75
│ │ │ │ -
77 int GetMaxValence() const { return _maxValence; }
│ │ │ │ -
78
│ │ │ │ -
80 bool HasHoles() const { return _hasHoles; }
│ │ │ │ +
77template <class MESH>
│ │ │ │ + │ │ │ │ +
79
│ │ │ │ +
80public:
│ │ │ │
81
│ │ │ │ -
83 int GetNumVerticesTotal() const { return _totalVertices; }
│ │ │ │ -
84
│ │ │ │ -
86 int GetNumEdgesTotal() const { return _totalEdges; }
│ │ │ │ -
87
│ │ │ │ -
89 int GetNumFacesTotal() const { return _totalFaces; }
│ │ │ │ +
84 struct Options {
│ │ │ │ +
85
│ │ │ │ + │ │ │ │ +
87 schemeType(sdcType),
│ │ │ │ +
88 schemeOptions(sdcOptions),
│ │ │ │ +
89 validateFullTopology(false) { }
│ │ │ │
90
│ │ │ │ -
92 int GetNumFaceVerticesTotal() const { return _totalFaceVertices; }
│ │ │ │ -
93
│ │ │ │ -
95 TopologyLevel const & GetLevel(int level) const { return _farLevels[level]; }
│ │ │ │ -
96
│ │ │ │ + │ │ │ │ + │ │ │ │ +
94 unsigned int validateFullTopology : 1;
│ │ │ │ +
97 };
│ │ │ │
98
│ │ │ │ -
100
│ │ │ │ -
101 //
│ │ │ │ -
102 // Uniform refinement
│ │ │ │ -
103 //
│ │ │ │ -
104
│ │ │ │ - │ │ │ │ -
119
│ │ │ │ -
120 UniformOptions(int level) :
│ │ │ │ -
121 refinementLevel(level & 0xf),
│ │ │ │ - │ │ │ │ -
123 fullTopologyInLastLevel(false) { }
│ │ │ │ -
124
│ │ │ │ -
126 void SetRefinementLevel(int level) { refinementLevel = level & 0xf; }
│ │ │ │ -
127
│ │ │ │ -
128 unsigned int refinementLevel:4,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
134 };
│ │ │ │ -
135
│ │ │ │ - │ │ │ │ -
147
│ │ │ │ -
149 UniformOptions GetUniformOptions() const { return _uniformOptions; }
│ │ │ │ -
150
│ │ │ │ -
151 //
│ │ │ │ -
152 // Adaptive refinement
│ │ │ │ -
153 //
│ │ │ │ -
154
│ │ │ │ - │ │ │ │ -
157
│ │ │ │ -
158 AdaptiveOptions(int level) :
│ │ │ │ -
159 isolationLevel(level & 0xf),
│ │ │ │ -
160 secondaryLevel(0xf),
│ │ │ │ - │ │ │ │ -
162 useInfSharpPatch(false),
│ │ │ │ - │ │ │ │ - │ │ │ │ +
108 //
│ │ │ │ +
113 static TopologyRefiner* Create(MESH const& mesh, Options options = Options());
│ │ │ │ +
114
│ │ │ │ +
128 static TopologyRefiner* Create(TopologyRefiner const & baseLevel);
│ │ │ │ +
129
│ │ │ │ +
130protected:
│ │ │ │ +
131 typedef Vtr::internal::Level::TopologyError TopologyError;
│ │ │ │ +
132
│ │ │ │ +
134
│ │ │ │ +
149
│ │ │ │ +
151 static bool resizeComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ +
152
│ │ │ │ +
155 static bool assignComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ +
156
│ │ │ │ +
158 static bool assignComponentTags(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ +
159
│ │ │ │ +
161 static bool assignFaceVaryingTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ +
162
│ │ │ │ +
164 static void reportInvalidTopology(TopologyError errCode, char const * msg, MESH const& mesh);
│ │ │ │
165
│ │ │ │ -
167 void SetIsolationLevel(int level) { isolationLevel = level & 0xf; }
│ │ │ │ -
168
│ │ │ │ -
170 void SetSecondaryLevel(int level) { secondaryLevel = level & 0xf; }
│ │ │ │ -
171
│ │ │ │ -
172 unsigned int isolationLevel:4;
│ │ │ │ -
174 unsigned int secondaryLevel:4;
│ │ │ │ -
176 unsigned int useSingleCreasePatch:1;
│ │ │ │ -
178 unsigned int useInfSharpPatch:1;
│ │ │ │ -
180 unsigned int considerFVarChannels:1;
│ │ │ │ - │ │ │ │ -
184 };
│ │ │ │ -
185
│ │ │ │ - │ │ │ │ -
193 ConstIndexArray selectedFaces = ConstIndexArray());
│ │ │ │ -
194
│ │ │ │ -
196 AdaptiveOptions GetAdaptiveOptions() const { return _adaptiveOptions; }
│ │ │ │ -
197
│ │ │ │ -
199 void Unrefine();
│ │ │ │ -
200
│ │ │ │ -
201
│ │ │ │ -
203
│ │ │ │ +
167
│ │ │ │ +
168protected:
│ │ │ │ +
170
│ │ │ │ +
187
│ │ │ │ +
189 static void setNumBaseVertices(TopologyRefiner & newRefiner, int count);
│ │ │ │ +
190
│ │ │ │ +
192 static void setNumBaseFaces(TopologyRefiner & newRefiner, int count);
│ │ │ │ +
193
│ │ │ │ +
195 static void setNumBaseEdges(TopologyRefiner & newRefiner, int count);
│ │ │ │ +
196
│ │ │ │ +
198 static void setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, int count);
│ │ │ │ +
199
│ │ │ │ +
201 static void setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int count);
│ │ │ │ +
202
│ │ │ │ +
204 static void setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, int count);
│ │ │ │
205
│ │ │ │ -
207 int GetNumFVarChannels() const;
│ │ │ │ +
207 static void setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, int count);
│ │ │ │
208
│ │ │ │ - │ │ │ │ -
211
│ │ │ │ -
213 int GetNumFVarValuesTotal(int channel = 0) const;
│ │ │ │ -
214
│ │ │ │ -
216
│ │ │ │ -
217protected:
│ │ │ │ -
218
│ │ │ │ -
219 //
│ │ │ │ -
220 // Lower level protected methods intended strictly for internal use:
│ │ │ │ -
221 //
│ │ │ │ -
222 template <class MESH>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
225 friend class PatchTableBuilder;
│ │ │ │ -
226 friend class PatchBuilder;
│ │ │ │ -
227 friend class PtexIndices;
│ │ │ │ -
228 template <typename REAL>
│ │ │ │ -
229 friend class PrimvarRefinerReal;
│ │ │ │ -
230
│ │ │ │ -
231 // Copy constructor exposed via the factory class:
│ │ │ │ - │ │ │ │ -
233
│ │ │ │ -
234public:
│ │ │ │ -
235 // Levels and Refinements available internally (avoids need for more friends)
│ │ │ │ -
236 Vtr::internal::Level & getLevel(int l) { return *_levels[l]; }
│ │ │ │ -
237 Vtr::internal::Level const & getLevel(int l) const { return *_levels[l]; }
│ │ │ │ -
238
│ │ │ │ -
239 Vtr::internal::Refinement & getRefinement(int l) { return *_refinements[l]; }
│ │ │ │ -
240 Vtr::internal::Refinement const & getRefinement(int l) const { return *_refinements[l]; }
│ │ │ │ -
241
│ │ │ │ -
242private:
│ │ │ │ -
243 // Not default constructible or copyable:
│ │ │ │ -
244 TopologyRefiner() : _uniformOptions(0), _adaptiveOptions(0) { }
│ │ │ │ -
245 TopologyRefiner & operator=(TopologyRefiner const &) { return *this; }
│ │ │ │ +
209 static int getNumBaseVertices(TopologyRefiner const & newRefiner);
│ │ │ │ +
210 static int getNumBaseFaces(TopologyRefiner const & newRefiner);
│ │ │ │ +
211 static int getNumBaseEdges(TopologyRefiner const & newRefiner);
│ │ │ │ +
213
│ │ │ │ +
215
│ │ │ │ +
237
│ │ │ │ +
239 static IndexArray getBaseFaceVertices(TopologyRefiner & newRefiner, Index f);
│ │ │ │ +
240
│ │ │ │ +
242 static IndexArray getBaseFaceEdges(TopologyRefiner & newRefiner, Index f);
│ │ │ │ +
243
│ │ │ │ +
245 static IndexArray getBaseEdgeVertices(TopologyRefiner & newRefiner, Index e);
│ │ │ │
246
│ │ │ │ -
247 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& selector,
│ │ │ │ -
248 internal::FeatureMask const & mask,
│ │ │ │ -
249 ConstIndexArray selectedFaces);
│ │ │ │ -
250 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector,
│ │ │ │ -
251 ConstIndexArray selectedFaces);
│ │ │ │ +
248 static IndexArray getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e);
│ │ │ │ +
249
│ │ │ │ +
251 static IndexArray getBaseVertexFaces(TopologyRefiner & newRefiner, Index v);
│ │ │ │
252
│ │ │ │ -
253 void initializeInventory();
│ │ │ │ -
254 void updateInventory(Vtr::internal::Level const & newLevel);
│ │ │ │ +
254 static IndexArray getBaseVertexEdges(TopologyRefiner & newRefiner, Index v);
│ │ │ │
255
│ │ │ │ -
256 void appendLevel(Vtr::internal::Level & newLevel);
│ │ │ │ -
257 void appendRefinement(Vtr::internal::Refinement & newRefinement);
│ │ │ │ -
258 void assembleFarLevels();
│ │ │ │ -
259
│ │ │ │ -
260private:
│ │ │ │ -
261
│ │ │ │ -
262 Sdc::SchemeType _subdivType;
│ │ │ │ -
263 Sdc::Options _subdivOptions;
│ │ │ │ -
264
│ │ │ │ -
265 unsigned int _isUniform : 1;
│ │ │ │ -
266 unsigned int _hasHoles : 1;
│ │ │ │ -
267 unsigned int _hasIrregFaces : 1;
│ │ │ │ -
268 unsigned int _regFaceSize : 3;
│ │ │ │ -
269 unsigned int _maxLevel : 4;
│ │ │ │ -
270
│ │ │ │ -
271 // Options assigned on refinement:
│ │ │ │ -
272 UniformOptions _uniformOptions;
│ │ │ │ -
273 AdaptiveOptions _adaptiveOptions;
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
262
│ │ │ │ +
264 static void populateBaseLocalIndices(TopologyRefiner & newRefiner);
│ │ │ │ +
265
│ │ │ │ +
267 static void setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, bool b);
│ │ │ │ +
268
│ │ │ │ +
270 static void setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index v, bool b);
│ │ │ │ +
272
│ │ │ │
274
│ │ │ │ -
275 // Cumulative properties of all levels:
│ │ │ │ -
276 int _totalVertices;
│ │ │ │ -
277 int _totalEdges;
│ │ │ │ -
278 int _totalFaces;
│ │ │ │ -
279 int _totalFaceVertices;
│ │ │ │ -
280 int _maxValence;
│ │ │ │ -
281
│ │ │ │ -
282 // Note the base level may be shared with another instance
│ │ │ │ -
283 bool _baseLevelOwned;
│ │ │ │ -
284
│ │ │ │ -
285 std::vector<Vtr::internal::Level *> _levels;
│ │ │ │ -
286 std::vector<Vtr::internal::Refinement *> _refinements;
│ │ │ │ -
287
│ │ │ │ -
288 std::vector<TopologyLevel> _farLevels;
│ │ │ │ -
289};
│ │ │ │ -
290
│ │ │ │ -
291
│ │ │ │ -
292inline int
│ │ │ │ - │ │ │ │ -
294
│ │ │ │ -
295 return _levels[0]->getNumFVarChannels();
│ │ │ │ -
296}
│ │ │ │ - │ │ │ │ - │ │ │ │ -
299
│ │ │ │ -
300 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation();
│ │ │ │ -
301}
│ │ │ │ -
302
│ │ │ │ -
303} // end namespace Far
│ │ │ │ -
304
│ │ │ │ -
305} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
306using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
307} // end namespace OpenSubdiv
│ │ │ │ +
283
│ │ │ │ +
285 static Index findBaseEdge(TopologyRefiner const & newRefiner, Index v0, Index v1);
│ │ │ │ +
286
│ │ │ │ +
288 static void setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, float sharpness);
│ │ │ │ +
289
│ │ │ │ +
291 static void setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, float sharpness);
│ │ │ │ +
292
│ │ │ │ +
294 static void setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool isHole);
│ │ │ │ +
296
│ │ │ │ +
298
│ │ │ │
308
│ │ │ │ -
309#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H */
│ │ │ │ +
310 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues);
│ │ │ │ +
311
│ │ │ │ +
313 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues, Sdc::Options const& fvarOptions);
│ │ │ │ +
314
│ │ │ │ +
316 static IndexArray getBaseFaceFVarValues(TopologyRefiner & newRefiner, Index face, int channel = 0);
│ │ │ │ +
317
│ │ │ │ +
319
│ │ │ │ +
320protected:
│ │ │ │ +
321 //
│ │ │ │ +
322 // Not to be specialized:
│ │ │ │ +
323 //
│ │ │ │ +
324 static bool populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, Options options);
│ │ │ │ +
325
│ │ │ │ +
326private:
│ │ │ │ +
327 //
│ │ │ │ +
328 // An oversight in the interfaces of the error reporting function between the factory
│ │ │ │ +
329 // class and the Vtr::Level requires this adapter function to avoid warnings.
│ │ │ │ +
330 //
│ │ │ │ +
331 // The static class method requires a reference as the MESH argument, but the interface
│ │ │ │ +
332 // for Vtr::Level requires a pointer (void*). So this adapter with a MESH* argument is
│ │ │ │ +
333 // used to effectively cast the function pointer required by Vtr::Level error reporting:
│ │ │ │ +
334 //
│ │ │ │ +
335 static void reportInvalidTopologyAdapter(TopologyError errCode, char const * msg, MESH const * mesh) {
│ │ │ │ +
336 reportInvalidTopology(errCode, msg, *mesh);
│ │ │ │ +
337 }
│ │ │ │ +
338};
│ │ │ │ +
339
│ │ │ │ +
340
│ │ │ │ +
341//
│ │ │ │ +
342// Generic implementations:
│ │ │ │ +
343//
│ │ │ │ +
344template <class MESH>
│ │ │ │ +
345TopologyRefiner*
│ │ │ │ + │ │ │ │ +
347
│ │ │ │ +
348 TopologyRefiner * refiner = new TopologyRefiner(options.schemeType, options.schemeOptions);
│ │ │ │ +
349
│ │ │ │ +
350 if (! populateBaseLevel(*refiner, mesh, options)) {
│ │ │ │ +
351 delete refiner;
│ │ │ │ +
352 return 0;
│ │ │ │ +
353 }
│ │ │ │ +
354
│ │ │ │ +
355 // Eventually want to move the Refiner's inventory initialization here. Currently it
│ │ │ │ +
356 // is handled after topology assignment, but if the inventory is to include additional
│ │ │ │ +
357 // features (e.g. holes, etc.) it is better off deferred to here.
│ │ │ │ +
358
│ │ │ │ +
359 return refiner;
│ │ │ │ +
360}
│ │ │ │ +
361
│ │ │ │ +
362template <class MESH>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
365
│ │ │ │ +
366 return new TopologyRefiner(source);
│ │ │ │ +
367}
│ │ │ │ +
368
│ │ │ │ +
369template <class MESH>
│ │ │ │ +
370bool
│ │ │ │ + │ │ │ │ +
372
│ │ │ │ +
373 //
│ │ │ │ +
374 // Construction of a specialized topology refiner involves four steps, each of which
│ │ │ │ +
375 // involves a method specialized for MESH followed by one that takes an action in
│ │ │ │ +
376 // response to it or in preparation for the next step.
│ │ │ │ +
377 //
│ │ │ │ +
378 // Both the specialized methods and those that follow them may find fault in the
│ │ │ │ +
379 // construction and trigger failure at any time:
│ │ │ │ +
380 //
│ │ │ │ +
381
│ │ │ │ +
382 //
│ │ │ │ +
383 // Sizing of the topology -- this is a required specialization for MESH. This defines
│ │ │ │ +
384 // an inventory of all components and their relations that is used to allocate buffers
│ │ │ │ +
385 // to be efficiently populated in the subsequent topology assignment step.
│ │ │ │ +
386 //
│ │ │ │ +
387 if (! resizeComponentTopology(refiner, mesh)) return false;
│ │ │ │ +
388 if (! prepareComponentTopologySizing(refiner)) return false;
│ │ │ │ +
389
│ │ │ │ +
390 //
│ │ │ │ +
391 // Assignment of the topology -- this is a required specialization for MESH. If edges
│ │ │ │ +
392 // are specified, all other topological relations are expected to be defined for them.
│ │ │ │ +
393 // Otherwise edges and remaining topology will be completed from the face-vertices:
│ │ │ │ +
394 //
│ │ │ │ +
395 bool validate = options.validateFullTopology;
│ │ │ │ +
396 TopologyCallback callback = reinterpret_cast<TopologyCallback>(reportInvalidTopologyAdapter);
│ │ │ │ +
397 void const * userData = &mesh;
│ │ │ │ +
398
│ │ │ │ +
399 if (! assignComponentTopology(refiner, mesh)) return false;
│ │ │ │ +
400 if (! prepareComponentTopologyAssignment(refiner, validate, callback, userData)) return false;
│ │ │ │ +
401
│ │ │ │ +
402 //
│ │ │ │ +
403 // User assigned and internal tagging of components -- an optional specialization for
│ │ │ │ +
404 // MESH. Allows the specification of sharpness values, holes, etc.
│ │ │ │ +
405 //
│ │ │ │ +
406 if (! assignComponentTags(refiner, mesh)) return false;
│ │ │ │ +
407 if (! prepareComponentTagsAndSharpness(refiner)) return false;
│ │ │ │ +
408
│ │ │ │ +
409 //
│ │ │ │ +
410 // Defining channels of face-varying primvar data -- an optional specialization for MESH.
│ │ │ │ +
411 //
│ │ │ │ +
412 if (! assignFaceVaryingTopology(refiner, mesh)) return false;
│ │ │ │ +
413 if (! prepareFaceVaryingChannels(refiner)) return false;
│ │ │ │ +
414
│ │ │ │ +
415 return true;
│ │ │ │ +
416}
│ │ │ │ +
417
│ │ │ │ +
418template <class MESH>
│ │ │ │ +
419inline void
│ │ │ │ + │ │ │ │ +
421 newRefiner._levels[0]->resizeFaces(count);
│ │ │ │ +
422}
│ │ │ │ +
423template <class MESH>
│ │ │ │ +
424inline void
│ │ │ │ + │ │ │ │ +
426 newRefiner._levels[0]->resizeEdges(count);
│ │ │ │ +
427}
│ │ │ │ +
428template <class MESH>
│ │ │ │ +
429inline void
│ │ │ │ + │ │ │ │ +
431 newRefiner._levels[0]->resizeVertices(count);
│ │ │ │ +
432}
│ │ │ │ +
433
│ │ │ │ +
434template <class MESH>
│ │ │ │ +
435inline int
│ │ │ │ + │ │ │ │ +
437 return newRefiner._levels[0]->getNumFaces();
│ │ │ │ +
438}
│ │ │ │ +
439template <class MESH>
│ │ │ │ +
440inline int
│ │ │ │ + │ │ │ │ +
442 return newRefiner._levels[0]->getNumEdges();
│ │ │ │ +
443}
│ │ │ │ +
444template <class MESH>
│ │ │ │ +
445inline int
│ │ │ │ + │ │ │ │ +
447 return newRefiner._levels[0]->getNumVertices();
│ │ │ │ +
448}
│ │ │ │ +
449
│ │ │ │ +
450template <class MESH>
│ │ │ │ +
451inline void
│ │ │ │ + │ │ │ │ +
453 newRefiner._levels[0]->resizeFaceVertices(f, count);
│ │ │ │ +
454 newRefiner._hasIrregFaces = newRefiner._hasIrregFaces || (count != newRefiner._regFaceSize);
│ │ │ │ +
455}
│ │ │ │ +
456template <class MESH>
│ │ │ │ +
457inline void
│ │ │ │ + │ │ │ │ +
459 newRefiner._levels[0]->resizeEdgeFaces(e, count);
│ │ │ │ +
460}
│ │ │ │ +
461template <class MESH>
│ │ │ │ +
462inline void
│ │ │ │ + │ │ │ │ +
464 newRefiner._levels[0]->resizeVertexFaces(v, count);
│ │ │ │ +
465}
│ │ │ │ +
466template <class MESH>
│ │ │ │ +
467inline void
│ │ │ │ + │ │ │ │ +
469 newRefiner._levels[0]->resizeVertexEdges(v, count);
│ │ │ │ +
470}
│ │ │ │ +
471
│ │ │ │ +
472template <class MESH>
│ │ │ │ +
473inline IndexArray
│ │ │ │ + │ │ │ │ +
475 return newRefiner._levels[0]->getFaceVertices(f);
│ │ │ │ +
476}
│ │ │ │ +
477template <class MESH>
│ │ │ │ +
478inline IndexArray
│ │ │ │ + │ │ │ │ +
480 return newRefiner._levels[0]->getFaceEdges(f);
│ │ │ │ +
481}
│ │ │ │ +
482template <class MESH>
│ │ │ │ +
483inline IndexArray
│ │ │ │ + │ │ │ │ +
485 return newRefiner._levels[0]->getEdgeVertices(e);
│ │ │ │ +
486}
│ │ │ │ +
487template <class MESH>
│ │ │ │ +
488inline IndexArray
│ │ │ │ + │ │ │ │ +
490 return newRefiner._levels[0]->getEdgeFaces(e);
│ │ │ │ +
491}
│ │ │ │ +
492template <class MESH>
│ │ │ │ +
493inline IndexArray
│ │ │ │ + │ │ │ │ +
495 return newRefiner._levels[0]->getVertexFaces(v);
│ │ │ │ +
496}
│ │ │ │ +
497template <class MESH>
│ │ │ │ +
498inline IndexArray
│ │ │ │ + │ │ │ │ +
500 return newRefiner._levels[0]->getVertexEdges(v);
│ │ │ │ +
501}
│ │ │ │ +
502
│ │ │ │ +
503template <class MESH>
│ │ │ │ +
504inline LocalIndexArray
│ │ │ │ + │ │ │ │ +
506 return newRefiner._levels[0]->getEdgeFaceLocalIndices(e);
│ │ │ │ +
507}
│ │ │ │ +
508template <class MESH>
│ │ │ │ +
509inline LocalIndexArray
│ │ │ │ + │ │ │ │ +
511 return newRefiner._levels[0]->getVertexFaceLocalIndices(v);
│ │ │ │ +
512}
│ │ │ │ +
513template <class MESH>
│ │ │ │ +
514inline LocalIndexArray
│ │ │ │ + │ │ │ │ +
516 return newRefiner._levels[0]->getVertexEdgeLocalIndices(v);
│ │ │ │ +
517}
│ │ │ │ +
518
│ │ │ │ +
519template <class MESH>
│ │ │ │ +
520inline Index
│ │ │ │ + │ │ │ │ +
522 return newRefiner._levels[0]->findEdge(v0, v1);
│ │ │ │ +
523}
│ │ │ │ +
524
│ │ │ │ +
525template <class MESH>
│ │ │ │ +
526inline void
│ │ │ │ + │ │ │ │ +
528 newRefiner._levels[0]->populateLocalIndices();
│ │ │ │ +
529}
│ │ │ │ +
530
│ │ │ │ +
531template <class MESH>
│ │ │ │ +
532inline void
│ │ │ │ + │ │ │ │ +
534 newRefiner._levels[0]->setEdgeNonManifold(e, b);
│ │ │ │ +
535}
│ │ │ │ +
536template <class MESH>
│ │ │ │ +
537inline void
│ │ │ │ + │ │ │ │ +
539 newRefiner._levels[0]->setVertexNonManifold(v, b);
│ │ │ │ +
540}
│ │ │ │ +
541
│ │ │ │ +
542template <class MESH>
│ │ │ │ +
543inline void
│ │ │ │ + │ │ │ │ +
545 newRefiner._levels[0]->getEdgeSharpness(e) = s;
│ │ │ │ +
546}
│ │ │ │ +
547template <class MESH>
│ │ │ │ +
548inline void
│ │ │ │ + │ │ │ │ +
550 newRefiner._levels[0]->getVertexSharpness(v) = s;
│ │ │ │ +
551}
│ │ │ │ +
552template <class MESH>
│ │ │ │ +
553inline void
│ │ │ │ + │ │ │ │ +
555 newRefiner._levels[0]->setFaceHole(f, b);
│ │ │ │ +
556 newRefiner._hasHoles = newRefiner._hasHoles || b;
│ │ │ │ +
557}
│ │ │ │ +
558
│ │ │ │ +
559template <class MESH>
│ │ │ │ +
560inline int
│ │ │ │ + │ │ │ │ +
562 return newRefiner._levels[0]->createFVarChannel(numValues, newRefiner._subdivOptions);
│ │ │ │ +
563}
│ │ │ │ +
564template <class MESH>
│ │ │ │ +
565inline int
│ │ │ │ + │ │ │ │ +
567 Sdc::Options newOptions = newRefiner._subdivOptions;
│ │ │ │ + │ │ │ │ +
569 return newRefiner._levels[0]->createFVarChannel(numValues, newOptions);
│ │ │ │ +
570}
│ │ │ │ +
571template <class MESH>
│ │ │ │ +
572inline IndexArray
│ │ │ │ + │ │ │ │ +
574 return newRefiner._levels[0]->getFaceFVarValues(face, channel);
│ │ │ │ +
575}
│ │ │ │ +
576
│ │ │ │ +
577
│ │ │ │ +
578template <class MESH>
│ │ │ │ +
579bool
│ │ │ │ + │ │ │ │ +
581
│ │ │ │ + │ │ │ │ +
583 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided.");
│ │ │ │ +
584
│ │ │ │ +
585 //
│ │ │ │ +
586 // Sizing the topology tables:
│ │ │ │ +
587 // This method is for determining the sizes of the various topology tables (and other
│ │ │ │ +
588 // data) associated with the mesh. Once completed, appropriate memory will be allocated
│ │ │ │ +
589 // and an additional method invoked to populate it accordingly.
│ │ │ │ +
590 //
│ │ │ │ +
591 // The following methods should be called -- first those to specify the number of faces,
│ │ │ │ +
592 // edges and vertices in the mesh:
│ │ │ │ +
593 //
│ │ │ │ +
594 // void setBaseFaceCount( TopologyRefiner& newRefiner, int count)
│ │ │ │ +
595 // void setBaseEdgeCount( TopologyRefiner& newRefiner, int count)
│ │ │ │ +
596 // void setBaseVertexCount(TopologyRefiner& newRefiner, int count)
│ │ │ │ +
597 //
│ │ │ │ +
598 // and then for each face, edge and vertex, the number of its incident components:
│ │ │ │ +
599 //
│ │ │ │ +
600 // void setBaseFaceVertexCount(TopologyRefiner& newRefiner, Index face, int count)
│ │ │ │ +
601 // void setBaseEdgeFaceCount( TopologyRefiner& newRefiner, Index edge, int count)
│ │ │ │ +
602 // void setBaseVertexFaceCount(TopologyRefiner& newRefiner, Index vertex, int count)
│ │ │ │ +
603 // void setBaseVertexEdgeCount(TopologyRefiner& newRefiner, Index vertex, int count)
│ │ │ │ +
604 //
│ │ │ │ +
605 // The count/size for a component type must be set before indices associated with that
│ │ │ │ +
606 // component type can be used.
│ │ │ │ +
607 //
│ │ │ │ +
608 // Note that it is only necessary to size 4 of the 6 supported topological relations --
│ │ │ │ +
609 // the number of edge-vertices is fixed at two per edge, and the number of face-edges is
│ │ │ │ +
610 // the same as the number of face-vertices.
│ │ │ │ +
611 //
│ │ │ │ +
612 // So a single pass through your mesh to gather up all of this sizing information will
│ │ │ │ +
613 // allow the Tables to be allocated appropriately once and avoid any dynamic resizing as
│ │ │ │ +
614 // it grows.
│ │ │ │ +
615 //
│ │ │ │ +
616 return false;
│ │ │ │ +
617}
│ │ │ │ +
618
│ │ │ │ +
619template <class MESH>
│ │ │ │ +
620bool
│ │ │ │ + │ │ │ │ +
622
│ │ │ │ + │ │ │ │ +
624 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no specialization provided.");
│ │ │ │ +
625
│ │ │ │ +
626 //
│ │ │ │ +
627 // Assigning the topology tables:
│ │ │ │ +
628 // Once the topology tables have been allocated, the six required topological
│ │ │ │ +
629 // relations can be directly populated using the following methods:
│ │ │ │ +
630 //
│ │ │ │ +
631 // IndexArray setBaseFaceVertices(TopologyRefiner& newRefiner, Index face)
│ │ │ │ +
632 // IndexArray setBaseFaceEdges(TopologyRefiner& newRefiner, Index face)
│ │ │ │ +
633 //
│ │ │ │ +
634 // IndexArray setBaseEdgeVertices(TopologyRefiner& newRefiner, Index edge)
│ │ │ │ +
635 // IndexArray setBaseEdgeFaces(TopologyRefiner& newRefiner, Index edge)
│ │ │ │ +
636 //
│ │ │ │ +
637 // IndexArray setBaseVertexEdges(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ +
638 // IndexArray setBaseVertexFaces(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ +
639 //
│ │ │ │ +
640 // For the last two relations -- the faces and edges incident a vertex -- there are
│ │ │ │ +
641 // also "local indices" that must be specified (considering doing this internally),
│ │ │ │ +
642 // where the "local index" of each incident face or edge is the index of the vertex
│ │ │ │ +
643 // within that face or edge, and so ranging from 0-3 for incident quads and 0-1 for
│ │ │ │ +
644 // incident edges. These are assigned through similarly retrieved arrays:
│ │ │ │ +
645 //
│ │ │ │ +
646 // LocalIndexArray setBaseVertexFaceLocalIndices(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ +
647 // LocalIndexArray setBaseVertexEdgeLocalIndices(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ +
648 // LocalIndexArray setBaseEdgeFaceLocalIndices( TopologyRefiner& newRefiner, Index edge)
│ │ │ │ +
649 //
│ │ │ │ +
650 // or, if the mesh is manifold, explicit assignment of these can be deferred and
│ │ │ │ +
651 // all can be determined by calling:
│ │ │ │ +
652 //
│ │ │ │ +
653 // void populateBaseLocalIndices(TopologyRefiner& newRefiner)
│ │ │ │ +
654 //
│ │ │ │ +
655 // All components are assumed to be locally manifold and ordering of components in
│ │ │ │ +
656 // the above relations is expected to be counter-clockwise.
│ │ │ │ +
657 //
│ │ │ │ +
658 // For non-manifold components, no ordering/orientation of incident components is
│ │ │ │ +
659 // assumed or required, but be sure to explicitly tag such components (vertices and
│ │ │ │ +
660 // edges) as non-manifold:
│ │ │ │ +
661 //
│ │ │ │ +
662 // void setBaseEdgeNonManifold(TopologyRefiner& newRefiner, Index edge, bool b);
│ │ │ │ +
663 //
│ │ │ │ +
664 // void setBaseVertexNonManifold(TopologyRefiner& newRefiner, Index vertex, bool b);
│ │ │ │ +
665 //
│ │ │ │ +
666 // Also consider using TopologyLevel::ValidateTopology() when debugging to ensure
│ │ │ │ +
667 // that topology has been completely and correctly specified.
│ │ │ │ +
668 //
│ │ │ │ +
669 return false;
│ │ │ │ +
670}
│ │ │ │ +
671
│ │ │ │ +
672template <class MESH>
│ │ │ │ +
673bool
│ │ │ │ + │ │ │ │ +
675
│ │ │ │ +
676 //
│ │ │ │ +
677 // Optional assigning face-varying topology tables:
│ │ │ │ +
678 //
│ │ │ │ +
679 // Create independent face-varying primitive variable channels:
│ │ │ │ +
680 // int createBaseFVarChannel(TopologyRefiner& newRefiner, int numValues)
│ │ │ │ +
681 //
│ │ │ │ +
682 // For each channel, populate the face-vertex values:
│ │ │ │ +
683 // IndexArray setBaseFaceFVarValues(TopologyRefiner& newRefiner, Index face, int channel = 0)
│ │ │ │ +
684 //
│ │ │ │ +
685 return true;
│ │ │ │ +
686}
│ │ │ │ +
687
│ │ │ │ +
688template <class MESH>
│ │ │ │ +
689bool
│ │ │ │ + │ │ │ │ +
691
│ │ │ │ +
692 //
│ │ │ │ +
693 // Optional tagging:
│ │ │ │ +
694 // This is where any additional feature tags -- sharpness, holes, etc. -- can be
│ │ │ │ +
695 // specified using:
│ │ │ │ +
696 //
│ │ │ │ +
697 // void setBaseEdgeSharpness(TopologyRefiner& newRefiner, Index edge, float sharpness)
│ │ │ │ +
698 // void setBaseVertexSharpness(TopologyRefiner& newRefiner, Index vertex, float sharpness)
│ │ │ │ +
699 //
│ │ │ │ +
700 // void setBaseFaceHole(TopologyRefiner& newRefiner, Index face, bool hole)
│ │ │ │ +
701 //
│ │ │ │ +
702 return true;
│ │ │ │ +
703}
│ │ │ │ +
704
│ │ │ │ +
705template <class MESH>
│ │ │ │ +
706void
│ │ │ │ + │ │ │ │ +
708 TopologyError /* errCode */, char const * /* msg */, MESH const& /* mesh */) {
│ │ │ │ +
709
│ │ │ │ +
710 //
│ │ │ │ +
711 // Optional topology validation error reporting:
│ │ │ │ +
712 // This method is called whenever the factory encounters topology validation
│ │ │ │ +
713 // errors. By default, nothing is reported
│ │ │ │ +
714 //
│ │ │ │ +
715}
│ │ │ │ +
716
│ │ │ │ +
717} // end namespace Far
│ │ │ │ +
718
│ │ │ │ +
719} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
720using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
721} // end namespace OpenSubdiv
│ │ │ │ +
722
│ │ │ │ +
723#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H */
│ │ │ │ │ │ │ │ -
Vtr::ConstIndexArray ConstIndexArray
Definition: types.h:47
│ │ │ │ +
void Error(ErrorType err, const char *format,...)
Sends an OSD error with a message (internal use only)
│ │ │ │ +
@ FAR_RUNTIME_ERROR
Issue a generic runtime error, but continue execution.
Definition: error.h:40
│ │ │ │ + │ │ │ │
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
Definition: types.h:37
│ │ │ │ -
Applies refinement operations to generic primvar data.
│ │ │ │ -
Object used to compute and query ptex face indices.
Definition: ptexIndices.h:46
│ │ │ │ -
An interface for accessing data in a specific level of a refined topology hierarchy.
Definition: topologyLevel.h:49
│ │ │ │ -
Factory for constructing TopologyRefiners from specific mesh classes.
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ -
TopologyRefiner(TopologyRefiner const &source)
│ │ │ │ -
int GetMaxValence() const
Returns the maximum vertex valence in all levels.
│ │ │ │ -
Vtr::internal::Level const & getLevel(int l) const
│ │ │ │ -
bool HasHoles() const
Returns true if faces have been tagged as holes.
│ │ │ │ -
int GetNumLevels() const
Returns the number of refinement levels.
│ │ │ │ -
int GetNumFVarValuesTotal(int channel=0) const
Returns the total number of face-varying values in all levels.
│ │ │ │ -
Vtr::internal::Refinement const & getRefinement(int l) const
│ │ │ │ -
Sdc::Options GetSchemeOptions() const
Returns the subdivision options.
│ │ │ │ - │ │ │ │ -
bool IsUniform() const
Returns true if uniform refinement has been applied.
│ │ │ │ -
Sdc::SchemeType GetSchemeType() const
Returns the subdivision scheme.
│ │ │ │ -
int GetMaxLevel() const
Returns the highest level of refinement.
│ │ │ │ -
TopologyRefiner(Sdc::SchemeType type, Sdc::Options options=Sdc::Options())
Constructor.
│ │ │ │ -
int GetNumEdgesTotal() const
Returns the total number of edges in all levels.
│ │ │ │ - │ │ │ │ -
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
│ │ │ │ -
UniformOptions GetUniformOptions() const
Returns the options specified on refinement.
│ │ │ │ -
int GetNumFacesTotal() const
Returns the total number of edges in all levels.
│ │ │ │ -
int GetNumFaceVerticesTotal() const
Returns the total number of face vertices in all levels.
│ │ │ │ -
Vtr::internal::Refinement & getRefinement(int l)
│ │ │ │ -
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
│ │ │ │ -
int GetNumVerticesTotal() const
Returns the total number of vertices in all levels.
│ │ │ │ -
void Unrefine()
Unrefine the topology, keeping only the base level.
│ │ │ │ -
AdaptiveOptions GetAdaptiveOptions() const
Returns the options specified on refinement.
│ │ │ │ -
Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) const
Returns the face-varying interpolation rule set for a given channel.
│ │ │ │ -
void RefineAdaptive(AdaptiveOptions options, ConstIndexArray selectedFaces=ConstIndexArray())
Feature Adaptive topology refinement.
│ │ │ │ - │ │ │ │ -
unsigned int refinementLevel
Number of refinement iterations.
│ │ │ │ - │ │ │ │ -
void SetRefinementLevel(int level)
Set uniform refinement level.
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
void SetSecondaryLevel(int level)
Set secondary isolation level.
│ │ │ │ -
Private base class of Factories for constructing TopologyRefiners.
│ │ │ │ -
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ +
Factory for constructing TopologyRefiners from specific mesh classes.
│ │ │ │ +
static int getNumBaseFaces(TopologyRefiner const &newRefiner)
│ │ │ │ +
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
│ │ │ │ +
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
│ │ │ │ +
static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident faces.
│ │ │ │ +
static int getNumBaseVertices(TopologyRefiner const &newRefiner)
│ │ │ │ +
static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int count)
Specify the number of faces incident each edge.
│ │ │ │ +
static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f)
Assign the vertices incident each face.
│ │ │ │ +
static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, Index e)
Assign the local indices of an edge within each of its incident faces.
│ │ │ │ +
static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, Options options)
│ │ │ │ +
static void populateBaseLocalIndices(TopologyRefiner &newRefiner)
Determine all local indices by inspection (only for pure manifold meshes)
│ │ │ │ +
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
│ │ │ │ +
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
│ │ │ │ +
static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of edges incident each vertex.
│ │ │ │ + │ │ │ │ +
static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index face, int channel=0)
Assign the face-varying values for the corners of each face.
│ │ │ │ +
static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e)
Assign the faces incident each edge.
│ │ │ │ +
static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of faces incident each vertex.
│ │ │ │ +
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
│ │ │ │ +
static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float sharpness)
Assign a sharpness value to a given vertex.
│ │ │ │ +
static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident edges.
│ │ │ │ +
static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e)
Assign the vertices incident each edge.
│ │ │ │ +
static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v)
Assign the faces incident each vertex.
│ │ │ │ +
static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool b)
Tag a vertex as non-manifold.
│ │ │ │ +
static void setNumBaseFaces(TopologyRefiner &newRefiner, int count)
Specify the number of faces to be accommodated.
│ │ │ │ +
static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f)
Assign the edges incident each face.
│ │ │ │ +
static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int count)
Specify the number of vertices incident each face.
│ │ │ │ +
static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float sharpness)
Assign a sharpness value to a given edge.
│ │ │ │ +
static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool b)
Tag an edge as non-manifold.
│ │ │ │ +
static void setNumBaseEdges(TopologyRefiner &newRefiner, int count)
Specify the number of edges to be accommodated.
│ │ │ │ +
static TopologyRefiner * Create(MESH const &mesh, Options options=Options())
Instantiates a TopologyRefiner from client-provided topological representation.
│ │ │ │ +
static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index v1)
Identify an edge to be assigned a sharpness value given a vertex pair.
│ │ │ │ +
static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v)
Assign the edges incident each vertex.
│ │ │ │ +
static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues)
Create a new face-varying channel with the given number of values.
│ │ │ │ +
static int getNumBaseEdges(TopologyRefiner const &newRefiner)
│ │ │ │ +
static void setNumBaseVertices(TopologyRefiner &newRefiner, int count)
Specify the number of vertices to be accommodated.
│ │ │ │ +
static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole)
Tag a face as a hole.
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ +
Private base class of Factories for constructing TopologyRefiners.
│ │ │ │ +
static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool fullValidation, TopologyCallback callback, void const *callbackData)
│ │ │ │ + │ │ │ │ +
static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner)
│ │ │ │ +
static bool prepareComponentTopologySizing(TopologyRefiner &refiner)
│ │ │ │ +
static bool prepareFaceVaryingChannels(TopologyRefiner &refiner)
│ │ │ │ +
Options related to the construction of each TopologyRefiner.
│ │ │ │ +
Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions=Sdc::Options())
│ │ │ │ + │ │ │ │ +
Sdc::SchemeType schemeType
The subdivision scheme type identifier.
│ │ │ │ + │ │ │ │ +
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ +
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:98
│ │ │ │ +
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:95
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -topologyRefiner.h │ │ │ │ │ +topologyRefinerFactory.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -29,441 +29,934 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H │ │ │ │ │ - 25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H │ │ │ │ │ + 24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H │ │ │ │ │ + 25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H │ │ │ │ │ 26 │ │ │ │ │ 27#include "../version.h" │ │ │ │ │ 28 │ │ │ │ │ - 29#include "../sdc/types.h" │ │ │ │ │ - 30#include "../sdc/options.h" │ │ │ │ │ - 31#include "../far/types.h" │ │ │ │ │ - 32#include "../far/topologyLevel.h" │ │ │ │ │ + 29#include "../far/topologyRefiner.h" │ │ │ │ │ + 30#include "../far/error.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ 33 │ │ │ │ │ - 34#include │ │ │ │ │ - 35 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ - 37namespace OpenSubdiv { │ │ │ │ │ - 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 39 │ │ │ │ │ -40namespace Vtr { namespace internal { class SparseSelector; } } │ │ │ │ │ - 41namespace Far { namespace internal { class FeatureMask; } } │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Far { │ │ │ │ │ - 44 │ │ │ │ │ - 45template class PrimvarRefinerReal; │ │ │ │ │ - 46template class TopologyRefinerFactory; │ │ │ │ │ - 47 │ │ │ │ │ -51class TopologyRefiner { │ │ │ │ │ - 52 │ │ │ │ │ - 53public: │ │ │ │ │ - 54 │ │ │ │ │ -56 TopologyRefiner(Sdc::SchemeType type, Sdc::Options options = Sdc::Options │ │ │ │ │ -()); │ │ │ │ │ - 57 │ │ │ │ │ -59 ~TopologyRefiner(); │ │ │ │ │ - 60 │ │ │ │ │ -62 Sdc::SchemeType GetSchemeType() const { return _subdivType; } │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 │ │ │ │ │ + 46// │ │ │ │ │ +47class TopologyRefinerFactoryBase { │ │ │ │ │ + 48protected: │ │ │ │ │ + 49 │ │ │ │ │ + 50 // │ │ │ │ │ + 51 // Protected methods invoked by the subclass template to verify and process │ │ │ │ │ +each │ │ │ │ │ + 52 // stage of construction implemented by the subclass: │ │ │ │ │ + 53 // │ │ │ │ │ +54 typedef Vtr::internal::Level::ValidationCallback TopologyCallback; │ │ │ │ │ + 55 │ │ │ │ │ +56 static bool prepareComponentTopologySizing(TopologyRefiner& refiner); │ │ │ │ │ +57 static bool prepareComponentTopologyAssignment(TopologyRefiner& refiner, │ │ │ │ │ +bool fullValidation, │ │ │ │ │ + 58 TopologyCallback callback, void const * callbackData); │ │ │ │ │ +59 static bool prepareComponentTagsAndSharpness(TopologyRefiner& refiner); │ │ │ │ │ +60 static bool prepareFaceVaryingChannels(TopologyRefiner& refiner); │ │ │ │ │ + 61}; │ │ │ │ │ + 62 │ │ │ │ │ 63 │ │ │ │ │ -65 Sdc::Options GetSchemeOptions() const { return _subdivOptions; } │ │ │ │ │ - 66 │ │ │ │ │ -68 bool IsUniform() const { return _isUniform; } │ │ │ │ │ - 69 │ │ │ │ │ -71 int GetNumLevels() const { return (int)_farLevels.size(); } │ │ │ │ │ - 72 │ │ │ │ │ -74 int GetMaxLevel() const { return _maxLevel; } │ │ │ │ │ - 75 │ │ │ │ │ -77 int GetMaxValence() const { return _maxValence; } │ │ │ │ │ - 78 │ │ │ │ │ -80 bool HasHoles() const { return _hasHoles; } │ │ │ │ │ + 77template │ │ │ │ │ +78class TopologyRefinerFactory : public TopologyRefinerFactoryBase { │ │ │ │ │ + 79 │ │ │ │ │ + 80public: │ │ │ │ │ 81 │ │ │ │ │ -83 int GetNumVerticesTotal() const { return _totalVertices; } │ │ │ │ │ - 84 │ │ │ │ │ -86 int GetNumEdgesTotal() const { return _totalEdges; } │ │ │ │ │ - 87 │ │ │ │ │ -89 int GetNumFacesTotal() const { return _totalFaces; } │ │ │ │ │ +84 struct Options { │ │ │ │ │ + 85 │ │ │ │ │ +86 Options(Sdc::SchemeType sdcType = Sdc::SCHEME_CATMARK, Sdc::Options │ │ │ │ │ +sdcOptions = Sdc::Options()) : │ │ │ │ │ + 87 schemeType(sdcType), │ │ │ │ │ + 88 schemeOptions(sdcOptions), │ │ │ │ │ + 89 validateFullTopology(false) { } │ │ │ │ │ 90 │ │ │ │ │ -92 int GetNumFaceVerticesTotal() const { return _totalFaceVertices; } │ │ │ │ │ - 93 │ │ │ │ │ -95 TopologyLevel const & GetLevel(int level) const { return _farLevels[level]; │ │ │ │ │ -} │ │ │ │ │ - 96 │ │ │ │ │ +91 Sdc::SchemeType schemeType; │ │ │ │ │ +92 Sdc::Options schemeOptions; │ │ │ │ │ +94 unsigned int validateFullTopology : 1; │ │ │ │ │ + 97 }; │ │ │ │ │ 98 │ │ │ │ │ - 100 │ │ │ │ │ - 101 // │ │ │ │ │ - 102 // Uniform refinement │ │ │ │ │ - 103 // │ │ │ │ │ - 104 │ │ │ │ │ -118 struct UniformOptions { │ │ │ │ │ - 119 │ │ │ │ │ -120 UniformOptions(int level) : │ │ │ │ │ - 121 refinementLevel(level & 0xf), │ │ │ │ │ - 122 orderVerticesFromFacesFirst(false), │ │ │ │ │ - 123 fullTopologyInLastLevel(false) { } │ │ │ │ │ - 124 │ │ │ │ │ -126 void SetRefinementLevel(int level) { refinementLevel = level & 0xf; } │ │ │ │ │ - 127 │ │ │ │ │ -128 unsigned int refinementLevel:4, │ │ │ │ │ -129 orderVerticesFromFacesFirst:1, │ │ │ │ │ -131 fullTopologyInLastLevel:1; │ │ │ │ │ - 134 }; │ │ │ │ │ - 135 │ │ │ │ │ -146 void RefineUniform(UniformOptions options); │ │ │ │ │ - 147 │ │ │ │ │ -149 UniformOptions GetUniformOptions() const { return _uniformOptions; } │ │ │ │ │ - 150 │ │ │ │ │ - 151 // │ │ │ │ │ - 152 // Adaptive refinement │ │ │ │ │ - 153 // │ │ │ │ │ - 154 │ │ │ │ │ -156 struct AdaptiveOptions { │ │ │ │ │ - 157 │ │ │ │ │ -158 AdaptiveOptions(int level) : │ │ │ │ │ - 159 isolationLevel(level & 0xf), │ │ │ │ │ - 160 secondaryLevel(0xf), │ │ │ │ │ - 161 useSingleCreasePatch(false), │ │ │ │ │ - 162 useInfSharpPatch(false), │ │ │ │ │ - 163 considerFVarChannels(false), │ │ │ │ │ - 164 orderVerticesFromFacesFirst(false) { } │ │ │ │ │ + 108 // │ │ │ │ │ + 113 static TopologyRefiner* Create(MESH const& mesh, Options options = Options │ │ │ │ │ +()); │ │ │ │ │ + 114 │ │ │ │ │ + 128 static TopologyRefiner* Create(TopologyRefiner const & baseLevel); │ │ │ │ │ + 129 │ │ │ │ │ + 130protected: │ │ │ │ │ +131 typedef Vtr::internal::Level::TopologyError TopologyError; │ │ │ │ │ + 132 │ │ │ │ │ + 134 │ │ │ │ │ + 149 │ │ │ │ │ + 151 static bool resizeComponentTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ +const& mesh); │ │ │ │ │ + 152 │ │ │ │ │ + 155 static bool assignComponentTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ +const& mesh); │ │ │ │ │ + 156 │ │ │ │ │ + 158 static bool assignComponentTags(TopologyRefiner& newRefiner, MESH const& │ │ │ │ │ +mesh); │ │ │ │ │ + 159 │ │ │ │ │ + 161 static bool assignFaceVaryingTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ +const& mesh); │ │ │ │ │ + 162 │ │ │ │ │ + 164 static void reportInvalidTopology(TopologyError errCode, char const * msg, │ │ │ │ │ +MESH const& mesh); │ │ │ │ │ 165 │ │ │ │ │ -167 void SetIsolationLevel(int level) { isolationLevel = level & 0xf; } │ │ │ │ │ - 168 │ │ │ │ │ -170 void SetSecondaryLevel(int level) { secondaryLevel = level & 0xf; } │ │ │ │ │ - 171 │ │ │ │ │ -172 unsigned int isolationLevel:4; │ │ │ │ │ -174 unsigned int secondaryLevel:4; │ │ │ │ │ -176 unsigned int useSingleCreasePatch:1; │ │ │ │ │ -178 unsigned int useInfSharpPatch:1; │ │ │ │ │ -180 unsigned int considerFVarChannels:1; │ │ │ │ │ -182 unsigned int orderVerticesFromFacesFirst:1; │ │ │ │ │ - 184 }; │ │ │ │ │ - 185 │ │ │ │ │ -192 void RefineAdaptive(AdaptiveOptions options, │ │ │ │ │ - 193 ConstIndexArray selectedFaces = ConstIndexArray()); │ │ │ │ │ - 194 │ │ │ │ │ -196 AdaptiveOptions GetAdaptiveOptions() const { return _adaptiveOptions; } │ │ │ │ │ - 197 │ │ │ │ │ -199 void Unrefine(); │ │ │ │ │ - 200 │ │ │ │ │ - 201 │ │ │ │ │ - 203 │ │ │ │ │ + 167 │ │ │ │ │ + 168protected: │ │ │ │ │ + 170 │ │ │ │ │ + 187 │ │ │ │ │ + 189 static void setNumBaseVertices(TopologyRefiner & newRefiner, int count); │ │ │ │ │ + 190 │ │ │ │ │ + 192 static void setNumBaseFaces(TopologyRefiner & newRefiner, int count); │ │ │ │ │ + 193 │ │ │ │ │ + 195 static void setNumBaseEdges(TopologyRefiner & newRefiner, int count); │ │ │ │ │ + 196 │ │ │ │ │ + 198 static void setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, │ │ │ │ │ +int count); │ │ │ │ │ + 199 │ │ │ │ │ + 201 static void setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int │ │ │ │ │ +count); │ │ │ │ │ + 202 │ │ │ │ │ + 204 static void setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ +int count); │ │ │ │ │ 205 │ │ │ │ │ - 207 int GetNumFVarChannels() const; │ │ │ │ │ + 207 static void setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ +int count); │ │ │ │ │ 208 │ │ │ │ │ - 210 Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int │ │ │ │ │ -channel = 0) const; │ │ │ │ │ - 211 │ │ │ │ │ -213 int GetNumFVarValuesTotal(int channel = 0) const; │ │ │ │ │ - 214 │ │ │ │ │ - 216 │ │ │ │ │ - 217protected: │ │ │ │ │ - 218 │ │ │ │ │ - 219 // │ │ │ │ │ - 220 // Lower level protected methods intended strictly for internal use: │ │ │ │ │ - 221 // │ │ │ │ │ - 222 template │ │ │ │ │ -223 friend class TopologyRefinerFactory; │ │ │ │ │ -224 friend class TopologyRefinerFactoryBase; │ │ │ │ │ -225 friend class PatchTableBuilder; │ │ │ │ │ -226 friend class PatchBuilder; │ │ │ │ │ -227 friend class PtexIndices; │ │ │ │ │ - 228 template │ │ │ │ │ -229 friend class PrimvarRefinerReal; │ │ │ │ │ - 230 │ │ │ │ │ - 231 // Copy constructor exposed via the factory class: │ │ │ │ │ -232 TopologyRefiner(TopologyRefiner const & source); │ │ │ │ │ - 233 │ │ │ │ │ - 234public: │ │ │ │ │ - 235 // Levels and Refinements available internally (avoids need for more │ │ │ │ │ -friends) │ │ │ │ │ -236 Vtr::internal::Level & getLevel(int l) { return *_levels[l]; } │ │ │ │ │ -237 Vtr::internal::Level const & getLevel(int l) const { return *_levels[l]; } │ │ │ │ │ - 238 │ │ │ │ │ -239 Vtr::internal::Refinement & getRefinement(int l) { return *_refinements[l]; │ │ │ │ │ -} │ │ │ │ │ -240 Vtr::internal::Refinement const & getRefinement(int l) const { return │ │ │ │ │ -*_refinements[l]; } │ │ │ │ │ - 241 │ │ │ │ │ - 242private: │ │ │ │ │ - 243 // Not default constructible or copyable: │ │ │ │ │ - 244 TopologyRefiner() : _uniformOptions(0), _adaptiveOptions(0) { } │ │ │ │ │ - 245 TopologyRefiner & operator=(TopologyRefiner const &) { return *this; } │ │ │ │ │ + 209 static int getNumBaseVertices(TopologyRefiner const & newRefiner); │ │ │ │ │ + 210 static int getNumBaseFaces(TopologyRefiner const & newRefiner); │ │ │ │ │ + 211 static int getNumBaseEdges(TopologyRefiner const & newRefiner); │ │ │ │ │ + 213 │ │ │ │ │ + 215 │ │ │ │ │ + 237 │ │ │ │ │ + 239 static IndexArray getBaseFaceVertices(TopologyRefiner & newRefiner, Index │ │ │ │ │ +f); │ │ │ │ │ + 240 │ │ │ │ │ + 242 static IndexArray getBaseFaceEdges(TopologyRefiner & newRefiner, Index f); │ │ │ │ │ + 243 │ │ │ │ │ + 245 static IndexArray getBaseEdgeVertices(TopologyRefiner & newRefiner, Index │ │ │ │ │ +e); │ │ │ │ │ 246 │ │ │ │ │ - 247 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& │ │ │ │ │ -selector, │ │ │ │ │ - 248 internal::FeatureMask const & mask, │ │ │ │ │ - 249 ConstIndexArray selectedFaces); │ │ │ │ │ - 250 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector, │ │ │ │ │ - 251 ConstIndexArray selectedFaces); │ │ │ │ │ + 248 static IndexArray getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e); │ │ │ │ │ + 249 │ │ │ │ │ + 251 static IndexArray getBaseVertexFaces(TopologyRefiner & newRefiner, Index │ │ │ │ │ +v); │ │ │ │ │ 252 │ │ │ │ │ - 253 void initializeInventory(); │ │ │ │ │ - 254 void updateInventory(Vtr::internal::Level const & newLevel); │ │ │ │ │ + 254 static IndexArray getBaseVertexEdges(TopologyRefiner & newRefiner, Index │ │ │ │ │ +v); │ │ │ │ │ 255 │ │ │ │ │ - 256 void appendLevel(Vtr::internal::Level & newLevel); │ │ │ │ │ - 257 void appendRefinement(Vtr::internal::Refinement & newRefinement); │ │ │ │ │ - 258 void assembleFarLevels(); │ │ │ │ │ - 259 │ │ │ │ │ - 260private: │ │ │ │ │ - 261 │ │ │ │ │ - 262 Sdc::SchemeType _subdivType; │ │ │ │ │ - 263 Sdc::Options _subdivOptions; │ │ │ │ │ - 264 │ │ │ │ │ - 265 unsigned int _isUniform : 1; │ │ │ │ │ - 266 unsigned int _hasHoles : 1; │ │ │ │ │ - 267 unsigned int _hasIrregFaces : 1; │ │ │ │ │ - 268 unsigned int _regFaceSize : 3; │ │ │ │ │ - 269 unsigned int _maxLevel : 4; │ │ │ │ │ - 270 │ │ │ │ │ - 271 // Options assigned on refinement: │ │ │ │ │ - 272 UniformOptions _uniformOptions; │ │ │ │ │ - 273 AdaptiveOptions _adaptiveOptions; │ │ │ │ │ + 257 static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v); │ │ │ │ │ + 259 static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v); │ │ │ │ │ + 261 static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e); │ │ │ │ │ + 262 │ │ │ │ │ + 264 static void populateBaseLocalIndices(TopologyRefiner & newRefiner); │ │ │ │ │ + 265 │ │ │ │ │ + 267 static void setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, │ │ │ │ │ +bool b); │ │ │ │ │ + 268 │ │ │ │ │ + 270 static void setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index │ │ │ │ │ +v, bool b); │ │ │ │ │ + 272 │ │ │ │ │ 274 │ │ │ │ │ - 275 // Cumulative properties of all levels: │ │ │ │ │ - 276 int _totalVertices; │ │ │ │ │ - 277 int _totalEdges; │ │ │ │ │ - 278 int _totalFaces; │ │ │ │ │ - 279 int _totalFaceVertices; │ │ │ │ │ - 280 int _maxValence; │ │ │ │ │ - 281 │ │ │ │ │ - 282 // Note the base level may be shared with another instance │ │ │ │ │ - 283 bool _baseLevelOwned; │ │ │ │ │ - 284 │ │ │ │ │ - 285 std::vector _levels; │ │ │ │ │ - 286 std::vector _refinements; │ │ │ │ │ - 287 │ │ │ │ │ - 288 std::vector _farLevels; │ │ │ │ │ - 289}; │ │ │ │ │ - 290 │ │ │ │ │ - 291 │ │ │ │ │ - 292inline int │ │ │ │ │ -293TopologyRefiner::GetNumFVarChannels() const { │ │ │ │ │ - 294 │ │ │ │ │ - 295 return _levels[0]->getNumFVarChannels(); │ │ │ │ │ - 296} │ │ │ │ │ - 297inline Sdc::Options::FVarLinearInterpolation │ │ │ │ │ -298TopologyRefiner::GetFVarLinearInterpolation(int channel) const { │ │ │ │ │ - 299 │ │ │ │ │ - 300 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation(); │ │ │ │ │ - 301} │ │ │ │ │ - 302 │ │ │ │ │ - 303} // end namespace Far │ │ │ │ │ - 304 │ │ │ │ │ - 305} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 306using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 307} // end namespace OpenSubdiv │ │ │ │ │ + 283 │ │ │ │ │ + 285 static Index findBaseEdge(TopologyRefiner const & newRefiner, Index v0, │ │ │ │ │ +Index v1); │ │ │ │ │ + 286 │ │ │ │ │ + 288 static void setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, │ │ │ │ │ +float sharpness); │ │ │ │ │ + 289 │ │ │ │ │ + 291 static void setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ +float sharpness); │ │ │ │ │ + 292 │ │ │ │ │ + 294 static void setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool │ │ │ │ │ +isHole); │ │ │ │ │ + 296 │ │ │ │ │ + 298 │ │ │ │ │ 308 │ │ │ │ │ - 309#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H */ │ │ │ │ │ + 310 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int │ │ │ │ │ +numValues); │ │ │ │ │ + 311 │ │ │ │ │ + 313 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int │ │ │ │ │ +numValues, Sdc::Options const& fvarOptions); │ │ │ │ │ + 314 │ │ │ │ │ + 316 static IndexArray getBaseFaceFVarValues(TopologyRefiner & newRefiner, │ │ │ │ │ +Index face, int channel = 0); │ │ │ │ │ + 317 │ │ │ │ │ + 319 │ │ │ │ │ + 320protected: │ │ │ │ │ + 321 // │ │ │ │ │ + 322 // Not to be specialized: │ │ │ │ │ + 323 // │ │ │ │ │ + 324 static bool populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, │ │ │ │ │ +Options options); │ │ │ │ │ + 325 │ │ │ │ │ + 326private: │ │ │ │ │ + 327 // │ │ │ │ │ + 328 // An oversight in the interfaces of the error reporting function between │ │ │ │ │ +the factory │ │ │ │ │ + 329 // class and the Vtr::Level requires this adapter function to avoid │ │ │ │ │ +warnings. │ │ │ │ │ + 330 // │ │ │ │ │ + 331 // The static class method requires a reference as the MESH argument, but │ │ │ │ │ +the interface │ │ │ │ │ + 332 // for Vtr::Level requires a pointer (void*). So this adapter with a MESH* │ │ │ │ │ +argument is │ │ │ │ │ + 333 // used to effectively cast the function pointer required by Vtr::Level │ │ │ │ │ +error reporting: │ │ │ │ │ + 334 // │ │ │ │ │ + 335 static void reportInvalidTopologyAdapter(TopologyError errCode, char const │ │ │ │ │ +* msg, MESH const * mesh) { │ │ │ │ │ + 336 reportInvalidTopology(errCode, msg, *mesh); │ │ │ │ │ + 337 } │ │ │ │ │ + 338}; │ │ │ │ │ + 339 │ │ │ │ │ + 340 │ │ │ │ │ + 341// │ │ │ │ │ + 342// Generic implementations: │ │ │ │ │ + 343// │ │ │ │ │ + 344template │ │ │ │ │ + 345TopologyRefiner* │ │ │ │ │ +346TopologyRefinerFactory::Create(MESH const& mesh, Options options) { │ │ │ │ │ + 347 │ │ │ │ │ + 348 TopologyRefiner * refiner = new TopologyRefiner(options.schemeType, │ │ │ │ │ +options.schemeOptions); │ │ │ │ │ + 349 │ │ │ │ │ + 350 if (! populateBaseLevel(*refiner, mesh, options)) { │ │ │ │ │ + 351 delete refiner; │ │ │ │ │ + 352 return 0; │ │ │ │ │ + 353 } │ │ │ │ │ + 354 │ │ │ │ │ + 355 // Eventually want to move the Refiner's inventory initialization here. │ │ │ │ │ +Currently it │ │ │ │ │ + 356 // is handled after topology assignment, but if the inventory is to │ │ │ │ │ +include additional │ │ │ │ │ + 357 // features (e.g. holes, etc.) it is better off deferred to here. │ │ │ │ │ + 358 │ │ │ │ │ + 359 return refiner; │ │ │ │ │ + 360} │ │ │ │ │ + 361 │ │ │ │ │ + 362template │ │ │ │ │ + 363TopologyRefiner* │ │ │ │ │ +364TopologyRefinerFactory::Create(TopologyRefiner const & source) { │ │ │ │ │ + 365 │ │ │ │ │ + 366 return new TopologyRefiner(source); │ │ │ │ │ + 367} │ │ │ │ │ + 368 │ │ │ │ │ + 369template │ │ │ │ │ + 370bool │ │ │ │ │ +371TopologyRefinerFactory::populateBaseLevel(TopologyRefiner& refiner, │ │ │ │ │ +MESH const& mesh, Options options) { │ │ │ │ │ + 372 │ │ │ │ │ + 373 // │ │ │ │ │ + 374 // Construction of a specialized topology refiner involves four steps, │ │ │ │ │ +each of which │ │ │ │ │ + 375 // involves a method specialized for MESH followed by one that takes an │ │ │ │ │ +action in │ │ │ │ │ + 376 // response to it or in preparation for the next step. │ │ │ │ │ + 377 // │ │ │ │ │ + 378 // Both the specialized methods and those that follow them may find fault │ │ │ │ │ +in the │ │ │ │ │ + 379 // construction and trigger failure at any time: │ │ │ │ │ + 380 // │ │ │ │ │ + 381 │ │ │ │ │ + 382 // │ │ │ │ │ + 383 // Sizing of the topology -- this is a required specialization for MESH. │ │ │ │ │ +This defines │ │ │ │ │ + 384 // an inventory of all components and their relations that is used to │ │ │ │ │ +allocate buffers │ │ │ │ │ + 385 // to be efficiently populated in the subsequent topology assignment step. │ │ │ │ │ + 386 // │ │ │ │ │ + 387 if (! resizeComponentTopology(refiner, mesh)) return false; │ │ │ │ │ + 388 if (! prepareComponentTopologySizing(refiner)) return false; │ │ │ │ │ + 389 │ │ │ │ │ + 390 // │ │ │ │ │ + 391 // Assignment of the topology -- this is a required specialization for │ │ │ │ │ +MESH. If edges │ │ │ │ │ + 392 // are specified, all other topological relations are expected to be │ │ │ │ │ +defined for them. │ │ │ │ │ + 393 // Otherwise edges and remaining topology will be completed from the face- │ │ │ │ │ +vertices: │ │ │ │ │ + 394 // │ │ │ │ │ + 395 bool validate = options.validateFullTopology; │ │ │ │ │ + 396 TopologyCallback callback = reinterpret_cast │ │ │ │ │ +(reportInvalidTopologyAdapter); │ │ │ │ │ + 397 void const * userData = &mesh; │ │ │ │ │ + 398 │ │ │ │ │ + 399 if (! assignComponentTopology(refiner, mesh)) return false; │ │ │ │ │ + 400 if (! prepareComponentTopologyAssignment(refiner, validate, callback, │ │ │ │ │ +userData)) return false; │ │ │ │ │ + 401 │ │ │ │ │ + 402 // │ │ │ │ │ + 403 // User assigned and internal tagging of components -- an optional │ │ │ │ │ +specialization for │ │ │ │ │ + 404 // MESH. Allows the specification of sharpness values, holes, etc. │ │ │ │ │ + 405 // │ │ │ │ │ + 406 if (! assignComponentTags(refiner, mesh)) return false; │ │ │ │ │ + 407 if (! prepareComponentTagsAndSharpness(refiner)) return false; │ │ │ │ │ + 408 │ │ │ │ │ + 409 // │ │ │ │ │ + 410 // Defining channels of face-varying primvar data -- an optional │ │ │ │ │ +specialization for MESH. │ │ │ │ │ + 411 // │ │ │ │ │ + 412 if (! assignFaceVaryingTopology(refiner, mesh)) return false; │ │ │ │ │ + 413 if (! prepareFaceVaryingChannels(refiner)) return false; │ │ │ │ │ + 414 │ │ │ │ │ + 415 return true; │ │ │ │ │ + 416} │ │ │ │ │ + 417 │ │ │ │ │ + 418template │ │ │ │ │ + 419inline void │ │ │ │ │ +420TopologyRefinerFactory::setNumBaseFaces(TopologyRefiner & newRefiner, │ │ │ │ │ +int count) { │ │ │ │ │ + 421 newRefiner._levels[0]->resizeFaces(count); │ │ │ │ │ + 422} │ │ │ │ │ + 423template │ │ │ │ │ + 424inline void │ │ │ │ │ +425TopologyRefinerFactory::setNumBaseEdges(TopologyRefiner & newRefiner, │ │ │ │ │ +int count) { │ │ │ │ │ + 426 newRefiner._levels[0]->resizeEdges(count); │ │ │ │ │ + 427} │ │ │ │ │ + 428template │ │ │ │ │ + 429inline void │ │ │ │ │ +430TopologyRefinerFactory::setNumBaseVertices(TopologyRefiner & │ │ │ │ │ +newRefiner, int count) { │ │ │ │ │ + 431 newRefiner._levels[0]->resizeVertices(count); │ │ │ │ │ + 432} │ │ │ │ │ + 433 │ │ │ │ │ + 434template │ │ │ │ │ + 435inline int │ │ │ │ │ +436TopologyRefinerFactory::getNumBaseFaces(TopologyRefiner const & │ │ │ │ │ +newRefiner) { │ │ │ │ │ + 437 return newRefiner._levels[0]->getNumFaces(); │ │ │ │ │ + 438} │ │ │ │ │ + 439template │ │ │ │ │ + 440inline int │ │ │ │ │ +441TopologyRefinerFactory::getNumBaseEdges(TopologyRefiner const & │ │ │ │ │ +newRefiner) { │ │ │ │ │ + 442 return newRefiner._levels[0]->getNumEdges(); │ │ │ │ │ + 443} │ │ │ │ │ + 444template │ │ │ │ │ + 445inline int │ │ │ │ │ +446TopologyRefinerFactory::getNumBaseVertices(TopologyRefiner const & │ │ │ │ │ +newRefiner) { │ │ │ │ │ + 447 return newRefiner._levels[0]->getNumVertices(); │ │ │ │ │ + 448} │ │ │ │ │ + 449 │ │ │ │ │ + 450template │ │ │ │ │ + 451inline void │ │ │ │ │ +452TopologyRefinerFactory::setNumBaseFaceVertices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index f, int count) { │ │ │ │ │ + 453 newRefiner._levels[0]->resizeFaceVertices(f, count); │ │ │ │ │ + 454 newRefiner._hasIrregFaces = newRefiner._hasIrregFaces || (count != │ │ │ │ │ +newRefiner._regFaceSize); │ │ │ │ │ + 455} │ │ │ │ │ + 456template │ │ │ │ │ + 457inline void │ │ │ │ │ +458TopologyRefinerFactory::setNumBaseEdgeFaces(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e, int count) { │ │ │ │ │ + 459 newRefiner._levels[0]->resizeEdgeFaces(e, count); │ │ │ │ │ + 460} │ │ │ │ │ + 461template │ │ │ │ │ + 462inline void │ │ │ │ │ +463TopologyRefinerFactory::setNumBaseVertexFaces(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v, int count) { │ │ │ │ │ + 464 newRefiner._levels[0]->resizeVertexFaces(v, count); │ │ │ │ │ + 465} │ │ │ │ │ + 466template │ │ │ │ │ + 467inline void │ │ │ │ │ +468TopologyRefinerFactory::setNumBaseVertexEdges(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v, int count) { │ │ │ │ │ + 469 newRefiner._levels[0]->resizeVertexEdges(v, count); │ │ │ │ │ + 470} │ │ │ │ │ + 471 │ │ │ │ │ + 472template │ │ │ │ │ + 473inline IndexArray │ │ │ │ │ +474TopologyRefinerFactory::getBaseFaceVertices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index f) { │ │ │ │ │ + 475 return newRefiner._levels[0]->getFaceVertices(f); │ │ │ │ │ + 476} │ │ │ │ │ + 477template │ │ │ │ │ + 478inline IndexArray │ │ │ │ │ +479TopologyRefinerFactory::getBaseFaceEdges(TopologyRefiner & newRefiner, │ │ │ │ │ +Index f) { │ │ │ │ │ + 480 return newRefiner._levels[0]->getFaceEdges(f); │ │ │ │ │ + 481} │ │ │ │ │ + 482template │ │ │ │ │ + 483inline IndexArray │ │ │ │ │ +484TopologyRefinerFactory::getBaseEdgeVertices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e) { │ │ │ │ │ + 485 return newRefiner._levels[0]->getEdgeVertices(e); │ │ │ │ │ + 486} │ │ │ │ │ + 487template │ │ │ │ │ + 488inline IndexArray │ │ │ │ │ +489TopologyRefinerFactory::getBaseEdgeFaces(TopologyRefiner & newRefiner, │ │ │ │ │ +Index e) { │ │ │ │ │ + 490 return newRefiner._levels[0]->getEdgeFaces(e); │ │ │ │ │ + 491} │ │ │ │ │ + 492template │ │ │ │ │ + 493inline IndexArray │ │ │ │ │ +494TopologyRefinerFactory::getBaseVertexFaces(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v) { │ │ │ │ │ + 495 return newRefiner._levels[0]->getVertexFaces(v); │ │ │ │ │ + 496} │ │ │ │ │ + 497template │ │ │ │ │ + 498inline IndexArray │ │ │ │ │ +499TopologyRefinerFactory::getBaseVertexEdges(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v) { │ │ │ │ │ + 500 return newRefiner._levels[0]->getVertexEdges(v); │ │ │ │ │ + 501} │ │ │ │ │ + 502 │ │ │ │ │ + 503template │ │ │ │ │ + 504inline LocalIndexArray │ │ │ │ │ +505TopologyRefinerFactory::getBaseEdgeFaceLocalIndices(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e) { │ │ │ │ │ + 506 return newRefiner._levels[0]->getEdgeFaceLocalIndices(e); │ │ │ │ │ + 507} │ │ │ │ │ + 508template │ │ │ │ │ + 509inline LocalIndexArray │ │ │ │ │ +510TopologyRefinerFactory::getBaseVertexFaceLocalIndices(TopologyRefiner │ │ │ │ │ +& newRefiner, Index v) { │ │ │ │ │ + 511 return newRefiner._levels[0]->getVertexFaceLocalIndices(v); │ │ │ │ │ + 512} │ │ │ │ │ + 513template │ │ │ │ │ + 514inline LocalIndexArray │ │ │ │ │ +515TopologyRefinerFactory::getBaseVertexEdgeLocalIndices(TopologyRefiner │ │ │ │ │ +& newRefiner, Index v) { │ │ │ │ │ + 516 return newRefiner._levels[0]->getVertexEdgeLocalIndices(v); │ │ │ │ │ + 517} │ │ │ │ │ + 518 │ │ │ │ │ + 519template │ │ │ │ │ + 520inline Index │ │ │ │ │ +521TopologyRefinerFactory::findBaseEdge(TopologyRefiner const & │ │ │ │ │ +newRefiner, Index v0, Index v1) { │ │ │ │ │ + 522 return newRefiner._levels[0]->findEdge(v0, v1); │ │ │ │ │ + 523} │ │ │ │ │ + 524 │ │ │ │ │ + 525template │ │ │ │ │ + 526inline void │ │ │ │ │ +527TopologyRefinerFactory::populateBaseLocalIndices(TopologyRefiner & │ │ │ │ │ +newRefiner) { │ │ │ │ │ + 528 newRefiner._levels[0]->populateLocalIndices(); │ │ │ │ │ + 529} │ │ │ │ │ + 530 │ │ │ │ │ + 531template │ │ │ │ │ + 532inline void │ │ │ │ │ +533TopologyRefinerFactory::setBaseEdgeNonManifold(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e, bool b) { │ │ │ │ │ + 534 newRefiner._levels[0]->setEdgeNonManifold(e, b); │ │ │ │ │ + 535} │ │ │ │ │ + 536template │ │ │ │ │ + 537inline void │ │ │ │ │ +538TopologyRefinerFactory::setBaseVertexNonManifold(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v, bool b) { │ │ │ │ │ + 539 newRefiner._levels[0]->setVertexNonManifold(v, b); │ │ │ │ │ + 540} │ │ │ │ │ + 541 │ │ │ │ │ + 542template │ │ │ │ │ + 543inline void │ │ │ │ │ +544TopologyRefinerFactory::setBaseEdgeSharpness(TopologyRefiner & │ │ │ │ │ +newRefiner, Index e, float s) { │ │ │ │ │ + 545 newRefiner._levels[0]->getEdgeSharpness(e) = s; │ │ │ │ │ + 546} │ │ │ │ │ + 547template │ │ │ │ │ + 548inline void │ │ │ │ │ +549TopologyRefinerFactory::setBaseVertexSharpness(TopologyRefiner & │ │ │ │ │ +newRefiner, Index v, float s) { │ │ │ │ │ + 550 newRefiner._levels[0]->getVertexSharpness(v) = s; │ │ │ │ │ + 551} │ │ │ │ │ + 552template │ │ │ │ │ + 553inline void │ │ │ │ │ +554TopologyRefinerFactory::setBaseFaceHole(TopologyRefiner & newRefiner, │ │ │ │ │ +Index f, bool b) { │ │ │ │ │ + 555 newRefiner._levels[0]->setFaceHole(f, b); │ │ │ │ │ + 556 newRefiner._hasHoles = newRefiner._hasHoles || b; │ │ │ │ │ + 557} │ │ │ │ │ + 558 │ │ │ │ │ + 559template │ │ │ │ │ + 560inline int │ │ │ │ │ +561TopologyRefinerFactory::createBaseFVarChannel(TopologyRefiner & │ │ │ │ │ +newRefiner, int numValues) { │ │ │ │ │ + 562 return newRefiner._levels[0]->createFVarChannel(numValues, │ │ │ │ │ +newRefiner._subdivOptions); │ │ │ │ │ + 563} │ │ │ │ │ + 564template │ │ │ │ │ + 565inline int │ │ │ │ │ +566TopologyRefinerFactory::createBaseFVarChannel(TopologyRefiner & │ │ │ │ │ +newRefiner, int numValues, Sdc::Options const& fvarOptions) { │ │ │ │ │ + 567 Sdc::Options newOptions = newRefiner._subdivOptions; │ │ │ │ │ + 568 newOptions.SetFVarLinearInterpolation │ │ │ │ │ +(fvarOptions.GetFVarLinearInterpolation()); │ │ │ │ │ + 569 return newRefiner._levels[0]->createFVarChannel(numValues, newOptions); │ │ │ │ │ + 570} │ │ │ │ │ + 571template │ │ │ │ │ + 572inline IndexArray │ │ │ │ │ +573TopologyRefinerFactory::getBaseFaceFVarValues(TopologyRefiner & │ │ │ │ │ +newRefiner, Index face, int channel) { │ │ │ │ │ + 574 return newRefiner._levels[0]->getFaceFVarValues(face, channel); │ │ │ │ │ + 575} │ │ │ │ │ + 576 │ │ │ │ │ + 577 │ │ │ │ │ + 578template │ │ │ │ │ + 579bool │ │ │ │ │ +580TopologyRefinerFactory::resizeComponentTopology(TopologyRefiner& / │ │ │ │ │ +* refiner */, MESH const& /* mesh */) { │ │ │ │ │ + 581 │ │ │ │ │ + 582 Error(FAR_RUNTIME_ERROR, │ │ │ │ │ + 583 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no │ │ │ │ │ +specialization provided."); │ │ │ │ │ + 584 │ │ │ │ │ + 585 // │ │ │ │ │ + 586 // Sizing the topology tables: │ │ │ │ │ + 587 // This method is for determining the sizes of the various topology tables │ │ │ │ │ +(and other │ │ │ │ │ + 588 // data) associated with the mesh. Once completed, appropriate memory will │ │ │ │ │ +be allocated │ │ │ │ │ + 589 // and an additional method invoked to populate it accordingly. │ │ │ │ │ + 590 // │ │ │ │ │ + 591 // The following methods should be called -- first those to specify the │ │ │ │ │ +number of faces, │ │ │ │ │ + 592 // edges and vertices in the mesh: │ │ │ │ │ + 593 // │ │ │ │ │ + 594 // void setBaseFaceCount( TopologyRefiner& newRefiner, int count) │ │ │ │ │ + 595 // void setBaseEdgeCount( TopologyRefiner& newRefiner, int count) │ │ │ │ │ + 596 // void setBaseVertexCount(TopologyRefiner& newRefiner, int count) │ │ │ │ │ + 597 // │ │ │ │ │ + 598 // and then for each face, edge and vertex, the number of its incident │ │ │ │ │ +components: │ │ │ │ │ + 599 // │ │ │ │ │ + 600 // void setBaseFaceVertexCount(TopologyRefiner& newRefiner, Index face, │ │ │ │ │ +int count) │ │ │ │ │ + 601 // void setBaseEdgeFaceCount( TopologyRefiner& newRefiner, Index edge, int │ │ │ │ │ +count) │ │ │ │ │ + 602 // void setBaseVertexFaceCount(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ +int count) │ │ │ │ │ + 603 // void setBaseVertexEdgeCount(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ +int count) │ │ │ │ │ + 604 // │ │ │ │ │ + 605 // The count/size for a component type must be set before indices │ │ │ │ │ +associated with that │ │ │ │ │ + 606 // component type can be used. │ │ │ │ │ + 607 // │ │ │ │ │ + 608 // Note that it is only necessary to size 4 of the 6 supported topological │ │ │ │ │ +relations -- │ │ │ │ │ + 609 // the number of edge-vertices is fixed at two per edge, and the number of │ │ │ │ │ +face-edges is │ │ │ │ │ + 610 // the same as the number of face-vertices. │ │ │ │ │ + 611 // │ │ │ │ │ + 612 // So a single pass through your mesh to gather up all of this sizing │ │ │ │ │ +information will │ │ │ │ │ + 613 // allow the Tables to be allocated appropriately once and avoid any │ │ │ │ │ +dynamic resizing as │ │ │ │ │ + 614 // it grows. │ │ │ │ │ + 615 // │ │ │ │ │ + 616 return false; │ │ │ │ │ + 617} │ │ │ │ │ + 618 │ │ │ │ │ + 619template │ │ │ │ │ + 620bool │ │ │ │ │ +621TopologyRefinerFactory::assignComponentTopology(TopologyRefiner& / │ │ │ │ │ +* refiner */, MESH const& /* mesh */) { │ │ │ │ │ + 622 │ │ │ │ │ + 623 Error(FAR_RUNTIME_ERROR, │ │ │ │ │ + 624 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no │ │ │ │ │ +specialization provided."); │ │ │ │ │ + 625 │ │ │ │ │ + 626 // │ │ │ │ │ + 627 // Assigning the topology tables: │ │ │ │ │ + 628 // Once the topology tables have been allocated, the six required │ │ │ │ │ +topological │ │ │ │ │ + 629 // relations can be directly populated using the following methods: │ │ │ │ │ + 630 // │ │ │ │ │ + 631 // IndexArray setBaseFaceVertices(TopologyRefiner& newRefiner, Index face) │ │ │ │ │ + 632 // IndexArray setBaseFaceEdges(TopologyRefiner& newRefiner, Index face) │ │ │ │ │ + 633 // │ │ │ │ │ + 634 // IndexArray setBaseEdgeVertices(TopologyRefiner& newRefiner, Index edge) │ │ │ │ │ + 635 // IndexArray setBaseEdgeFaces(TopologyRefiner& newRefiner, Index edge) │ │ │ │ │ + 636 // │ │ │ │ │ + 637 // IndexArray setBaseVertexEdges(TopologyRefiner& newRefiner, Index │ │ │ │ │ +vertex) │ │ │ │ │ + 638 // IndexArray setBaseVertexFaces(TopologyRefiner& newRefiner, Index │ │ │ │ │ +vertex) │ │ │ │ │ + 639 // │ │ │ │ │ + 640 // For the last two relations -- the faces and edges incident a vertex - │ │ │ │ │ +- there are │ │ │ │ │ + 641 // also "local indices" that must be specified (considering doing this │ │ │ │ │ +internally), │ │ │ │ │ + 642 // where the "local index" of each incident face or edge is the index of │ │ │ │ │ +the vertex │ │ │ │ │ + 643 // within that face or edge, and so ranging from 0-3 for incident quads │ │ │ │ │ +and 0-1 for │ │ │ │ │ + 644 // incident edges. These are assigned through similarly retrieved arrays: │ │ │ │ │ + 645 // │ │ │ │ │ + 646 // LocalIndexArray setBaseVertexFaceLocalIndices(TopologyRefiner& │ │ │ │ │ +newRefiner, Index vertex) │ │ │ │ │ + 647 // LocalIndexArray setBaseVertexEdgeLocalIndices(TopologyRefiner& │ │ │ │ │ +newRefiner, Index vertex) │ │ │ │ │ + 648 // LocalIndexArray setBaseEdgeFaceLocalIndices( TopologyRefiner& │ │ │ │ │ +newRefiner, Index edge) │ │ │ │ │ + 649 // │ │ │ │ │ + 650 // or, if the mesh is manifold, explicit assignment of these can be │ │ │ │ │ +deferred and │ │ │ │ │ + 651 // all can be determined by calling: │ │ │ │ │ + 652 // │ │ │ │ │ + 653 // void populateBaseLocalIndices(TopologyRefiner& newRefiner) │ │ │ │ │ + 654 // │ │ │ │ │ + 655 // All components are assumed to be locally manifold and ordering of │ │ │ │ │ +components in │ │ │ │ │ + 656 // the above relations is expected to be counter-clockwise. │ │ │ │ │ + 657 // │ │ │ │ │ + 658 // For non-manifold components, no ordering/orientation of incident │ │ │ │ │ +components is │ │ │ │ │ + 659 // assumed or required, but be sure to explicitly tag such components │ │ │ │ │ +(vertices and │ │ │ │ │ + 660 // edges) as non-manifold: │ │ │ │ │ + 661 // │ │ │ │ │ + 662 // void setBaseEdgeNonManifold(TopologyRefiner& newRefiner, Index edge, │ │ │ │ │ +bool b); │ │ │ │ │ + 663 // │ │ │ │ │ + 664 // void setBaseVertexNonManifold(TopologyRefiner& newRefiner, Index │ │ │ │ │ +vertex, bool b); │ │ │ │ │ + 665 // │ │ │ │ │ + 666 // Also consider using TopologyLevel::ValidateTopology() when debugging to │ │ │ │ │ +ensure │ │ │ │ │ + 667 // that topology has been completely and correctly specified. │ │ │ │ │ + 668 // │ │ │ │ │ + 669 return false; │ │ │ │ │ + 670} │ │ │ │ │ + 671 │ │ │ │ │ + 672template │ │ │ │ │ + 673bool │ │ │ │ │ +674TopologyRefinerFactory::assignFaceVaryingTopology(TopologyRefiner& / │ │ │ │ │ +* refiner */, MESH const& /* mesh */) { │ │ │ │ │ + 675 │ │ │ │ │ + 676 // │ │ │ │ │ + 677 // Optional assigning face-varying topology tables: │ │ │ │ │ + 678 // │ │ │ │ │ + 679 // Create independent face-varying primitive variable channels: │ │ │ │ │ + 680 // int createBaseFVarChannel(TopologyRefiner& newRefiner, int numValues) │ │ │ │ │ + 681 // │ │ │ │ │ + 682 // For each channel, populate the face-vertex values: │ │ │ │ │ + 683 // IndexArray setBaseFaceFVarValues(TopologyRefiner& newRefiner, Index │ │ │ │ │ +face, int channel = 0) │ │ │ │ │ + 684 // │ │ │ │ │ + 685 return true; │ │ │ │ │ + 686} │ │ │ │ │ + 687 │ │ │ │ │ + 688template │ │ │ │ │ + 689bool │ │ │ │ │ +690TopologyRefinerFactory::assignComponentTags(TopologyRefiner& / │ │ │ │ │ +* refiner */, MESH const& /* mesh */) { │ │ │ │ │ + 691 │ │ │ │ │ + 692 // │ │ │ │ │ + 693 // Optional tagging: │ │ │ │ │ + 694 // This is where any additional feature tags -- sharpness, holes, etc. - │ │ │ │ │ +- can be │ │ │ │ │ + 695 // specified using: │ │ │ │ │ + 696 // │ │ │ │ │ + 697 // void setBaseEdgeSharpness(TopologyRefiner& newRefiner, Index edge, │ │ │ │ │ +float sharpness) │ │ │ │ │ + 698 // void setBaseVertexSharpness(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ +float sharpness) │ │ │ │ │ + 699 // │ │ │ │ │ + 700 // void setBaseFaceHole(TopologyRefiner& newRefiner, Index face, bool │ │ │ │ │ +hole) │ │ │ │ │ + 701 // │ │ │ │ │ + 702 return true; │ │ │ │ │ + 703} │ │ │ │ │ + 704 │ │ │ │ │ + 705template │ │ │ │ │ + 706void │ │ │ │ │ +707TopologyRefinerFactory::reportInvalidTopology( │ │ │ │ │ + 708 TopologyError /* errCode */, char const * /* msg */, MESH const& /* mesh │ │ │ │ │ +*/) { │ │ │ │ │ + 709 │ │ │ │ │ + 710 // │ │ │ │ │ + 711 // Optional topology validation error reporting: │ │ │ │ │ + 712 // This method is called whenever the factory encounters topology │ │ │ │ │ +validation │ │ │ │ │ + 713 // errors. By default, nothing is reported │ │ │ │ │ + 714 // │ │ │ │ │ + 715} │ │ │ │ │ + 716 │ │ │ │ │ + 717} // end namespace Far │ │ │ │ │ + 718 │ │ │ │ │ + 719} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 720using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 721} // end namespace OpenSubdiv │ │ │ │ │ + 722 │ │ │ │ │ + 723#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstIndexArray │ │ │ │ │ -Vtr::ConstIndexArray ConstIndexArray │ │ │ │ │ -Definition: types.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::Error │ │ │ │ │ +void Error(ErrorType err, const char *format,...) │ │ │ │ │ +Sends an OSD error with a message (internal use only) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::FAR_RUNTIME_ERROR │ │ │ │ │ +@ FAR_RUNTIME_ERROR │ │ │ │ │ +Issue a generic runtime error, but continue execution. │ │ │ │ │ +Definition: error.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::Index │ │ │ │ │ +Vtr::Index Index │ │ │ │ │ +Definition: types.h:41 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SchemeType │ │ │ │ │ SchemeType │ │ │ │ │ Enumerated type for all subdivision schemes supported by OpenSubdiv. │ │ │ │ │ Definition: types.h:37 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PrimvarRefinerReal │ │ │ │ │ -Applies refinement operations to generic primvar data. │ │ │ │ │ -Definition: primvarRefiner.h:56 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PtexIndices │ │ │ │ │ -Object used to compute and query ptex face indices. │ │ │ │ │ -Definition: ptexIndices.h:46 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel │ │ │ │ │ -An interface for accessing data in a specific level of a refined topology │ │ │ │ │ -hierarchy. │ │ │ │ │ -Definition: topologyLevel.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SCHEME_CATMARK │ │ │ │ │ +@ SCHEME_CATMARK │ │ │ │ │ +Definition: types.h:39 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory │ │ │ │ │ Factory for constructing TopologyRefiners from specific mesh classes. │ │ │ │ │ Definition: topologyRefinerFactory.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseFaces │ │ │ │ │ +static int getNumBaseFaces(TopologyRefiner const &newRefiner) │ │ │ │ │ +Definition: topologyRefinerFactory.h:436 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +assignComponentTopology │ │ │ │ │ +static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ +&mesh) │ │ │ │ │ +Specify the relationships between vertices, faces, etc. ie the face-vertices, │ │ │ │ │ +vertex-faces,... │ │ │ │ │ +Definition: topologyRefinerFactory.h:621 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +reportInvalidTopology │ │ │ │ │ +static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH │ │ │ │ │ +const &mesh) │ │ │ │ │ +(Optional) Control run-time topology validation and error reporting │ │ │ │ │ +Definition: topologyRefinerFactory.h:707 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseVertexFaceLocalIndices │ │ │ │ │ +static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner │ │ │ │ │ +&newRefiner, Index v) │ │ │ │ │ +Assign the local indices of a vertex within each of its incident faces. │ │ │ │ │ +Definition: topologyRefinerFactory.h:510 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseVertices │ │ │ │ │ +static int getNumBaseVertices(TopologyRefiner const &newRefiner) │ │ │ │ │ +Definition: topologyRefinerFactory.h:446 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setNumBaseEdgeFaces │ │ │ │ │ +static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int │ │ │ │ │ +count) │ │ │ │ │ +Specify the number of faces incident each edge. │ │ │ │ │ +Definition: topologyRefinerFactory.h:458 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseFaceVertices │ │ │ │ │ +static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f) │ │ │ │ │ +Assign the vertices incident each face. │ │ │ │ │ +Definition: topologyRefinerFactory.h:474 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseEdgeFaceLocalIndices │ │ │ │ │ +static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, │ │ │ │ │ +Index e) │ │ │ │ │ +Assign the local indices of an edge within each of its incident faces. │ │ │ │ │ +Definition: topologyRefinerFactory.h:505 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::populateBaseLevel │ │ │ │ │ +static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, │ │ │ │ │ +Options options) │ │ │ │ │ +Definition: topologyRefinerFactory.h:371 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +populateBaseLocalIndices │ │ │ │ │ +static void populateBaseLocalIndices(TopologyRefiner &newRefiner) │ │ │ │ │ +Determine all local indices by inspection (only for pure manifold meshes) │ │ │ │ │ +Definition: topologyRefinerFactory.h:527 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +assignComponentTags │ │ │ │ │ +static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh) │ │ │ │ │ +(Optional) Specify edge or vertex sharpness or face holes │ │ │ │ │ +Definition: topologyRefinerFactory.h:690 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +resizeComponentTopology │ │ │ │ │ +static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ +&mesh) │ │ │ │ │ +Specify the number of vertices, faces, face-vertices, etc. │ │ │ │ │ +Definition: topologyRefinerFactory.h:580 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setNumBaseVertexEdges │ │ │ │ │ +static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int │ │ │ │ │ +count) │ │ │ │ │ +Specify the number of edges incident each vertex. │ │ │ │ │ +Definition: topologyRefinerFactory.h:468 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::TopologyError │ │ │ │ │ +Vtr::internal::Level::TopologyError TopologyError │ │ │ │ │ +Definition: topologyRefinerFactory.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseFaceFVarValues │ │ │ │ │ +static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index │ │ │ │ │ +face, int channel=0) │ │ │ │ │ +Assign the face-varying values for the corners of each face. │ │ │ │ │ +Definition: topologyRefinerFactory.h:573 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseEdgeFaces │ │ │ │ │ +static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e) │ │ │ │ │ +Assign the faces incident each edge. │ │ │ │ │ +Definition: topologyRefinerFactory.h:489 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setNumBaseVertexFaces │ │ │ │ │ +static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int │ │ │ │ │ +count) │ │ │ │ │ +Specify the number of faces incident each vertex. │ │ │ │ │ +Definition: topologyRefinerFactory.h:463 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +assignFaceVaryingTopology │ │ │ │ │ +static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ +&mesh) │ │ │ │ │ +(Optional) Specify face-varying data per face │ │ │ │ │ +Definition: topologyRefinerFactory.h:674 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setBaseVertexSharpness │ │ │ │ │ +static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float │ │ │ │ │ +sharpness) │ │ │ │ │ +Assign a sharpness value to a given vertex. │ │ │ │ │ +Definition: topologyRefinerFactory.h:549 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseVertexEdgeLocalIndices │ │ │ │ │ +static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner │ │ │ │ │ +&newRefiner, Index v) │ │ │ │ │ +Assign the local indices of a vertex within each of its incident edges. │ │ │ │ │ +Definition: topologyRefinerFactory.h:515 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +getBaseEdgeVertices │ │ │ │ │ +static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e) │ │ │ │ │ +Assign the vertices incident each edge. │ │ │ │ │ +Definition: topologyRefinerFactory.h:484 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexFaces │ │ │ │ │ +static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v) │ │ │ │ │ +Assign the faces incident each vertex. │ │ │ │ │ +Definition: topologyRefinerFactory.h:494 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setBaseVertexNonManifold │ │ │ │ │ +static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool │ │ │ │ │ +b) │ │ │ │ │ +Tag a vertex as non-manifold. │ │ │ │ │ +Definition: topologyRefinerFactory.h:538 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseFaces │ │ │ │ │ +static void setNumBaseFaces(TopologyRefiner &newRefiner, int count) │ │ │ │ │ +Specify the number of faces to be accommodated. │ │ │ │ │ +Definition: topologyRefinerFactory.h:420 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseFaceEdges │ │ │ │ │ +static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f) │ │ │ │ │ +Assign the edges incident each face. │ │ │ │ │ +Definition: topologyRefinerFactory.h:479 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setNumBaseFaceVertices │ │ │ │ │ +static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int │ │ │ │ │ +count) │ │ │ │ │ +Specify the number of vertices incident each face. │ │ │ │ │ +Definition: topologyRefinerFactory.h:452 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setBaseEdgeSharpness │ │ │ │ │ +static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float │ │ │ │ │ +sharpness) │ │ │ │ │ +Assign a sharpness value to a given edge. │ │ │ │ │ +Definition: topologyRefinerFactory.h:544 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +setBaseEdgeNonManifold │ │ │ │ │ +static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool │ │ │ │ │ +b) │ │ │ │ │ +Tag an edge as non-manifold. │ │ │ │ │ +Definition: topologyRefinerFactory.h:533 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseEdges │ │ │ │ │ +static void setNumBaseEdges(TopologyRefiner &newRefiner, int count) │ │ │ │ │ +Specify the number of edges to be accommodated. │ │ │ │ │ +Definition: topologyRefinerFactory.h:425 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Create │ │ │ │ │ +static TopologyRefiner * Create(MESH const &mesh, Options options=Options()) │ │ │ │ │ +Instantiates a TopologyRefiner from client-provided topological representation. │ │ │ │ │ +Definition: topologyRefinerFactory.h:346 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::findBaseEdge │ │ │ │ │ +static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index │ │ │ │ │ +v1) │ │ │ │ │ +Identify an edge to be assigned a sharpness value given a vertex pair. │ │ │ │ │ +Definition: topologyRefinerFactory.h:521 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexEdges │ │ │ │ │ +static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v) │ │ │ │ │ +Assign the edges incident each vertex. │ │ │ │ │ +Definition: topologyRefinerFactory.h:499 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ +createBaseFVarChannel │ │ │ │ │ +static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues) │ │ │ │ │ +Create a new face-varying channel with the given number of values. │ │ │ │ │ +Definition: topologyRefinerFactory.h:561 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseEdges │ │ │ │ │ +static int getNumBaseEdges(TopologyRefiner const &newRefiner) │ │ │ │ │ +Definition: topologyRefinerFactory.h:441 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseVertices │ │ │ │ │ +static void setNumBaseVertices(TopologyRefiner &newRefiner, int count) │ │ │ │ │ +Specify the number of vertices to be accommodated. │ │ │ │ │ +Definition: topologyRefinerFactory.h:430 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseFaceHole │ │ │ │ │ +static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole) │ │ │ │ │ +Tag a face as a hole. │ │ │ │ │ +Definition: topologyRefinerFactory.h:554 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner │ │ │ │ │ Stores topology data for a specified set of refinement options. │ │ │ │ │ Definition: topologyRefiner.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::TopologyRefiner │ │ │ │ │ -TopologyRefiner(TopologyRefiner const &source) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetMaxValence │ │ │ │ │ -int GetMaxValence() const │ │ │ │ │ -Returns the maximum vertex valence in all levels. │ │ │ │ │ -Definition: topologyRefiner.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getLevel │ │ │ │ │ -Vtr::internal::Level const & getLevel(int l) const │ │ │ │ │ -Definition: topologyRefiner.h:237 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::HasHoles │ │ │ │ │ -bool HasHoles() const │ │ │ │ │ -Returns true if faces have been tagged as holes. │ │ │ │ │ -Definition: topologyRefiner.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumLevels │ │ │ │ │ -int GetNumLevels() const │ │ │ │ │ -Returns the number of refinement levels. │ │ │ │ │ -Definition: topologyRefiner.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFVarValuesTotal │ │ │ │ │ -int GetNumFVarValuesTotal(int channel=0) const │ │ │ │ │ -Returns the total number of face-varying values in all levels. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getRefinement │ │ │ │ │ -Vtr::internal::Refinement const & getRefinement(int l) const │ │ │ │ │ -Definition: topologyRefiner.h:240 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetSchemeOptions │ │ │ │ │ -Sdc::Options GetSchemeOptions() const │ │ │ │ │ -Returns the subdivision options. │ │ │ │ │ -Definition: topologyRefiner.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getLevel │ │ │ │ │ -Vtr::internal::Level & getLevel(int l) │ │ │ │ │ -Definition: topologyRefiner.h:236 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::IsUniform │ │ │ │ │ -bool IsUniform() const │ │ │ │ │ -Returns true if uniform refinement has been applied. │ │ │ │ │ -Definition: topologyRefiner.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetSchemeType │ │ │ │ │ -Sdc::SchemeType GetSchemeType() const │ │ │ │ │ -Returns the subdivision scheme. │ │ │ │ │ -Definition: topologyRefiner.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetMaxLevel │ │ │ │ │ -int GetMaxLevel() const │ │ │ │ │ -Returns the highest level of refinement. │ │ │ │ │ -Definition: topologyRefiner.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::TopologyRefiner │ │ │ │ │ -TopologyRefiner(Sdc::SchemeType type, Sdc::Options options=Sdc::Options()) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumEdgesTotal │ │ │ │ │ -int GetNumEdgesTotal() const │ │ │ │ │ -Returns the total number of edges in all levels. │ │ │ │ │ -Definition: topologyRefiner.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::PatchBuilder │ │ │ │ │ -friend class PatchBuilder │ │ │ │ │ -Definition: topologyRefiner.h:226 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Returns the number of face-varying channels in the tables. │ │ │ │ │ -Definition: topologyRefiner.h:293 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetUniformOptions │ │ │ │ │ -UniformOptions GetUniformOptions() const │ │ │ │ │ -Returns the options specified on refinement. │ │ │ │ │ -Definition: topologyRefiner.h:149 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFacesTotal │ │ │ │ │ -int GetNumFacesTotal() const │ │ │ │ │ -Returns the total number of edges in all levels. │ │ │ │ │ -Definition: topologyRefiner.h:89 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFaceVerticesTotal │ │ │ │ │ -int GetNumFaceVerticesTotal() const │ │ │ │ │ -Returns the total number of face vertices in all levels. │ │ │ │ │ -Definition: topologyRefiner.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getRefinement │ │ │ │ │ -Vtr::internal::Refinement & getRefinement(int l) │ │ │ │ │ -Definition: topologyRefiner.h:239 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineUniform │ │ │ │ │ -void RefineUniform(UniformOptions options) │ │ │ │ │ -Refine the topology uniformly. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::~TopologyRefiner │ │ │ │ │ -~TopologyRefiner() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::PatchTableBuilder │ │ │ │ │ -friend class PatchTableBuilder │ │ │ │ │ -Definition: topologyRefiner.h:225 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetLevel │ │ │ │ │ -TopologyLevel const & GetLevel(int level) const │ │ │ │ │ -Returns a handle to access data specific to a particular level. │ │ │ │ │ -Definition: topologyRefiner.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumVerticesTotal │ │ │ │ │ -int GetNumVerticesTotal() const │ │ │ │ │ -Returns the total number of vertices in all levels. │ │ │ │ │ -Definition: topologyRefiner.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::Unrefine │ │ │ │ │ -void Unrefine() │ │ │ │ │ -Unrefine the topology, keeping only the base level. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetAdaptiveOptions │ │ │ │ │ -AdaptiveOptions GetAdaptiveOptions() const │ │ │ │ │ -Returns the options specified on refinement. │ │ │ │ │ -Definition: topologyRefiner.h:196 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner:: │ │ │ │ │ -GetFVarLinearInterpolation │ │ │ │ │ -Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) │ │ │ │ │ -const │ │ │ │ │ -Returns the face-varying interpolation rule set for a given channel. │ │ │ │ │ -Definition: topologyRefiner.h:298 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineAdaptive │ │ │ │ │ -void RefineAdaptive(AdaptiveOptions options, ConstIndexArray │ │ │ │ │ -selectedFaces=ConstIndexArray()) │ │ │ │ │ -Feature Adaptive topology refinement. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions │ │ │ │ │ -Uniform refinement options. │ │ │ │ │ -Definition: topologyRefiner.h:118 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ -refinementLevel │ │ │ │ │ -unsigned int refinementLevel │ │ │ │ │ -Number of refinement iterations. │ │ │ │ │ -Definition: topologyRefiner.h:128 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ -orderVerticesFromFacesFirst │ │ │ │ │ -unsigned int orderVerticesFromFacesFirst │ │ │ │ │ -Definition: topologyRefiner.h:130 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ -SetRefinementLevel │ │ │ │ │ -void SetRefinementLevel(int level) │ │ │ │ │ -Set uniform refinement level. │ │ │ │ │ -Definition: topologyRefiner.h:126 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ -fullTopologyInLastLevel │ │ │ │ │ -unsigned int fullTopologyInLastLevel │ │ │ │ │ -Definition: topologyRefiner.h:131 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ -UniformOptions │ │ │ │ │ -UniformOptions(int level) │ │ │ │ │ -Definition: topologyRefiner.h:120 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions │ │ │ │ │ -Adaptive refinement options. │ │ │ │ │ -Definition: topologyRefiner.h:156 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -secondaryLevel │ │ │ │ │ -unsigned int secondaryLevel │ │ │ │ │ -Definition: topologyRefiner.h:174 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -orderVerticesFromFacesFirst │ │ │ │ │ -unsigned int orderVerticesFromFacesFirst │ │ │ │ │ -Definition: topologyRefiner.h:182 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -AdaptiveOptions │ │ │ │ │ -AdaptiveOptions(int level) │ │ │ │ │ -Definition: topologyRefiner.h:158 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -isolationLevel │ │ │ │ │ -unsigned int isolationLevel │ │ │ │ │ -Definition: topologyRefiner.h:172 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -useSingleCreasePatch │ │ │ │ │ -unsigned int useSingleCreasePatch │ │ │ │ │ -Definition: topologyRefiner.h:176 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -useInfSharpPatch │ │ │ │ │ -unsigned int useInfSharpPatch │ │ │ │ │ -Definition: topologyRefiner.h:178 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -SetIsolationLevel │ │ │ │ │ -void SetIsolationLevel(int level) │ │ │ │ │ -Set isolation level. │ │ │ │ │ -Definition: topologyRefiner.h:167 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -considerFVarChannels │ │ │ │ │ -unsigned int considerFVarChannels │ │ │ │ │ -Definition: topologyRefiner.h:180 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ -SetSecondaryLevel │ │ │ │ │ -void SetSecondaryLevel(int level) │ │ │ │ │ -Set secondary isolation level. │ │ │ │ │ -Definition: topologyRefiner.h:170 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase │ │ │ │ │ Private base class of Factories for constructing TopologyRefiners. │ │ │ │ │ Definition: topologyRefinerFactory.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ +prepareComponentTopologyAssignment │ │ │ │ │ +static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool │ │ │ │ │ +fullValidation, TopologyCallback callback, void const *callbackData) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ +TopologyCallback │ │ │ │ │ +Vtr::internal::Level::ValidationCallback TopologyCallback │ │ │ │ │ +Definition: topologyRefinerFactory.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ +prepareComponentTagsAndSharpness │ │ │ │ │ +static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ +prepareComponentTopologySizing │ │ │ │ │ +static bool prepareComponentTopologySizing(TopologyRefiner &refiner) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ +prepareFaceVaryingChannels │ │ │ │ │ +static bool prepareFaceVaryingChannels(TopologyRefiner &refiner) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options │ │ │ │ │ +Options related to the construction of each TopologyRefiner. │ │ │ │ │ +Definition: topologyRefinerFactory.h:84 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::Options │ │ │ │ │ +Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options │ │ │ │ │ +sdcOptions=Sdc::Options()) │ │ │ │ │ +Definition: topologyRefinerFactory.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ +schemeOptions │ │ │ │ │ +Sdc::Options schemeOptions │ │ │ │ │ +Definition: topologyRefinerFactory.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ +schemeType │ │ │ │ │ +Sdc::SchemeType schemeType │ │ │ │ │ +The subdivision scheme type identifier. │ │ │ │ │ +Definition: topologyRefinerFactory.h:91 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ +validateFullTopology │ │ │ │ │ +unsigned int validateFullTopology │ │ │ │ │ +Definition: topologyRefinerFactory.h:94 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ All supported options applying to subdivision scheme. │ │ │ │ │ Definition: options.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ -FVarLinearInterpolation │ │ │ │ │ -Definition: options.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray │ │ │ │ │ -Definition: array.h:53 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation │ │ │ │ │ +void SetFVarLinearInterpolation(FVarLinearInterpolation b) │ │ │ │ │ +Set face-varying interpolation rule. │ │ │ │ │ +Definition: options.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation │ │ │ │ │ +FVarLinearInterpolation GetFVarLinearInterpolation() const │ │ │ │ │ +Get face-varying interpolation rule. │ │ │ │ │ +Definition: options.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Array │ │ │ │ │ +Definition: array.h:105 │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * topologyRefiner.h │ │ │ │ │ + * topologyRefinerFactory.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00707.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/topologyRefinerFactory.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/far/topologyRefiner.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,49 +83,53 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
topologyRefinerFactory.h File Reference
│ │ │ │ +
topologyRefiner.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ -#include "../far/error.h"
│ │ │ │ -#include <cassert>
│ │ │ │ +#include "../sdc/types.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ +#include "../far/types.h"
│ │ │ │ +#include "../far/topologyLevel.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  TopologyRefinerFactoryBase
 Private base class of Factories for constructing TopologyRefiners. More...
class  TopologyRefiner
 Stores topology data for a specified set of refinement options. More...
 
class  TopologyRefinerFactory< MESH >
 Factory for constructing TopologyRefiners from specific mesh classes. More...
struct  TopologyRefiner::UniformOptions
 Uniform refinement options. More...
 
struct  TopologyRefinerFactory< MESH >::Options
 Options related to the construction of each TopologyRefiner. More...
struct  TopologyRefiner::AdaptiveOptions
 Adaptive refinement options. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,36 +5,39 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -topologyRefinerFactory.h File Reference │ │ │ │ │ +topologyRefiner.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/topologyRefiner.h" │ │ │ │ │ -#include "../far/error.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../sdc/types.h" │ │ │ │ │ +#include "../sdc/options.h" │ │ │ │ │ +#include "../far/types.h" │ │ │ │ │ +#include "../far/topologyLevel.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  TopologyRefinerFactoryBase │ │ │ │ │ -  Private base class of Factories for constructing TopologyRefiners. │ │ │ │ │ + class  TopologyRefiner │ │ │ │ │ +  Stores topology data for a specified set of refinement options. │ │ │ │ │ More... │ │ │ │ │   │ │ │ │ │ - class  TopologyRefinerFactory<_MESH_> │ │ │ │ │ -  Factory for constructing TopologyRefiners from specific mesh classes. │ │ │ │ │ - More... │ │ │ │ │ +struct  TopologyRefiner::UniformOptions │ │ │ │ │ +  Uniform refinement options. More... │ │ │ │ │   │ │ │ │ │ -struct  TopologyRefinerFactory<_MESH_>::Options │ │ │ │ │ -  Options related to the construction of each TopologyRefiner. More... │ │ │ │ │ +struct  TopologyRefiner::AdaptiveOptions │ │ │ │ │ +  Adaptive refinement options. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr │ │ │ │ │ +  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * topologyRefinerFactory.h │ │ │ │ │ + * topologyRefiner.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00707.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,5 +1,5 @@ │ │ │ │ │ var a00707 = [ │ │ │ │ │ - ["TopologyRefinerFactoryBase", "a01125.html", "a01125"], │ │ │ │ │ - ["TopologyRefinerFactory< MESH >", "a01109.html", "a01109"], │ │ │ │ │ - ["TopologyRefinerFactory< MESH >::Options", "a01129.html", "a01129"] │ │ │ │ │ + ["TopologyRefiner", "a01113.html", "a01113"], │ │ │ │ │ + ["TopologyRefiner::UniformOptions", "a01117.html", "a01117"], │ │ │ │ │ + ["TopologyRefiner::AdaptiveOptions", "a01121.html", "a01121"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00707_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/topologyRefinerFactory.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/far/topologyRefiner.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
topologyRefinerFactory.h
│ │ │ │ +
topologyRefiner.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -106,616 +106,291 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
│ │ │ │ -
25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
│ │ │ │ +
24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
│ │ │ │ +
25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
│ │ │ │
26
│ │ │ │
27#include "../version.h"
│ │ │ │
28
│ │ │ │ -
29#include "../far/topologyRefiner.h"
│ │ │ │ -
30#include "../far/error.h"
│ │ │ │ -
31
│ │ │ │ -
32#include <cassert>
│ │ │ │ +
29#include "../sdc/types.h"
│ │ │ │ +
30#include "../sdc/options.h"
│ │ │ │ +
31#include "../far/types.h"
│ │ │ │ +
32#include "../far/topologyLevel.h"
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
34#include <vector>
│ │ │ │ +
35
│ │ │ │
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38
│ │ │ │ -
46//
│ │ │ │ - │ │ │ │ -
48protected:
│ │ │ │ -
49
│ │ │ │ -
50 //
│ │ │ │ -
51 // Protected methods invoked by the subclass template to verify and process each
│ │ │ │ -
52 // stage of construction implemented by the subclass:
│ │ │ │ -
53 //
│ │ │ │ -
54 typedef Vtr::internal::Level::ValidationCallback TopologyCallback;
│ │ │ │ -
55
│ │ │ │ - │ │ │ │ -
57 static bool prepareComponentTopologyAssignment(TopologyRefiner& refiner, bool fullValidation,
│ │ │ │ -
58 TopologyCallback callback, void const * callbackData);
│ │ │ │ - │ │ │ │ - │ │ │ │ -
61};
│ │ │ │ -
62
│ │ │ │ +
37namespace OpenSubdiv {
│ │ │ │ +
38namespace OPENSUBDIV_VERSION {
│ │ │ │ +
39
│ │ │ │ +
40namespace Vtr { namespace internal { class SparseSelector; } }
│ │ │ │ +
41namespace Far { namespace internal { class FeatureMask; } }
│ │ │ │ +
42
│ │ │ │ +
43namespace Far {
│ │ │ │ +
44
│ │ │ │ +
45template <typename REAL> class PrimvarRefinerReal;
│ │ │ │ +
46template <class MESH> class TopologyRefinerFactory;
│ │ │ │ +
47
│ │ │ │ + │ │ │ │ +
52
│ │ │ │ +
53public:
│ │ │ │ +
54
│ │ │ │ + │ │ │ │ +
57
│ │ │ │ + │ │ │ │ +
60
│ │ │ │ +
62 Sdc::SchemeType GetSchemeType() const { return _subdivType; }
│ │ │ │
63
│ │ │ │ -
77template <class MESH>
│ │ │ │ - │ │ │ │ -
79
│ │ │ │ -
80public:
│ │ │ │ +
65 Sdc::Options GetSchemeOptions() const { return _subdivOptions; }
│ │ │ │ +
66
│ │ │ │ +
68 bool IsUniform() const { return _isUniform; }
│ │ │ │ +
69
│ │ │ │ +
71 int GetNumLevels() const { return (int)_farLevels.size(); }
│ │ │ │ +
72
│ │ │ │ +
74 int GetMaxLevel() const { return _maxLevel; }
│ │ │ │ +
75
│ │ │ │ +
77 int GetMaxValence() const { return _maxValence; }
│ │ │ │ +
78
│ │ │ │ +
80 bool HasHoles() const { return _hasHoles; }
│ │ │ │
81
│ │ │ │ -
84 struct Options {
│ │ │ │ -
85
│ │ │ │ - │ │ │ │ -
87 schemeType(sdcType),
│ │ │ │ -
88 schemeOptions(sdcOptions),
│ │ │ │ -
89 validateFullTopology(false) { }
│ │ │ │ +
83 int GetNumVerticesTotal() const { return _totalVertices; }
│ │ │ │ +
84
│ │ │ │ +
86 int GetNumEdgesTotal() const { return _totalEdges; }
│ │ │ │ +
87
│ │ │ │ +
89 int GetNumFacesTotal() const { return _totalFaces; }
│ │ │ │
90
│ │ │ │ - │ │ │ │ - │ │ │ │ -
94 unsigned int validateFullTopology : 1;
│ │ │ │ -
97 };
│ │ │ │ +
92 int GetNumFaceVerticesTotal() const { return _totalFaceVertices; }
│ │ │ │ +
93
│ │ │ │ +
95 TopologyLevel const & GetLevel(int level) const { return _farLevels[level]; }
│ │ │ │ +
96
│ │ │ │
98
│ │ │ │ -
108 //
│ │ │ │ -
113 static TopologyRefiner* Create(MESH const& mesh, Options options = Options());
│ │ │ │ -
114
│ │ │ │ -
128 static TopologyRefiner* Create(TopologyRefiner const & baseLevel);
│ │ │ │ -
129
│ │ │ │ -
130protected:
│ │ │ │ -
131 typedef Vtr::internal::Level::TopologyError TopologyError;
│ │ │ │ -
132
│ │ │ │ -
134
│ │ │ │ -
149
│ │ │ │ -
151 static bool resizeComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ -
152
│ │ │ │ -
155 static bool assignComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ -
156
│ │ │ │ -
158 static bool assignComponentTags(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ -
159
│ │ │ │ -
161 static bool assignFaceVaryingTopology(TopologyRefiner& newRefiner, MESH const& mesh);
│ │ │ │ -
162
│ │ │ │ -
164 static void reportInvalidTopology(TopologyError errCode, char const * msg, MESH const& mesh);
│ │ │ │ +
100
│ │ │ │ +
101 //
│ │ │ │ +
102 // Uniform refinement
│ │ │ │ +
103 //
│ │ │ │ +
104
│ │ │ │ + │ │ │ │ +
119
│ │ │ │ +
120 UniformOptions(int level) :
│ │ │ │ +
121 refinementLevel(level & 0xf),
│ │ │ │ + │ │ │ │ +
123 fullTopologyInLastLevel(false) { }
│ │ │ │ +
124
│ │ │ │ +
126 void SetRefinementLevel(int level) { refinementLevel = level & 0xf; }
│ │ │ │ +
127
│ │ │ │ +
128 unsigned int refinementLevel:4,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
134 };
│ │ │ │ +
135
│ │ │ │ + │ │ │ │ +
147
│ │ │ │ +
149 UniformOptions GetUniformOptions() const { return _uniformOptions; }
│ │ │ │ +
150
│ │ │ │ +
151 //
│ │ │ │ +
152 // Adaptive refinement
│ │ │ │ +
153 //
│ │ │ │ +
154
│ │ │ │ + │ │ │ │ +
157
│ │ │ │ +
158 AdaptiveOptions(int level) :
│ │ │ │ +
159 isolationLevel(level & 0xf),
│ │ │ │ +
160 secondaryLevel(0xf),
│ │ │ │ + │ │ │ │ +
162 useInfSharpPatch(false),
│ │ │ │ + │ │ │ │ + │ │ │ │
165
│ │ │ │ -
167
│ │ │ │ -
168protected:
│ │ │ │ -
170
│ │ │ │ -
187
│ │ │ │ -
189 static void setNumBaseVertices(TopologyRefiner & newRefiner, int count);
│ │ │ │ -
190
│ │ │ │ -
192 static void setNumBaseFaces(TopologyRefiner & newRefiner, int count);
│ │ │ │ -
193
│ │ │ │ -
195 static void setNumBaseEdges(TopologyRefiner & newRefiner, int count);
│ │ │ │ -
196
│ │ │ │ -
198 static void setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, int count);
│ │ │ │ -
199
│ │ │ │ -
201 static void setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int count);
│ │ │ │ -
202
│ │ │ │ -
204 static void setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, int count);
│ │ │ │ +
167 void SetIsolationLevel(int level) { isolationLevel = level & 0xf; }
│ │ │ │ +
168
│ │ │ │ +
170 void SetSecondaryLevel(int level) { secondaryLevel = level & 0xf; }
│ │ │ │ +
171
│ │ │ │ +
172 unsigned int isolationLevel:4;
│ │ │ │ +
174 unsigned int secondaryLevel:4;
│ │ │ │ +
176 unsigned int useSingleCreasePatch:1;
│ │ │ │ +
178 unsigned int useInfSharpPatch:1;
│ │ │ │ +
180 unsigned int considerFVarChannels:1;
│ │ │ │ + │ │ │ │ +
184 };
│ │ │ │ +
185
│ │ │ │ + │ │ │ │ +
193 ConstIndexArray selectedFaces = ConstIndexArray());
│ │ │ │ +
194
│ │ │ │ +
196 AdaptiveOptions GetAdaptiveOptions() const { return _adaptiveOptions; }
│ │ │ │ +
197
│ │ │ │ +
199 void Unrefine();
│ │ │ │ +
200
│ │ │ │ +
201
│ │ │ │ +
203
│ │ │ │
205
│ │ │ │ -
207 static void setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, int count);
│ │ │ │ +
207 int GetNumFVarChannels() const;
│ │ │ │
208
│ │ │ │ -
209 static int getNumBaseVertices(TopologyRefiner const & newRefiner);
│ │ │ │ -
210 static int getNumBaseFaces(TopologyRefiner const & newRefiner);
│ │ │ │ -
211 static int getNumBaseEdges(TopologyRefiner const & newRefiner);
│ │ │ │ -
213
│ │ │ │ -
215
│ │ │ │ -
237
│ │ │ │ -
239 static IndexArray getBaseFaceVertices(TopologyRefiner & newRefiner, Index f);
│ │ │ │ -
240
│ │ │ │ -
242 static IndexArray getBaseFaceEdges(TopologyRefiner & newRefiner, Index f);
│ │ │ │ -
243
│ │ │ │ -
245 static IndexArray getBaseEdgeVertices(TopologyRefiner & newRefiner, Index e);
│ │ │ │ + │ │ │ │ +
211
│ │ │ │ +
213 int GetNumFVarValuesTotal(int channel = 0) const;
│ │ │ │ +
214
│ │ │ │ +
216
│ │ │ │ +
217protected:
│ │ │ │ +
218
│ │ │ │ +
219 //
│ │ │ │ +
220 // Lower level protected methods intended strictly for internal use:
│ │ │ │ +
221 //
│ │ │ │ +
222 template <class MESH>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
225 friend class PatchTableBuilder;
│ │ │ │ +
226 friend class PatchBuilder;
│ │ │ │ +
227 friend class PtexIndices;
│ │ │ │ +
228 template <typename REAL>
│ │ │ │ +
229 friend class PrimvarRefinerReal;
│ │ │ │ +
230
│ │ │ │ +
231 // Copy constructor exposed via the factory class:
│ │ │ │ + │ │ │ │ +
233
│ │ │ │ +
234public:
│ │ │ │ +
235 // Levels and Refinements available internally (avoids need for more friends)
│ │ │ │ +
236 Vtr::internal::Level & getLevel(int l) { return *_levels[l]; }
│ │ │ │ +
237 Vtr::internal::Level const & getLevel(int l) const { return *_levels[l]; }
│ │ │ │ +
238
│ │ │ │ +
239 Vtr::internal::Refinement & getRefinement(int l) { return *_refinements[l]; }
│ │ │ │ +
240 Vtr::internal::Refinement const & getRefinement(int l) const { return *_refinements[l]; }
│ │ │ │ +
241
│ │ │ │ +
242private:
│ │ │ │ +
243 // Not default constructible or copyable:
│ │ │ │ +
244 TopologyRefiner() : _uniformOptions(0), _adaptiveOptions(0) { }
│ │ │ │ +
245 TopologyRefiner & operator=(TopologyRefiner const &) { return *this; }
│ │ │ │
246
│ │ │ │ -
248 static IndexArray getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e);
│ │ │ │ -
249
│ │ │ │ -
251 static IndexArray getBaseVertexFaces(TopologyRefiner & newRefiner, Index v);
│ │ │ │ +
247 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& selector,
│ │ │ │ +
248 internal::FeatureMask const & mask,
│ │ │ │ +
249 ConstIndexArray selectedFaces);
│ │ │ │ +
250 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector,
│ │ │ │ +
251 ConstIndexArray selectedFaces);
│ │ │ │
252
│ │ │ │ -
254 static IndexArray getBaseVertexEdges(TopologyRefiner & newRefiner, Index v);
│ │ │ │ +
253 void initializeInventory();
│ │ │ │ +
254 void updateInventory(Vtr::internal::Level const & newLevel);
│ │ │ │
255
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
262
│ │ │ │ -
264 static void populateBaseLocalIndices(TopologyRefiner & newRefiner);
│ │ │ │ -
265
│ │ │ │ -
267 static void setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, bool b);
│ │ │ │ -
268
│ │ │ │ -
270 static void setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index v, bool b);
│ │ │ │ -
272
│ │ │ │ +
256 void appendLevel(Vtr::internal::Level & newLevel);
│ │ │ │ +
257 void appendRefinement(Vtr::internal::Refinement & newRefinement);
│ │ │ │ +
258 void assembleFarLevels();
│ │ │ │ +
259
│ │ │ │ +
260private:
│ │ │ │ +
261
│ │ │ │ +
262 Sdc::SchemeType _subdivType;
│ │ │ │ +
263 Sdc::Options _subdivOptions;
│ │ │ │ +
264
│ │ │ │ +
265 unsigned int _isUniform : 1;
│ │ │ │ +
266 unsigned int _hasHoles : 1;
│ │ │ │ +
267 unsigned int _hasIrregFaces : 1;
│ │ │ │ +
268 unsigned int _regFaceSize : 3;
│ │ │ │ +
269 unsigned int _maxLevel : 4;
│ │ │ │ +
270
│ │ │ │ +
271 // Options assigned on refinement:
│ │ │ │ +
272 UniformOptions _uniformOptions;
│ │ │ │ +
273 AdaptiveOptions _adaptiveOptions;
│ │ │ │
274
│ │ │ │ -
283
│ │ │ │ -
285 static Index findBaseEdge(TopologyRefiner const & newRefiner, Index v0, Index v1);
│ │ │ │ -
286
│ │ │ │ -
288 static void setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, float sharpness);
│ │ │ │ -
289
│ │ │ │ -
291 static void setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, float sharpness);
│ │ │ │ -
292
│ │ │ │ -
294 static void setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool isHole);
│ │ │ │ -
296
│ │ │ │ -
298
│ │ │ │ +
275 // Cumulative properties of all levels:
│ │ │ │ +
276 int _totalVertices;
│ │ │ │ +
277 int _totalEdges;
│ │ │ │ +
278 int _totalFaces;
│ │ │ │ +
279 int _totalFaceVertices;
│ │ │ │ +
280 int _maxValence;
│ │ │ │ +
281
│ │ │ │ +
282 // Note the base level may be shared with another instance
│ │ │ │ +
283 bool _baseLevelOwned;
│ │ │ │ +
284
│ │ │ │ +
285 std::vector<Vtr::internal::Level *> _levels;
│ │ │ │ +
286 std::vector<Vtr::internal::Refinement *> _refinements;
│ │ │ │ +
287
│ │ │ │ +
288 std::vector<TopologyLevel> _farLevels;
│ │ │ │ +
289};
│ │ │ │ +
290
│ │ │ │ +
291
│ │ │ │ +
292inline int
│ │ │ │ + │ │ │ │ +
294
│ │ │ │ +
295 return _levels[0]->getNumFVarChannels();
│ │ │ │ +
296}
│ │ │ │ + │ │ │ │ + │ │ │ │ +
299
│ │ │ │ +
300 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation();
│ │ │ │ +
301}
│ │ │ │ +
302
│ │ │ │ +
303} // end namespace Far
│ │ │ │ +
304
│ │ │ │ +
305} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
306using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
307} // end namespace OpenSubdiv
│ │ │ │
308
│ │ │ │ -
310 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues);
│ │ │ │ -
311
│ │ │ │ -
313 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues, Sdc::Options const& fvarOptions);
│ │ │ │ -
314
│ │ │ │ -
316 static IndexArray getBaseFaceFVarValues(TopologyRefiner & newRefiner, Index face, int channel = 0);
│ │ │ │ -
317
│ │ │ │ -
319
│ │ │ │ -
320protected:
│ │ │ │ -
321 //
│ │ │ │ -
322 // Not to be specialized:
│ │ │ │ -
323 //
│ │ │ │ -
324 static bool populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, Options options);
│ │ │ │ -
325
│ │ │ │ -
326private:
│ │ │ │ -
327 //
│ │ │ │ -
328 // An oversight in the interfaces of the error reporting function between the factory
│ │ │ │ -
329 // class and the Vtr::Level requires this adapter function to avoid warnings.
│ │ │ │ -
330 //
│ │ │ │ -
331 // The static class method requires a reference as the MESH argument, but the interface
│ │ │ │ -
332 // for Vtr::Level requires a pointer (void*). So this adapter with a MESH* argument is
│ │ │ │ -
333 // used to effectively cast the function pointer required by Vtr::Level error reporting:
│ │ │ │ -
334 //
│ │ │ │ -
335 static void reportInvalidTopologyAdapter(TopologyError errCode, char const * msg, MESH const * mesh) {
│ │ │ │ -
336 reportInvalidTopology(errCode, msg, *mesh);
│ │ │ │ -
337 }
│ │ │ │ -
338};
│ │ │ │ -
339
│ │ │ │ -
340
│ │ │ │ -
341//
│ │ │ │ -
342// Generic implementations:
│ │ │ │ -
343//
│ │ │ │ -
344template <class MESH>
│ │ │ │ -
345TopologyRefiner*
│ │ │ │ - │ │ │ │ -
347
│ │ │ │ -
348 TopologyRefiner * refiner = new TopologyRefiner(options.schemeType, options.schemeOptions);
│ │ │ │ -
349
│ │ │ │ -
350 if (! populateBaseLevel(*refiner, mesh, options)) {
│ │ │ │ -
351 delete refiner;
│ │ │ │ -
352 return 0;
│ │ │ │ -
353 }
│ │ │ │ -
354
│ │ │ │ -
355 // Eventually want to move the Refiner's inventory initialization here. Currently it
│ │ │ │ -
356 // is handled after topology assignment, but if the inventory is to include additional
│ │ │ │ -
357 // features (e.g. holes, etc.) it is better off deferred to here.
│ │ │ │ -
358
│ │ │ │ -
359 return refiner;
│ │ │ │ -
360}
│ │ │ │ -
361
│ │ │ │ -
362template <class MESH>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
365
│ │ │ │ -
366 return new TopologyRefiner(source);
│ │ │ │ -
367}
│ │ │ │ -
368
│ │ │ │ -
369template <class MESH>
│ │ │ │ -
370bool
│ │ │ │ - │ │ │ │ -
372
│ │ │ │ -
373 //
│ │ │ │ -
374 // Construction of a specialized topology refiner involves four steps, each of which
│ │ │ │ -
375 // involves a method specialized for MESH followed by one that takes an action in
│ │ │ │ -
376 // response to it or in preparation for the next step.
│ │ │ │ -
377 //
│ │ │ │ -
378 // Both the specialized methods and those that follow them may find fault in the
│ │ │ │ -
379 // construction and trigger failure at any time:
│ │ │ │ -
380 //
│ │ │ │ -
381
│ │ │ │ -
382 //
│ │ │ │ -
383 // Sizing of the topology -- this is a required specialization for MESH. This defines
│ │ │ │ -
384 // an inventory of all components and their relations that is used to allocate buffers
│ │ │ │ -
385 // to be efficiently populated in the subsequent topology assignment step.
│ │ │ │ -
386 //
│ │ │ │ -
387 if (! resizeComponentTopology(refiner, mesh)) return false;
│ │ │ │ -
388 if (! prepareComponentTopologySizing(refiner)) return false;
│ │ │ │ -
389
│ │ │ │ -
390 //
│ │ │ │ -
391 // Assignment of the topology -- this is a required specialization for MESH. If edges
│ │ │ │ -
392 // are specified, all other topological relations are expected to be defined for them.
│ │ │ │ -
393 // Otherwise edges and remaining topology will be completed from the face-vertices:
│ │ │ │ -
394 //
│ │ │ │ -
395 bool validate = options.validateFullTopology;
│ │ │ │ -
396 TopologyCallback callback = reinterpret_cast<TopologyCallback>(reportInvalidTopologyAdapter);
│ │ │ │ -
397 void const * userData = &mesh;
│ │ │ │ -
398
│ │ │ │ -
399 if (! assignComponentTopology(refiner, mesh)) return false;
│ │ │ │ -
400 if (! prepareComponentTopologyAssignment(refiner, validate, callback, userData)) return false;
│ │ │ │ -
401
│ │ │ │ -
402 //
│ │ │ │ -
403 // User assigned and internal tagging of components -- an optional specialization for
│ │ │ │ -
404 // MESH. Allows the specification of sharpness values, holes, etc.
│ │ │ │ -
405 //
│ │ │ │ -
406 if (! assignComponentTags(refiner, mesh)) return false;
│ │ │ │ -
407 if (! prepareComponentTagsAndSharpness(refiner)) return false;
│ │ │ │ -
408
│ │ │ │ -
409 //
│ │ │ │ -
410 // Defining channels of face-varying primvar data -- an optional specialization for MESH.
│ │ │ │ -
411 //
│ │ │ │ -
412 if (! assignFaceVaryingTopology(refiner, mesh)) return false;
│ │ │ │ -
413 if (! prepareFaceVaryingChannels(refiner)) return false;
│ │ │ │ -
414
│ │ │ │ -
415 return true;
│ │ │ │ -
416}
│ │ │ │ -
417
│ │ │ │ -
418template <class MESH>
│ │ │ │ -
419inline void
│ │ │ │ - │ │ │ │ -
421 newRefiner._levels[0]->resizeFaces(count);
│ │ │ │ -
422}
│ │ │ │ -
423template <class MESH>
│ │ │ │ -
424inline void
│ │ │ │ - │ │ │ │ -
426 newRefiner._levels[0]->resizeEdges(count);
│ │ │ │ -
427}
│ │ │ │ -
428template <class MESH>
│ │ │ │ -
429inline void
│ │ │ │ - │ │ │ │ -
431 newRefiner._levels[0]->resizeVertices(count);
│ │ │ │ -
432}
│ │ │ │ -
433
│ │ │ │ -
434template <class MESH>
│ │ │ │ -
435inline int
│ │ │ │ - │ │ │ │ -
437 return newRefiner._levels[0]->getNumFaces();
│ │ │ │ -
438}
│ │ │ │ -
439template <class MESH>
│ │ │ │ -
440inline int
│ │ │ │ - │ │ │ │ -
442 return newRefiner._levels[0]->getNumEdges();
│ │ │ │ -
443}
│ │ │ │ -
444template <class MESH>
│ │ │ │ -
445inline int
│ │ │ │ - │ │ │ │ -
447 return newRefiner._levels[0]->getNumVertices();
│ │ │ │ -
448}
│ │ │ │ -
449
│ │ │ │ -
450template <class MESH>
│ │ │ │ -
451inline void
│ │ │ │ - │ │ │ │ -
453 newRefiner._levels[0]->resizeFaceVertices(f, count);
│ │ │ │ -
454 newRefiner._hasIrregFaces = newRefiner._hasIrregFaces || (count != newRefiner._regFaceSize);
│ │ │ │ -
455}
│ │ │ │ -
456template <class MESH>
│ │ │ │ -
457inline void
│ │ │ │ - │ │ │ │ -
459 newRefiner._levels[0]->resizeEdgeFaces(e, count);
│ │ │ │ -
460}
│ │ │ │ -
461template <class MESH>
│ │ │ │ -
462inline void
│ │ │ │ - │ │ │ │ -
464 newRefiner._levels[0]->resizeVertexFaces(v, count);
│ │ │ │ -
465}
│ │ │ │ -
466template <class MESH>
│ │ │ │ -
467inline void
│ │ │ │ - │ │ │ │ -
469 newRefiner._levels[0]->resizeVertexEdges(v, count);
│ │ │ │ -
470}
│ │ │ │ -
471
│ │ │ │ -
472template <class MESH>
│ │ │ │ -
473inline IndexArray
│ │ │ │ - │ │ │ │ -
475 return newRefiner._levels[0]->getFaceVertices(f);
│ │ │ │ -
476}
│ │ │ │ -
477template <class MESH>
│ │ │ │ -
478inline IndexArray
│ │ │ │ - │ │ │ │ -
480 return newRefiner._levels[0]->getFaceEdges(f);
│ │ │ │ -
481}
│ │ │ │ -
482template <class MESH>
│ │ │ │ -
483inline IndexArray
│ │ │ │ - │ │ │ │ -
485 return newRefiner._levels[0]->getEdgeVertices(e);
│ │ │ │ -
486}
│ │ │ │ -
487template <class MESH>
│ │ │ │ -
488inline IndexArray
│ │ │ │ - │ │ │ │ -
490 return newRefiner._levels[0]->getEdgeFaces(e);
│ │ │ │ -
491}
│ │ │ │ -
492template <class MESH>
│ │ │ │ -
493inline IndexArray
│ │ │ │ - │ │ │ │ -
495 return newRefiner._levels[0]->getVertexFaces(v);
│ │ │ │ -
496}
│ │ │ │ -
497template <class MESH>
│ │ │ │ -
498inline IndexArray
│ │ │ │ - │ │ │ │ -
500 return newRefiner._levels[0]->getVertexEdges(v);
│ │ │ │ -
501}
│ │ │ │ -
502
│ │ │ │ -
503template <class MESH>
│ │ │ │ -
504inline LocalIndexArray
│ │ │ │ - │ │ │ │ -
506 return newRefiner._levels[0]->getEdgeFaceLocalIndices(e);
│ │ │ │ -
507}
│ │ │ │ -
508template <class MESH>
│ │ │ │ -
509inline LocalIndexArray
│ │ │ │ - │ │ │ │ -
511 return newRefiner._levels[0]->getVertexFaceLocalIndices(v);
│ │ │ │ -
512}
│ │ │ │ -
513template <class MESH>
│ │ │ │ -
514inline LocalIndexArray
│ │ │ │ - │ │ │ │ -
516 return newRefiner._levels[0]->getVertexEdgeLocalIndices(v);
│ │ │ │ -
517}
│ │ │ │ -
518
│ │ │ │ -
519template <class MESH>
│ │ │ │ -
520inline Index
│ │ │ │ - │ │ │ │ -
522 return newRefiner._levels[0]->findEdge(v0, v1);
│ │ │ │ -
523}
│ │ │ │ -
524
│ │ │ │ -
525template <class MESH>
│ │ │ │ -
526inline void
│ │ │ │ - │ │ │ │ -
528 newRefiner._levels[0]->populateLocalIndices();
│ │ │ │ -
529}
│ │ │ │ -
530
│ │ │ │ -
531template <class MESH>
│ │ │ │ -
532inline void
│ │ │ │ - │ │ │ │ -
534 newRefiner._levels[0]->setEdgeNonManifold(e, b);
│ │ │ │ -
535}
│ │ │ │ -
536template <class MESH>
│ │ │ │ -
537inline void
│ │ │ │ - │ │ │ │ -
539 newRefiner._levels[0]->setVertexNonManifold(v, b);
│ │ │ │ -
540}
│ │ │ │ -
541
│ │ │ │ -
542template <class MESH>
│ │ │ │ -
543inline void
│ │ │ │ - │ │ │ │ -
545 newRefiner._levels[0]->getEdgeSharpness(e) = s;
│ │ │ │ -
546}
│ │ │ │ -
547template <class MESH>
│ │ │ │ -
548inline void
│ │ │ │ - │ │ │ │ -
550 newRefiner._levels[0]->getVertexSharpness(v) = s;
│ │ │ │ -
551}
│ │ │ │ -
552template <class MESH>
│ │ │ │ -
553inline void
│ │ │ │ - │ │ │ │ -
555 newRefiner._levels[0]->setFaceHole(f, b);
│ │ │ │ -
556 newRefiner._hasHoles = newRefiner._hasHoles || b;
│ │ │ │ -
557}
│ │ │ │ -
558
│ │ │ │ -
559template <class MESH>
│ │ │ │ -
560inline int
│ │ │ │ - │ │ │ │ -
562 return newRefiner._levels[0]->createFVarChannel(numValues, newRefiner._subdivOptions);
│ │ │ │ -
563}
│ │ │ │ -
564template <class MESH>
│ │ │ │ -
565inline int
│ │ │ │ - │ │ │ │ -
567 Sdc::Options newOptions = newRefiner._subdivOptions;
│ │ │ │ - │ │ │ │ -
569 return newRefiner._levels[0]->createFVarChannel(numValues, newOptions);
│ │ │ │ -
570}
│ │ │ │ -
571template <class MESH>
│ │ │ │ -
572inline IndexArray
│ │ │ │ - │ │ │ │ -
574 return newRefiner._levels[0]->getFaceFVarValues(face, channel);
│ │ │ │ -
575}
│ │ │ │ -
576
│ │ │ │ -
577
│ │ │ │ -
578template <class MESH>
│ │ │ │ -
579bool
│ │ │ │ - │ │ │ │ -
581
│ │ │ │ - │ │ │ │ -
583 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided.");
│ │ │ │ -
584
│ │ │ │ -
585 //
│ │ │ │ -
586 // Sizing the topology tables:
│ │ │ │ -
587 // This method is for determining the sizes of the various topology tables (and other
│ │ │ │ -
588 // data) associated with the mesh. Once completed, appropriate memory will be allocated
│ │ │ │ -
589 // and an additional method invoked to populate it accordingly.
│ │ │ │ -
590 //
│ │ │ │ -
591 // The following methods should be called -- first those to specify the number of faces,
│ │ │ │ -
592 // edges and vertices in the mesh:
│ │ │ │ -
593 //
│ │ │ │ -
594 // void setBaseFaceCount( TopologyRefiner& newRefiner, int count)
│ │ │ │ -
595 // void setBaseEdgeCount( TopologyRefiner& newRefiner, int count)
│ │ │ │ -
596 // void setBaseVertexCount(TopologyRefiner& newRefiner, int count)
│ │ │ │ -
597 //
│ │ │ │ -
598 // and then for each face, edge and vertex, the number of its incident components:
│ │ │ │ -
599 //
│ │ │ │ -
600 // void setBaseFaceVertexCount(TopologyRefiner& newRefiner, Index face, int count)
│ │ │ │ -
601 // void setBaseEdgeFaceCount( TopologyRefiner& newRefiner, Index edge, int count)
│ │ │ │ -
602 // void setBaseVertexFaceCount(TopologyRefiner& newRefiner, Index vertex, int count)
│ │ │ │ -
603 // void setBaseVertexEdgeCount(TopologyRefiner& newRefiner, Index vertex, int count)
│ │ │ │ -
604 //
│ │ │ │ -
605 // The count/size for a component type must be set before indices associated with that
│ │ │ │ -
606 // component type can be used.
│ │ │ │ -
607 //
│ │ │ │ -
608 // Note that it is only necessary to size 4 of the 6 supported topological relations --
│ │ │ │ -
609 // the number of edge-vertices is fixed at two per edge, and the number of face-edges is
│ │ │ │ -
610 // the same as the number of face-vertices.
│ │ │ │ -
611 //
│ │ │ │ -
612 // So a single pass through your mesh to gather up all of this sizing information will
│ │ │ │ -
613 // allow the Tables to be allocated appropriately once and avoid any dynamic resizing as
│ │ │ │ -
614 // it grows.
│ │ │ │ -
615 //
│ │ │ │ -
616 return false;
│ │ │ │ -
617}
│ │ │ │ -
618
│ │ │ │ -
619template <class MESH>
│ │ │ │ -
620bool
│ │ │ │ - │ │ │ │ -
622
│ │ │ │ - │ │ │ │ -
624 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no specialization provided.");
│ │ │ │ -
625
│ │ │ │ -
626 //
│ │ │ │ -
627 // Assigning the topology tables:
│ │ │ │ -
628 // Once the topology tables have been allocated, the six required topological
│ │ │ │ -
629 // relations can be directly populated using the following methods:
│ │ │ │ -
630 //
│ │ │ │ -
631 // IndexArray setBaseFaceVertices(TopologyRefiner& newRefiner, Index face)
│ │ │ │ -
632 // IndexArray setBaseFaceEdges(TopologyRefiner& newRefiner, Index face)
│ │ │ │ -
633 //
│ │ │ │ -
634 // IndexArray setBaseEdgeVertices(TopologyRefiner& newRefiner, Index edge)
│ │ │ │ -
635 // IndexArray setBaseEdgeFaces(TopologyRefiner& newRefiner, Index edge)
│ │ │ │ -
636 //
│ │ │ │ -
637 // IndexArray setBaseVertexEdges(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ -
638 // IndexArray setBaseVertexFaces(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ -
639 //
│ │ │ │ -
640 // For the last two relations -- the faces and edges incident a vertex -- there are
│ │ │ │ -
641 // also "local indices" that must be specified (considering doing this internally),
│ │ │ │ -
642 // where the "local index" of each incident face or edge is the index of the vertex
│ │ │ │ -
643 // within that face or edge, and so ranging from 0-3 for incident quads and 0-1 for
│ │ │ │ -
644 // incident edges. These are assigned through similarly retrieved arrays:
│ │ │ │ -
645 //
│ │ │ │ -
646 // LocalIndexArray setBaseVertexFaceLocalIndices(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ -
647 // LocalIndexArray setBaseVertexEdgeLocalIndices(TopologyRefiner& newRefiner, Index vertex)
│ │ │ │ -
648 // LocalIndexArray setBaseEdgeFaceLocalIndices( TopologyRefiner& newRefiner, Index edge)
│ │ │ │ -
649 //
│ │ │ │ -
650 // or, if the mesh is manifold, explicit assignment of these can be deferred and
│ │ │ │ -
651 // all can be determined by calling:
│ │ │ │ -
652 //
│ │ │ │ -
653 // void populateBaseLocalIndices(TopologyRefiner& newRefiner)
│ │ │ │ -
654 //
│ │ │ │ -
655 // All components are assumed to be locally manifold and ordering of components in
│ │ │ │ -
656 // the above relations is expected to be counter-clockwise.
│ │ │ │ -
657 //
│ │ │ │ -
658 // For non-manifold components, no ordering/orientation of incident components is
│ │ │ │ -
659 // assumed or required, but be sure to explicitly tag such components (vertices and
│ │ │ │ -
660 // edges) as non-manifold:
│ │ │ │ -
661 //
│ │ │ │ -
662 // void setBaseEdgeNonManifold(TopologyRefiner& newRefiner, Index edge, bool b);
│ │ │ │ -
663 //
│ │ │ │ -
664 // void setBaseVertexNonManifold(TopologyRefiner& newRefiner, Index vertex, bool b);
│ │ │ │ -
665 //
│ │ │ │ -
666 // Also consider using TopologyLevel::ValidateTopology() when debugging to ensure
│ │ │ │ -
667 // that topology has been completely and correctly specified.
│ │ │ │ -
668 //
│ │ │ │ -
669 return false;
│ │ │ │ -
670}
│ │ │ │ -
671
│ │ │ │ -
672template <class MESH>
│ │ │ │ -
673bool
│ │ │ │ - │ │ │ │ -
675
│ │ │ │ -
676 //
│ │ │ │ -
677 // Optional assigning face-varying topology tables:
│ │ │ │ -
678 //
│ │ │ │ -
679 // Create independent face-varying primitive variable channels:
│ │ │ │ -
680 // int createBaseFVarChannel(TopologyRefiner& newRefiner, int numValues)
│ │ │ │ -
681 //
│ │ │ │ -
682 // For each channel, populate the face-vertex values:
│ │ │ │ -
683 // IndexArray setBaseFaceFVarValues(TopologyRefiner& newRefiner, Index face, int channel = 0)
│ │ │ │ -
684 //
│ │ │ │ -
685 return true;
│ │ │ │ -
686}
│ │ │ │ -
687
│ │ │ │ -
688template <class MESH>
│ │ │ │ -
689bool
│ │ │ │ - │ │ │ │ -
691
│ │ │ │ -
692 //
│ │ │ │ -
693 // Optional tagging:
│ │ │ │ -
694 // This is where any additional feature tags -- sharpness, holes, etc. -- can be
│ │ │ │ -
695 // specified using:
│ │ │ │ -
696 //
│ │ │ │ -
697 // void setBaseEdgeSharpness(TopologyRefiner& newRefiner, Index edge, float sharpness)
│ │ │ │ -
698 // void setBaseVertexSharpness(TopologyRefiner& newRefiner, Index vertex, float sharpness)
│ │ │ │ -
699 //
│ │ │ │ -
700 // void setBaseFaceHole(TopologyRefiner& newRefiner, Index face, bool hole)
│ │ │ │ -
701 //
│ │ │ │ -
702 return true;
│ │ │ │ -
703}
│ │ │ │ -
704
│ │ │ │ -
705template <class MESH>
│ │ │ │ -
706void
│ │ │ │ - │ │ │ │ -
708 TopologyError /* errCode */, char const * /* msg */, MESH const& /* mesh */) {
│ │ │ │ -
709
│ │ │ │ -
710 //
│ │ │ │ -
711 // Optional topology validation error reporting:
│ │ │ │ -
712 // This method is called whenever the factory encounters topology validation
│ │ │ │ -
713 // errors. By default, nothing is reported
│ │ │ │ -
714 //
│ │ │ │ -
715}
│ │ │ │ -
716
│ │ │ │ -
717} // end namespace Far
│ │ │ │ -
718
│ │ │ │ -
719} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
720using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
721} // end namespace OpenSubdiv
│ │ │ │ -
722
│ │ │ │ -
723#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H */
│ │ │ │ +
309#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H */
│ │ │ │ │ │ │ │ -
void Error(ErrorType err, const char *format,...)
Sends an OSD error with a message (internal use only)
│ │ │ │ -
@ FAR_RUNTIME_ERROR
Issue a generic runtime error, but continue execution.
Definition: error.h:40
│ │ │ │ - │ │ │ │ +
Vtr::ConstIndexArray ConstIndexArray
Definition: types.h:47
│ │ │ │
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
Definition: types.h:37
│ │ │ │ - │ │ │ │ -
Factory for constructing TopologyRefiners from specific mesh classes.
│ │ │ │ -
static int getNumBaseFaces(TopologyRefiner const &newRefiner)
│ │ │ │ -
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
│ │ │ │ -
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
│ │ │ │ -
static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident faces.
│ │ │ │ -
static int getNumBaseVertices(TopologyRefiner const &newRefiner)
│ │ │ │ -
static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int count)
Specify the number of faces incident each edge.
│ │ │ │ -
static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f)
Assign the vertices incident each face.
│ │ │ │ -
static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, Index e)
Assign the local indices of an edge within each of its incident faces.
│ │ │ │ -
static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, Options options)
│ │ │ │ -
static void populateBaseLocalIndices(TopologyRefiner &newRefiner)
Determine all local indices by inspection (only for pure manifold meshes)
│ │ │ │ -
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
│ │ │ │ -
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
│ │ │ │ -
static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of edges incident each vertex.
│ │ │ │ - │ │ │ │ -
static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index face, int channel=0)
Assign the face-varying values for the corners of each face.
│ │ │ │ -
static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e)
Assign the faces incident each edge.
│ │ │ │ -
static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of faces incident each vertex.
│ │ │ │ -
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
│ │ │ │ -
static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float sharpness)
Assign a sharpness value to a given vertex.
│ │ │ │ -
static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident edges.
│ │ │ │ -
static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e)
Assign the vertices incident each edge.
│ │ │ │ -
static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v)
Assign the faces incident each vertex.
│ │ │ │ -
static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool b)
Tag a vertex as non-manifold.
│ │ │ │ -
static void setNumBaseFaces(TopologyRefiner &newRefiner, int count)
Specify the number of faces to be accommodated.
│ │ │ │ -
static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f)
Assign the edges incident each face.
│ │ │ │ -
static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int count)
Specify the number of vertices incident each face.
│ │ │ │ -
static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float sharpness)
Assign a sharpness value to a given edge.
│ │ │ │ -
static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool b)
Tag an edge as non-manifold.
│ │ │ │ -
static void setNumBaseEdges(TopologyRefiner &newRefiner, int count)
Specify the number of edges to be accommodated.
│ │ │ │ -
static TopologyRefiner * Create(MESH const &mesh, Options options=Options())
Instantiates a TopologyRefiner from client-provided topological representation.
│ │ │ │ -
static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index v1)
Identify an edge to be assigned a sharpness value given a vertex pair.
│ │ │ │ -
static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v)
Assign the edges incident each vertex.
│ │ │ │ -
static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues)
Create a new face-varying channel with the given number of values.
│ │ │ │ -
static int getNumBaseEdges(TopologyRefiner const &newRefiner)
│ │ │ │ -
static void setNumBaseVertices(TopologyRefiner &newRefiner, int count)
Specify the number of vertices to be accommodated.
│ │ │ │ -
static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole)
Tag a face as a hole.
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ -
Private base class of Factories for constructing TopologyRefiners.
│ │ │ │ -
static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool fullValidation, TopologyCallback callback, void const *callbackData)
│ │ │ │ - │ │ │ │ -
static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner)
│ │ │ │ -
static bool prepareComponentTopologySizing(TopologyRefiner &refiner)
│ │ │ │ -
static bool prepareFaceVaryingChannels(TopologyRefiner &refiner)
│ │ │ │ -
Options related to the construction of each TopologyRefiner.
│ │ │ │ -
Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions=Sdc::Options())
│ │ │ │ - │ │ │ │ -
Sdc::SchemeType schemeType
The subdivision scheme type identifier.
│ │ │ │ - │ │ │ │ -
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ -
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:98
│ │ │ │ -
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:95
│ │ │ │ - │ │ │ │ +
Applies refinement operations to generic primvar data.
│ │ │ │ +
Object used to compute and query ptex face indices.
Definition: ptexIndices.h:46
│ │ │ │ +
An interface for accessing data in a specific level of a refined topology hierarchy.
Definition: topologyLevel.h:49
│ │ │ │ +
Factory for constructing TopologyRefiners from specific mesh classes.
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ +
TopologyRefiner(TopologyRefiner const &source)
│ │ │ │ +
int GetMaxValence() const
Returns the maximum vertex valence in all levels.
│ │ │ │ +
Vtr::internal::Level const & getLevel(int l) const
│ │ │ │ +
bool HasHoles() const
Returns true if faces have been tagged as holes.
│ │ │ │ +
int GetNumLevels() const
Returns the number of refinement levels.
│ │ │ │ +
int GetNumFVarValuesTotal(int channel=0) const
Returns the total number of face-varying values in all levels.
│ │ │ │ +
Vtr::internal::Refinement const & getRefinement(int l) const
│ │ │ │ +
Sdc::Options GetSchemeOptions() const
Returns the subdivision options.
│ │ │ │ + │ │ │ │ +
bool IsUniform() const
Returns true if uniform refinement has been applied.
│ │ │ │ +
Sdc::SchemeType GetSchemeType() const
Returns the subdivision scheme.
│ │ │ │ +
int GetMaxLevel() const
Returns the highest level of refinement.
│ │ │ │ +
TopologyRefiner(Sdc::SchemeType type, Sdc::Options options=Sdc::Options())
Constructor.
│ │ │ │ +
int GetNumEdgesTotal() const
Returns the total number of edges in all levels.
│ │ │ │ + │ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
│ │ │ │ +
UniformOptions GetUniformOptions() const
Returns the options specified on refinement.
│ │ │ │ +
int GetNumFacesTotal() const
Returns the total number of edges in all levels.
│ │ │ │ +
int GetNumFaceVerticesTotal() const
Returns the total number of face vertices in all levels.
│ │ │ │ +
Vtr::internal::Refinement & getRefinement(int l)
│ │ │ │ +
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
│ │ │ │ +
int GetNumVerticesTotal() const
Returns the total number of vertices in all levels.
│ │ │ │ +
void Unrefine()
Unrefine the topology, keeping only the base level.
│ │ │ │ +
AdaptiveOptions GetAdaptiveOptions() const
Returns the options specified on refinement.
│ │ │ │ +
Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) const
Returns the face-varying interpolation rule set for a given channel.
│ │ │ │ +
void RefineAdaptive(AdaptiveOptions options, ConstIndexArray selectedFaces=ConstIndexArray())
Feature Adaptive topology refinement.
│ │ │ │ + │ │ │ │ +
unsigned int refinementLevel
Number of refinement iterations.
│ │ │ │ + │ │ │ │ +
void SetRefinementLevel(int level)
Set uniform refinement level.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
void SetSecondaryLevel(int level)
Set secondary isolation level.
│ │ │ │ +
Private base class of Factories for constructing TopologyRefiners.
│ │ │ │ +
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -topologyRefinerFactory.h │ │ │ │ │ +topologyRefiner.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -29,934 +29,441 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H │ │ │ │ │ - 25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H │ │ │ │ │ + 24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H │ │ │ │ │ + 25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H │ │ │ │ │ 26 │ │ │ │ │ 27#include "../version.h" │ │ │ │ │ 28 │ │ │ │ │ - 29#include "../far/topologyRefiner.h" │ │ │ │ │ - 30#include "../far/error.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32#include │ │ │ │ │ + 29#include "../sdc/types.h" │ │ │ │ │ + 30#include "../sdc/options.h" │ │ │ │ │ + 31#include "../far/types.h" │ │ │ │ │ + 32#include "../far/topologyLevel.h" │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 34#include │ │ │ │ │ + 35 │ │ │ │ │ 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 │ │ │ │ │ - 46// │ │ │ │ │ -47class TopologyRefinerFactoryBase { │ │ │ │ │ - 48protected: │ │ │ │ │ - 49 │ │ │ │ │ - 50 // │ │ │ │ │ - 51 // Protected methods invoked by the subclass template to verify and process │ │ │ │ │ -each │ │ │ │ │ - 52 // stage of construction implemented by the subclass: │ │ │ │ │ - 53 // │ │ │ │ │ -54 typedef Vtr::internal::Level::ValidationCallback TopologyCallback; │ │ │ │ │ - 55 │ │ │ │ │ -56 static bool prepareComponentTopologySizing(TopologyRefiner& refiner); │ │ │ │ │ -57 static bool prepareComponentTopologyAssignment(TopologyRefiner& refiner, │ │ │ │ │ -bool fullValidation, │ │ │ │ │ - 58 TopologyCallback callback, void const * callbackData); │ │ │ │ │ -59 static bool prepareComponentTagsAndSharpness(TopologyRefiner& refiner); │ │ │ │ │ -60 static bool prepareFaceVaryingChannels(TopologyRefiner& refiner); │ │ │ │ │ - 61}; │ │ │ │ │ - 62 │ │ │ │ │ + 37namespace OpenSubdiv { │ │ │ │ │ + 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 39 │ │ │ │ │ +40namespace Vtr { namespace internal { class SparseSelector; } } │ │ │ │ │ + 41namespace Far { namespace internal { class FeatureMask; } } │ │ │ │ │ + 42 │ │ │ │ │ + 43namespace Far { │ │ │ │ │ + 44 │ │ │ │ │ + 45template class PrimvarRefinerReal; │ │ │ │ │ + 46template class TopologyRefinerFactory; │ │ │ │ │ + 47 │ │ │ │ │ +51class TopologyRefiner { │ │ │ │ │ + 52 │ │ │ │ │ + 53public: │ │ │ │ │ + 54 │ │ │ │ │ +56 TopologyRefiner(Sdc::SchemeType type, Sdc::Options options = Sdc::Options │ │ │ │ │ +()); │ │ │ │ │ + 57 │ │ │ │ │ +59 ~TopologyRefiner(); │ │ │ │ │ + 60 │ │ │ │ │ +62 Sdc::SchemeType GetSchemeType() const { return _subdivType; } │ │ │ │ │ 63 │ │ │ │ │ - 77template │ │ │ │ │ -78class TopologyRefinerFactory : public TopologyRefinerFactoryBase { │ │ │ │ │ - 79 │ │ │ │ │ - 80public: │ │ │ │ │ +65 Sdc::Options GetSchemeOptions() const { return _subdivOptions; } │ │ │ │ │ + 66 │ │ │ │ │ +68 bool IsUniform() const { return _isUniform; } │ │ │ │ │ + 69 │ │ │ │ │ +71 int GetNumLevels() const { return (int)_farLevels.size(); } │ │ │ │ │ + 72 │ │ │ │ │ +74 int GetMaxLevel() const { return _maxLevel; } │ │ │ │ │ + 75 │ │ │ │ │ +77 int GetMaxValence() const { return _maxValence; } │ │ │ │ │ + 78 │ │ │ │ │ +80 bool HasHoles() const { return _hasHoles; } │ │ │ │ │ 81 │ │ │ │ │ -84 struct Options { │ │ │ │ │ - 85 │ │ │ │ │ -86 Options(Sdc::SchemeType sdcType = Sdc::SCHEME_CATMARK, Sdc::Options │ │ │ │ │ -sdcOptions = Sdc::Options()) : │ │ │ │ │ - 87 schemeType(sdcType), │ │ │ │ │ - 88 schemeOptions(sdcOptions), │ │ │ │ │ - 89 validateFullTopology(false) { } │ │ │ │ │ +83 int GetNumVerticesTotal() const { return _totalVertices; } │ │ │ │ │ + 84 │ │ │ │ │ +86 int GetNumEdgesTotal() const { return _totalEdges; } │ │ │ │ │ + 87 │ │ │ │ │ +89 int GetNumFacesTotal() const { return _totalFaces; } │ │ │ │ │ 90 │ │ │ │ │ -91 Sdc::SchemeType schemeType; │ │ │ │ │ -92 Sdc::Options schemeOptions; │ │ │ │ │ -94 unsigned int validateFullTopology : 1; │ │ │ │ │ - 97 }; │ │ │ │ │ +92 int GetNumFaceVerticesTotal() const { return _totalFaceVertices; } │ │ │ │ │ + 93 │ │ │ │ │ +95 TopologyLevel const & GetLevel(int level) const { return _farLevels[level]; │ │ │ │ │ +} │ │ │ │ │ + 96 │ │ │ │ │ 98 │ │ │ │ │ - 108 // │ │ │ │ │ - 113 static TopologyRefiner* Create(MESH const& mesh, Options options = Options │ │ │ │ │ -()); │ │ │ │ │ - 114 │ │ │ │ │ - 128 static TopologyRefiner* Create(TopologyRefiner const & baseLevel); │ │ │ │ │ - 129 │ │ │ │ │ - 130protected: │ │ │ │ │ -131 typedef Vtr::internal::Level::TopologyError TopologyError; │ │ │ │ │ - 132 │ │ │ │ │ - 134 │ │ │ │ │ - 149 │ │ │ │ │ - 151 static bool resizeComponentTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ -const& mesh); │ │ │ │ │ - 152 │ │ │ │ │ - 155 static bool assignComponentTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ -const& mesh); │ │ │ │ │ - 156 │ │ │ │ │ - 158 static bool assignComponentTags(TopologyRefiner& newRefiner, MESH const& │ │ │ │ │ -mesh); │ │ │ │ │ - 159 │ │ │ │ │ - 161 static bool assignFaceVaryingTopology(TopologyRefiner& newRefiner, MESH │ │ │ │ │ -const& mesh); │ │ │ │ │ - 162 │ │ │ │ │ - 164 static void reportInvalidTopology(TopologyError errCode, char const * msg, │ │ │ │ │ -MESH const& mesh); │ │ │ │ │ + 100 │ │ │ │ │ + 101 // │ │ │ │ │ + 102 // Uniform refinement │ │ │ │ │ + 103 // │ │ │ │ │ + 104 │ │ │ │ │ +118 struct UniformOptions { │ │ │ │ │ + 119 │ │ │ │ │ +120 UniformOptions(int level) : │ │ │ │ │ + 121 refinementLevel(level & 0xf), │ │ │ │ │ + 122 orderVerticesFromFacesFirst(false), │ │ │ │ │ + 123 fullTopologyInLastLevel(false) { } │ │ │ │ │ + 124 │ │ │ │ │ +126 void SetRefinementLevel(int level) { refinementLevel = level & 0xf; } │ │ │ │ │ + 127 │ │ │ │ │ +128 unsigned int refinementLevel:4, │ │ │ │ │ +129 orderVerticesFromFacesFirst:1, │ │ │ │ │ +131 fullTopologyInLastLevel:1; │ │ │ │ │ + 134 }; │ │ │ │ │ + 135 │ │ │ │ │ +146 void RefineUniform(UniformOptions options); │ │ │ │ │ + 147 │ │ │ │ │ +149 UniformOptions GetUniformOptions() const { return _uniformOptions; } │ │ │ │ │ + 150 │ │ │ │ │ + 151 // │ │ │ │ │ + 152 // Adaptive refinement │ │ │ │ │ + 153 // │ │ │ │ │ + 154 │ │ │ │ │ +156 struct AdaptiveOptions { │ │ │ │ │ + 157 │ │ │ │ │ +158 AdaptiveOptions(int level) : │ │ │ │ │ + 159 isolationLevel(level & 0xf), │ │ │ │ │ + 160 secondaryLevel(0xf), │ │ │ │ │ + 161 useSingleCreasePatch(false), │ │ │ │ │ + 162 useInfSharpPatch(false), │ │ │ │ │ + 163 considerFVarChannels(false), │ │ │ │ │ + 164 orderVerticesFromFacesFirst(false) { } │ │ │ │ │ 165 │ │ │ │ │ - 167 │ │ │ │ │ - 168protected: │ │ │ │ │ - 170 │ │ │ │ │ - 187 │ │ │ │ │ - 189 static void setNumBaseVertices(TopologyRefiner & newRefiner, int count); │ │ │ │ │ - 190 │ │ │ │ │ - 192 static void setNumBaseFaces(TopologyRefiner & newRefiner, int count); │ │ │ │ │ - 193 │ │ │ │ │ - 195 static void setNumBaseEdges(TopologyRefiner & newRefiner, int count); │ │ │ │ │ - 196 │ │ │ │ │ - 198 static void setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, │ │ │ │ │ -int count); │ │ │ │ │ - 199 │ │ │ │ │ - 201 static void setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int │ │ │ │ │ -count); │ │ │ │ │ - 202 │ │ │ │ │ - 204 static void setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ -int count); │ │ │ │ │ +167 void SetIsolationLevel(int level) { isolationLevel = level & 0xf; } │ │ │ │ │ + 168 │ │ │ │ │ +170 void SetSecondaryLevel(int level) { secondaryLevel = level & 0xf; } │ │ │ │ │ + 171 │ │ │ │ │ +172 unsigned int isolationLevel:4; │ │ │ │ │ +174 unsigned int secondaryLevel:4; │ │ │ │ │ +176 unsigned int useSingleCreasePatch:1; │ │ │ │ │ +178 unsigned int useInfSharpPatch:1; │ │ │ │ │ +180 unsigned int considerFVarChannels:1; │ │ │ │ │ +182 unsigned int orderVerticesFromFacesFirst:1; │ │ │ │ │ + 184 }; │ │ │ │ │ + 185 │ │ │ │ │ +192 void RefineAdaptive(AdaptiveOptions options, │ │ │ │ │ + 193 ConstIndexArray selectedFaces = ConstIndexArray()); │ │ │ │ │ + 194 │ │ │ │ │ +196 AdaptiveOptions GetAdaptiveOptions() const { return _adaptiveOptions; } │ │ │ │ │ + 197 │ │ │ │ │ +199 void Unrefine(); │ │ │ │ │ + 200 │ │ │ │ │ + 201 │ │ │ │ │ + 203 │ │ │ │ │ 205 │ │ │ │ │ - 207 static void setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ -int count); │ │ │ │ │ + 207 int GetNumFVarChannels() const; │ │ │ │ │ 208 │ │ │ │ │ - 209 static int getNumBaseVertices(TopologyRefiner const & newRefiner); │ │ │ │ │ - 210 static int getNumBaseFaces(TopologyRefiner const & newRefiner); │ │ │ │ │ - 211 static int getNumBaseEdges(TopologyRefiner const & newRefiner); │ │ │ │ │ - 213 │ │ │ │ │ - 215 │ │ │ │ │ - 237 │ │ │ │ │ - 239 static IndexArray getBaseFaceVertices(TopologyRefiner & newRefiner, Index │ │ │ │ │ -f); │ │ │ │ │ - 240 │ │ │ │ │ - 242 static IndexArray getBaseFaceEdges(TopologyRefiner & newRefiner, Index f); │ │ │ │ │ - 243 │ │ │ │ │ - 245 static IndexArray getBaseEdgeVertices(TopologyRefiner & newRefiner, Index │ │ │ │ │ -e); │ │ │ │ │ + 210 Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int │ │ │ │ │ +channel = 0) const; │ │ │ │ │ + 211 │ │ │ │ │ +213 int GetNumFVarValuesTotal(int channel = 0) const; │ │ │ │ │ + 214 │ │ │ │ │ + 216 │ │ │ │ │ + 217protected: │ │ │ │ │ + 218 │ │ │ │ │ + 219 // │ │ │ │ │ + 220 // Lower level protected methods intended strictly for internal use: │ │ │ │ │ + 221 // │ │ │ │ │ + 222 template │ │ │ │ │ +223 friend class TopologyRefinerFactory; │ │ │ │ │ +224 friend class TopologyRefinerFactoryBase; │ │ │ │ │ +225 friend class PatchTableBuilder; │ │ │ │ │ +226 friend class PatchBuilder; │ │ │ │ │ +227 friend class PtexIndices; │ │ │ │ │ + 228 template │ │ │ │ │ +229 friend class PrimvarRefinerReal; │ │ │ │ │ + 230 │ │ │ │ │ + 231 // Copy constructor exposed via the factory class: │ │ │ │ │ +232 TopologyRefiner(TopologyRefiner const & source); │ │ │ │ │ + 233 │ │ │ │ │ + 234public: │ │ │ │ │ + 235 // Levels and Refinements available internally (avoids need for more │ │ │ │ │ +friends) │ │ │ │ │ +236 Vtr::internal::Level & getLevel(int l) { return *_levels[l]; } │ │ │ │ │ +237 Vtr::internal::Level const & getLevel(int l) const { return *_levels[l]; } │ │ │ │ │ + 238 │ │ │ │ │ +239 Vtr::internal::Refinement & getRefinement(int l) { return *_refinements[l]; │ │ │ │ │ +} │ │ │ │ │ +240 Vtr::internal::Refinement const & getRefinement(int l) const { return │ │ │ │ │ +*_refinements[l]; } │ │ │ │ │ + 241 │ │ │ │ │ + 242private: │ │ │ │ │ + 243 // Not default constructible or copyable: │ │ │ │ │ + 244 TopologyRefiner() : _uniformOptions(0), _adaptiveOptions(0) { } │ │ │ │ │ + 245 TopologyRefiner & operator=(TopologyRefiner const &) { return *this; } │ │ │ │ │ 246 │ │ │ │ │ - 248 static IndexArray getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e); │ │ │ │ │ - 249 │ │ │ │ │ - 251 static IndexArray getBaseVertexFaces(TopologyRefiner & newRefiner, Index │ │ │ │ │ -v); │ │ │ │ │ + 247 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& │ │ │ │ │ +selector, │ │ │ │ │ + 248 internal::FeatureMask const & mask, │ │ │ │ │ + 249 ConstIndexArray selectedFaces); │ │ │ │ │ + 250 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector, │ │ │ │ │ + 251 ConstIndexArray selectedFaces); │ │ │ │ │ 252 │ │ │ │ │ - 254 static IndexArray getBaseVertexEdges(TopologyRefiner & newRefiner, Index │ │ │ │ │ -v); │ │ │ │ │ + 253 void initializeInventory(); │ │ │ │ │ + 254 void updateInventory(Vtr::internal::Level const & newLevel); │ │ │ │ │ 255 │ │ │ │ │ - 257 static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v); │ │ │ │ │ - 259 static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v); │ │ │ │ │ - 261 static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e); │ │ │ │ │ - 262 │ │ │ │ │ - 264 static void populateBaseLocalIndices(TopologyRefiner & newRefiner); │ │ │ │ │ - 265 │ │ │ │ │ - 267 static void setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, │ │ │ │ │ -bool b); │ │ │ │ │ - 268 │ │ │ │ │ - 270 static void setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index │ │ │ │ │ -v, bool b); │ │ │ │ │ - 272 │ │ │ │ │ + 256 void appendLevel(Vtr::internal::Level & newLevel); │ │ │ │ │ + 257 void appendRefinement(Vtr::internal::Refinement & newRefinement); │ │ │ │ │ + 258 void assembleFarLevels(); │ │ │ │ │ + 259 │ │ │ │ │ + 260private: │ │ │ │ │ + 261 │ │ │ │ │ + 262 Sdc::SchemeType _subdivType; │ │ │ │ │ + 263 Sdc::Options _subdivOptions; │ │ │ │ │ + 264 │ │ │ │ │ + 265 unsigned int _isUniform : 1; │ │ │ │ │ + 266 unsigned int _hasHoles : 1; │ │ │ │ │ + 267 unsigned int _hasIrregFaces : 1; │ │ │ │ │ + 268 unsigned int _regFaceSize : 3; │ │ │ │ │ + 269 unsigned int _maxLevel : 4; │ │ │ │ │ + 270 │ │ │ │ │ + 271 // Options assigned on refinement: │ │ │ │ │ + 272 UniformOptions _uniformOptions; │ │ │ │ │ + 273 AdaptiveOptions _adaptiveOptions; │ │ │ │ │ 274 │ │ │ │ │ - 283 │ │ │ │ │ - 285 static Index findBaseEdge(TopologyRefiner const & newRefiner, Index v0, │ │ │ │ │ -Index v1); │ │ │ │ │ - 286 │ │ │ │ │ - 288 static void setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, │ │ │ │ │ -float sharpness); │ │ │ │ │ - 289 │ │ │ │ │ - 291 static void setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, │ │ │ │ │ -float sharpness); │ │ │ │ │ - 292 │ │ │ │ │ - 294 static void setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool │ │ │ │ │ -isHole); │ │ │ │ │ - 296 │ │ │ │ │ - 298 │ │ │ │ │ + 275 // Cumulative properties of all levels: │ │ │ │ │ + 276 int _totalVertices; │ │ │ │ │ + 277 int _totalEdges; │ │ │ │ │ + 278 int _totalFaces; │ │ │ │ │ + 279 int _totalFaceVertices; │ │ │ │ │ + 280 int _maxValence; │ │ │ │ │ + 281 │ │ │ │ │ + 282 // Note the base level may be shared with another instance │ │ │ │ │ + 283 bool _baseLevelOwned; │ │ │ │ │ + 284 │ │ │ │ │ + 285 std::vector _levels; │ │ │ │ │ + 286 std::vector _refinements; │ │ │ │ │ + 287 │ │ │ │ │ + 288 std::vector _farLevels; │ │ │ │ │ + 289}; │ │ │ │ │ + 290 │ │ │ │ │ + 291 │ │ │ │ │ + 292inline int │ │ │ │ │ +293TopologyRefiner::GetNumFVarChannels() const { │ │ │ │ │ + 294 │ │ │ │ │ + 295 return _levels[0]->getNumFVarChannels(); │ │ │ │ │ + 296} │ │ │ │ │ + 297inline Sdc::Options::FVarLinearInterpolation │ │ │ │ │ +298TopologyRefiner::GetFVarLinearInterpolation(int channel) const { │ │ │ │ │ + 299 │ │ │ │ │ + 300 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation(); │ │ │ │ │ + 301} │ │ │ │ │ + 302 │ │ │ │ │ + 303} // end namespace Far │ │ │ │ │ + 304 │ │ │ │ │ + 305} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 306using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 307} // end namespace OpenSubdiv │ │ │ │ │ 308 │ │ │ │ │ - 310 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int │ │ │ │ │ -numValues); │ │ │ │ │ - 311 │ │ │ │ │ - 313 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int │ │ │ │ │ -numValues, Sdc::Options const& fvarOptions); │ │ │ │ │ - 314 │ │ │ │ │ - 316 static IndexArray getBaseFaceFVarValues(TopologyRefiner & newRefiner, │ │ │ │ │ -Index face, int channel = 0); │ │ │ │ │ - 317 │ │ │ │ │ - 319 │ │ │ │ │ - 320protected: │ │ │ │ │ - 321 // │ │ │ │ │ - 322 // Not to be specialized: │ │ │ │ │ - 323 // │ │ │ │ │ - 324 static bool populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, │ │ │ │ │ -Options options); │ │ │ │ │ - 325 │ │ │ │ │ - 326private: │ │ │ │ │ - 327 // │ │ │ │ │ - 328 // An oversight in the interfaces of the error reporting function between │ │ │ │ │ -the factory │ │ │ │ │ - 329 // class and the Vtr::Level requires this adapter function to avoid │ │ │ │ │ -warnings. │ │ │ │ │ - 330 // │ │ │ │ │ - 331 // The static class method requires a reference as the MESH argument, but │ │ │ │ │ -the interface │ │ │ │ │ - 332 // for Vtr::Level requires a pointer (void*). So this adapter with a MESH* │ │ │ │ │ -argument is │ │ │ │ │ - 333 // used to effectively cast the function pointer required by Vtr::Level │ │ │ │ │ -error reporting: │ │ │ │ │ - 334 // │ │ │ │ │ - 335 static void reportInvalidTopologyAdapter(TopologyError errCode, char const │ │ │ │ │ -* msg, MESH const * mesh) { │ │ │ │ │ - 336 reportInvalidTopology(errCode, msg, *mesh); │ │ │ │ │ - 337 } │ │ │ │ │ - 338}; │ │ │ │ │ - 339 │ │ │ │ │ - 340 │ │ │ │ │ - 341// │ │ │ │ │ - 342// Generic implementations: │ │ │ │ │ - 343// │ │ │ │ │ - 344template │ │ │ │ │ - 345TopologyRefiner* │ │ │ │ │ -346TopologyRefinerFactory::Create(MESH const& mesh, Options options) { │ │ │ │ │ - 347 │ │ │ │ │ - 348 TopologyRefiner * refiner = new TopologyRefiner(options.schemeType, │ │ │ │ │ -options.schemeOptions); │ │ │ │ │ - 349 │ │ │ │ │ - 350 if (! populateBaseLevel(*refiner, mesh, options)) { │ │ │ │ │ - 351 delete refiner; │ │ │ │ │ - 352 return 0; │ │ │ │ │ - 353 } │ │ │ │ │ - 354 │ │ │ │ │ - 355 // Eventually want to move the Refiner's inventory initialization here. │ │ │ │ │ -Currently it │ │ │ │ │ - 356 // is handled after topology assignment, but if the inventory is to │ │ │ │ │ -include additional │ │ │ │ │ - 357 // features (e.g. holes, etc.) it is better off deferred to here. │ │ │ │ │ - 358 │ │ │ │ │ - 359 return refiner; │ │ │ │ │ - 360} │ │ │ │ │ - 361 │ │ │ │ │ - 362template │ │ │ │ │ - 363TopologyRefiner* │ │ │ │ │ -364TopologyRefinerFactory::Create(TopologyRefiner const & source) { │ │ │ │ │ - 365 │ │ │ │ │ - 366 return new TopologyRefiner(source); │ │ │ │ │ - 367} │ │ │ │ │ - 368 │ │ │ │ │ - 369template │ │ │ │ │ - 370bool │ │ │ │ │ -371TopologyRefinerFactory::populateBaseLevel(TopologyRefiner& refiner, │ │ │ │ │ -MESH const& mesh, Options options) { │ │ │ │ │ - 372 │ │ │ │ │ - 373 // │ │ │ │ │ - 374 // Construction of a specialized topology refiner involves four steps, │ │ │ │ │ -each of which │ │ │ │ │ - 375 // involves a method specialized for MESH followed by one that takes an │ │ │ │ │ -action in │ │ │ │ │ - 376 // response to it or in preparation for the next step. │ │ │ │ │ - 377 // │ │ │ │ │ - 378 // Both the specialized methods and those that follow them may find fault │ │ │ │ │ -in the │ │ │ │ │ - 379 // construction and trigger failure at any time: │ │ │ │ │ - 380 // │ │ │ │ │ - 381 │ │ │ │ │ - 382 // │ │ │ │ │ - 383 // Sizing of the topology -- this is a required specialization for MESH. │ │ │ │ │ -This defines │ │ │ │ │ - 384 // an inventory of all components and their relations that is used to │ │ │ │ │ -allocate buffers │ │ │ │ │ - 385 // to be efficiently populated in the subsequent topology assignment step. │ │ │ │ │ - 386 // │ │ │ │ │ - 387 if (! resizeComponentTopology(refiner, mesh)) return false; │ │ │ │ │ - 388 if (! prepareComponentTopologySizing(refiner)) return false; │ │ │ │ │ - 389 │ │ │ │ │ - 390 // │ │ │ │ │ - 391 // Assignment of the topology -- this is a required specialization for │ │ │ │ │ -MESH. If edges │ │ │ │ │ - 392 // are specified, all other topological relations are expected to be │ │ │ │ │ -defined for them. │ │ │ │ │ - 393 // Otherwise edges and remaining topology will be completed from the face- │ │ │ │ │ -vertices: │ │ │ │ │ - 394 // │ │ │ │ │ - 395 bool validate = options.validateFullTopology; │ │ │ │ │ - 396 TopologyCallback callback = reinterpret_cast │ │ │ │ │ -(reportInvalidTopologyAdapter); │ │ │ │ │ - 397 void const * userData = &mesh; │ │ │ │ │ - 398 │ │ │ │ │ - 399 if (! assignComponentTopology(refiner, mesh)) return false; │ │ │ │ │ - 400 if (! prepareComponentTopologyAssignment(refiner, validate, callback, │ │ │ │ │ -userData)) return false; │ │ │ │ │ - 401 │ │ │ │ │ - 402 // │ │ │ │ │ - 403 // User assigned and internal tagging of components -- an optional │ │ │ │ │ -specialization for │ │ │ │ │ - 404 // MESH. Allows the specification of sharpness values, holes, etc. │ │ │ │ │ - 405 // │ │ │ │ │ - 406 if (! assignComponentTags(refiner, mesh)) return false; │ │ │ │ │ - 407 if (! prepareComponentTagsAndSharpness(refiner)) return false; │ │ │ │ │ - 408 │ │ │ │ │ - 409 // │ │ │ │ │ - 410 // Defining channels of face-varying primvar data -- an optional │ │ │ │ │ -specialization for MESH. │ │ │ │ │ - 411 // │ │ │ │ │ - 412 if (! assignFaceVaryingTopology(refiner, mesh)) return false; │ │ │ │ │ - 413 if (! prepareFaceVaryingChannels(refiner)) return false; │ │ │ │ │ - 414 │ │ │ │ │ - 415 return true; │ │ │ │ │ - 416} │ │ │ │ │ - 417 │ │ │ │ │ - 418template │ │ │ │ │ - 419inline void │ │ │ │ │ -420TopologyRefinerFactory::setNumBaseFaces(TopologyRefiner & newRefiner, │ │ │ │ │ -int count) { │ │ │ │ │ - 421 newRefiner._levels[0]->resizeFaces(count); │ │ │ │ │ - 422} │ │ │ │ │ - 423template │ │ │ │ │ - 424inline void │ │ │ │ │ -425TopologyRefinerFactory::setNumBaseEdges(TopologyRefiner & newRefiner, │ │ │ │ │ -int count) { │ │ │ │ │ - 426 newRefiner._levels[0]->resizeEdges(count); │ │ │ │ │ - 427} │ │ │ │ │ - 428template │ │ │ │ │ - 429inline void │ │ │ │ │ -430TopologyRefinerFactory::setNumBaseVertices(TopologyRefiner & │ │ │ │ │ -newRefiner, int count) { │ │ │ │ │ - 431 newRefiner._levels[0]->resizeVertices(count); │ │ │ │ │ - 432} │ │ │ │ │ - 433 │ │ │ │ │ - 434template │ │ │ │ │ - 435inline int │ │ │ │ │ -436TopologyRefinerFactory::getNumBaseFaces(TopologyRefiner const & │ │ │ │ │ -newRefiner) { │ │ │ │ │ - 437 return newRefiner._levels[0]->getNumFaces(); │ │ │ │ │ - 438} │ │ │ │ │ - 439template │ │ │ │ │ - 440inline int │ │ │ │ │ -441TopologyRefinerFactory::getNumBaseEdges(TopologyRefiner const & │ │ │ │ │ -newRefiner) { │ │ │ │ │ - 442 return newRefiner._levels[0]->getNumEdges(); │ │ │ │ │ - 443} │ │ │ │ │ - 444template │ │ │ │ │ - 445inline int │ │ │ │ │ -446TopologyRefinerFactory::getNumBaseVertices(TopologyRefiner const & │ │ │ │ │ -newRefiner) { │ │ │ │ │ - 447 return newRefiner._levels[0]->getNumVertices(); │ │ │ │ │ - 448} │ │ │ │ │ - 449 │ │ │ │ │ - 450template │ │ │ │ │ - 451inline void │ │ │ │ │ -452TopologyRefinerFactory::setNumBaseFaceVertices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index f, int count) { │ │ │ │ │ - 453 newRefiner._levels[0]->resizeFaceVertices(f, count); │ │ │ │ │ - 454 newRefiner._hasIrregFaces = newRefiner._hasIrregFaces || (count != │ │ │ │ │ -newRefiner._regFaceSize); │ │ │ │ │ - 455} │ │ │ │ │ - 456template │ │ │ │ │ - 457inline void │ │ │ │ │ -458TopologyRefinerFactory::setNumBaseEdgeFaces(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e, int count) { │ │ │ │ │ - 459 newRefiner._levels[0]->resizeEdgeFaces(e, count); │ │ │ │ │ - 460} │ │ │ │ │ - 461template │ │ │ │ │ - 462inline void │ │ │ │ │ -463TopologyRefinerFactory::setNumBaseVertexFaces(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v, int count) { │ │ │ │ │ - 464 newRefiner._levels[0]->resizeVertexFaces(v, count); │ │ │ │ │ - 465} │ │ │ │ │ - 466template │ │ │ │ │ - 467inline void │ │ │ │ │ -468TopologyRefinerFactory::setNumBaseVertexEdges(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v, int count) { │ │ │ │ │ - 469 newRefiner._levels[0]->resizeVertexEdges(v, count); │ │ │ │ │ - 470} │ │ │ │ │ - 471 │ │ │ │ │ - 472template │ │ │ │ │ - 473inline IndexArray │ │ │ │ │ -474TopologyRefinerFactory::getBaseFaceVertices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index f) { │ │ │ │ │ - 475 return newRefiner._levels[0]->getFaceVertices(f); │ │ │ │ │ - 476} │ │ │ │ │ - 477template │ │ │ │ │ - 478inline IndexArray │ │ │ │ │ -479TopologyRefinerFactory::getBaseFaceEdges(TopologyRefiner & newRefiner, │ │ │ │ │ -Index f) { │ │ │ │ │ - 480 return newRefiner._levels[0]->getFaceEdges(f); │ │ │ │ │ - 481} │ │ │ │ │ - 482template │ │ │ │ │ - 483inline IndexArray │ │ │ │ │ -484TopologyRefinerFactory::getBaseEdgeVertices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e) { │ │ │ │ │ - 485 return newRefiner._levels[0]->getEdgeVertices(e); │ │ │ │ │ - 486} │ │ │ │ │ - 487template │ │ │ │ │ - 488inline IndexArray │ │ │ │ │ -489TopologyRefinerFactory::getBaseEdgeFaces(TopologyRefiner & newRefiner, │ │ │ │ │ -Index e) { │ │ │ │ │ - 490 return newRefiner._levels[0]->getEdgeFaces(e); │ │ │ │ │ - 491} │ │ │ │ │ - 492template │ │ │ │ │ - 493inline IndexArray │ │ │ │ │ -494TopologyRefinerFactory::getBaseVertexFaces(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v) { │ │ │ │ │ - 495 return newRefiner._levels[0]->getVertexFaces(v); │ │ │ │ │ - 496} │ │ │ │ │ - 497template │ │ │ │ │ - 498inline IndexArray │ │ │ │ │ -499TopologyRefinerFactory::getBaseVertexEdges(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v) { │ │ │ │ │ - 500 return newRefiner._levels[0]->getVertexEdges(v); │ │ │ │ │ - 501} │ │ │ │ │ - 502 │ │ │ │ │ - 503template │ │ │ │ │ - 504inline LocalIndexArray │ │ │ │ │ -505TopologyRefinerFactory::getBaseEdgeFaceLocalIndices(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e) { │ │ │ │ │ - 506 return newRefiner._levels[0]->getEdgeFaceLocalIndices(e); │ │ │ │ │ - 507} │ │ │ │ │ - 508template │ │ │ │ │ - 509inline LocalIndexArray │ │ │ │ │ -510TopologyRefinerFactory::getBaseVertexFaceLocalIndices(TopologyRefiner │ │ │ │ │ -& newRefiner, Index v) { │ │ │ │ │ - 511 return newRefiner._levels[0]->getVertexFaceLocalIndices(v); │ │ │ │ │ - 512} │ │ │ │ │ - 513template │ │ │ │ │ - 514inline LocalIndexArray │ │ │ │ │ -515TopologyRefinerFactory::getBaseVertexEdgeLocalIndices(TopologyRefiner │ │ │ │ │ -& newRefiner, Index v) { │ │ │ │ │ - 516 return newRefiner._levels[0]->getVertexEdgeLocalIndices(v); │ │ │ │ │ - 517} │ │ │ │ │ - 518 │ │ │ │ │ - 519template │ │ │ │ │ - 520inline Index │ │ │ │ │ -521TopologyRefinerFactory::findBaseEdge(TopologyRefiner const & │ │ │ │ │ -newRefiner, Index v0, Index v1) { │ │ │ │ │ - 522 return newRefiner._levels[0]->findEdge(v0, v1); │ │ │ │ │ - 523} │ │ │ │ │ - 524 │ │ │ │ │ - 525template │ │ │ │ │ - 526inline void │ │ │ │ │ -527TopologyRefinerFactory::populateBaseLocalIndices(TopologyRefiner & │ │ │ │ │ -newRefiner) { │ │ │ │ │ - 528 newRefiner._levels[0]->populateLocalIndices(); │ │ │ │ │ - 529} │ │ │ │ │ - 530 │ │ │ │ │ - 531template │ │ │ │ │ - 532inline void │ │ │ │ │ -533TopologyRefinerFactory::setBaseEdgeNonManifold(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e, bool b) { │ │ │ │ │ - 534 newRefiner._levels[0]->setEdgeNonManifold(e, b); │ │ │ │ │ - 535} │ │ │ │ │ - 536template │ │ │ │ │ - 537inline void │ │ │ │ │ -538TopologyRefinerFactory::setBaseVertexNonManifold(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v, bool b) { │ │ │ │ │ - 539 newRefiner._levels[0]->setVertexNonManifold(v, b); │ │ │ │ │ - 540} │ │ │ │ │ - 541 │ │ │ │ │ - 542template │ │ │ │ │ - 543inline void │ │ │ │ │ -544TopologyRefinerFactory::setBaseEdgeSharpness(TopologyRefiner & │ │ │ │ │ -newRefiner, Index e, float s) { │ │ │ │ │ - 545 newRefiner._levels[0]->getEdgeSharpness(e) = s; │ │ │ │ │ - 546} │ │ │ │ │ - 547template │ │ │ │ │ - 548inline void │ │ │ │ │ -549TopologyRefinerFactory::setBaseVertexSharpness(TopologyRefiner & │ │ │ │ │ -newRefiner, Index v, float s) { │ │ │ │ │ - 550 newRefiner._levels[0]->getVertexSharpness(v) = s; │ │ │ │ │ - 551} │ │ │ │ │ - 552template │ │ │ │ │ - 553inline void │ │ │ │ │ -554TopologyRefinerFactory::setBaseFaceHole(TopologyRefiner & newRefiner, │ │ │ │ │ -Index f, bool b) { │ │ │ │ │ - 555 newRefiner._levels[0]->setFaceHole(f, b); │ │ │ │ │ - 556 newRefiner._hasHoles = newRefiner._hasHoles || b; │ │ │ │ │ - 557} │ │ │ │ │ - 558 │ │ │ │ │ - 559template │ │ │ │ │ - 560inline int │ │ │ │ │ -561TopologyRefinerFactory::createBaseFVarChannel(TopologyRefiner & │ │ │ │ │ -newRefiner, int numValues) { │ │ │ │ │ - 562 return newRefiner._levels[0]->createFVarChannel(numValues, │ │ │ │ │ -newRefiner._subdivOptions); │ │ │ │ │ - 563} │ │ │ │ │ - 564template │ │ │ │ │ - 565inline int │ │ │ │ │ -566TopologyRefinerFactory::createBaseFVarChannel(TopologyRefiner & │ │ │ │ │ -newRefiner, int numValues, Sdc::Options const& fvarOptions) { │ │ │ │ │ - 567 Sdc::Options newOptions = newRefiner._subdivOptions; │ │ │ │ │ - 568 newOptions.SetFVarLinearInterpolation │ │ │ │ │ -(fvarOptions.GetFVarLinearInterpolation()); │ │ │ │ │ - 569 return newRefiner._levels[0]->createFVarChannel(numValues, newOptions); │ │ │ │ │ - 570} │ │ │ │ │ - 571template │ │ │ │ │ - 572inline IndexArray │ │ │ │ │ -573TopologyRefinerFactory::getBaseFaceFVarValues(TopologyRefiner & │ │ │ │ │ -newRefiner, Index face, int channel) { │ │ │ │ │ - 574 return newRefiner._levels[0]->getFaceFVarValues(face, channel); │ │ │ │ │ - 575} │ │ │ │ │ - 576 │ │ │ │ │ - 577 │ │ │ │ │ - 578template │ │ │ │ │ - 579bool │ │ │ │ │ -580TopologyRefinerFactory::resizeComponentTopology(TopologyRefiner& / │ │ │ │ │ -* refiner */, MESH const& /* mesh */) { │ │ │ │ │ - 581 │ │ │ │ │ - 582 Error(FAR_RUNTIME_ERROR, │ │ │ │ │ - 583 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no │ │ │ │ │ -specialization provided."); │ │ │ │ │ - 584 │ │ │ │ │ - 585 // │ │ │ │ │ - 586 // Sizing the topology tables: │ │ │ │ │ - 587 // This method is for determining the sizes of the various topology tables │ │ │ │ │ -(and other │ │ │ │ │ - 588 // data) associated with the mesh. Once completed, appropriate memory will │ │ │ │ │ -be allocated │ │ │ │ │ - 589 // and an additional method invoked to populate it accordingly. │ │ │ │ │ - 590 // │ │ │ │ │ - 591 // The following methods should be called -- first those to specify the │ │ │ │ │ -number of faces, │ │ │ │ │ - 592 // edges and vertices in the mesh: │ │ │ │ │ - 593 // │ │ │ │ │ - 594 // void setBaseFaceCount( TopologyRefiner& newRefiner, int count) │ │ │ │ │ - 595 // void setBaseEdgeCount( TopologyRefiner& newRefiner, int count) │ │ │ │ │ - 596 // void setBaseVertexCount(TopologyRefiner& newRefiner, int count) │ │ │ │ │ - 597 // │ │ │ │ │ - 598 // and then for each face, edge and vertex, the number of its incident │ │ │ │ │ -components: │ │ │ │ │ - 599 // │ │ │ │ │ - 600 // void setBaseFaceVertexCount(TopologyRefiner& newRefiner, Index face, │ │ │ │ │ -int count) │ │ │ │ │ - 601 // void setBaseEdgeFaceCount( TopologyRefiner& newRefiner, Index edge, int │ │ │ │ │ -count) │ │ │ │ │ - 602 // void setBaseVertexFaceCount(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ -int count) │ │ │ │ │ - 603 // void setBaseVertexEdgeCount(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ -int count) │ │ │ │ │ - 604 // │ │ │ │ │ - 605 // The count/size for a component type must be set before indices │ │ │ │ │ -associated with that │ │ │ │ │ - 606 // component type can be used. │ │ │ │ │ - 607 // │ │ │ │ │ - 608 // Note that it is only necessary to size 4 of the 6 supported topological │ │ │ │ │ -relations -- │ │ │ │ │ - 609 // the number of edge-vertices is fixed at two per edge, and the number of │ │ │ │ │ -face-edges is │ │ │ │ │ - 610 // the same as the number of face-vertices. │ │ │ │ │ - 611 // │ │ │ │ │ - 612 // So a single pass through your mesh to gather up all of this sizing │ │ │ │ │ -information will │ │ │ │ │ - 613 // allow the Tables to be allocated appropriately once and avoid any │ │ │ │ │ -dynamic resizing as │ │ │ │ │ - 614 // it grows. │ │ │ │ │ - 615 // │ │ │ │ │ - 616 return false; │ │ │ │ │ - 617} │ │ │ │ │ - 618 │ │ │ │ │ - 619template │ │ │ │ │ - 620bool │ │ │ │ │ -621TopologyRefinerFactory::assignComponentTopology(TopologyRefiner& / │ │ │ │ │ -* refiner */, MESH const& /* mesh */) { │ │ │ │ │ - 622 │ │ │ │ │ - 623 Error(FAR_RUNTIME_ERROR, │ │ │ │ │ - 624 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no │ │ │ │ │ -specialization provided."); │ │ │ │ │ - 625 │ │ │ │ │ - 626 // │ │ │ │ │ - 627 // Assigning the topology tables: │ │ │ │ │ - 628 // Once the topology tables have been allocated, the six required │ │ │ │ │ -topological │ │ │ │ │ - 629 // relations can be directly populated using the following methods: │ │ │ │ │ - 630 // │ │ │ │ │ - 631 // IndexArray setBaseFaceVertices(TopologyRefiner& newRefiner, Index face) │ │ │ │ │ - 632 // IndexArray setBaseFaceEdges(TopologyRefiner& newRefiner, Index face) │ │ │ │ │ - 633 // │ │ │ │ │ - 634 // IndexArray setBaseEdgeVertices(TopologyRefiner& newRefiner, Index edge) │ │ │ │ │ - 635 // IndexArray setBaseEdgeFaces(TopologyRefiner& newRefiner, Index edge) │ │ │ │ │ - 636 // │ │ │ │ │ - 637 // IndexArray setBaseVertexEdges(TopologyRefiner& newRefiner, Index │ │ │ │ │ -vertex) │ │ │ │ │ - 638 // IndexArray setBaseVertexFaces(TopologyRefiner& newRefiner, Index │ │ │ │ │ -vertex) │ │ │ │ │ - 639 // │ │ │ │ │ - 640 // For the last two relations -- the faces and edges incident a vertex - │ │ │ │ │ -- there are │ │ │ │ │ - 641 // also "local indices" that must be specified (considering doing this │ │ │ │ │ -internally), │ │ │ │ │ - 642 // where the "local index" of each incident face or edge is the index of │ │ │ │ │ -the vertex │ │ │ │ │ - 643 // within that face or edge, and so ranging from 0-3 for incident quads │ │ │ │ │ -and 0-1 for │ │ │ │ │ - 644 // incident edges. These are assigned through similarly retrieved arrays: │ │ │ │ │ - 645 // │ │ │ │ │ - 646 // LocalIndexArray setBaseVertexFaceLocalIndices(TopologyRefiner& │ │ │ │ │ -newRefiner, Index vertex) │ │ │ │ │ - 647 // LocalIndexArray setBaseVertexEdgeLocalIndices(TopologyRefiner& │ │ │ │ │ -newRefiner, Index vertex) │ │ │ │ │ - 648 // LocalIndexArray setBaseEdgeFaceLocalIndices( TopologyRefiner& │ │ │ │ │ -newRefiner, Index edge) │ │ │ │ │ - 649 // │ │ │ │ │ - 650 // or, if the mesh is manifold, explicit assignment of these can be │ │ │ │ │ -deferred and │ │ │ │ │ - 651 // all can be determined by calling: │ │ │ │ │ - 652 // │ │ │ │ │ - 653 // void populateBaseLocalIndices(TopologyRefiner& newRefiner) │ │ │ │ │ - 654 // │ │ │ │ │ - 655 // All components are assumed to be locally manifold and ordering of │ │ │ │ │ -components in │ │ │ │ │ - 656 // the above relations is expected to be counter-clockwise. │ │ │ │ │ - 657 // │ │ │ │ │ - 658 // For non-manifold components, no ordering/orientation of incident │ │ │ │ │ -components is │ │ │ │ │ - 659 // assumed or required, but be sure to explicitly tag such components │ │ │ │ │ -(vertices and │ │ │ │ │ - 660 // edges) as non-manifold: │ │ │ │ │ - 661 // │ │ │ │ │ - 662 // void setBaseEdgeNonManifold(TopologyRefiner& newRefiner, Index edge, │ │ │ │ │ -bool b); │ │ │ │ │ - 663 // │ │ │ │ │ - 664 // void setBaseVertexNonManifold(TopologyRefiner& newRefiner, Index │ │ │ │ │ -vertex, bool b); │ │ │ │ │ - 665 // │ │ │ │ │ - 666 // Also consider using TopologyLevel::ValidateTopology() when debugging to │ │ │ │ │ -ensure │ │ │ │ │ - 667 // that topology has been completely and correctly specified. │ │ │ │ │ - 668 // │ │ │ │ │ - 669 return false; │ │ │ │ │ - 670} │ │ │ │ │ - 671 │ │ │ │ │ - 672template │ │ │ │ │ - 673bool │ │ │ │ │ -674TopologyRefinerFactory::assignFaceVaryingTopology(TopologyRefiner& / │ │ │ │ │ -* refiner */, MESH const& /* mesh */) { │ │ │ │ │ - 675 │ │ │ │ │ - 676 // │ │ │ │ │ - 677 // Optional assigning face-varying topology tables: │ │ │ │ │ - 678 // │ │ │ │ │ - 679 // Create independent face-varying primitive variable channels: │ │ │ │ │ - 680 // int createBaseFVarChannel(TopologyRefiner& newRefiner, int numValues) │ │ │ │ │ - 681 // │ │ │ │ │ - 682 // For each channel, populate the face-vertex values: │ │ │ │ │ - 683 // IndexArray setBaseFaceFVarValues(TopologyRefiner& newRefiner, Index │ │ │ │ │ -face, int channel = 0) │ │ │ │ │ - 684 // │ │ │ │ │ - 685 return true; │ │ │ │ │ - 686} │ │ │ │ │ - 687 │ │ │ │ │ - 688template │ │ │ │ │ - 689bool │ │ │ │ │ -690TopologyRefinerFactory::assignComponentTags(TopologyRefiner& / │ │ │ │ │ -* refiner */, MESH const& /* mesh */) { │ │ │ │ │ - 691 │ │ │ │ │ - 692 // │ │ │ │ │ - 693 // Optional tagging: │ │ │ │ │ - 694 // This is where any additional feature tags -- sharpness, holes, etc. - │ │ │ │ │ -- can be │ │ │ │ │ - 695 // specified using: │ │ │ │ │ - 696 // │ │ │ │ │ - 697 // void setBaseEdgeSharpness(TopologyRefiner& newRefiner, Index edge, │ │ │ │ │ -float sharpness) │ │ │ │ │ - 698 // void setBaseVertexSharpness(TopologyRefiner& newRefiner, Index vertex, │ │ │ │ │ -float sharpness) │ │ │ │ │ - 699 // │ │ │ │ │ - 700 // void setBaseFaceHole(TopologyRefiner& newRefiner, Index face, bool │ │ │ │ │ -hole) │ │ │ │ │ - 701 // │ │ │ │ │ - 702 return true; │ │ │ │ │ - 703} │ │ │ │ │ - 704 │ │ │ │ │ - 705template │ │ │ │ │ - 706void │ │ │ │ │ -707TopologyRefinerFactory::reportInvalidTopology( │ │ │ │ │ - 708 TopologyError /* errCode */, char const * /* msg */, MESH const& /* mesh │ │ │ │ │ -*/) { │ │ │ │ │ - 709 │ │ │ │ │ - 710 // │ │ │ │ │ - 711 // Optional topology validation error reporting: │ │ │ │ │ - 712 // This method is called whenever the factory encounters topology │ │ │ │ │ -validation │ │ │ │ │ - 713 // errors. By default, nothing is reported │ │ │ │ │ - 714 // │ │ │ │ │ - 715} │ │ │ │ │ - 716 │ │ │ │ │ - 717} // end namespace Far │ │ │ │ │ - 718 │ │ │ │ │ - 719} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 720using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 721} // end namespace OpenSubdiv │ │ │ │ │ - 722 │ │ │ │ │ - 723#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H */ │ │ │ │ │ + 309#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::Error │ │ │ │ │ -void Error(ErrorType err, const char *format,...) │ │ │ │ │ -Sends an OSD error with a message (internal use only) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::FAR_RUNTIME_ERROR │ │ │ │ │ -@ FAR_RUNTIME_ERROR │ │ │ │ │ -Issue a generic runtime error, but continue execution. │ │ │ │ │ -Definition: error.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::Index │ │ │ │ │ -Vtr::Index Index │ │ │ │ │ -Definition: types.h:41 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::ConstIndexArray │ │ │ │ │ +Vtr::ConstIndexArray ConstIndexArray │ │ │ │ │ +Definition: types.h:47 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SchemeType │ │ │ │ │ SchemeType │ │ │ │ │ Enumerated type for all subdivision schemes supported by OpenSubdiv. │ │ │ │ │ Definition: types.h:37 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SCHEME_CATMARK │ │ │ │ │ -@ SCHEME_CATMARK │ │ │ │ │ -Definition: types.h:39 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PrimvarRefinerReal │ │ │ │ │ +Applies refinement operations to generic primvar data. │ │ │ │ │ +Definition: primvarRefiner.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PtexIndices │ │ │ │ │ +Object used to compute and query ptex face indices. │ │ │ │ │ +Definition: ptexIndices.h:46 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel │ │ │ │ │ +An interface for accessing data in a specific level of a refined topology │ │ │ │ │ +hierarchy. │ │ │ │ │ +Definition: topologyLevel.h:49 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory │ │ │ │ │ Factory for constructing TopologyRefiners from specific mesh classes. │ │ │ │ │ Definition: topologyRefinerFactory.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseFaces │ │ │ │ │ -static int getNumBaseFaces(TopologyRefiner const &newRefiner) │ │ │ │ │ -Definition: topologyRefinerFactory.h:436 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -assignComponentTopology │ │ │ │ │ -static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ -&mesh) │ │ │ │ │ -Specify the relationships between vertices, faces, etc. ie the face-vertices, │ │ │ │ │ -vertex-faces,... │ │ │ │ │ -Definition: topologyRefinerFactory.h:621 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -reportInvalidTopology │ │ │ │ │ -static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH │ │ │ │ │ -const &mesh) │ │ │ │ │ -(Optional) Control run-time topology validation and error reporting │ │ │ │ │ -Definition: topologyRefinerFactory.h:707 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseVertexFaceLocalIndices │ │ │ │ │ -static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner │ │ │ │ │ -&newRefiner, Index v) │ │ │ │ │ -Assign the local indices of a vertex within each of its incident faces. │ │ │ │ │ -Definition: topologyRefinerFactory.h:510 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseVertices │ │ │ │ │ -static int getNumBaseVertices(TopologyRefiner const &newRefiner) │ │ │ │ │ -Definition: topologyRefinerFactory.h:446 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setNumBaseEdgeFaces │ │ │ │ │ -static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int │ │ │ │ │ -count) │ │ │ │ │ -Specify the number of faces incident each edge. │ │ │ │ │ -Definition: topologyRefinerFactory.h:458 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseFaceVertices │ │ │ │ │ -static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f) │ │ │ │ │ -Assign the vertices incident each face. │ │ │ │ │ -Definition: topologyRefinerFactory.h:474 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseEdgeFaceLocalIndices │ │ │ │ │ -static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, │ │ │ │ │ -Index e) │ │ │ │ │ -Assign the local indices of an edge within each of its incident faces. │ │ │ │ │ -Definition: topologyRefinerFactory.h:505 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::populateBaseLevel │ │ │ │ │ -static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, │ │ │ │ │ -Options options) │ │ │ │ │ -Definition: topologyRefinerFactory.h:371 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -populateBaseLocalIndices │ │ │ │ │ -static void populateBaseLocalIndices(TopologyRefiner &newRefiner) │ │ │ │ │ -Determine all local indices by inspection (only for pure manifold meshes) │ │ │ │ │ -Definition: topologyRefinerFactory.h:527 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -assignComponentTags │ │ │ │ │ -static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh) │ │ │ │ │ -(Optional) Specify edge or vertex sharpness or face holes │ │ │ │ │ -Definition: topologyRefinerFactory.h:690 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -resizeComponentTopology │ │ │ │ │ -static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ -&mesh) │ │ │ │ │ -Specify the number of vertices, faces, face-vertices, etc. │ │ │ │ │ -Definition: topologyRefinerFactory.h:580 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setNumBaseVertexEdges │ │ │ │ │ -static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int │ │ │ │ │ -count) │ │ │ │ │ -Specify the number of edges incident each vertex. │ │ │ │ │ -Definition: topologyRefinerFactory.h:468 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::TopologyError │ │ │ │ │ -Vtr::internal::Level::TopologyError TopologyError │ │ │ │ │ -Definition: topologyRefinerFactory.h:131 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseFaceFVarValues │ │ │ │ │ -static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index │ │ │ │ │ -face, int channel=0) │ │ │ │ │ -Assign the face-varying values for the corners of each face. │ │ │ │ │ -Definition: topologyRefinerFactory.h:573 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseEdgeFaces │ │ │ │ │ -static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e) │ │ │ │ │ -Assign the faces incident each edge. │ │ │ │ │ -Definition: topologyRefinerFactory.h:489 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setNumBaseVertexFaces │ │ │ │ │ -static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int │ │ │ │ │ -count) │ │ │ │ │ -Specify the number of faces incident each vertex. │ │ │ │ │ -Definition: topologyRefinerFactory.h:463 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -assignFaceVaryingTopology │ │ │ │ │ -static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const │ │ │ │ │ -&mesh) │ │ │ │ │ -(Optional) Specify face-varying data per face │ │ │ │ │ -Definition: topologyRefinerFactory.h:674 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setBaseVertexSharpness │ │ │ │ │ -static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float │ │ │ │ │ -sharpness) │ │ │ │ │ -Assign a sharpness value to a given vertex. │ │ │ │ │ -Definition: topologyRefinerFactory.h:549 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseVertexEdgeLocalIndices │ │ │ │ │ -static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner │ │ │ │ │ -&newRefiner, Index v) │ │ │ │ │ -Assign the local indices of a vertex within each of its incident edges. │ │ │ │ │ -Definition: topologyRefinerFactory.h:515 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -getBaseEdgeVertices │ │ │ │ │ -static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e) │ │ │ │ │ -Assign the vertices incident each edge. │ │ │ │ │ -Definition: topologyRefinerFactory.h:484 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexFaces │ │ │ │ │ -static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v) │ │ │ │ │ -Assign the faces incident each vertex. │ │ │ │ │ -Definition: topologyRefinerFactory.h:494 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setBaseVertexNonManifold │ │ │ │ │ -static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool │ │ │ │ │ -b) │ │ │ │ │ -Tag a vertex as non-manifold. │ │ │ │ │ -Definition: topologyRefinerFactory.h:538 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseFaces │ │ │ │ │ -static void setNumBaseFaces(TopologyRefiner &newRefiner, int count) │ │ │ │ │ -Specify the number of faces to be accommodated. │ │ │ │ │ -Definition: topologyRefinerFactory.h:420 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseFaceEdges │ │ │ │ │ -static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f) │ │ │ │ │ -Assign the edges incident each face. │ │ │ │ │ -Definition: topologyRefinerFactory.h:479 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setNumBaseFaceVertices │ │ │ │ │ -static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int │ │ │ │ │ -count) │ │ │ │ │ -Specify the number of vertices incident each face. │ │ │ │ │ -Definition: topologyRefinerFactory.h:452 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setBaseEdgeSharpness │ │ │ │ │ -static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float │ │ │ │ │ -sharpness) │ │ │ │ │ -Assign a sharpness value to a given edge. │ │ │ │ │ -Definition: topologyRefinerFactory.h:544 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -setBaseEdgeNonManifold │ │ │ │ │ -static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool │ │ │ │ │ -b) │ │ │ │ │ -Tag an edge as non-manifold. │ │ │ │ │ -Definition: topologyRefinerFactory.h:533 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseEdges │ │ │ │ │ -static void setNumBaseEdges(TopologyRefiner &newRefiner, int count) │ │ │ │ │ -Specify the number of edges to be accommodated. │ │ │ │ │ -Definition: topologyRefinerFactory.h:425 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Create │ │ │ │ │ -static TopologyRefiner * Create(MESH const &mesh, Options options=Options()) │ │ │ │ │ -Instantiates a TopologyRefiner from client-provided topological representation. │ │ │ │ │ -Definition: topologyRefinerFactory.h:346 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::findBaseEdge │ │ │ │ │ -static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index │ │ │ │ │ -v1) │ │ │ │ │ -Identify an edge to be assigned a sharpness value given a vertex pair. │ │ │ │ │ -Definition: topologyRefinerFactory.h:521 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexEdges │ │ │ │ │ -static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v) │ │ │ │ │ -Assign the edges incident each vertex. │ │ │ │ │ -Definition: topologyRefinerFactory.h:499 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory:: │ │ │ │ │ -createBaseFVarChannel │ │ │ │ │ -static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues) │ │ │ │ │ -Create a new face-varying channel with the given number of values. │ │ │ │ │ -Definition: topologyRefinerFactory.h:561 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseEdges │ │ │ │ │ -static int getNumBaseEdges(TopologyRefiner const &newRefiner) │ │ │ │ │ -Definition: topologyRefinerFactory.h:441 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseVertices │ │ │ │ │ -static void setNumBaseVertices(TopologyRefiner &newRefiner, int count) │ │ │ │ │ -Specify the number of vertices to be accommodated. │ │ │ │ │ -Definition: topologyRefinerFactory.h:430 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseFaceHole │ │ │ │ │ -static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole) │ │ │ │ │ -Tag a face as a hole. │ │ │ │ │ -Definition: topologyRefinerFactory.h:554 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner │ │ │ │ │ Stores topology data for a specified set of refinement options. │ │ │ │ │ Definition: topologyRefiner.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::TopologyRefiner │ │ │ │ │ +TopologyRefiner(TopologyRefiner const &source) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetMaxValence │ │ │ │ │ +int GetMaxValence() const │ │ │ │ │ +Returns the maximum vertex valence in all levels. │ │ │ │ │ +Definition: topologyRefiner.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getLevel │ │ │ │ │ +Vtr::internal::Level const & getLevel(int l) const │ │ │ │ │ +Definition: topologyRefiner.h:237 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::HasHoles │ │ │ │ │ +bool HasHoles() const │ │ │ │ │ +Returns true if faces have been tagged as holes. │ │ │ │ │ +Definition: topologyRefiner.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumLevels │ │ │ │ │ +int GetNumLevels() const │ │ │ │ │ +Returns the number of refinement levels. │ │ │ │ │ +Definition: topologyRefiner.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFVarValuesTotal │ │ │ │ │ +int GetNumFVarValuesTotal(int channel=0) const │ │ │ │ │ +Returns the total number of face-varying values in all levels. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getRefinement │ │ │ │ │ +Vtr::internal::Refinement const & getRefinement(int l) const │ │ │ │ │ +Definition: topologyRefiner.h:240 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetSchemeOptions │ │ │ │ │ +Sdc::Options GetSchemeOptions() const │ │ │ │ │ +Returns the subdivision options. │ │ │ │ │ +Definition: topologyRefiner.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getLevel │ │ │ │ │ +Vtr::internal::Level & getLevel(int l) │ │ │ │ │ +Definition: topologyRefiner.h:236 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::IsUniform │ │ │ │ │ +bool IsUniform() const │ │ │ │ │ +Returns true if uniform refinement has been applied. │ │ │ │ │ +Definition: topologyRefiner.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetSchemeType │ │ │ │ │ +Sdc::SchemeType GetSchemeType() const │ │ │ │ │ +Returns the subdivision scheme. │ │ │ │ │ +Definition: topologyRefiner.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetMaxLevel │ │ │ │ │ +int GetMaxLevel() const │ │ │ │ │ +Returns the highest level of refinement. │ │ │ │ │ +Definition: topologyRefiner.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::TopologyRefiner │ │ │ │ │ +TopologyRefiner(Sdc::SchemeType type, Sdc::Options options=Sdc::Options()) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumEdgesTotal │ │ │ │ │ +int GetNumEdgesTotal() const │ │ │ │ │ +Returns the total number of edges in all levels. │ │ │ │ │ +Definition: topologyRefiner.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::PatchBuilder │ │ │ │ │ +friend class PatchBuilder │ │ │ │ │ +Definition: topologyRefiner.h:226 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channels in the tables. │ │ │ │ │ +Definition: topologyRefiner.h:293 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetUniformOptions │ │ │ │ │ +UniformOptions GetUniformOptions() const │ │ │ │ │ +Returns the options specified on refinement. │ │ │ │ │ +Definition: topologyRefiner.h:149 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFacesTotal │ │ │ │ │ +int GetNumFacesTotal() const │ │ │ │ │ +Returns the total number of edges in all levels. │ │ │ │ │ +Definition: topologyRefiner.h:89 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFaceVerticesTotal │ │ │ │ │ +int GetNumFaceVerticesTotal() const │ │ │ │ │ +Returns the total number of face vertices in all levels. │ │ │ │ │ +Definition: topologyRefiner.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::getRefinement │ │ │ │ │ +Vtr::internal::Refinement & getRefinement(int l) │ │ │ │ │ +Definition: topologyRefiner.h:239 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineUniform │ │ │ │ │ +void RefineUniform(UniformOptions options) │ │ │ │ │ +Refine the topology uniformly. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::~TopologyRefiner │ │ │ │ │ +~TopologyRefiner() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::PatchTableBuilder │ │ │ │ │ +friend class PatchTableBuilder │ │ │ │ │ +Definition: topologyRefiner.h:225 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetLevel │ │ │ │ │ +TopologyLevel const & GetLevel(int level) const │ │ │ │ │ +Returns a handle to access data specific to a particular level. │ │ │ │ │ +Definition: topologyRefiner.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumVerticesTotal │ │ │ │ │ +int GetNumVerticesTotal() const │ │ │ │ │ +Returns the total number of vertices in all levels. │ │ │ │ │ +Definition: topologyRefiner.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::Unrefine │ │ │ │ │ +void Unrefine() │ │ │ │ │ +Unrefine the topology, keeping only the base level. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetAdaptiveOptions │ │ │ │ │ +AdaptiveOptions GetAdaptiveOptions() const │ │ │ │ │ +Returns the options specified on refinement. │ │ │ │ │ +Definition: topologyRefiner.h:196 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner:: │ │ │ │ │ +GetFVarLinearInterpolation │ │ │ │ │ +Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) │ │ │ │ │ +const │ │ │ │ │ +Returns the face-varying interpolation rule set for a given channel. │ │ │ │ │ +Definition: topologyRefiner.h:298 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineAdaptive │ │ │ │ │ +void RefineAdaptive(AdaptiveOptions options, ConstIndexArray │ │ │ │ │ +selectedFaces=ConstIndexArray()) │ │ │ │ │ +Feature Adaptive topology refinement. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions │ │ │ │ │ +Uniform refinement options. │ │ │ │ │ +Definition: topologyRefiner.h:118 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +refinementLevel │ │ │ │ │ +unsigned int refinementLevel │ │ │ │ │ +Number of refinement iterations. │ │ │ │ │ +Definition: topologyRefiner.h:128 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +orderVerticesFromFacesFirst │ │ │ │ │ +unsigned int orderVerticesFromFacesFirst │ │ │ │ │ +Definition: topologyRefiner.h:130 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +SetRefinementLevel │ │ │ │ │ +void SetRefinementLevel(int level) │ │ │ │ │ +Set uniform refinement level. │ │ │ │ │ +Definition: topologyRefiner.h:126 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +fullTopologyInLastLevel │ │ │ │ │ +unsigned int fullTopologyInLastLevel │ │ │ │ │ +Definition: topologyRefiner.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +UniformOptions │ │ │ │ │ +UniformOptions(int level) │ │ │ │ │ +Definition: topologyRefiner.h:120 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions │ │ │ │ │ +Adaptive refinement options. │ │ │ │ │ +Definition: topologyRefiner.h:156 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +secondaryLevel │ │ │ │ │ +unsigned int secondaryLevel │ │ │ │ │ +Definition: topologyRefiner.h:174 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +orderVerticesFromFacesFirst │ │ │ │ │ +unsigned int orderVerticesFromFacesFirst │ │ │ │ │ +Definition: topologyRefiner.h:182 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +AdaptiveOptions │ │ │ │ │ +AdaptiveOptions(int level) │ │ │ │ │ +Definition: topologyRefiner.h:158 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +isolationLevel │ │ │ │ │ +unsigned int isolationLevel │ │ │ │ │ +Definition: topologyRefiner.h:172 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +useSingleCreasePatch │ │ │ │ │ +unsigned int useSingleCreasePatch │ │ │ │ │ +Definition: topologyRefiner.h:176 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +useInfSharpPatch │ │ │ │ │ +unsigned int useInfSharpPatch │ │ │ │ │ +Definition: topologyRefiner.h:178 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +SetIsolationLevel │ │ │ │ │ +void SetIsolationLevel(int level) │ │ │ │ │ +Set isolation level. │ │ │ │ │ +Definition: topologyRefiner.h:167 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +considerFVarChannels │ │ │ │ │ +unsigned int considerFVarChannels │ │ │ │ │ +Definition: topologyRefiner.h:180 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +SetSecondaryLevel │ │ │ │ │ +void SetSecondaryLevel(int level) │ │ │ │ │ +Set secondary isolation level. │ │ │ │ │ +Definition: topologyRefiner.h:170 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase │ │ │ │ │ Private base class of Factories for constructing TopologyRefiners. │ │ │ │ │ Definition: topologyRefinerFactory.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ -prepareComponentTopologyAssignment │ │ │ │ │ -static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool │ │ │ │ │ -fullValidation, TopologyCallback callback, void const *callbackData) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ -TopologyCallback │ │ │ │ │ -Vtr::internal::Level::ValidationCallback TopologyCallback │ │ │ │ │ -Definition: topologyRefinerFactory.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ -prepareComponentTagsAndSharpness │ │ │ │ │ -static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ -prepareComponentTopologySizing │ │ │ │ │ -static bool prepareComponentTopologySizing(TopologyRefiner &refiner) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase:: │ │ │ │ │ -prepareFaceVaryingChannels │ │ │ │ │ -static bool prepareFaceVaryingChannels(TopologyRefiner &refiner) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options │ │ │ │ │ -Options related to the construction of each TopologyRefiner. │ │ │ │ │ -Definition: topologyRefinerFactory.h:84 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::Options │ │ │ │ │ -Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options │ │ │ │ │ -sdcOptions=Sdc::Options()) │ │ │ │ │ -Definition: topologyRefinerFactory.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ -schemeOptions │ │ │ │ │ -Sdc::Options schemeOptions │ │ │ │ │ -Definition: topologyRefinerFactory.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ -schemeType │ │ │ │ │ -Sdc::SchemeType schemeType │ │ │ │ │ -The subdivision scheme type identifier. │ │ │ │ │ -Definition: topologyRefinerFactory.h:91 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options:: │ │ │ │ │ -validateFullTopology │ │ │ │ │ -unsigned int validateFullTopology │ │ │ │ │ -Definition: topologyRefinerFactory.h:94 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ All supported options applying to subdivision scheme. │ │ │ │ │ Definition: options.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation │ │ │ │ │ -void SetFVarLinearInterpolation(FVarLinearInterpolation b) │ │ │ │ │ -Set face-varying interpolation rule. │ │ │ │ │ -Definition: options.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation │ │ │ │ │ -FVarLinearInterpolation GetFVarLinearInterpolation() const │ │ │ │ │ -Get face-varying interpolation rule. │ │ │ │ │ -Definition: options.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Array │ │ │ │ │ -Definition: array.h:105 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ +FVarLinearInterpolation │ │ │ │ │ +Definition: options.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray │ │ │ │ │ +Definition: array.h:53 │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * topologyRefinerFactory.h │ │ │ │ │ + * topologyRefiner.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00710_source.html │ │ │ │ @@ -303,16 +303,16 @@ │ │ │ │
bool IsVertexSemiSharp(Index v) const
Return if the vertex is semi-sharp.
│ │ │ │
int GetNumFaceVertices() const
Return the total number of face-vertices, i.e. the sum of all vertices for all faces.
Definition: topologyLevel.h:71
│ │ │ │
bool IsVertexNonManifold(Index v) const
Return if the vertex is non-manifold.
│ │ │ │
bool IsEdgeBoundary(Index e) const
Return if the edge is a boundary (only one incident face)
│ │ │ │
bool IsVertexInfSharp(Index v) const
Return if the vertex is infinitely-sharp.
│ │ │ │
int GetNumFVarValues(int channel=0) const
Return the total number of face-varying values in a particular channel (the upper bound of a face-var...
│ │ │ │
ConstLocalIndexArray GetVertexFaceLocalIndices(Index v) const
Access the local indices of a vertex with respect to its incident faces.
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ - │ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ -#include "../far/topologyRefinerFactory.h"
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/topologyRefinerFactory.h"
│ │ │ │ #include "../far/error.h"
│ │ │ │ #include <cassert>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00713_source.html │ │ │ │ @@ -224,20 +224,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
│ │ │ │ -
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
│ │ │ │ -
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
│ │ │ │ -
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
│ │ │ │ -
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ +
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
│ │ │ │ +
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
│ │ │ │ +
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
│ │ │ │ +
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
│ │ │ │ +
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ #include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00716_source.html │ │ │ │ @@ -356,15 +356,15 @@ │ │ │ │
379} // end namespace OPENSUBDIV_VERSION
│ │ │ │
380using namespace OPENSUBDIV_VERSION;
│ │ │ │
381
│ │ │ │
382} // end namespace OpenSubdiv
│ │ │ │
383
│ │ │ │
384#endif // OPENSUBDIV3_FAR_STENCILTABLE_FACTORY_H
│ │ │ │ │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ │ │ │ │
static StencilTableReal< REAL > const * Create(TopologyRefiner const &refiner, Options options=Options())
Instantiates StencilTable from TopologyRefiner that have been refined uniformly or adaptively.
│ │ │ │
static StencilTableReal< REAL > const * AppendLocalPointStencilTableFaceVarying(TopologyRefiner const &refiner, StencilTableReal< REAL > const *baseStencilTable, StencilTableReal< REAL > const *localPointStencilTable, int channel=0, bool factorize=true)
Utility function for stencil splicing for local point face-varying stencils.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -409,15 +409,15 @@ │ │ │ │
static StencilTable const * AppendLocalPointStencilTableVarying(TopologyRefiner const &refiner, StencilTable const *baseStencilTable, StencilTable const *localPointStencilTable, bool factorize=true)
│ │ │ │
static StencilTable const * Create(TopologyRefiner const &refiner, Options options=Options())
│ │ │ │
static StencilTable const * AppendLocalPointStencilTableFaceVarying(TopologyRefiner const &refiner, StencilTable const *baseStencilTable, StencilTable const *localPointStencilTable, int channel=0, bool factorize=true)
│ │ │ │
static StencilTable const * AppendLocalPointStencilTable(TopologyRefiner const &refiner, StencilTable const *baseStencilTable, StencilTable const *localPointStencilTable, bool factorize=true)
│ │ │ │
static StencilTable const * Create(int numTables, StencilTable const **tables)
│ │ │ │
Stencil table factory class wrapping the template for compatibility.
│ │ │ │
static LimitStencilTable const * Create(TopologyRefiner const &refiner, LocationArrayVec const &locationArrays, StencilTable const *cvStencils=0, PatchTable const *patchTable=0, Options options=Options())
│ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ #include "../far/types.h"
│ │ │ │ #include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

class  StencilTableFactoryReal< REAL >
│ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00722_source.html │ │ │ │ @@ -166,15 +166,15 @@ │ │ │ │ │ │ │ │
Object used to compute and query ptex face indices.
Definition: ptexIndices.h:46
│ │ │ │
int GetFaceId(Index f) const
Returns the ptex face index given a coarse face 'f' or -1.
│ │ │ │
PtexIndices(TopologyRefiner const &refiner)
Constructor.
│ │ │ │
void GetAdjacency(TopologyRefiner const &refiner, int face, int quadrant, int adjFaces[4], int adjEdges[4]) const
Returns ptex face adjacency information for a given coarse face.
│ │ │ │
int GetNumFaces() const
Returns the number of ptex faces in the mesh.
│ │ │ │ │ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
primvarRefiner.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ -#include "../sdc/bilinearScheme.h"
│ │ │ │ -#include "../sdc/catmarkScheme.h"
│ │ │ │ -#include "../sdc/loopScheme.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/bilinearScheme.h"
│ │ │ │ +#include "../sdc/catmarkScheme.h"
│ │ │ │ +#include "../sdc/loopScheme.h"
│ │ │ │ #include "../vtr/level.h"
│ │ │ │ #include "../vtr/fvarLevel.h"
│ │ │ │ #include "../vtr/refinement.h"
│ │ │ │ #include "../vtr/fvarRefinement.h"
│ │ │ │ -#include "../vtr/stackBuffer.h"
│ │ │ │ +#include "../vtr/stackBuffer.h"
│ │ │ │ #include "../vtr/componentInterfaces.h"
│ │ │ │ #include "../far/types.h"
│ │ │ │ #include "../far/error.h"
│ │ │ │ #include "../far/topologyLevel.h"
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ #include <cassert>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00725_source.html │ │ │ │ @@ -1281,19 +1281,19 @@ │ │ │ │
void InterpolateVarying(int level, T const &src, U &dst) const
Apply only varying interpolation weights to a primvar buffer for a single level of refinement.
│ │ │ │
void Interpolate(int level, T const &src, U &dst) const
Apply vertex interpolation weights to a primvar buffer for a single level of refinement.
│ │ │ │
void InterpolateFaceVarying(int level, T const &src, U &dst, int channel=0) const
Apply face-varying interpolation weights to a primvar buffer associated with a particular face-varyin...
│ │ │ │ │ │ │ │
void LimitFaceVarying(T const &src, U &dst, int channel=0) const
│ │ │ │ │ │ │ │ │ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Scheme is a class template which provides all implementation for the subdivision schemes supported by...
Definition: scheme.h:66
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Scheme is a class template which provides all implementation for the subdivision schemes supported by...
Definition: scheme.h:66
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

class  PrimvarRefinerReal< REAL >
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00728_source.html │ │ │ │ @@ -267,15 +267,15 @@ │ │ │ │
231
│ │ │ │
232} // end namespace OpenSubdiv
│ │ │ │
233
│ │ │ │
234
│ │ │ │
235#endif /* OPENSUBDIV3_FAR_PATCH_TABLE_FACTORY_H */
│ │ │ │ │ │ │ │
Vtr::ConstIndexArray ConstIndexArray
Definition: types.h:47
│ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │
Factory for constructing a PatchTable from a TopologyRefiner.
│ │ │ │ │ │ │ │
static PatchTable * Create(TopologyRefiner const &refiner, Options options=Options(), ConstIndexArray selectedFaces=ConstIndexArray())
Instantiates a PatchTable from a client-provided TopologyRefiner.
│ │ │ │ │ │ │ │
unsigned int generateVaryingTables
Generate varying patch tables.
│ │ │ │
unsigned int generateLegacySharpCornerPatches
Generate sharp regular patches at smooth corners (legacy)
│ │ │ │ │ │ │ │ @@ -316,19 +316,19 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -
Stores topology data for a specified set of refinement options.
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
patchTable.h File Reference
│ │ │ │ +
patchMap.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchDescriptor.h"
│ │ │ │ -#include "../far/patchParam.h"
│ │ │ │ -#include "../far/stencilTable.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ -#include <vector>
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ +#include <cassert>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

class  PatchTableFactory
 Factory for constructing a PatchTable from a TopologyRefiner. More...
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  PatchTable
 Container for arrays of parametric patches. More...
class  PatchMap
 An quadtree-based map connecting coarse faces to their sub-patches. More...
 
class  PatchTable::PatchHandle
 Handle that can be used as unique patch identifier within PatchTable. More...
struct  PatchMap::QuadNode::Child
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -118,13 +114,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,34 +5,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -patchTable.h File Reference │ │ │ │ │ +patchMap.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchDescriptor.h" │ │ │ │ │ -#include "../far/patchParam.h" │ │ │ │ │ -#include "../far/stencilTable.h" │ │ │ │ │ -#include "../sdc/options.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../far/patchTable.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  PatchTable │ │ │ │ │ -  Container for arrays of parametric patches. More... │ │ │ │ │ + class  PatchMap │ │ │ │ │ +  An quadtree-based map connecting coarse faces to their sub-patches. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ -class  PatchTable::PatchHandle │ │ │ │ │ -  Handle that can be used as unique patch identifier within PatchTable. │ │ │ │ │ - More... │ │ │ │ │ +struct  PatchMap::QuadNode::Child │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * patchTable.h │ │ │ │ │ + * patchMap.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00731.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ │ var a00731 = [ │ │ │ │ │ - ["PatchTable", "a00993.html", "a00993"], │ │ │ │ │ - ["PatchTable::PatchHandle", "a00997.html", "a00997"] │ │ │ │ │ + ["PatchMap", "a00977.html", "a00977"], │ │ │ │ │ + ["PatchMap::QuadNode::Child", "a00985.html", "a00985"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00731_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/patchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/far/patchMap.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
patchTable.h
│ │ │ │ +
patchMap.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,695 +107,216 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_FAR_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_FAR_PATCH_MAP_H
│ │ │ │ +
26#define OPENSUBDIV3_FAR_PATCH_MAP_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../far/patchDescriptor.h"
│ │ │ │ -
31#include "../far/patchParam.h"
│ │ │ │ -
32#include "../far/stencilTable.h"
│ │ │ │ +
30#include "../far/patchTable.h"
│ │ │ │ +
31
│ │ │ │ +
32#include <cassert>
│ │ │ │
33
│ │ │ │ -
34#include "../sdc/options.h"
│ │ │ │ -
35
│ │ │ │ -
36#include <vector>
│ │ │ │ -
37
│ │ │ │ -
38namespace OpenSubdiv {
│ │ │ │ -
39namespace OPENSUBDIV_VERSION {
│ │ │ │ -
40
│ │ │ │ -
41namespace Far {
│ │ │ │ -
42
│ │ │ │ - │ │ │ │ -
56
│ │ │ │ -
57public:
│ │ │ │ -
58
│ │ │ │ - │ │ │ │ -
61 // XXXX manuelk members will eventually be made private
│ │ │ │ -
62 public:
│ │ │ │ -
63
│ │ │ │ -
64 friend class PatchTable;
│ │ │ │ -
65 friend class PatchMap;
│ │ │ │ -
66
│ │ │ │ -
67 Index arrayIndex, // Array index of the patch
│ │ │ │ -
68 patchIndex, // Absolute Index of the patch
│ │ │ │ -
69 vertIndex; // Relative offset to the first CV of the patch in array
│ │ │ │ -
70 };
│ │ │ │ -
71
│ │ │ │ -
72public:
│ │ │ │ -
73
│ │ │ │ -
75 PatchTable(PatchTable const & src);
│ │ │ │ -
76
│ │ │ │ - │ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Far {
│ │ │ │ +
38
│ │ │ │ +
49class PatchMap {
│ │ │ │ +
50public:
│ │ │ │ +
51
│ │ │ │ + │ │ │ │ +
53
│ │ │ │ +
58 PatchMap( PatchTable const & patchTable );
│ │ │ │ +
59
│ │ │ │ +
74 Handle const * FindPatch( int patchFaceId, double u, double v ) const;
│ │ │ │ +
75
│ │ │ │ +
76private:
│ │ │ │ +
77 void initializeHandles(PatchTable const & patchTable);
│ │ │ │ +
78 void initializeQuadtree(PatchTable const & patchTable);
│ │ │ │
79
│ │ │ │ -
81 bool IsFeatureAdaptive() const;
│ │ │ │ -
82
│ │ │ │ - │ │ │ │ -
85 return (int)_patchVerts.size();
│ │ │ │ -
86 }
│ │ │ │ -
87
│ │ │ │ -
89 int GetNumPatchesTotal() const;
│ │ │ │ +
80private:
│ │ │ │ +
81 // Quadtree node with 4 children, tree is just a vector of nodes
│ │ │ │ +
82 struct QuadNode {
│ │ │ │ +
83 QuadNode() { std::memset(this, 0, sizeof(QuadNode)); }
│ │ │ │ +
84
│ │ │ │ +
85 struct Child {
│ │ │ │ +
86 unsigned int isSet : 1; // true if the child has been set
│ │ │ │ +
87 unsigned int isLeaf : 1; // true if the child is a QuadNode
│ │ │ │ +
88 unsigned int index : 30; // child index (either QuadNode or Handle)
│ │ │ │ +
89 };
│ │ │ │
90
│ │ │ │ -
92 int GetMaxValence() const { return _maxValence; }
│ │ │ │ +
91 // sets all the children to point to the patch of given index
│ │ │ │ +
92 void SetChildren(int index);
│ │ │ │
93
│ │ │ │ -
95 int GetNumPtexFaces() const { return _numPtexFaces; }
│ │ │ │ +
94 // sets the child in "quadrant" to point to the node or patch of the given index
│ │ │ │ +
95 void SetChild(int quadrant, int index, bool isLeaf);
│ │ │ │
96
│ │ │ │ -
97
│ │ │ │ -
99
│ │ │ │ -
105
│ │ │ │ - │ │ │ │ -
108
│ │ │ │ - │ │ │ │ -
111
│ │ │ │ -
113 PatchParam GetPatchParam(PatchHandle const & handle) const;
│ │ │ │ -
114
│ │ │ │ -
116 ConstIndexArray GetPatchVertices(int array, int patch) const;
│ │ │ │ -
117
│ │ │ │ -
119 PatchParam GetPatchParam(int array, int patch) const;
│ │ │ │ -
121
│ │ │ │ -
122
│ │ │ │ -
124
│ │ │ │ -
130
│ │ │ │ -
132 int GetNumPatchArrays() const;
│ │ │ │ -
133
│ │ │ │ -
135 int GetNumPatches(int array) const;
│ │ │ │ -
136
│ │ │ │ -
138 int GetNumControlVertices(int array) const;
│ │ │ │ -
139
│ │ │ │ - │ │ │ │ -
142
│ │ │ │ - │ │ │ │ -
145
│ │ │ │ -
147 ConstPatchParamArray const GetPatchParams(int array) const;
│ │ │ │ -
149
│ │ │ │ +
97 Child children[4];
│ │ │ │ +
98 };
│ │ │ │ +
99 typedef std::vector<QuadNode> QuadTree;
│ │ │ │ +
100
│ │ │ │ +
101 // Internal methods supporting quadtree construction and queries
│ │ │ │ +
102 void assignRootNode(QuadNode * node, int index);
│ │ │ │ +
103 QuadNode * assignLeafOrChildNode(QuadNode * node, bool isLeaf, int quad, int index);
│ │ │ │ +
104
│ │ │ │ +
105 template <class T>
│ │ │ │ +
106 static int transformUVToQuadQuadrant(T const & median, T & u, T & v);
│ │ │ │ +
107 template <class T>
│ │ │ │ +
108 static int transformUVToTriQuadrant(T const & median, T & u, T & v, bool & rotated);
│ │ │ │ +
109
│ │ │ │ +
110private:
│ │ │ │ +
111 bool _patchesAreTriangular; // tri and quad assembly and search requirements differ
│ │ │ │ +
112
│ │ │ │ +
113 int _minPatchFace; // minimum patch face index supported by the map
│ │ │ │ +
114 int _maxPatchFace; // maximum patch face index supported by the map
│ │ │ │ +
115 int _maxDepth; // maximum depth of a patch in the tree
│ │ │ │ +
116
│ │ │ │ +
117 std::vector<Handle> _handles; // all the patches in the PatchTable
│ │ │ │ +
118 std::vector<QuadNode> _quadtree; // quadtree nodes
│ │ │ │ +
119};
│ │ │ │ +
120
│ │ │ │ +
121//
│ │ │ │ +
122// Given a median value for both U and V, these methods transform a (u,v) pair
│ │ │ │ +
123// into the quadrant that contains them and returns the quadrant index.
│ │ │ │ +
124//
│ │ │ │ +
125// Quadrant indexing for tri and quad patches -- consistent with PatchParam's
│ │ │ │ +
126// usage of UV bits:
│ │ │ │ +
127//
│ │ │ │ +
128// (0,1) o-----o-----o (1,1) (0,1) o (1,0) o-----o-----o (0,0)
│ │ │ │ +
129// | | | |\ \ 1 |\ 0 |
│ │ │ │ +
130// | 2 | 3 | | \ \ | \ |
│ │ │ │ +
131// | | | | 2 \ \| 3 \|
│ │ │ │ +
132// o-----o-----o o-----o o-----o
│ │ │ │ +
133// | | | |\ 3 |\ \ 2 |
│ │ │ │ +
134// | 0 | 1 | | \ | \ \ |
│ │ │ │ +
135// | | | | 0 \| 1 \ \|
│ │ │ │ +
136// (0,0) o-----o-----o (1,0) (0,0) o-----o-----o (1,0) o (0,1)
│ │ │ │ +
137//
│ │ │ │ +
138// The triangular case also takes and returns/affects the rotation of the
│ │ │ │ +
139// quadrant being searched and identified (quadrant 3 imparts a rotation).
│ │ │ │ +
140//
│ │ │ │ +
141template <class T>
│ │ │ │ +
142inline int
│ │ │ │ +
143PatchMap::transformUVToQuadQuadrant(T const & median, T & u, T & v) {
│ │ │ │ +
144
│ │ │ │ +
145 int uHalf = (u >= median);
│ │ │ │ +
146 if (uHalf) u -= median;
│ │ │ │ +
147
│ │ │ │ +
148 int vHalf = (v >= median);
│ │ │ │ +
149 if (vHalf) v -= median;
│ │ │ │
150
│ │ │ │ -
152
│ │ │ │ -
159
│ │ │ │ -
161 int GetNumLocalPoints() const;
│ │ │ │ -
162
│ │ │ │ - │ │ │ │ -
165
│ │ │ │ -
167 template <typename REAL>
│ │ │ │ - │ │ │ │ -
169
│ │ │ │ -
172 template <typename REAL> bool LocalPointStencilPrecisionMatchesType() const;
│ │ │ │ -
173
│ │ │ │ -
186 template <class T> void
│ │ │ │ -
187 ComputeLocalPointValues(T const *src, T *dst) const;
│ │ │ │ -
188
│ │ │ │ -
189
│ │ │ │ - │ │ │ │ -
192
│ │ │ │ - │ │ │ │ -
195
│ │ │ │ -
197 template <typename REAL>
│ │ │ │ - │ │ │ │ -
199
│ │ │ │ -
202 template <typename REAL> bool LocalPointVaryingStencilPrecisionMatchesType() const;
│ │ │ │ +
151 return (vHalf << 1) | uHalf;
│ │ │ │ +
152}
│ │ │ │ +
153
│ │ │ │ +
154template <class T>
│ │ │ │ +
155int inline
│ │ │ │ +
156PatchMap::transformUVToTriQuadrant(T const & median, T & u, T & v, bool & rotated) {
│ │ │ │ +
157
│ │ │ │ +
158 if (!rotated) {
│ │ │ │ +
159 if (u >= median) {
│ │ │ │ +
160 u -= median;
│ │ │ │ +
161 return 1;
│ │ │ │ +
162 }
│ │ │ │ +
163 if (v >= median) {
│ │ │ │ +
164 v -= median;
│ │ │ │ +
165 return 2;
│ │ │ │ +
166 }
│ │ │ │ +
167 if ((u + v) >= median) {
│ │ │ │ +
168 rotated = true;
│ │ │ │ +
169 return 3;
│ │ │ │ +
170 }
│ │ │ │ +
171 return 0;
│ │ │ │ +
172 } else {
│ │ │ │ +
173 if (u < median) {
│ │ │ │ +
174 v -= median;
│ │ │ │ +
175 return 1;
│ │ │ │ +
176 }
│ │ │ │ +
177 if (v < median) {
│ │ │ │ +
178 u -= median;
│ │ │ │ +
179 return 2;
│ │ │ │ +
180 }
│ │ │ │ +
181 u -= median;
│ │ │ │ +
182 v -= median;
│ │ │ │ +
183 if ((u + v) < median) {
│ │ │ │ +
184 rotated = false;
│ │ │ │ +
185 return 3;
│ │ │ │ +
186 }
│ │ │ │ +
187 return 0;
│ │ │ │ +
188 }
│ │ │ │ +
189}
│ │ │ │ +
190
│ │ │ │ +
192inline PatchMap::Handle const *
│ │ │ │ +
193PatchMap::FindPatch( int faceid, double u, double v ) const {
│ │ │ │ +
194
│ │ │ │ +
195 //
│ │ │ │ +
196 // Reject patch faces not supported by this map, or those corresponding
│ │ │ │ +
197 // to holes or otherwise unassigned (the root node for a patch will
│ │ │ │ +
198 // have all or no quadrants set):
│ │ │ │ +
199 //
│ │ │ │ +
200 if ((faceid < _minPatchFace) || (faceid > _maxPatchFace)) return 0;
│ │ │ │ +
201
│ │ │ │ +
202 QuadNode const * node = &_quadtree[faceid - _minPatchFace];
│ │ │ │
203
│ │ │ │ -
216 template <class T> void
│ │ │ │ -
217 ComputeLocalPointValuesVarying(T const *src, T *dst) const;
│ │ │ │ -
218
│ │ │ │ +
204 if (!node->children[0].isSet) return 0;
│ │ │ │ +
205
│ │ │ │ +
206 //
│ │ │ │ +
207 // Search the tree for the sub-patch containing the given (u,v)
│ │ │ │ +
208 //
│ │ │ │ +
209 assert( (u>=0.0) && (u<=1.0) && (v>=0.0) && (v<=1.0) );
│ │ │ │ +
210
│ │ │ │ +
211 double median = 0.5;
│ │ │ │ +
212 bool triRotated = false;
│ │ │ │ +
213
│ │ │ │ +
214 for (int depth = 0; depth <= _maxDepth; ++depth, median *= 0.5) {
│ │ │ │ +
215
│ │ │ │ +
216 int quadrant = _patchesAreTriangular
│ │ │ │ +
217 ? transformUVToTriQuadrant(median, u, v, triRotated)
│ │ │ │ +
218 : transformUVToQuadQuadrant(median, u, v);
│ │ │ │
219
│ │ │ │ -
221 int GetNumLocalPointsFaceVarying(int channel = 0) const;
│ │ │ │ +
220 // holes should have been rejected at the root node of the face
│ │ │ │ +
221 assert(node->children[quadrant].isSet);
│ │ │ │
222
│ │ │ │ -
224 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
│ │ │ │ -
225
│ │ │ │ -
227 template <typename REAL>
│ │ │ │ - │ │ │ │ -
229
│ │ │ │ -
232 template <typename REAL> bool LocalPointFaceVaryingStencilPrecisionMatchesType() const;
│ │ │ │ -
233
│ │ │ │ -
248 template <class T> void
│ │ │ │ -
249 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) const;
│ │ │ │ -
251
│ │ │ │ -
252
│ │ │ │ -
254
│ │ │ │ -
255
│ │ │ │ - │ │ │ │ -
260
│ │ │ │ - │ │ │ │ -
263
│ │ │ │ -
264 typedef std::vector<Index> VertexValenceTable;
│ │ │ │ -
265
│ │ │ │ - │ │ │ │ -
268 return _vertexValenceTable;
│ │ │ │ -
269 }
│ │ │ │ -
271
│ │ │ │ -
272
│ │ │ │ -
274
│ │ │ │ -
280
│ │ │ │ - │ │ │ │ -
284
│ │ │ │ -
287 float GetSingleCreasePatchSharpnessValue(int array, int patch) const;
│ │ │ │ -
289
│ │ │ │ -
290
│ │ │ │ -
292
│ │ │ │ -
298
│ │ │ │ - │ │ │ │ -
301
│ │ │ │ - │ │ │ │ -
304
│ │ │ │ -
306 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const;
│ │ │ │ -
307
│ │ │ │ - │ │ │ │ -
310
│ │ │ │ - │ │ │ │ -
314
│ │ │ │ -
315
│ │ │ │ -
317
│ │ │ │ -
323
│ │ │ │ - │ │ │ │ -
326
│ │ │ │ - │ │ │ │ -
329
│ │ │ │ - │ │ │ │ -
332
│ │ │ │ - │ │ │ │ -
335
│ │ │ │ -
337 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel = 0) const;
│ │ │ │ -
338
│ │ │ │ -
340 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) const;
│ │ │ │ -
341
│ │ │ │ -
343 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const;
│ │ │ │ -
344
│ │ │ │ -
346 ConstIndexArray GetFVarValues(int channel = 0) const;
│ │ │ │ -
347
│ │ │ │ -
349 int GetFVarValueStride(int channel = 0) const;
│ │ │ │ -
350
│ │ │ │ -
352 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = 0) const;
│ │ │ │ -
353
│ │ │ │ -
355 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) const;
│ │ │ │ -
356
│ │ │ │ -
358 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = 0) const;
│ │ │ │ -
359
│ │ │ │ - │ │ │ │ -
362
│ │ │ │ - │ │ │ │ -
366
│ │ │ │ -
367
│ │ │ │ -
369
│ │ │ │ -
374
│ │ │ │ -
375 typedef std::vector<Index> PatchVertsTable;
│ │ │ │ -
376
│ │ │ │ -
378 PatchVertsTable const & GetPatchControlVerticesTable() const { return _patchVerts; }
│ │ │ │ -
379
│ │ │ │ -
381 PatchParamTable const & GetPatchParamTable() const { return _paramTable; }
│ │ │ │ -
382
│ │ │ │ -
384 std::vector<Index> const &GetSharpnessIndexTable() const { return _sharpnessIndices; }
│ │ │ │ -
385
│ │ │ │ -
387 std::vector<float> const &GetSharpnessValues() const { return _sharpnessValues; }
│ │ │ │ -
388
│ │ │ │ -
389 typedef std::vector<unsigned int> QuadOffsetsTable;
│ │ │ │ -
390
│ │ │ │ - │ │ │ │ -
393 return _quadOffsetsTable;
│ │ │ │ -
394 }
│ │ │ │ -
396
│ │ │ │ -
398 void print() const;
│ │ │ │ -
399
│ │ │ │ -
400public:
│ │ │ │ -
401
│ │ │ │ -
403
│ │ │ │ -
405
│ │ │ │ -
428 template <typename REAL>
│ │ │ │ -
429 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ -
430 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ -
431 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
│ │ │ │ -
432
│ │ │ │ -
435 void EvaluateBasis(PatchHandle const & handle, float u, float v,
│ │ │ │ -
436 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ -
437 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
│ │ │ │ -
438
│ │ │ │ -
441 void EvaluateBasis(PatchHandle const & handle, double u, double v,
│ │ │ │ -
442 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ -
443 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
│ │ │ │ -
444
│ │ │ │ -
467 template <typename REAL>
│ │ │ │ -
468 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ -
469 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ -
470 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
│ │ │ │ -
471
│ │ │ │ -
474 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ -
475 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ -
476 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
│ │ │ │ -
477
│ │ │ │ -
480 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ -
481 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ -
482 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
│ │ │ │ -
483
│ │ │ │ -
508 template <typename REAL>
│ │ │ │ -
509 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ -
510 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ -
511 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0,
│ │ │ │ -
512 int channel = 0) const;
│ │ │ │ -
513
│ │ │ │ -
516 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ -
517 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ -
518 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0,
│ │ │ │ -
519 int channel = 0) const;
│ │ │ │ -
520
│ │ │ │ -
523 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ -
524 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ -
525 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0,
│ │ │ │ -
526 int channel = 0) const;
│ │ │ │ -
528
│ │ │ │ -
529protected:
│ │ │ │ -
530
│ │ │ │ -
531 friend class PatchTableBuilder;
│ │ │ │ -
532
│ │ │ │ -
533 // Factory constructor
│ │ │ │ -
534 PatchTable(int maxvalence);
│ │ │ │ -
535
│ │ │ │ -
536 Index getPatchIndex(int array, int patch) const;
│ │ │ │ -
537
│ │ │ │ - │ │ │ │ -
539
│ │ │ │ - │ │ │ │ -
541 float * getSharpnessValues(Index arrayIndex);
│ │ │ │ -
542
│ │ │ │ -
543private:
│ │ │ │ -
544
│ │ │ │ -
545 //
│ │ │ │ -
546 // Patch arrays
│ │ │ │ -
547 //
│ │ │ │ -
548
│ │ │ │ -
549 struct PatchArray;
│ │ │ │ -
550 typedef std::vector<PatchArray> PatchArrayVector;
│ │ │ │ -
551
│ │ │ │ -
552 PatchArray & getPatchArray(Index arrayIndex);
│ │ │ │ -
553 PatchArray const & getPatchArray(Index arrayIndex) const;
│ │ │ │ -
554
│ │ │ │ -
555 void reservePatchArrays(int numPatchArrays);
│ │ │ │ -
556 void pushPatchArray(PatchDescriptor desc, int npatches,
│ │ │ │ -
557 Index * vidx, Index * pidx, Index * qoidx=0);
│ │ │ │ -
558
│ │ │ │ -
559 IndexArray getPatchArrayVertices(int arrayIndex);
│ │ │ │ -
560
│ │ │ │ -
561 Index findPatchArray(PatchDescriptor desc);
│ │ │ │ -
562
│ │ │ │ -
563
│ │ │ │ -
564 //
│ │ │ │ -
565 // Varying patch arrays
│ │ │ │ -
566 //
│ │ │ │ -
567 IndexArray getPatchArrayVaryingVertices(int arrayIndex);
│ │ │ │ -
568
│ │ │ │ -
569 void allocateVaryingVertices(
│ │ │ │ -
570 PatchDescriptor desc, int numPatches);
│ │ │ │ -
571 void populateVaryingVertices();
│ │ │ │ -
572
│ │ │ │ -
573 //
│ │ │ │ -
574 // Face-varying patch channels
│ │ │ │ -
575 //
│ │ │ │ -
576
│ │ │ │ -
577 struct FVarPatchChannel;
│ │ │ │ -
578 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
│ │ │ │ -
579
│ │ │ │ -
580 FVarPatchChannel & getFVarPatchChannel(int channel);
│ │ │ │ -
581 FVarPatchChannel const & getFVarPatchChannel(int channel) const;
│ │ │ │ -
582
│ │ │ │ -
583 void allocateFVarPatchChannels(int numChannels);
│ │ │ │ -
584 void allocateFVarPatchChannelValues(
│ │ │ │ -
585 PatchDescriptor regDesc, PatchDescriptor irregDesc,
│ │ │ │ -
586 int numPatches, int channel);
│ │ │ │ -
587
│ │ │ │ -
588 // deprecated
│ │ │ │ -
589 void setFVarPatchChannelLinearInterpolation(
│ │ │ │ -
590 Sdc::Options::FVarLinearInterpolation interpolation, int channel);
│ │ │ │ -
591
│ │ │ │ -
592 IndexArray getFVarValues(int channel);
│ │ │ │ -
593 ConstIndexArray getPatchFVarValues(int patch, int channel) const;
│ │ │ │ -
594
│ │ │ │ -
595 PatchParamArray getFVarPatchParams(int channel);
│ │ │ │ -
596 PatchParam getPatchFVarPatchParam(int patch, int channel) const;
│ │ │ │ -
597
│ │ │ │ -
598private:
│ │ │ │ -
599 //
│ │ │ │ -
600 // Simple private class to hold stencil table pointers of varying precision,
│ │ │ │ -
601 // where the discriminant of the precision is external.
│ │ │ │ -
602 //
│ │ │ │ -
603 // NOTE that this is a simple pointer container and NOT a smart pointer that
│ │ │ │ -
604 // manages the ownership of the object referred to by it.
│ │ │ │ -
605 //
│ │ │ │ -
606 class StencilTablePtr {
│ │ │ │ -
607 private:
│ │ │ │ -
608 typedef StencilTableReal<float> float_type;
│ │ │ │ -
609 typedef StencilTableReal<double> double_type;
│ │ │ │ -
610
│ │ │ │ -
611 union {
│ │ │ │ -
612 float_type * _fPtr;
│ │ │ │ -
613 double_type * _dPtr;
│ │ │ │ -
614 };
│ │ │ │ -
615
│ │ │ │ -
616 public:
│ │ │ │ -
617 StencilTablePtr() { _fPtr = 0; }
│ │ │ │ -
618 StencilTablePtr(float_type * ptr) { _fPtr = ptr; }
│ │ │ │ -
619 StencilTablePtr(double_type * ptr) { _dPtr = ptr; }
│ │ │ │ -
620
│ │ │ │ -
621 operator bool() const { return _fPtr != 0; }
│ │ │ │ -
622
│ │ │ │ -
623 void Set() { _fPtr = 0; }
│ │ │ │ -
624 void Set(float_type * ptr) { _fPtr = ptr; }
│ │ │ │ -
625 void Set(double_type * ptr) { _dPtr = ptr; }
│ │ │ │ -
626
│ │ │ │ -
627 template <typename REAL> StencilTableReal<REAL> * Get() const;
│ │ │ │ -
628 };
│ │ │ │ -
629
│ │ │ │ -
630private:
│ │ │ │ -
631
│ │ │ │ -
632 //
│ │ │ │ -
633 // Topology
│ │ │ │ -
634 //
│ │ │ │ -
635
│ │ │ │ -
636 int _maxValence, // highest vertex valence found in the mesh
│ │ │ │ -
637 _numPtexFaces; // total number of ptex faces
│ │ │ │ -
638
│ │ │ │ -
639 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of patches
│ │ │ │ -
640
│ │ │ │ -
641 std::vector<Index> _patchVerts; // Indices of the control vertices of the patches
│ │ │ │ -
642
│ │ │ │ -
643 PatchParamTable _paramTable; // PatchParam bitfields (one per patch)
│ │ │ │ -
644
│ │ │ │ -
645 //
│ │ │ │ -
646 // Extraordinary vertex closed-form evaluation / endcap basis conversion
│ │ │ │ -
647 //
│ │ │ │ -
648 // XXXtakahito: these data will probably be replaced with mask coefficient or something
│ │ │ │ -
649 // SchemeWorker populates.
│ │ │ │ -
650 //
│ │ │ │ -
651 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches)
│ │ │ │ -
652 VertexValenceTable _vertexValenceTable; // Vertex valence table (for Gregory patches)
│ │ │ │ -
653
│ │ │ │ -
654 StencilTablePtr _localPointStencils; // local point conversion stencils
│ │ │ │ -
655 StencilTablePtr _localPointVaryingStencils; // local point varying stencils
│ │ │ │ -
656
│ │ │ │ -
657 //
│ │ │ │ -
658 // Varying data
│ │ │ │ -
659 //
│ │ │ │ -
660 PatchDescriptor _varyingDesc;
│ │ │ │ -
661
│ │ │ │ -
662 std::vector<Index> _varyingVerts;
│ │ │ │ -
663
│ │ │ │ -
664 //
│ │ │ │ -
665 // Face-varying data
│ │ │ │ -
666 //
│ │ │ │ -
667 FVarPatchChannelVector _fvarChannels;
│ │ │ │ -
668
│ │ │ │ -
669 std::vector<StencilTablePtr> _localPointFaceVaryingStencils;
│ │ │ │ -
670
│ │ │ │ -
671 //
│ │ │ │ -
672 // 'single-crease' patch sharpness tables
│ │ │ │ -
673 //
│ │ │ │ -
674 std::vector<Index> _sharpnessIndices; // Indices of single-crease sharpness (one per patch)
│ │ │ │ -
675 std::vector<float> _sharpnessValues; // Sharpness values.
│ │ │ │ -
676
│ │ │ │ -
677 //
│ │ │ │ -
678 // Construction history -- relevant to at least one public query:
│ │ │ │ -
679 //
│ │ │ │ -
680 unsigned int _isUniformLinear : 1;
│ │ │ │ -
681
│ │ │ │ -
682 //
│ │ │ │ -
683 // Precision -- only applies to local-point stencil tables
│ │ │ │ -
684 //
│ │ │ │ -
685 unsigned int _vertexPrecisionIsDouble : 1;
│ │ │ │ -
686 unsigned int _varyingPrecisionIsDouble : 1;
│ │ │ │ -
687 unsigned int _faceVaryingPrecisionIsDouble : 1;
│ │ │ │ -
688};
│ │ │ │ -
689
│ │ │ │ -
690
│ │ │ │ -
691//
│ │ │ │ -
692// Template specializations for float/double -- to be defined before used:
│ │ │ │ -
693//
│ │ │ │ -
694template <> inline StencilTableReal<float> *
│ │ │ │ -
695PatchTable::StencilTablePtr::Get<float>() const { return _fPtr; }
│ │ │ │ -
696
│ │ │ │ -
697template <> inline StencilTableReal<double> *
│ │ │ │ -
698PatchTable::StencilTablePtr::Get<double>() const { return _dPtr; }
│ │ │ │ -
699
│ │ │ │ -
700template <> inline bool
│ │ │ │ -
701PatchTable::LocalPointStencilPrecisionMatchesType<float>() const {
│ │ │ │ -
702 return !_vertexPrecisionIsDouble;
│ │ │ │ -
703}
│ │ │ │ -
704template <> inline bool
│ │ │ │ -
705PatchTable::LocalPointVaryingStencilPrecisionMatchesType<float>() const {
│ │ │ │ -
706 return !_varyingPrecisionIsDouble;
│ │ │ │ -
707}
│ │ │ │ -
708template <> inline bool
│ │ │ │ -
709PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<float>() const {
│ │ │ │ -
710 return !_faceVaryingPrecisionIsDouble;
│ │ │ │ -
711}
│ │ │ │ -
712
│ │ │ │ -
713template <> inline bool
│ │ │ │ -
714PatchTable::LocalPointStencilPrecisionMatchesType<double>() const {
│ │ │ │ -
715 return _vertexPrecisionIsDouble;
│ │ │ │ -
716}
│ │ │ │ -
717template <> inline bool
│ │ │ │ -
718PatchTable::LocalPointVaryingStencilPrecisionMatchesType<double>() const {
│ │ │ │ -
719 return _varyingPrecisionIsDouble;
│ │ │ │ -
720}
│ │ │ │ -
721template <> inline bool
│ │ │ │ -
722PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<double>() const {
│ │ │ │ -
723 return _faceVaryingPrecisionIsDouble;
│ │ │ │ -
724}
│ │ │ │ -
725
│ │ │ │ -
726//
│ │ │ │ -
727// StencilTable access -- backward compatible and generic:
│ │ │ │ -
728//
│ │ │ │ -
729inline StencilTable const *
│ │ │ │ - │ │ │ │ -
731 assert(LocalPointStencilPrecisionMatchesType<float>());
│ │ │ │ -
732 return static_cast<StencilTable const *>(_localPointStencils.Get<float>());
│ │ │ │ -
733}
│ │ │ │ -
734inline StencilTable const *
│ │ │ │ - │ │ │ │ -
736 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ -
737 return static_cast<StencilTable const *>(
│ │ │ │ -
738 _localPointVaryingStencils.Get<float>());
│ │ │ │ -
739}
│ │ │ │ -
740inline StencilTable const *
│ │ │ │ - │ │ │ │ -
742 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ -
743 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ -
744 return static_cast<StencilTable const *>(
│ │ │ │ -
745 _localPointFaceVaryingStencils[channel].Get<float>());
│ │ │ │ -
746 }
│ │ │ │ -
747 return NULL;
│ │ │ │ -
748}
│ │ │ │ -
749
│ │ │ │ -
750template <typename REAL>
│ │ │ │ -
751inline StencilTableReal<REAL> const *
│ │ │ │ - │ │ │ │ -
753 assert(LocalPointStencilPrecisionMatchesType<REAL>());
│ │ │ │ -
754 return _localPointStencils.Get<REAL>();
│ │ │ │ -
755}
│ │ │ │ -
756template <typename REAL>
│ │ │ │ -
757inline StencilTableReal<REAL> const *
│ │ │ │ - │ │ │ │ -
759 assert(LocalPointVaryingStencilPrecisionMatchesType<REAL>());
│ │ │ │ -
760 return _localPointVaryingStencils.Get<REAL>();
│ │ │ │ -
761}
│ │ │ │ -
762template <typename REAL>
│ │ │ │ -
763inline StencilTableReal<REAL> const *
│ │ │ │ - │ │ │ │ -
765 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<REAL>());
│ │ │ │ -
766 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ -
767 return _localPointFaceVaryingStencils[channel].Get<REAL>();
│ │ │ │ -
768 }
│ │ │ │ -
769 return NULL;
│ │ │ │ -
770}
│ │ │ │ -
771
│ │ │ │ -
772
│ │ │ │ -
773//
│ │ │ │ -
774// Computation of local point values:
│ │ │ │ -
775//
│ │ │ │ -
776template <class T>
│ │ │ │ -
777inline void
│ │ │ │ -
778PatchTable::ComputeLocalPointValues(T const *src, T *dst) const {
│ │ │ │ -
779 assert(LocalPointStencilPrecisionMatchesType<float>());
│ │ │ │ -
780 if (_localPointStencils) {
│ │ │ │ -
781 _localPointStencils.Get<float>()->UpdateValues(src, dst);
│ │ │ │ -
782 }
│ │ │ │ -
783}
│ │ │ │ -
784
│ │ │ │ -
785template <class T>
│ │ │ │ -
786inline void
│ │ │ │ - │ │ │ │ -
788 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ -
789 if (_localPointVaryingStencils) {
│ │ │ │ -
790 _localPointVaryingStencils.Get<float>()->UpdateValues(src, dst);
│ │ │ │ -
791 }
│ │ │ │ -
792}
│ │ │ │ -
793
│ │ │ │ -
794template <class T>
│ │ │ │ -
795inline void
│ │ │ │ -
796PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel) const {
│ │ │ │ -
797 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ -
798 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ -
799 if (_localPointFaceVaryingStencils[channel]) {
│ │ │ │ -
800 _localPointFaceVaryingStencils[channel].Get<float>()->UpdateValues(src, dst);
│ │ │ │ -
801 }
│ │ │ │ -
802 }
│ │ │ │ -
803}
│ │ │ │ -
804
│ │ │ │ -
805
│ │ │ │ -
806//
│ │ │ │ -
807// Basis evaluation overloads
│ │ │ │ -
808//
│ │ │ │ -
809inline void
│ │ │ │ -
810PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v,
│ │ │ │ -
811 float wP[], float wDu[], float wDv[],
│ │ │ │ -
812 float wDuu[], float wDuv[], float wDvv[]) const {
│ │ │ │ -
813
│ │ │ │ -
814 EvaluateBasis<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ -
815}
│ │ │ │ -
816inline void
│ │ │ │ -
817PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v,
│ │ │ │ -
818 double wP[], double wDu[], double wDv[],
│ │ │ │ -
819 double wDuu[], double wDuv[], double wDvv[]) const {
│ │ │ │ -
820
│ │ │ │ -
821 EvaluateBasis<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ -
822}
│ │ │ │ -
823
│ │ │ │ -
824inline void
│ │ │ │ -
825PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ -
826 float wP[], float wDu[], float wDv[],
│ │ │ │ -
827 float wDuu[], float wDuv[], float wDvv[]) const {
│ │ │ │ -
828
│ │ │ │ -
829 EvaluateBasisVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ -
830}
│ │ │ │ -
831inline void
│ │ │ │ -
832PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ -
833 double wP[], double wDu[], double wDv[],
│ │ │ │ -
834 double wDuu[], double wDuv[], double wDvv[]) const {
│ │ │ │ -
835
│ │ │ │ -
836 EvaluateBasisVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ -
837}
│ │ │ │ -
838
│ │ │ │ -
839inline void
│ │ │ │ -
840PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ -
841 float wP[], float wDu[], float wDv[],
│ │ │ │ -
842 float wDuu[], float wDuv[], float wDvv[], int channel) const {
│ │ │ │ -
843
│ │ │ │ -
844 EvaluateBasisFaceVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
│ │ │ │ -
845}
│ │ │ │ -
846inline void
│ │ │ │ -
847PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ -
848 double wP[], double wDu[], double wDv[],
│ │ │ │ -
849 double wDuu[], double wDuv[], double wDvv[], int channel) const {
│ │ │ │ -
850
│ │ │ │ -
851 EvaluateBasisFaceVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
│ │ │ │ -
852}
│ │ │ │ -
853
│ │ │ │ -
854} // end namespace Far
│ │ │ │ -
855
│ │ │ │ -
856} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
857using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
858
│ │ │ │ -
859} // end namespace OpenSubdiv
│ │ │ │ -
860
│ │ │ │ -
861#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */
│ │ │ │ +
223 if (node->children[quadrant].isLeaf) {
│ │ │ │ +
224 return &_handles[node->children[quadrant].index];
│ │ │ │ +
225 } else {
│ │ │ │ +
226 node = &_quadtree[node->children[quadrant].index];
│ │ │ │ +
227 }
│ │ │ │ +
228 }
│ │ │ │ +
229 assert(0);
│ │ │ │ +
230 return 0;
│ │ │ │ +
231}
│ │ │ │ +
232
│ │ │ │ +
233} // end namespace Far
│ │ │ │ +
234
│ │ │ │ +
235} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
236using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
237
│ │ │ │ +
238} // end namespace OpenSubdiv
│ │ │ │ +
239
│ │ │ │ +
240#endif /* OPENSUBDIV3_FAR_PATCH_PARAM */
│ │ │ │ │ │ │ │ -
std::vector< PatchParam > PatchParamTable
Definition: patchParam.h:243
│ │ │ │ - │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ - │ │ │ │ -
An quadtree-based map connecting coarse faces to their sub-patches.
Definition: patchMap.h:49
│ │ │ │ - │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ -
ConstIndexArray GetPatchArrayVaryingVertices(int array) const
Returns the varying vertex indices for the patches in array.
│ │ │ │ - │ │ │ │ -
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
Definition: patchTable.h:378
│ │ │ │ -
void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) const
Updates local point face-varying values.
Definition: patchTable.h:796
│ │ │ │ -
ConstIndexArray GetVaryingVertices() const
Returns an array of varying vertex indices for the patches.
│ │ │ │ -
void ComputeLocalPointValuesVarying(T const *src, T *dst) const
Updates local point varying values.
Definition: patchTable.h:787
│ │ │ │ -
ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const
Returns the varying vertex indices for a given patch.
│ │ │ │ -
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
│ │ │ │ -
int GetMaxValence() const
Returns max vertex valence.
Definition: patchTable.h:92
│ │ │ │ -
StencilTableReal< REAL > const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
│ │ │ │ -
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Definition: patchTable.h:730
│ │ │ │ -
PatchParamArray getPatchParams(int arrayIndex)
│ │ │ │ -
ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const
Returns the value indices for the patches in array in channel.
│ │ │ │ -
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
Definition: patchTable.h:387
│ │ │ │ - │ │ │ │ -
PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const
Returns the face-varying params for a given patch channel.
│ │ │ │ -
ConstIndexArray GetPatchVaryingVertices(int array, int patch) const
Returns the varying vertex indices for a given patch.
│ │ │ │ -
PatchTable(PatchTable const &src)
Copy constructor.
│ │ │ │ -
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
│ │ │ │ -
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by handle.
│ │ │ │ - │ │ │ │ -
bool LocalPointFaceVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point face-varying values matches the gi...
│ │ │ │ -
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Definition: patchTable.h:381
│ │ │ │ -
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
Definition: patchTable.h:267
│ │ │ │ -
StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
Definition: patchTable.h:741
│ │ │ │ -
int GetNumControlVertices(int array) const
Returns the number of control vertices in array.
│ │ │ │ - │ │ │ │ -
void EvaluateBasisFaceVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0, int channel=0) const
Evaluate basis functions for a face-varying value and derivatives at a given (u,v) parametric locatio...
│ │ │ │ -
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by handle.
│ │ │ │ -
PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const
Returns the irregular patch descriptor for channel.
│ │ │ │ -
float GetSingleCreasePatchSharpnessValue(int array, int patch) const
Returns the crease sharpness for the patch in array if it is a single-crease patch,...
│ │ │ │ - │ │ │ │ -
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point vertex values.
Definition: patchTable.h:778
│ │ │ │ -
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch,...
│ │ │ │ -
PatchParam GetPatchParam(int array, int patch) const
Returns the PatchParam for patch in array.
│ │ │ │ -
ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ -
PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const
Returns the regular patch descriptor for channel.
│ │ │ │ -
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patch identified by handle.
│ │ │ │ - │ │ │ │ -
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
Definition: patchTable.h:392
│ │ │ │ -
int GetNumPatches(int array) const
Returns the number of patches in array.
│ │ │ │ -
PatchDescriptor GetVaryingPatchDescriptor() const
Returns the varying patch descriptor.
│ │ │ │ -
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ -
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array.
│ │ │ │ -
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
Definition: patchTable.h:84
│ │ │ │ -
int GetNumFVarChannels() const
Returns the number of face-varying channels.
│ │ │ │ -
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) const
Returns the face-varying for a given patch in array in channel.
│ │ │ │ -
Index getPatchIndex(int array, int patch) const
│ │ │ │ -
int GetNumLocalPoints() const
Returns the number of local vertex points.
│ │ │ │ -
bool LocalPointVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point varying values matches the given f...
│ │ │ │ -
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array.
│ │ │ │ -
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
Definition: patchTable.h:95
│ │ │ │ -
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in channel.
│ │ │ │ -
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Definition: patchTable.h:259
│ │ │ │ -
void EvaluateBasis(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for position and derivatives at a given (u,v) parametric location of a patch...
│ │ │ │ -
StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
│ │ │ │ -
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
│ │ │ │ -
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by handle.
│ │ │ │ - │ │ │ │ -
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Deprecated.
│ │ │ │ -
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
Definition: patchTable.h:384
│ │ │ │ -
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array.
│ │ │ │ - │ │ │ │ -
void EvaluateBasisVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for a varying value and derivatives at a given (u,v) parametric location of ...
│ │ │ │ -
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
Definition: patchTable.h:735
│ │ │ │ -
std::vector< unsigned int > QuadOffsetsTable
Definition: patchTable.h:389
│ │ │ │ -
ConstIndexArray GetPatchVertices(int array, int patch) const
Returns the control vertex indices for patch in array.
│ │ │ │ -
PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ -
int GetFVarValueStride(int channel=0) const
Returns the stride between patches in the value index array of channel.
│ │ │ │ -
ConstPatchParamArray GetFVarPatchParams(int channel=0) const
Returns an array of face-varying patch param for channel.
│ │ │ │ -
PatchDescriptor GetFVarPatchDescriptor(int channel=0) const
Returns the default/irregular patch descriptor for channel.
│ │ │ │ -
int GetNumLocalPointsVarying() const
Returns the number of local varying points.
│ │ │ │ -
bool LocalPointStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point vertex values matches the given fl...
│ │ │ │ -
StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
│ │ │ │ -
int GetNumLocalPointsFaceVarying(int channel=0) const
Returns the number of local face-varying points for channel.
│ │ │ │ -
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
An quadtree-based map connecting coarse faces to their sub-patches.
Definition: patchMap.h:49
│ │ │ │ +
PatchMap(PatchTable const &patchTable)
Constructor.
│ │ │ │ +
Handle const * FindPatch(int patchFaceId, double u, double v) const
Returns a handle to the sub-patch of the face at the given (u,v). Note that the patch face ID corresp...
Definition: patchMap.h:193
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ +
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -patchTable.h │ │ │ │ │ +patchMap.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,952 +30,238 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_FAR_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_FAR_PATCH_MAP_H │ │ │ │ │ + 26#define OPENSUBDIV3_FAR_PATCH_MAP_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../far/patchDescriptor.h" │ │ │ │ │ - 31#include "../far/patchParam.h" │ │ │ │ │ - 32#include "../far/stencilTable.h" │ │ │ │ │ + 30#include "../far/patchTable.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ 33 │ │ │ │ │ - 34#include "../sdc/options.h" │ │ │ │ │ - 35 │ │ │ │ │ - 36#include │ │ │ │ │ - 37 │ │ │ │ │ - 38namespace OpenSubdiv { │ │ │ │ │ - 39namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 40 │ │ │ │ │ - 41namespace Far { │ │ │ │ │ - 42 │ │ │ │ │ -55class PatchTable { │ │ │ │ │ - 56 │ │ │ │ │ - 57public: │ │ │ │ │ - 58 │ │ │ │ │ -60 class PatchHandle { │ │ │ │ │ - 61 // XXXX manuelk members will eventually be made private │ │ │ │ │ - 62 public: │ │ │ │ │ - 63 │ │ │ │ │ -64 friend class PatchTable; │ │ │ │ │ -65 friend class PatchMap; │ │ │ │ │ - 66 │ │ │ │ │ -67 Index arrayIndex, // Array index of the patch │ │ │ │ │ -68 patchIndex, // Absolute Index of the patch │ │ │ │ │ -69 vertIndex; // Relative offset to the first CV of the patch in array │ │ │ │ │ - 70 }; │ │ │ │ │ - 71 │ │ │ │ │ - 72public: │ │ │ │ │ - 73 │ │ │ │ │ -75 PatchTable(PatchTable const & src); │ │ │ │ │ - 76 │ │ │ │ │ -78 ~PatchTable(); │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 │ │ │ │ │ +49class PatchMap { │ │ │ │ │ + 50public: │ │ │ │ │ + 51 │ │ │ │ │ +52 typedef PatchTable::PatchHandle Handle; │ │ │ │ │ + 53 │ │ │ │ │ +58 PatchMap( PatchTable const & patchTable ); │ │ │ │ │ + 59 │ │ │ │ │ + 74 Handle const * FindPatch( int patchFaceId, double u, double v ) const; │ │ │ │ │ + 75 │ │ │ │ │ + 76private: │ │ │ │ │ + 77 void initializeHandles(PatchTable const & patchTable); │ │ │ │ │ + 78 void initializeQuadtree(PatchTable const & patchTable); │ │ │ │ │ 79 │ │ │ │ │ -81 bool IsFeatureAdaptive() const; │ │ │ │ │ - 82 │ │ │ │ │ -84 int GetNumControlVerticesTotal() const { │ │ │ │ │ - 85 return (int)_patchVerts.size(); │ │ │ │ │ - 86 } │ │ │ │ │ - 87 │ │ │ │ │ -89 int GetNumPatchesTotal() const; │ │ │ │ │ + 80private: │ │ │ │ │ + 81 // Quadtree node with 4 children, tree is just a vector of nodes │ │ │ │ │ + 82 struct QuadNode { │ │ │ │ │ + 83 QuadNode() { std::memset(this, 0, sizeof(QuadNode)); } │ │ │ │ │ + 84 │ │ │ │ │ +85 struct Child { │ │ │ │ │ +86 unsigned int isSet : 1; // true if the child has been set │ │ │ │ │ +87 unsigned int isLeaf : 1; // true if the child is a QuadNode │ │ │ │ │ +88 unsigned int index : 30; // child index (either QuadNode or Handle) │ │ │ │ │ + 89 }; │ │ │ │ │ 90 │ │ │ │ │ -92 int GetMaxValence() const { return _maxValence; } │ │ │ │ │ + 91 // sets all the children to point to the patch of given index │ │ │ │ │ + 92 void SetChildren(int index); │ │ │ │ │ 93 │ │ │ │ │ -95 int GetNumPtexFaces() const { return _numPtexFaces; } │ │ │ │ │ + 94 // sets the child in "quadrant" to point to the node or patch of the given │ │ │ │ │ +index │ │ │ │ │ + 95 void SetChild(int quadrant, int index, bool isLeaf); │ │ │ │ │ 96 │ │ │ │ │ - 97 │ │ │ │ │ - 99 │ │ │ │ │ - 105 │ │ │ │ │ -107 PatchDescriptor GetPatchDescriptor(PatchHandle const & handle) const; │ │ │ │ │ - 108 │ │ │ │ │ -110 ConstIndexArray GetPatchVertices(PatchHandle const & handle) const; │ │ │ │ │ - 111 │ │ │ │ │ -113 PatchParam GetPatchParam(PatchHandle const & handle) const; │ │ │ │ │ - 114 │ │ │ │ │ -116 ConstIndexArray GetPatchVertices(int array, int patch) const; │ │ │ │ │ - 117 │ │ │ │ │ -119 PatchParam GetPatchParam(int array, int patch) const; │ │ │ │ │ - 121 │ │ │ │ │ - 122 │ │ │ │ │ - 124 │ │ │ │ │ - 130 │ │ │ │ │ -132 int GetNumPatchArrays() const; │ │ │ │ │ - 133 │ │ │ │ │ -135 int GetNumPatches(int array) const; │ │ │ │ │ - 136 │ │ │ │ │ -138 int GetNumControlVertices(int array) const; │ │ │ │ │ - 139 │ │ │ │ │ -141 PatchDescriptor GetPatchArrayDescriptor(int array) const; │ │ │ │ │ - 142 │ │ │ │ │ -144 ConstIndexArray GetPatchArrayVertices(int array) const; │ │ │ │ │ - 145 │ │ │ │ │ -147 ConstPatchParamArray const GetPatchParams(int array) const; │ │ │ │ │ - 149 │ │ │ │ │ + 97 Child children[4]; │ │ │ │ │ + 98 }; │ │ │ │ │ + 99 typedef std::vector QuadTree; │ │ │ │ │ + 100 │ │ │ │ │ + 101 // Internal methods supporting quadtree construction and queries │ │ │ │ │ + 102 void assignRootNode(QuadNode * node, int index); │ │ │ │ │ + 103 QuadNode * assignLeafOrChildNode(QuadNode * node, bool isLeaf, int quad, │ │ │ │ │ +int index); │ │ │ │ │ + 104 │ │ │ │ │ + 105 template │ │ │ │ │ + 106 static int transformUVToQuadQuadrant(T const & median, T & u, T & v); │ │ │ │ │ + 107 template │ │ │ │ │ + 108 static int transformUVToTriQuadrant(T const & median, T & u, T & v, bool & │ │ │ │ │ +rotated); │ │ │ │ │ + 109 │ │ │ │ │ + 110private: │ │ │ │ │ + 111 bool _patchesAreTriangular; // tri and quad assembly and search │ │ │ │ │ +requirements differ │ │ │ │ │ + 112 │ │ │ │ │ + 113 int _minPatchFace; // minimum patch face index supported by the map │ │ │ │ │ + 114 int _maxPatchFace; // maximum patch face index supported by the map │ │ │ │ │ + 115 int _maxDepth; // maximum depth of a patch in the tree │ │ │ │ │ + 116 │ │ │ │ │ + 117 std::vector _handles; // all the patches in the PatchTable │ │ │ │ │ + 118 std::vector _quadtree; // quadtree nodes │ │ │ │ │ + 119}; │ │ │ │ │ + 120 │ │ │ │ │ + 121// │ │ │ │ │ + 122// Given a median value for both U and V, these methods transform a (u,v) │ │ │ │ │ +pair │ │ │ │ │ + 123// into the quadrant that contains them and returns the quadrant index. │ │ │ │ │ + 124// │ │ │ │ │ + 125// Quadrant indexing for tri and quad patches -- consistent with │ │ │ │ │ +PatchParam's │ │ │ │ │ + 126// usage of UV bits: │ │ │ │ │ + 127// │ │ │ │ │ + 128// (0,1) o-----o-----o (1,1) (0,1) o (1,0) o-----o-----o (0,0) │ │ │ │ │ + 129// | | | |\ \ 1 |\ 0 | │ │ │ │ │ + 130// | 2 | 3 | | \ \ | \ | │ │ │ │ │ + 131// | | | | 2 \ \| 3 \| │ │ │ │ │ + 132// o-----o-----o o-----o o-----o │ │ │ │ │ + 133// | | | |\ 3 |\ \ 2 | │ │ │ │ │ + 134// | 0 | 1 | | \ | \ \ | │ │ │ │ │ + 135// | | | | 0 \| 1 \ \| │ │ │ │ │ + 136// (0,0) o-----o-----o (1,0) (0,0) o-----o-----o (1,0) o (0,1) │ │ │ │ │ + 137// │ │ │ │ │ + 138// The triangular case also takes and returns/affects the rotation of the │ │ │ │ │ + 139// quadrant being searched and identified (quadrant 3 imparts a rotation). │ │ │ │ │ + 140// │ │ │ │ │ + 141template │ │ │ │ │ + 142inline int │ │ │ │ │ + 143PatchMap::transformUVToQuadQuadrant(T const & median, T & u, T & v) { │ │ │ │ │ + 144 │ │ │ │ │ + 145 int uHalf = (u >= median); │ │ │ │ │ + 146 if (uHalf) u -= median; │ │ │ │ │ + 147 │ │ │ │ │ + 148 int vHalf = (v >= median); │ │ │ │ │ + 149 if (vHalf) v -= median; │ │ │ │ │ 150 │ │ │ │ │ - 152 │ │ │ │ │ - 159 │ │ │ │ │ -161 int GetNumLocalPoints() const; │ │ │ │ │ - 162 │ │ │ │ │ - 164 StencilTable const *GetLocalPointStencilTable() const; │ │ │ │ │ - 165 │ │ │ │ │ - 167 template │ │ │ │ │ -168 StencilTableReal const *GetLocalPointStencilTable() const; │ │ │ │ │ - 169 │ │ │ │ │ -172 template bool LocalPointStencilPrecisionMatchesType() │ │ │ │ │ -const; │ │ │ │ │ - 173 │ │ │ │ │ - 186 template void │ │ │ │ │ - 187 ComputeLocalPointValues(T const *src, T *dst) const; │ │ │ │ │ - 188 │ │ │ │ │ - 189 │ │ │ │ │ -191 int GetNumLocalPointsVarying() const; │ │ │ │ │ - 192 │ │ │ │ │ - 194 StencilTable const *GetLocalPointVaryingStencilTable() const; │ │ │ │ │ - 195 │ │ │ │ │ - 197 template │ │ │ │ │ -198 StencilTableReal const *GetLocalPointVaryingStencilTable() const; │ │ │ │ │ - 199 │ │ │ │ │ -202 template bool LocalPointVaryingStencilPrecisionMatchesType │ │ │ │ │ -() const; │ │ │ │ │ + 151 return (vHalf << 1) | uHalf; │ │ │ │ │ + 152} │ │ │ │ │ + 153 │ │ │ │ │ + 154template │ │ │ │ │ + 155int inline │ │ │ │ │ + 156PatchMap::transformUVToTriQuadrant(T const & median, T & u, T & v, bool & │ │ │ │ │ +rotated) { │ │ │ │ │ + 157 │ │ │ │ │ + 158 if (!rotated) { │ │ │ │ │ + 159 if (u >= median) { │ │ │ │ │ + 160 u -= median; │ │ │ │ │ + 161 return 1; │ │ │ │ │ + 162 } │ │ │ │ │ + 163 if (v >= median) { │ │ │ │ │ + 164 v -= median; │ │ │ │ │ + 165 return 2; │ │ │ │ │ + 166 } │ │ │ │ │ + 167 if ((u + v) >= median) { │ │ │ │ │ + 168 rotated = true; │ │ │ │ │ + 169 return 3; │ │ │ │ │ + 170 } │ │ │ │ │ + 171 return 0; │ │ │ │ │ + 172 } else { │ │ │ │ │ + 173 if (u < median) { │ │ │ │ │ + 174 v -= median; │ │ │ │ │ + 175 return 1; │ │ │ │ │ + 176 } │ │ │ │ │ + 177 if (v < median) { │ │ │ │ │ + 178 u -= median; │ │ │ │ │ + 179 return 2; │ │ │ │ │ + 180 } │ │ │ │ │ + 181 u -= median; │ │ │ │ │ + 182 v -= median; │ │ │ │ │ + 183 if ((u + v) < median) { │ │ │ │ │ + 184 rotated = false; │ │ │ │ │ + 185 return 3; │ │ │ │ │ + 186 } │ │ │ │ │ + 187 return 0; │ │ │ │ │ + 188 } │ │ │ │ │ + 189} │ │ │ │ │ + 190 │ │ │ │ │ + 192inline PatchMap::Handle const * │ │ │ │ │ +193PatchMap::FindPatch( int faceid, double u, double v ) const { │ │ │ │ │ + 194 │ │ │ │ │ + 195 // │ │ │ │ │ + 196 // Reject patch faces not supported by this map, or those corresponding │ │ │ │ │ + 197 // to holes or otherwise unassigned (the root node for a patch will │ │ │ │ │ + 198 // have all or no quadrants set): │ │ │ │ │ + 199 // │ │ │ │ │ + 200 if ((faceid < _minPatchFace) || (faceid > _maxPatchFace)) return 0; │ │ │ │ │ + 201 │ │ │ │ │ + 202 QuadNode const * node = &_quadtree[faceid - _minPatchFace]; │ │ │ │ │ 203 │ │ │ │ │ - 216 template void │ │ │ │ │ - 217 ComputeLocalPointValuesVarying(T const *src, T *dst) const; │ │ │ │ │ - 218 │ │ │ │ │ + 204 if (!node->children[0].isSet) return 0; │ │ │ │ │ + 205 │ │ │ │ │ + 206 // │ │ │ │ │ + 207 // Search the tree for the sub-patch containing the given (u,v) │ │ │ │ │ + 208 // │ │ │ │ │ + 209 assert( (u>=0.0) && (u<=1.0) && (v>=0.0) && (v<=1.0) ); │ │ │ │ │ + 210 │ │ │ │ │ + 211 double median = 0.5; │ │ │ │ │ + 212 bool triRotated = false; │ │ │ │ │ + 213 │ │ │ │ │ + 214 for (int depth = 0; depth <= _maxDepth; ++depth, median *= 0.5) { │ │ │ │ │ + 215 │ │ │ │ │ + 216 int quadrant = _patchesAreTriangular │ │ │ │ │ + 217 ? transformUVToTriQuadrant(median, u, v, triRotated) │ │ │ │ │ + 218 : transformUVToQuadQuadrant(median, u, v); │ │ │ │ │ 219 │ │ │ │ │ -221 int GetNumLocalPointsFaceVarying(int channel = 0) const; │ │ │ │ │ + 220 // holes should have been rejected at the root node of the face │ │ │ │ │ + 221 assert(node->children[quadrant].isSet); │ │ │ │ │ 222 │ │ │ │ │ - 224 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) │ │ │ │ │ -const; │ │ │ │ │ - 225 │ │ │ │ │ - 227 template │ │ │ │ │ -228 StencilTableReal const * GetLocalPointFaceVaryingStencilTable(int │ │ │ │ │ -channel = 0) const; │ │ │ │ │ - 229 │ │ │ │ │ -232 template bool │ │ │ │ │ -LocalPointFaceVaryingStencilPrecisionMatchesType() const; │ │ │ │ │ - 233 │ │ │ │ │ - 248 template void │ │ │ │ │ - 249 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) │ │ │ │ │ -const; │ │ │ │ │ - 251 │ │ │ │ │ - 252 │ │ │ │ │ - 254 │ │ │ │ │ - 255 │ │ │ │ │ -259 typedef Vtr::ConstArray ConstQuadOffsetsArray; │ │ │ │ │ - 260 │ │ │ │ │ -262 ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const & handle) │ │ │ │ │ -const; │ │ │ │ │ - 263 │ │ │ │ │ -264 typedef std::vector VertexValenceTable; │ │ │ │ │ - 265 │ │ │ │ │ -267 VertexValenceTable const & GetVertexValenceTable() const { │ │ │ │ │ - 268 return _vertexValenceTable; │ │ │ │ │ - 269 } │ │ │ │ │ - 271 │ │ │ │ │ - 272 │ │ │ │ │ - 274 │ │ │ │ │ - 280 │ │ │ │ │ -283 float GetSingleCreasePatchSharpnessValue(PatchHandle const & handle) const; │ │ │ │ │ - 284 │ │ │ │ │ -287 float GetSingleCreasePatchSharpnessValue(int array, int patch) const; │ │ │ │ │ - 289 │ │ │ │ │ - 290 │ │ │ │ │ - 292 │ │ │ │ │ - 298 │ │ │ │ │ -300 PatchDescriptor GetVaryingPatchDescriptor() const; │ │ │ │ │ - 301 │ │ │ │ │ -303 ConstIndexArray GetPatchVaryingVertices(PatchHandle const & handle) const; │ │ │ │ │ - 304 │ │ │ │ │ -306 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const; │ │ │ │ │ - 307 │ │ │ │ │ -309 ConstIndexArray GetPatchArrayVaryingVertices(int array) const; │ │ │ │ │ - 310 │ │ │ │ │ -312 ConstIndexArray GetVaryingVertices() const; │ │ │ │ │ - 314 │ │ │ │ │ - 315 │ │ │ │ │ - 317 │ │ │ │ │ - 323 │ │ │ │ │ -325 int GetNumFVarChannels() const; │ │ │ │ │ - 326 │ │ │ │ │ -328 PatchDescriptor GetFVarPatchDescriptorRegular(int channel = 0) const; │ │ │ │ │ - 329 │ │ │ │ │ -331 PatchDescriptor GetFVarPatchDescriptorIrregular(int channel = 0) const; │ │ │ │ │ - 332 │ │ │ │ │ -334 PatchDescriptor GetFVarPatchDescriptor(int channel = 0) const; │ │ │ │ │ - 335 │ │ │ │ │ -337 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel │ │ │ │ │ -= 0) const; │ │ │ │ │ - 338 │ │ │ │ │ -340 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) │ │ │ │ │ -const; │ │ │ │ │ - 341 │ │ │ │ │ -343 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const; │ │ │ │ │ - 344 │ │ │ │ │ -346 ConstIndexArray GetFVarValues(int channel = 0) const; │ │ │ │ │ - 347 │ │ │ │ │ -349 int GetFVarValueStride(int channel = 0) const; │ │ │ │ │ - 350 │ │ │ │ │ -352 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = │ │ │ │ │ -0) const; │ │ │ │ │ - 353 │ │ │ │ │ -355 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) │ │ │ │ │ -const; │ │ │ │ │ - 356 │ │ │ │ │ -358 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = │ │ │ │ │ -0) const; │ │ │ │ │ - 359 │ │ │ │ │ -361 ConstPatchParamArray GetFVarPatchParams(int channel = 0) const; │ │ │ │ │ - 362 │ │ │ │ │ -364 Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int │ │ │ │ │ -channel = 0) const; │ │ │ │ │ - 366 │ │ │ │ │ - 367 │ │ │ │ │ - 369 │ │ │ │ │ - 374 │ │ │ │ │ -375 typedef std::vector PatchVertsTable; │ │ │ │ │ - 376 │ │ │ │ │ -378 PatchVertsTable const & GetPatchControlVerticesTable() const { return │ │ │ │ │ -_patchVerts; } │ │ │ │ │ - 379 │ │ │ │ │ -381 PatchParamTable const & GetPatchParamTable() const { return _paramTable; } │ │ │ │ │ - 382 │ │ │ │ │ -384 std::vector const &GetSharpnessIndexTable() const { return │ │ │ │ │ -_sharpnessIndices; } │ │ │ │ │ - 385 │ │ │ │ │ -387 std::vector const &GetSharpnessValues() const { return │ │ │ │ │ -_sharpnessValues; } │ │ │ │ │ - 388 │ │ │ │ │ -389 typedef std::vector QuadOffsetsTable; │ │ │ │ │ - 390 │ │ │ │ │ -392 QuadOffsetsTable const & GetQuadOffsetsTable() const { │ │ │ │ │ - 393 return _quadOffsetsTable; │ │ │ │ │ - 394 } │ │ │ │ │ - 396 │ │ │ │ │ -398 void print() const; │ │ │ │ │ - 399 │ │ │ │ │ - 400public: │ │ │ │ │ - 401 │ │ │ │ │ - 403 │ │ │ │ │ - 405 │ │ │ │ │ - 428 template │ │ │ │ │ -429 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ - 430 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ - 431 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const; │ │ │ │ │ - 432 │ │ │ │ │ - 435 void EvaluateBasis(PatchHandle const & handle, float u, float v, │ │ │ │ │ - 436 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ - 437 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const; │ │ │ │ │ - 438 │ │ │ │ │ - 441 void EvaluateBasis(PatchHandle const & handle, double u, double v, │ │ │ │ │ - 442 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ - 443 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const; │ │ │ │ │ - 444 │ │ │ │ │ - 467 template │ │ │ │ │ -468 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ - 469 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ - 470 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const; │ │ │ │ │ - 471 │ │ │ │ │ - 474 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v, │ │ │ │ │ - 475 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ - 476 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const; │ │ │ │ │ - 477 │ │ │ │ │ - 480 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v, │ │ │ │ │ - 481 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ - 482 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const; │ │ │ │ │ - 483 │ │ │ │ │ - 508 template │ │ │ │ │ -509 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ - 510 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ - 511 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0, │ │ │ │ │ - 512 int channel = 0) const; │ │ │ │ │ - 513 │ │ │ │ │ - 516 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float │ │ │ │ │ -v, │ │ │ │ │ - 517 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ - 518 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0, │ │ │ │ │ - 519 int channel = 0) const; │ │ │ │ │ - 520 │ │ │ │ │ - 523 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double │ │ │ │ │ -v, │ │ │ │ │ - 524 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ - 525 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0, │ │ │ │ │ - 526 int channel = 0) const; │ │ │ │ │ - 528 │ │ │ │ │ - 529protected: │ │ │ │ │ - 530 │ │ │ │ │ -531 friend class PatchTableBuilder; │ │ │ │ │ - 532 │ │ │ │ │ - 533 // Factory constructor │ │ │ │ │ -534 PatchTable(int maxvalence); │ │ │ │ │ - 535 │ │ │ │ │ -536 Index getPatchIndex(int array, int patch) const; │ │ │ │ │ - 537 │ │ │ │ │ -538 PatchParamArray getPatchParams(int arrayIndex); │ │ │ │ │ - 539 │ │ │ │ │ -540 Index * getSharpnessIndices(Index arrayIndex); │ │ │ │ │ -541 float * getSharpnessValues(Index arrayIndex); │ │ │ │ │ - 542 │ │ │ │ │ - 543private: │ │ │ │ │ - 544 │ │ │ │ │ - 545 // │ │ │ │ │ - 546 // Patch arrays │ │ │ │ │ - 547 // │ │ │ │ │ - 548 │ │ │ │ │ - 549 struct PatchArray; │ │ │ │ │ - 550 typedef std::vector PatchArrayVector; │ │ │ │ │ - 551 │ │ │ │ │ - 552 PatchArray & getPatchArray(Index arrayIndex); │ │ │ │ │ - 553 PatchArray const & getPatchArray(Index arrayIndex) const; │ │ │ │ │ - 554 │ │ │ │ │ - 555 void reservePatchArrays(int numPatchArrays); │ │ │ │ │ - 556 void pushPatchArray(PatchDescriptor desc, int npatches, │ │ │ │ │ - 557 Index * vidx, Index * pidx, Index * qoidx=0); │ │ │ │ │ - 558 │ │ │ │ │ - 559 IndexArray getPatchArrayVertices(int arrayIndex); │ │ │ │ │ - 560 │ │ │ │ │ - 561 Index findPatchArray(PatchDescriptor desc); │ │ │ │ │ - 562 │ │ │ │ │ - 563 │ │ │ │ │ - 564 // │ │ │ │ │ - 565 // Varying patch arrays │ │ │ │ │ - 566 // │ │ │ │ │ - 567 IndexArray getPatchArrayVaryingVertices(int arrayIndex); │ │ │ │ │ - 568 │ │ │ │ │ - 569 void allocateVaryingVertices( │ │ │ │ │ - 570 PatchDescriptor desc, int numPatches); │ │ │ │ │ - 571 void populateVaryingVertices(); │ │ │ │ │ - 572 │ │ │ │ │ - 573 // │ │ │ │ │ - 574 // Face-varying patch channels │ │ │ │ │ - 575 // │ │ │ │ │ - 576 │ │ │ │ │ - 577 struct FVarPatchChannel; │ │ │ │ │ - 578 typedef std::vector FVarPatchChannelVector; │ │ │ │ │ - 579 │ │ │ │ │ - 580 FVarPatchChannel & getFVarPatchChannel(int channel); │ │ │ │ │ - 581 FVarPatchChannel const & getFVarPatchChannel(int channel) const; │ │ │ │ │ - 582 │ │ │ │ │ - 583 void allocateFVarPatchChannels(int numChannels); │ │ │ │ │ - 584 void allocateFVarPatchChannelValues( │ │ │ │ │ - 585 PatchDescriptor regDesc, PatchDescriptor irregDesc, │ │ │ │ │ - 586 int numPatches, int channel); │ │ │ │ │ - 587 │ │ │ │ │ - 588 // deprecated │ │ │ │ │ - 589 void setFVarPatchChannelLinearInterpolation( │ │ │ │ │ - 590 Sdc::Options::FVarLinearInterpolation interpolation, int channel); │ │ │ │ │ - 591 │ │ │ │ │ - 592 IndexArray getFVarValues(int channel); │ │ │ │ │ - 593 ConstIndexArray getPatchFVarValues(int patch, int channel) const; │ │ │ │ │ - 594 │ │ │ │ │ - 595 PatchParamArray getFVarPatchParams(int channel); │ │ │ │ │ - 596 PatchParam getPatchFVarPatchParam(int patch, int channel) const; │ │ │ │ │ - 597 │ │ │ │ │ - 598private: │ │ │ │ │ - 599 // │ │ │ │ │ - 600 // Simple private class to hold stencil table pointers of varying │ │ │ │ │ -precision, │ │ │ │ │ - 601 // where the discriminant of the precision is external. │ │ │ │ │ - 602 // │ │ │ │ │ - 603 // NOTE that this is a simple pointer container and NOT a smart pointer │ │ │ │ │ -that │ │ │ │ │ - 604 // manages the ownership of the object referred to by it. │ │ │ │ │ - 605 // │ │ │ │ │ - 606 class StencilTablePtr { │ │ │ │ │ - 607 private: │ │ │ │ │ - 608 typedef StencilTableReal float_type; │ │ │ │ │ - 609 typedef StencilTableReal double_type; │ │ │ │ │ - 610 │ │ │ │ │ - 611 union { │ │ │ │ │ - 612 float_type * _fPtr; │ │ │ │ │ - 613 double_type * _dPtr; │ │ │ │ │ - 614 }; │ │ │ │ │ - 615 │ │ │ │ │ - 616 public: │ │ │ │ │ - 617 StencilTablePtr() { _fPtr = 0; } │ │ │ │ │ - 618 StencilTablePtr(float_type * ptr) { _fPtr = ptr; } │ │ │ │ │ - 619 StencilTablePtr(double_type * ptr) { _dPtr = ptr; } │ │ │ │ │ - 620 │ │ │ │ │ - 621 operator bool() const { return _fPtr != 0; } │ │ │ │ │ - 622 │ │ │ │ │ - 623 void Set() { _fPtr = 0; } │ │ │ │ │ - 624 void Set(float_type * ptr) { _fPtr = ptr; } │ │ │ │ │ - 625 void Set(double_type * ptr) { _dPtr = ptr; } │ │ │ │ │ - 626 │ │ │ │ │ - 627 template StencilTableReal * Get() const; │ │ │ │ │ - 628 }; │ │ │ │ │ - 629 │ │ │ │ │ - 630private: │ │ │ │ │ - 631 │ │ │ │ │ - 632 // │ │ │ │ │ - 633 // Topology │ │ │ │ │ - 634 // │ │ │ │ │ - 635 │ │ │ │ │ - 636 int _maxValence, // highest vertex valence found in the mesh │ │ │ │ │ - 637 _numPtexFaces; // total number of ptex faces │ │ │ │ │ - 638 │ │ │ │ │ - 639 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of │ │ │ │ │ -patches │ │ │ │ │ - 640 │ │ │ │ │ - 641 std::vector _patchVerts; // Indices of the control vertices of the │ │ │ │ │ -patches │ │ │ │ │ - 642 │ │ │ │ │ - 643 PatchParamTable _paramTable; // PatchParam bitfields (one per patch) │ │ │ │ │ - 644 │ │ │ │ │ - 645 // │ │ │ │ │ - 646 // Extraordinary vertex closed-form evaluation / endcap basis conversion │ │ │ │ │ - 647 // │ │ │ │ │ - 648 // XXXtakahito: these data will probably be replaced with mask coefficient │ │ │ │ │ -or something │ │ │ │ │ - 649 // SchemeWorker populates. │ │ │ │ │ - 650 // │ │ │ │ │ - 651 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches) │ │ │ │ │ - 652 VertexValenceTable _vertexValenceTable; // Vertex valence table (for │ │ │ │ │ -Gregory patches) │ │ │ │ │ - 653 │ │ │ │ │ - 654 StencilTablePtr _localPointStencils; // local point conversion stencils │ │ │ │ │ - 655 StencilTablePtr _localPointVaryingStencils; // local point varying │ │ │ │ │ -stencils │ │ │ │ │ - 656 │ │ │ │ │ - 657 // │ │ │ │ │ - 658 // Varying data │ │ │ │ │ - 659 // │ │ │ │ │ - 660 PatchDescriptor _varyingDesc; │ │ │ │ │ - 661 │ │ │ │ │ - 662 std::vector _varyingVerts; │ │ │ │ │ - 663 │ │ │ │ │ - 664 // │ │ │ │ │ - 665 // Face-varying data │ │ │ │ │ - 666 // │ │ │ │ │ - 667 FVarPatchChannelVector _fvarChannels; │ │ │ │ │ - 668 │ │ │ │ │ - 669 std::vector _localPointFaceVaryingStencils; │ │ │ │ │ - 670 │ │ │ │ │ - 671 // │ │ │ │ │ - 672 // 'single-crease' patch sharpness tables │ │ │ │ │ - 673 // │ │ │ │ │ - 674 std::vector _sharpnessIndices; // Indices of single-crease │ │ │ │ │ -sharpness (one per patch) │ │ │ │ │ - 675 std::vector _sharpnessValues; // Sharpness values. │ │ │ │ │ - 676 │ │ │ │ │ - 677 // │ │ │ │ │ - 678 // Construction history -- relevant to at least one public query: │ │ │ │ │ - 679 // │ │ │ │ │ - 680 unsigned int _isUniformLinear : 1; │ │ │ │ │ - 681 │ │ │ │ │ - 682 // │ │ │ │ │ - 683 // Precision -- only applies to local-point stencil tables │ │ │ │ │ - 684 // │ │ │ │ │ - 685 unsigned int _vertexPrecisionIsDouble : 1; │ │ │ │ │ - 686 unsigned int _varyingPrecisionIsDouble : 1; │ │ │ │ │ - 687 unsigned int _faceVaryingPrecisionIsDouble : 1; │ │ │ │ │ - 688}; │ │ │ │ │ - 689 │ │ │ │ │ - 690 │ │ │ │ │ - 691// │ │ │ │ │ - 692// Template specializations for float/double -- to be defined before used: │ │ │ │ │ - 693// │ │ │ │ │ - 694template <> inline StencilTableReal * │ │ │ │ │ - 695PatchTable::StencilTablePtr::Get() const { return _fPtr; } │ │ │ │ │ - 696 │ │ │ │ │ - 697template <> inline StencilTableReal * │ │ │ │ │ - 698PatchTable::StencilTablePtr::Get() const { return _dPtr; } │ │ │ │ │ - 699 │ │ │ │ │ -700template <> inline bool │ │ │ │ │ - 701PatchTable::LocalPointStencilPrecisionMatchesType() const { │ │ │ │ │ - 702 return !_vertexPrecisionIsDouble; │ │ │ │ │ - 703} │ │ │ │ │ -704template <> inline bool │ │ │ │ │ - 705PatchTable::LocalPointVaryingStencilPrecisionMatchesType() const { │ │ │ │ │ - 706 return !_varyingPrecisionIsDouble; │ │ │ │ │ - 707} │ │ │ │ │ -708template <> inline bool │ │ │ │ │ - 709PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType() const │ │ │ │ │ -{ │ │ │ │ │ - 710 return !_faceVaryingPrecisionIsDouble; │ │ │ │ │ - 711} │ │ │ │ │ - 712 │ │ │ │ │ -713template <> inline bool │ │ │ │ │ - 714PatchTable::LocalPointStencilPrecisionMatchesType() const { │ │ │ │ │ - 715 return _vertexPrecisionIsDouble; │ │ │ │ │ - 716} │ │ │ │ │ -717template <> inline bool │ │ │ │ │ - 718PatchTable::LocalPointVaryingStencilPrecisionMatchesType() const { │ │ │ │ │ - 719 return _varyingPrecisionIsDouble; │ │ │ │ │ - 720} │ │ │ │ │ -721template <> inline bool │ │ │ │ │ - 722PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType() │ │ │ │ │ -const { │ │ │ │ │ - 723 return _faceVaryingPrecisionIsDouble; │ │ │ │ │ - 724} │ │ │ │ │ - 725 │ │ │ │ │ - 726// │ │ │ │ │ - 727// StencilTable access -- backward compatible and generic: │ │ │ │ │ - 728// │ │ │ │ │ - 729inline StencilTable const * │ │ │ │ │ -730PatchTable::GetLocalPointStencilTable() const { │ │ │ │ │ - 731 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ - 732 return static_cast(_localPointStencils.Get │ │ │ │ │ -()); │ │ │ │ │ - 733} │ │ │ │ │ - 734inline StencilTable const * │ │ │ │ │ -735PatchTable::GetLocalPointVaryingStencilTable() const { │ │ │ │ │ - 736 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 737 return static_cast( │ │ │ │ │ - 738 _localPointVaryingStencils.Get()); │ │ │ │ │ - 739} │ │ │ │ │ - 740inline StencilTable const * │ │ │ │ │ -741PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const { │ │ │ │ │ - 742 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 743 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ -{ │ │ │ │ │ - 744 return static_cast( │ │ │ │ │ - 745 _localPointFaceVaryingStencils[channel].Get()); │ │ │ │ │ - 746 } │ │ │ │ │ - 747 return NULL; │ │ │ │ │ - 748} │ │ │ │ │ - 749 │ │ │ │ │ - 750template │ │ │ │ │ - 751inline StencilTableReal const * │ │ │ │ │ -752PatchTable::GetLocalPointStencilTable() const { │ │ │ │ │ - 753 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ - 754 return _localPointStencils.Get(); │ │ │ │ │ - 755} │ │ │ │ │ - 756template │ │ │ │ │ - 757inline StencilTableReal const * │ │ │ │ │ -758PatchTable::GetLocalPointVaryingStencilTable() const { │ │ │ │ │ - 759 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 760 return _localPointVaryingStencils.Get(); │ │ │ │ │ - 761} │ │ │ │ │ - 762template │ │ │ │ │ - 763inline StencilTableReal const * │ │ │ │ │ -764PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const { │ │ │ │ │ - 765 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 766 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ -{ │ │ │ │ │ - 767 return _localPointFaceVaryingStencils[channel].Get(); │ │ │ │ │ - 768 } │ │ │ │ │ - 769 return NULL; │ │ │ │ │ - 770} │ │ │ │ │ - 771 │ │ │ │ │ - 772 │ │ │ │ │ - 773// │ │ │ │ │ - 774// Computation of local point values: │ │ │ │ │ - 775// │ │ │ │ │ - 776template │ │ │ │ │ - 777inline void │ │ │ │ │ -778PatchTable::ComputeLocalPointValues(T const *src, T *dst) const { │ │ │ │ │ - 779 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ - 780 if (_localPointStencils) { │ │ │ │ │ - 781 _localPointStencils.Get()->UpdateValues(src, dst); │ │ │ │ │ - 782 } │ │ │ │ │ - 783} │ │ │ │ │ - 784 │ │ │ │ │ - 785template │ │ │ │ │ - 786inline void │ │ │ │ │ -787PatchTable::ComputeLocalPointValuesVarying(T const *src, T *dst) const { │ │ │ │ │ - 788 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 789 if (_localPointVaryingStencils) { │ │ │ │ │ - 790 _localPointVaryingStencils.Get()->UpdateValues(src, dst); │ │ │ │ │ - 791 } │ │ │ │ │ - 792} │ │ │ │ │ - 793 │ │ │ │ │ - 794template │ │ │ │ │ - 795inline void │ │ │ │ │ -796PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int │ │ │ │ │ -channel) const { │ │ │ │ │ - 797 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ - 798 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ -{ │ │ │ │ │ - 799 if (_localPointFaceVaryingStencils[channel]) { │ │ │ │ │ - 800 _localPointFaceVaryingStencils[channel].Get()->UpdateValues(src, │ │ │ │ │ -dst); │ │ │ │ │ - 801 } │ │ │ │ │ - 802 } │ │ │ │ │ - 803} │ │ │ │ │ - 804 │ │ │ │ │ - 805 │ │ │ │ │ - 806// │ │ │ │ │ - 807// Basis evaluation overloads │ │ │ │ │ - 808// │ │ │ │ │ - 809inline void │ │ │ │ │ -810PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v, │ │ │ │ │ - 811 float wP[], float wDu[], float wDv[], │ │ │ │ │ - 812 float wDuu[], float wDuv[], float wDvv[]) const { │ │ │ │ │ - 813 │ │ │ │ │ - 814 EvaluateBasis(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ - 815} │ │ │ │ │ - 816inline void │ │ │ │ │ -817PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v, │ │ │ │ │ - 818 double wP[], double wDu[], double wDv[], │ │ │ │ │ - 819 double wDuu[], double wDuv[], double wDvv[]) const { │ │ │ │ │ - 820 │ │ │ │ │ - 821 EvaluateBasis(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ - 822} │ │ │ │ │ - 823 │ │ │ │ │ - 824inline void │ │ │ │ │ -825PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float │ │ │ │ │ -v, │ │ │ │ │ - 826 float wP[], float wDu[], float wDv[], │ │ │ │ │ - 827 float wDuu[], float wDuv[], float wDvv[]) const { │ │ │ │ │ - 828 │ │ │ │ │ - 829 EvaluateBasisVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ - 830} │ │ │ │ │ - 831inline void │ │ │ │ │ -832PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, │ │ │ │ │ -double v, │ │ │ │ │ - 833 double wP[], double wDu[], double wDv[], │ │ │ │ │ - 834 double wDuu[], double wDuv[], double wDvv[]) const { │ │ │ │ │ - 835 │ │ │ │ │ - 836 EvaluateBasisVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ -wDvv); │ │ │ │ │ - 837} │ │ │ │ │ - 838 │ │ │ │ │ - 839inline void │ │ │ │ │ -840PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, │ │ │ │ │ -float v, │ │ │ │ │ - 841 float wP[], float wDu[], float wDv[], │ │ │ │ │ - 842 float wDuu[], float wDuv[], float wDvv[], int channel) const { │ │ │ │ │ - 843 │ │ │ │ │ - 844 EvaluateBasisFaceVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ -wDvv, channel); │ │ │ │ │ - 845} │ │ │ │ │ - 846inline void │ │ │ │ │ -847PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, │ │ │ │ │ -double v, │ │ │ │ │ - 848 double wP[], double wDu[], double wDv[], │ │ │ │ │ - 849 double wDuu[], double wDuv[], double wDvv[], int channel) const { │ │ │ │ │ - 850 │ │ │ │ │ - 851 EvaluateBasisFaceVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ -wDvv, channel); │ │ │ │ │ - 852} │ │ │ │ │ - 853 │ │ │ │ │ - 854} // end namespace Far │ │ │ │ │ - 855 │ │ │ │ │ - 856} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 857using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 858 │ │ │ │ │ - 859} // end namespace OpenSubdiv │ │ │ │ │ - 860 │ │ │ │ │ - 861#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */ │ │ │ │ │ + 223 if (node->children[quadrant].isLeaf) { │ │ │ │ │ + 224 return &_handles[node->children[quadrant].index]; │ │ │ │ │ + 225 } else { │ │ │ │ │ + 226 node = &_quadtree[node->children[quadrant].index]; │ │ │ │ │ + 227 } │ │ │ │ │ + 228 } │ │ │ │ │ + 229 assert(0); │ │ │ │ │ + 230 return 0; │ │ │ │ │ + 231} │ │ │ │ │ + 232 │ │ │ │ │ + 233} // end namespace Far │ │ │ │ │ + 234 │ │ │ │ │ + 235} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 236using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 237 │ │ │ │ │ + 238} // end namespace OpenSubdiv │ │ │ │ │ + 239 │ │ │ │ │ + 240#endif /* OPENSUBDIV3_FAR_PATCH_PARAM */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamTable │ │ │ │ │ -std::vector< PatchParam > PatchParamTable │ │ │ │ │ -Definition: patchParam.h:243 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::Index │ │ │ │ │ -Vtr::Index Index │ │ │ │ │ -Definition: types.h:41 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor │ │ │ │ │ -Describes the type of a patch. │ │ │ │ │ -Definition: patchDescriptor.h:44 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap │ │ │ │ │ An quadtree-based map connecting coarse faces to their sub-patches. │ │ │ │ │ Definition: patchMap.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParam │ │ │ │ │ -Patch parameterization. │ │ │ │ │ -Definition: patchParam.h:152 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::PatchMap │ │ │ │ │ +PatchMap(PatchTable const &patchTable) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::FindPatch │ │ │ │ │ +Handle const * FindPatch(int patchFaceId, double u, double v) const │ │ │ │ │ +Returns a handle to the sub-patch of the face at the given (u,v). Note that the │ │ │ │ │ +patch face ID corresp... │ │ │ │ │ +Definition: patchMap.h:193 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::Handle │ │ │ │ │ +PatchTable::PatchHandle Handle │ │ │ │ │ +Definition: patchMap.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child │ │ │ │ │ +Definition: patchMap.h:85 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::isLeaf │ │ │ │ │ +unsigned int isLeaf │ │ │ │ │ +Definition: patchMap.h:87 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::index │ │ │ │ │ +unsigned int index │ │ │ │ │ +Definition: patchMap.h:88 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::isSet │ │ │ │ │ +unsigned int isSet │ │ │ │ │ +Definition: patchMap.h:86 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ Container for arrays of parametric patches. │ │ │ │ │ Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVaryingVertices │ │ │ │ │ -ConstIndexArray GetPatchArrayVaryingVertices(int array) const │ │ │ │ │ -Returns the varying vertex indices for the patches in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessValues │ │ │ │ │ -float * getSharpnessValues(Index arrayIndex) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchControlVerticesTable │ │ │ │ │ -PatchVertsTable const & GetPatchControlVerticesTable() const │ │ │ │ │ -Get the table of patch control vertices. │ │ │ │ │ -Definition: patchTable.h:378 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -ComputeLocalPointValuesFaceVarying │ │ │ │ │ -void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) │ │ │ │ │ -const │ │ │ │ │ -Updates local point face-varying values. │ │ │ │ │ -Definition: patchTable.h:796 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingVertices │ │ │ │ │ -ConstIndexArray GetVaryingVertices() const │ │ │ │ │ -Returns an array of varying vertex indices for the patches. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValuesVarying │ │ │ │ │ -void ComputeLocalPointValuesVarying(T const *src, T *dst) const │ │ │ │ │ -Updates local point varying values. │ │ │ │ │ -Definition: patchTable.h:787 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices │ │ │ │ │ -ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const │ │ │ │ │ -Returns the varying vertex indices for a given patch. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::IsFeatureAdaptive │ │ │ │ │ -bool IsFeatureAdaptive() const │ │ │ │ │ -True if the patches are of feature adaptive types. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetMaxValence │ │ │ │ │ -int GetMaxValence() const │ │ │ │ │ -Returns max vertex valence. │ │ │ │ │ -Definition: patchTable.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable │ │ │ │ │ -StencilTableReal< REAL > const * GetLocalPointStencilTable() const │ │ │ │ │ -Returns the stencil table to compute local point vertex values. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable │ │ │ │ │ -StencilTable const * GetLocalPointStencilTable() const │ │ │ │ │ -Returns the stencil table to compute local point vertex values. │ │ │ │ │ -Definition: patchTable.h:730 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchParams │ │ │ │ │ -PatchParamArray getPatchParams(int arrayIndex) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarValues │ │ │ │ │ -ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const │ │ │ │ │ -Returns the value indices for the patches in array in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessValues │ │ │ │ │ -std::vector< float > const & GetSharpnessValues() const │ │ │ │ │ -Returns sharpness values table. │ │ │ │ │ -Definition: patchTable.h:387 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::VertexValenceTable │ │ │ │ │ -std::vector< Index > VertexValenceTable │ │ │ │ │ -Definition: patchTable.h:264 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam │ │ │ │ │ -PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const │ │ │ │ │ -Returns the face-varying params for a given patch channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices │ │ │ │ │ -ConstIndexArray GetPatchVaryingVertices(int array, int patch) const │ │ │ │ │ -Returns the varying vertex indices for a given patch. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable │ │ │ │ │ -PatchTable(PatchTable const &src) │ │ │ │ │ -Copy constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchArrays │ │ │ │ │ -int GetNumPatchArrays() const │ │ │ │ │ -Returns the number of patch arrays in the table. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices │ │ │ │ │ -ConstIndexArray GetPatchVertices(PatchHandle const &handle) const │ │ │ │ │ -Returns the control vertex indices for the patch identified by handle. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable │ │ │ │ │ -PatchTable(int maxvalence) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -LocalPointFaceVaryingStencilPrecisionMatchesType │ │ │ │ │ -bool LocalPointFaceVaryingStencilPrecisionMatchesType() const │ │ │ │ │ -Tests if the precision of the stencil table to compute local point face-varying │ │ │ │ │ -values matches the gi... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParamTable │ │ │ │ │ -PatchParamTable const & GetPatchParamTable() const │ │ │ │ │ -Returns the PatchParamTable (PatchParams order matches patch array sorting) │ │ │ │ │ -Definition: patchTable.h:381 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVertexValenceTable │ │ │ │ │ -VertexValenceTable const & GetVertexValenceTable() const │ │ │ │ │ -Returns the 'VertexValences' table (vertex neighborhoods table) │ │ │ │ │ -Definition: patchTable.h:267 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetLocalPointFaceVaryingStencilTable │ │ │ │ │ -StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const │ │ │ │ │ -Returns the stencil table to compute local point face-varying values. │ │ │ │ │ -Definition: patchTable.h:741 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVertices │ │ │ │ │ -int GetNumControlVertices(int array) const │ │ │ │ │ -Returns the number of control vertices in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::~PatchTable │ │ │ │ │ -~PatchTable() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisFaceVarying │ │ │ │ │ -void EvaluateBasisFaceVarying(PatchHandle const &handle, REAL u, REAL v, REAL │ │ │ │ │ -wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0, │ │ │ │ │ -int channel=0) const │ │ │ │ │ -Evaluate basis functions for a face-varying value and derivatives at a given │ │ │ │ │ -(u,v) parametric locatio... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchQuadOffsets │ │ │ │ │ -ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const │ │ │ │ │ -Returns the 'QuadOffsets' for the Gregory patch identified by handle. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetFVarPatchDescriptorIrregular │ │ │ │ │ -PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const │ │ │ │ │ -Returns the irregular patch descriptor for channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetSingleCreasePatchSharpnessValue │ │ │ │ │ -float GetSingleCreasePatchSharpnessValue(int array, int patch) const │ │ │ │ │ -Returns the crease sharpness for the patch in array if it is a single-crease │ │ │ │ │ -patch,... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessIndices │ │ │ │ │ -Index * getSharpnessIndices(Index arrayIndex) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValues │ │ │ │ │ -void ComputeLocalPointValues(T const *src, T *dst) const │ │ │ │ │ -Updates local point vertex values. │ │ │ │ │ -Definition: patchTable.h:778 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetSingleCreasePatchSharpnessValue │ │ │ │ │ -float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const │ │ │ │ │ -Returns the crease sharpness for the patch identified by handle if it is a │ │ │ │ │ -single-crease patch,... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam │ │ │ │ │ -PatchParam GetPatchParam(int array, int patch) const │ │ │ │ │ -Returns the PatchParam for patch in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues │ │ │ │ │ -ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const │ │ │ │ │ -Returns the value indices for a given patch in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptorRegular │ │ │ │ │ -PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const │ │ │ │ │ -Returns the regular patch descriptor for channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchDescriptor │ │ │ │ │ -PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const │ │ │ │ │ -Returns the PatchDescriptor for the patch identified by handle. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchVertsTable │ │ │ │ │ -std::vector< Index > PatchVertsTable │ │ │ │ │ -Definition: patchTable.h:375 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetQuadOffsetsTable │ │ │ │ │ -QuadOffsetsTable const & GetQuadOffsetsTable() const │ │ │ │ │ -Returns the quad-offsets table. │ │ │ │ │ -Definition: patchTable.h:392 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatches │ │ │ │ │ -int GetNumPatches(int array) const │ │ │ │ │ -Returns the number of patches in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingPatchDescriptor │ │ │ │ │ -PatchDescriptor GetVaryingPatchDescriptor() const │ │ │ │ │ -Returns the varying patch descriptor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues │ │ │ │ │ -ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) │ │ │ │ │ -const │ │ │ │ │ -Returns the value indices for a given patch in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParams │ │ │ │ │ -ConstPatchParamArray const GetPatchParams(int array) const │ │ │ │ │ -Returns the PatchParams for the patches in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVerticesTotal │ │ │ │ │ -int GetNumControlVerticesTotal() const │ │ │ │ │ -Returns the total number of control vertex indices in the table. │ │ │ │ │ -Definition: patchTable.h:84 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Returns the number of face-varying channels. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarPatchParams │ │ │ │ │ -ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) │ │ │ │ │ -const │ │ │ │ │ -Returns the face-varying for a given patch in array in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchIndex │ │ │ │ │ -Index getPatchIndex(int array, int patch) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPoints │ │ │ │ │ -int GetNumLocalPoints() const │ │ │ │ │ -Returns the number of local vertex points. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -LocalPointVaryingStencilPrecisionMatchesType │ │ │ │ │ -bool LocalPointVaryingStencilPrecisionMatchesType() const │ │ │ │ │ -Tests if the precision of the stencil table to compute local point varying │ │ │ │ │ -values matches the given f... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVertices │ │ │ │ │ -ConstIndexArray GetPatchArrayVertices(int array) const │ │ │ │ │ -Returns the control vertex indices for the patches in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPtexFaces │ │ │ │ │ -int GetNumPtexFaces() const │ │ │ │ │ -Returns the total number of ptex faces in the mesh. │ │ │ │ │ -Definition: patchTable.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValues │ │ │ │ │ -ConstIndexArray GetFVarValues(int channel=0) const │ │ │ │ │ -Returns an array of value indices for the patches in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ConstQuadOffsetsArray │ │ │ │ │ -Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray │ │ │ │ │ -Accessors for the gregory patch evaluation buffers. These methods will be │ │ │ │ │ -deprecated. │ │ │ │ │ -Definition: patchTable.h:259 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasis │ │ │ │ │ -void EvaluateBasis(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL │ │ │ │ │ -wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const │ │ │ │ │ -Evaluate basis functions for position and derivatives at a given (u,v) │ │ │ │ │ -parametric location of a patch... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetLocalPointFaceVaryingStencilTable │ │ │ │ │ -StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int │ │ │ │ │ -channel=0) const │ │ │ │ │ -Returns the stencil table to compute local point face-varying values. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchesTotal │ │ │ │ │ -int GetNumPatchesTotal() const │ │ │ │ │ -Returns the total number of patches stored in the table. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam │ │ │ │ │ -PatchParam GetPatchParam(PatchHandle const &handle) const │ │ │ │ │ -Returns a PatchParam for the patch identified by handle. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::print │ │ │ │ │ -void print() const │ │ │ │ │ -debug helper │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetFVarChannelLinearInterpolation │ │ │ │ │ -Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int │ │ │ │ │ -channel=0) const │ │ │ │ │ -Deprecated. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessIndexTable │ │ │ │ │ -std::vector< Index > const & GetSharpnessIndexTable() const │ │ │ │ │ -Returns a sharpness index table for each patch (if exists) │ │ │ │ │ -Definition: patchTable.h:384 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayDescriptor │ │ │ │ │ -PatchDescriptor GetPatchArrayDescriptor(int array) const │ │ │ │ │ -Returns the PatchDescriptor for the patches in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTableBuilder │ │ │ │ │ -friend class PatchTableBuilder │ │ │ │ │ -Definition: patchTable.h:531 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisVarying │ │ │ │ │ -void EvaluateBasisVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], │ │ │ │ │ -REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const │ │ │ │ │ -Evaluate basis functions for a varying value and derivatives at a given (u,v) │ │ │ │ │ -parametric location of ... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetLocalPointVaryingStencilTable │ │ │ │ │ -StencilTable const * GetLocalPointVaryingStencilTable() const │ │ │ │ │ -Returns the stencil table to compute local point varying values. │ │ │ │ │ -Definition: patchTable.h:735 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::QuadOffsetsTable │ │ │ │ │ -std::vector< unsigned int > QuadOffsetsTable │ │ │ │ │ -Definition: patchTable.h:389 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices │ │ │ │ │ -ConstIndexArray GetPatchVertices(int array, int patch) const │ │ │ │ │ -Returns the control vertex indices for patch in array. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam │ │ │ │ │ -PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) │ │ │ │ │ -const │ │ │ │ │ -Returns the value indices for a given patch in channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValueStride │ │ │ │ │ -int GetFVarValueStride(int channel=0) const │ │ │ │ │ -Returns the stride between patches in the value index array of channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchParams │ │ │ │ │ -ConstPatchParamArray GetFVarPatchParams(int channel=0) const │ │ │ │ │ -Returns an array of face-varying patch param for channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptor │ │ │ │ │ -PatchDescriptor GetFVarPatchDescriptor(int channel=0) const │ │ │ │ │ -Returns the default/irregular patch descriptor for channel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsVarying │ │ │ │ │ -int GetNumLocalPointsVarying() const │ │ │ │ │ -Returns the number of local varying points. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -LocalPointStencilPrecisionMatchesType │ │ │ │ │ -bool LocalPointStencilPrecisionMatchesType() const │ │ │ │ │ -Tests if the precision of the stencil table to compute local point vertex │ │ │ │ │ -values matches the given fl... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ -GetLocalPointVaryingStencilTable │ │ │ │ │ -StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const │ │ │ │ │ -Returns the stencil table to compute local point varying values. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsFaceVarying │ │ │ │ │ -int GetNumLocalPointsFaceVarying(int channel=0) const │ │ │ │ │ -Returns the number of local face-varying points for channel. │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle │ │ │ │ │ Handle that can be used as unique patch identifier within PatchTable. │ │ │ │ │ Definition: patchTable.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::patchIndex │ │ │ │ │ -Index patchIndex │ │ │ │ │ -Definition: patchTable.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::arrayIndex │ │ │ │ │ -Index arrayIndex │ │ │ │ │ -Definition: patchTable.h:67 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::vertIndex │ │ │ │ │ -Index vertIndex │ │ │ │ │ -Definition: patchTable.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal │ │ │ │ │ -Table of subdivision stencils. │ │ │ │ │ -Definition: stencilTable.h:141 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ -FVarLinearInterpolation │ │ │ │ │ -Definition: options.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray │ │ │ │ │ -Definition: array.h:53 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Array │ │ │ │ │ -Definition: array.h:105 │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * patchTable.h │ │ │ │ │ + * patchMap.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00734.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/patchMap.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/far/patchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,29 +83,33 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
patchMap.h File Reference
│ │ │ │ +
patchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ -#include <cassert>
│ │ │ │ +#include "../far/patchDescriptor.h"
│ │ │ │ +#include "../far/patchParam.h"
│ │ │ │ +#include "../far/stencilTable.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  PatchMap
 An quadtree-based map connecting coarse faces to their sub-patches. More...
class  PatchTable
 Container for arrays of parametric patches. More...
 
struct  PatchMap::QuadNode::Child
class  PatchTable::PatchHandle
 Handle that can be used as unique patch identifier within PatchTable. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -114,13 +118,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,34 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -patchMap.h File Reference │ │ │ │ │ +patchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchTable.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../far/patchDescriptor.h" │ │ │ │ │ +#include "../far/patchParam.h" │ │ │ │ │ +#include "../far/stencilTable.h" │ │ │ │ │ +#include "../sdc/options.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  PatchMap │ │ │ │ │ -  An quadtree-based map connecting coarse faces to their sub-patches. │ │ │ │ │ - More... │ │ │ │ │ +class  PatchTable │ │ │ │ │ +  Container for arrays of parametric patches. More... │ │ │ │ │   │ │ │ │ │ -struct  PatchMap::QuadNode::Child │ │ │ │ │ +class  PatchTable::PatchHandle │ │ │ │ │ +  Handle that can be used as unique patch identifier within PatchTable. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * patchMap.h │ │ │ │ │ + * patchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00734.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ │ var a00734 = [ │ │ │ │ │ - ["PatchMap", "a00977.html", "a00977"], │ │ │ │ │ - ["PatchMap::QuadNode::Child", "a00985.html", "a00985"] │ │ │ │ │ + ["PatchTable", "a00993.html", "a00993"], │ │ │ │ │ + ["PatchTable::PatchHandle", "a00997.html", "a00997"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00734_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/far/patchMap.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/far/patchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
patchMap.h
│ │ │ │ +
patchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,216 +107,695 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_FAR_PATCH_MAP_H
│ │ │ │ -
26#define OPENSUBDIV3_FAR_PATCH_MAP_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_FAR_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../far/patchTable.h"
│ │ │ │ -
31
│ │ │ │ -
32#include <cassert>
│ │ │ │ +
30#include "../far/patchDescriptor.h"
│ │ │ │ +
31#include "../far/patchParam.h"
│ │ │ │ +
32#include "../far/stencilTable.h"
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38
│ │ │ │ -
49class PatchMap {
│ │ │ │ -
50public:
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ -
53
│ │ │ │ -
58 PatchMap( PatchTable const & patchTable );
│ │ │ │ -
59
│ │ │ │ -
74 Handle const * FindPatch( int patchFaceId, double u, double v ) const;
│ │ │ │ -
75
│ │ │ │ -
76private:
│ │ │ │ -
77 void initializeHandles(PatchTable const & patchTable);
│ │ │ │ -
78 void initializeQuadtree(PatchTable const & patchTable);
│ │ │ │ +
34#include "../sdc/options.h"
│ │ │ │ +
35
│ │ │ │ +
36#include <vector>
│ │ │ │ +
37
│ │ │ │ +
38namespace OpenSubdiv {
│ │ │ │ +
39namespace OPENSUBDIV_VERSION {
│ │ │ │ +
40
│ │ │ │ +
41namespace Far {
│ │ │ │ +
42
│ │ │ │ + │ │ │ │ +
56
│ │ │ │ +
57public:
│ │ │ │ +
58
│ │ │ │ + │ │ │ │ +
61 // XXXX manuelk members will eventually be made private
│ │ │ │ +
62 public:
│ │ │ │ +
63
│ │ │ │ +
64 friend class PatchTable;
│ │ │ │ +
65 friend class PatchMap;
│ │ │ │ +
66
│ │ │ │ +
67 Index arrayIndex, // Array index of the patch
│ │ │ │ +
68 patchIndex, // Absolute Index of the patch
│ │ │ │ +
69 vertIndex; // Relative offset to the first CV of the patch in array
│ │ │ │ +
70 };
│ │ │ │ +
71
│ │ │ │ +
72public:
│ │ │ │ +
73
│ │ │ │ +
75 PatchTable(PatchTable const & src);
│ │ │ │ +
76
│ │ │ │ + │ │ │ │
79
│ │ │ │ -
80private:
│ │ │ │ -
81 // Quadtree node with 4 children, tree is just a vector of nodes
│ │ │ │ -
82 struct QuadNode {
│ │ │ │ -
83 QuadNode() { std::memset(this, 0, sizeof(QuadNode)); }
│ │ │ │ -
84
│ │ │ │ -
85 struct Child {
│ │ │ │ -
86 unsigned int isSet : 1; // true if the child has been set
│ │ │ │ -
87 unsigned int isLeaf : 1; // true if the child is a QuadNode
│ │ │ │ -
88 unsigned int index : 30; // child index (either QuadNode or Handle)
│ │ │ │ -
89 };
│ │ │ │ +
81 bool IsFeatureAdaptive() const;
│ │ │ │ +
82
│ │ │ │ + │ │ │ │ +
85 return (int)_patchVerts.size();
│ │ │ │ +
86 }
│ │ │ │ +
87
│ │ │ │ +
89 int GetNumPatchesTotal() const;
│ │ │ │
90
│ │ │ │ -
91 // sets all the children to point to the patch of given index
│ │ │ │ -
92 void SetChildren(int index);
│ │ │ │ +
92 int GetMaxValence() const { return _maxValence; }
│ │ │ │
93
│ │ │ │ -
94 // sets the child in "quadrant" to point to the node or patch of the given index
│ │ │ │ -
95 void SetChild(int quadrant, int index, bool isLeaf);
│ │ │ │ +
95 int GetNumPtexFaces() const { return _numPtexFaces; }
│ │ │ │
96
│ │ │ │ -
97 Child children[4];
│ │ │ │ -
98 };
│ │ │ │ -
99 typedef std::vector<QuadNode> QuadTree;
│ │ │ │ -
100
│ │ │ │ -
101 // Internal methods supporting quadtree construction and queries
│ │ │ │ -
102 void assignRootNode(QuadNode * node, int index);
│ │ │ │ -
103 QuadNode * assignLeafOrChildNode(QuadNode * node, bool isLeaf, int quad, int index);
│ │ │ │ -
104
│ │ │ │ -
105 template <class T>
│ │ │ │ -
106 static int transformUVToQuadQuadrant(T const & median, T & u, T & v);
│ │ │ │ -
107 template <class T>
│ │ │ │ -
108 static int transformUVToTriQuadrant(T const & median, T & u, T & v, bool & rotated);
│ │ │ │ -
109
│ │ │ │ -
110private:
│ │ │ │ -
111 bool _patchesAreTriangular; // tri and quad assembly and search requirements differ
│ │ │ │ -
112
│ │ │ │ -
113 int _minPatchFace; // minimum patch face index supported by the map
│ │ │ │ -
114 int _maxPatchFace; // maximum patch face index supported by the map
│ │ │ │ -
115 int _maxDepth; // maximum depth of a patch in the tree
│ │ │ │ -
116
│ │ │ │ -
117 std::vector<Handle> _handles; // all the patches in the PatchTable
│ │ │ │ -
118 std::vector<QuadNode> _quadtree; // quadtree nodes
│ │ │ │ -
119};
│ │ │ │ -
120
│ │ │ │ -
121//
│ │ │ │ -
122// Given a median value for both U and V, these methods transform a (u,v) pair
│ │ │ │ -
123// into the quadrant that contains them and returns the quadrant index.
│ │ │ │ -
124//
│ │ │ │ -
125// Quadrant indexing for tri and quad patches -- consistent with PatchParam's
│ │ │ │ -
126// usage of UV bits:
│ │ │ │ -
127//
│ │ │ │ -
128// (0,1) o-----o-----o (1,1) (0,1) o (1,0) o-----o-----o (0,0)
│ │ │ │ -
129// | | | |\ \ 1 |\ 0 |
│ │ │ │ -
130// | 2 | 3 | | \ \ | \ |
│ │ │ │ -
131// | | | | 2 \ \| 3 \|
│ │ │ │ -
132// o-----o-----o o-----o o-----o
│ │ │ │ -
133// | | | |\ 3 |\ \ 2 |
│ │ │ │ -
134// | 0 | 1 | | \ | \ \ |
│ │ │ │ -
135// | | | | 0 \| 1 \ \|
│ │ │ │ -
136// (0,0) o-----o-----o (1,0) (0,0) o-----o-----o (1,0) o (0,1)
│ │ │ │ -
137//
│ │ │ │ -
138// The triangular case also takes and returns/affects the rotation of the
│ │ │ │ -
139// quadrant being searched and identified (quadrant 3 imparts a rotation).
│ │ │ │ -
140//
│ │ │ │ -
141template <class T>
│ │ │ │ -
142inline int
│ │ │ │ -
143PatchMap::transformUVToQuadQuadrant(T const & median, T & u, T & v) {
│ │ │ │ -
144
│ │ │ │ -
145 int uHalf = (u >= median);
│ │ │ │ -
146 if (uHalf) u -= median;
│ │ │ │ -
147
│ │ │ │ -
148 int vHalf = (v >= median);
│ │ │ │ -
149 if (vHalf) v -= median;
│ │ │ │ +
97
│ │ │ │ +
99
│ │ │ │ +
105
│ │ │ │ + │ │ │ │ +
108
│ │ │ │ + │ │ │ │ +
111
│ │ │ │ +
113 PatchParam GetPatchParam(PatchHandle const & handle) const;
│ │ │ │ +
114
│ │ │ │ +
116 ConstIndexArray GetPatchVertices(int array, int patch) const;
│ │ │ │ +
117
│ │ │ │ +
119 PatchParam GetPatchParam(int array, int patch) const;
│ │ │ │ +
121
│ │ │ │ +
122
│ │ │ │ +
124
│ │ │ │ +
130
│ │ │ │ +
132 int GetNumPatchArrays() const;
│ │ │ │ +
133
│ │ │ │ +
135 int GetNumPatches(int array) const;
│ │ │ │ +
136
│ │ │ │ +
138 int GetNumControlVertices(int array) const;
│ │ │ │ +
139
│ │ │ │ + │ │ │ │ +
142
│ │ │ │ + │ │ │ │ +
145
│ │ │ │ +
147 ConstPatchParamArray const GetPatchParams(int array) const;
│ │ │ │ +
149
│ │ │ │
150
│ │ │ │ -
151 return (vHalf << 1) | uHalf;
│ │ │ │ -
152}
│ │ │ │ -
153
│ │ │ │ -
154template <class T>
│ │ │ │ -
155int inline
│ │ │ │ -
156PatchMap::transformUVToTriQuadrant(T const & median, T & u, T & v, bool & rotated) {
│ │ │ │ -
157
│ │ │ │ -
158 if (!rotated) {
│ │ │ │ -
159 if (u >= median) {
│ │ │ │ -
160 u -= median;
│ │ │ │ -
161 return 1;
│ │ │ │ -
162 }
│ │ │ │ -
163 if (v >= median) {
│ │ │ │ -
164 v -= median;
│ │ │ │ -
165 return 2;
│ │ │ │ -
166 }
│ │ │ │ -
167 if ((u + v) >= median) {
│ │ │ │ -
168 rotated = true;
│ │ │ │ -
169 return 3;
│ │ │ │ -
170 }
│ │ │ │ -
171 return 0;
│ │ │ │ -
172 } else {
│ │ │ │ -
173 if (u < median) {
│ │ │ │ -
174 v -= median;
│ │ │ │ -
175 return 1;
│ │ │ │ -
176 }
│ │ │ │ -
177 if (v < median) {
│ │ │ │ -
178 u -= median;
│ │ │ │ -
179 return 2;
│ │ │ │ -
180 }
│ │ │ │ -
181 u -= median;
│ │ │ │ -
182 v -= median;
│ │ │ │ -
183 if ((u + v) < median) {
│ │ │ │ -
184 rotated = false;
│ │ │ │ -
185 return 3;
│ │ │ │ -
186 }
│ │ │ │ -
187 return 0;
│ │ │ │ -
188 }
│ │ │ │ -
189}
│ │ │ │ -
190
│ │ │ │ -
192inline PatchMap::Handle const *
│ │ │ │ -
193PatchMap::FindPatch( int faceid, double u, double v ) const {
│ │ │ │ -
194
│ │ │ │ -
195 //
│ │ │ │ -
196 // Reject patch faces not supported by this map, or those corresponding
│ │ │ │ -
197 // to holes or otherwise unassigned (the root node for a patch will
│ │ │ │ -
198 // have all or no quadrants set):
│ │ │ │ -
199 //
│ │ │ │ -
200 if ((faceid < _minPatchFace) || (faceid > _maxPatchFace)) return 0;
│ │ │ │ -
201
│ │ │ │ -
202 QuadNode const * node = &_quadtree[faceid - _minPatchFace];
│ │ │ │ +
152
│ │ │ │ +
159
│ │ │ │ +
161 int GetNumLocalPoints() const;
│ │ │ │ +
162
│ │ │ │ + │ │ │ │ +
165
│ │ │ │ +
167 template <typename REAL>
│ │ │ │ + │ │ │ │ +
169
│ │ │ │ +
172 template <typename REAL> bool LocalPointStencilPrecisionMatchesType() const;
│ │ │ │ +
173
│ │ │ │ +
186 template <class T> void
│ │ │ │ +
187 ComputeLocalPointValues(T const *src, T *dst) const;
│ │ │ │ +
188
│ │ │ │ +
189
│ │ │ │ + │ │ │ │ +
192
│ │ │ │ + │ │ │ │ +
195
│ │ │ │ +
197 template <typename REAL>
│ │ │ │ + │ │ │ │ +
199
│ │ │ │ +
202 template <typename REAL> bool LocalPointVaryingStencilPrecisionMatchesType() const;
│ │ │ │
203
│ │ │ │ -
204 if (!node->children[0].isSet) return 0;
│ │ │ │ -
205
│ │ │ │ -
206 //
│ │ │ │ -
207 // Search the tree for the sub-patch containing the given (u,v)
│ │ │ │ -
208 //
│ │ │ │ -
209 assert( (u>=0.0) && (u<=1.0) && (v>=0.0) && (v<=1.0) );
│ │ │ │ -
210
│ │ │ │ -
211 double median = 0.5;
│ │ │ │ -
212 bool triRotated = false;
│ │ │ │ -
213
│ │ │ │ -
214 for (int depth = 0; depth <= _maxDepth; ++depth, median *= 0.5) {
│ │ │ │ -
215
│ │ │ │ -
216 int quadrant = _patchesAreTriangular
│ │ │ │ -
217 ? transformUVToTriQuadrant(median, u, v, triRotated)
│ │ │ │ -
218 : transformUVToQuadQuadrant(median, u, v);
│ │ │ │ +
216 template <class T> void
│ │ │ │ +
217 ComputeLocalPointValuesVarying(T const *src, T *dst) const;
│ │ │ │ +
218
│ │ │ │
219
│ │ │ │ -
220 // holes should have been rejected at the root node of the face
│ │ │ │ -
221 assert(node->children[quadrant].isSet);
│ │ │ │ +
221 int GetNumLocalPointsFaceVarying(int channel = 0) const;
│ │ │ │
222
│ │ │ │ -
223 if (node->children[quadrant].isLeaf) {
│ │ │ │ -
224 return &_handles[node->children[quadrant].index];
│ │ │ │ -
225 } else {
│ │ │ │ -
226 node = &_quadtree[node->children[quadrant].index];
│ │ │ │ -
227 }
│ │ │ │ -
228 }
│ │ │ │ -
229 assert(0);
│ │ │ │ -
230 return 0;
│ │ │ │ -
231}
│ │ │ │ -
232
│ │ │ │ -
233} // end namespace Far
│ │ │ │ -
234
│ │ │ │ -
235} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
236using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
237
│ │ │ │ -
238} // end namespace OpenSubdiv
│ │ │ │ -
239
│ │ │ │ -
240#endif /* OPENSUBDIV3_FAR_PATCH_PARAM */
│ │ │ │ +
224 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) const;
│ │ │ │ +
225
│ │ │ │ +
227 template <typename REAL>
│ │ │ │ + │ │ │ │ +
229
│ │ │ │ +
232 template <typename REAL> bool LocalPointFaceVaryingStencilPrecisionMatchesType() const;
│ │ │ │ +
233
│ │ │ │ +
248 template <class T> void
│ │ │ │ +
249 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) const;
│ │ │ │ +
251
│ │ │ │ +
252
│ │ │ │ +
254
│ │ │ │ +
255
│ │ │ │ + │ │ │ │ +
260
│ │ │ │ + │ │ │ │ +
263
│ │ │ │ +
264 typedef std::vector<Index> VertexValenceTable;
│ │ │ │ +
265
│ │ │ │ + │ │ │ │ +
268 return _vertexValenceTable;
│ │ │ │ +
269 }
│ │ │ │ +
271
│ │ │ │ +
272
│ │ │ │ +
274
│ │ │ │ +
280
│ │ │ │ + │ │ │ │ +
284
│ │ │ │ +
287 float GetSingleCreasePatchSharpnessValue(int array, int patch) const;
│ │ │ │ +
289
│ │ │ │ +
290
│ │ │ │ +
292
│ │ │ │ +
298
│ │ │ │ + │ │ │ │ +
301
│ │ │ │ + │ │ │ │ +
304
│ │ │ │ +
306 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const;
│ │ │ │ +
307
│ │ │ │ + │ │ │ │ +
310
│ │ │ │ + │ │ │ │ +
314
│ │ │ │ +
315
│ │ │ │ +
317
│ │ │ │ +
323
│ │ │ │ + │ │ │ │ +
326
│ │ │ │ + │ │ │ │ +
329
│ │ │ │ + │ │ │ │ +
332
│ │ │ │ + │ │ │ │ +
335
│ │ │ │ +
337 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel = 0) const;
│ │ │ │ +
338
│ │ │ │ +
340 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) const;
│ │ │ │ +
341
│ │ │ │ +
343 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const;
│ │ │ │ +
344
│ │ │ │ +
346 ConstIndexArray GetFVarValues(int channel = 0) const;
│ │ │ │ +
347
│ │ │ │ +
349 int GetFVarValueStride(int channel = 0) const;
│ │ │ │ +
350
│ │ │ │ +
352 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = 0) const;
│ │ │ │ +
353
│ │ │ │ +
355 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) const;
│ │ │ │ +
356
│ │ │ │ +
358 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = 0) const;
│ │ │ │ +
359
│ │ │ │ + │ │ │ │ +
362
│ │ │ │ + │ │ │ │ +
366
│ │ │ │ +
367
│ │ │ │ +
369
│ │ │ │ +
374
│ │ │ │ +
375 typedef std::vector<Index> PatchVertsTable;
│ │ │ │ +
376
│ │ │ │ +
378 PatchVertsTable const & GetPatchControlVerticesTable() const { return _patchVerts; }
│ │ │ │ +
379
│ │ │ │ +
381 PatchParamTable const & GetPatchParamTable() const { return _paramTable; }
│ │ │ │ +
382
│ │ │ │ +
384 std::vector<Index> const &GetSharpnessIndexTable() const { return _sharpnessIndices; }
│ │ │ │ +
385
│ │ │ │ +
387 std::vector<float> const &GetSharpnessValues() const { return _sharpnessValues; }
│ │ │ │ +
388
│ │ │ │ +
389 typedef std::vector<unsigned int> QuadOffsetsTable;
│ │ │ │ +
390
│ │ │ │ + │ │ │ │ +
393 return _quadOffsetsTable;
│ │ │ │ +
394 }
│ │ │ │ +
396
│ │ │ │ +
398 void print() const;
│ │ │ │ +
399
│ │ │ │ +
400public:
│ │ │ │ +
401
│ │ │ │ +
403
│ │ │ │ +
405
│ │ │ │ +
428 template <typename REAL>
│ │ │ │ +
429 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ +
430 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ +
431 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
│ │ │ │ +
432
│ │ │ │ +
435 void EvaluateBasis(PatchHandle const & handle, float u, float v,
│ │ │ │ +
436 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ +
437 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
│ │ │ │ +
438
│ │ │ │ +
441 void EvaluateBasis(PatchHandle const & handle, double u, double v,
│ │ │ │ +
442 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ +
443 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
│ │ │ │ +
444
│ │ │ │ +
467 template <typename REAL>
│ │ │ │ +
468 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ +
469 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ +
470 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const;
│ │ │ │ +
471
│ │ │ │ +
474 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ +
475 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ +
476 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const;
│ │ │ │ +
477
│ │ │ │ +
480 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ +
481 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ +
482 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const;
│ │ │ │ +
483
│ │ │ │ +
508 template <typename REAL>
│ │ │ │ +
509 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v,
│ │ │ │ +
510 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0,
│ │ │ │ +
511 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0,
│ │ │ │ +
512 int channel = 0) const;
│ │ │ │ +
513
│ │ │ │ +
516 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ +
517 float wP[], float wDu[] = 0, float wDv[] = 0,
│ │ │ │ +
518 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0,
│ │ │ │ +
519 int channel = 0) const;
│ │ │ │ +
520
│ │ │ │ +
523 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ +
524 double wP[], double wDu[] = 0, double wDv[] = 0,
│ │ │ │ +
525 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0,
│ │ │ │ +
526 int channel = 0) const;
│ │ │ │ +
528
│ │ │ │ +
529protected:
│ │ │ │ +
530
│ │ │ │ +
531 friend class PatchTableBuilder;
│ │ │ │ +
532
│ │ │ │ +
533 // Factory constructor
│ │ │ │ +
534 PatchTable(int maxvalence);
│ │ │ │ +
535
│ │ │ │ +
536 Index getPatchIndex(int array, int patch) const;
│ │ │ │ +
537
│ │ │ │ + │ │ │ │ +
539
│ │ │ │ + │ │ │ │ +
541 float * getSharpnessValues(Index arrayIndex);
│ │ │ │ +
542
│ │ │ │ +
543private:
│ │ │ │ +
544
│ │ │ │ +
545 //
│ │ │ │ +
546 // Patch arrays
│ │ │ │ +
547 //
│ │ │ │ +
548
│ │ │ │ +
549 struct PatchArray;
│ │ │ │ +
550 typedef std::vector<PatchArray> PatchArrayVector;
│ │ │ │ +
551
│ │ │ │ +
552 PatchArray & getPatchArray(Index arrayIndex);
│ │ │ │ +
553 PatchArray const & getPatchArray(Index arrayIndex) const;
│ │ │ │ +
554
│ │ │ │ +
555 void reservePatchArrays(int numPatchArrays);
│ │ │ │ +
556 void pushPatchArray(PatchDescriptor desc, int npatches,
│ │ │ │ +
557 Index * vidx, Index * pidx, Index * qoidx=0);
│ │ │ │ +
558
│ │ │ │ +
559 IndexArray getPatchArrayVertices(int arrayIndex);
│ │ │ │ +
560
│ │ │ │ +
561 Index findPatchArray(PatchDescriptor desc);
│ │ │ │ +
562
│ │ │ │ +
563
│ │ │ │ +
564 //
│ │ │ │ +
565 // Varying patch arrays
│ │ │ │ +
566 //
│ │ │ │ +
567 IndexArray getPatchArrayVaryingVertices(int arrayIndex);
│ │ │ │ +
568
│ │ │ │ +
569 void allocateVaryingVertices(
│ │ │ │ +
570 PatchDescriptor desc, int numPatches);
│ │ │ │ +
571 void populateVaryingVertices();
│ │ │ │ +
572
│ │ │ │ +
573 //
│ │ │ │ +
574 // Face-varying patch channels
│ │ │ │ +
575 //
│ │ │ │ +
576
│ │ │ │ +
577 struct FVarPatchChannel;
│ │ │ │ +
578 typedef std::vector<FVarPatchChannel> FVarPatchChannelVector;
│ │ │ │ +
579
│ │ │ │ +
580 FVarPatchChannel & getFVarPatchChannel(int channel);
│ │ │ │ +
581 FVarPatchChannel const & getFVarPatchChannel(int channel) const;
│ │ │ │ +
582
│ │ │ │ +
583 void allocateFVarPatchChannels(int numChannels);
│ │ │ │ +
584 void allocateFVarPatchChannelValues(
│ │ │ │ +
585 PatchDescriptor regDesc, PatchDescriptor irregDesc,
│ │ │ │ +
586 int numPatches, int channel);
│ │ │ │ +
587
│ │ │ │ +
588 // deprecated
│ │ │ │ +
589 void setFVarPatchChannelLinearInterpolation(
│ │ │ │ +
590 Sdc::Options::FVarLinearInterpolation interpolation, int channel);
│ │ │ │ +
591
│ │ │ │ +
592 IndexArray getFVarValues(int channel);
│ │ │ │ +
593 ConstIndexArray getPatchFVarValues(int patch, int channel) const;
│ │ │ │ +
594
│ │ │ │ +
595 PatchParamArray getFVarPatchParams(int channel);
│ │ │ │ +
596 PatchParam getPatchFVarPatchParam(int patch, int channel) const;
│ │ │ │ +
597
│ │ │ │ +
598private:
│ │ │ │ +
599 //
│ │ │ │ +
600 // Simple private class to hold stencil table pointers of varying precision,
│ │ │ │ +
601 // where the discriminant of the precision is external.
│ │ │ │ +
602 //
│ │ │ │ +
603 // NOTE that this is a simple pointer container and NOT a smart pointer that
│ │ │ │ +
604 // manages the ownership of the object referred to by it.
│ │ │ │ +
605 //
│ │ │ │ +
606 class StencilTablePtr {
│ │ │ │ +
607 private:
│ │ │ │ +
608 typedef StencilTableReal<float> float_type;
│ │ │ │ +
609 typedef StencilTableReal<double> double_type;
│ │ │ │ +
610
│ │ │ │ +
611 union {
│ │ │ │ +
612 float_type * _fPtr;
│ │ │ │ +
613 double_type * _dPtr;
│ │ │ │ +
614 };
│ │ │ │ +
615
│ │ │ │ +
616 public:
│ │ │ │ +
617 StencilTablePtr() { _fPtr = 0; }
│ │ │ │ +
618 StencilTablePtr(float_type * ptr) { _fPtr = ptr; }
│ │ │ │ +
619 StencilTablePtr(double_type * ptr) { _dPtr = ptr; }
│ │ │ │ +
620
│ │ │ │ +
621 operator bool() const { return _fPtr != 0; }
│ │ │ │ +
622
│ │ │ │ +
623 void Set() { _fPtr = 0; }
│ │ │ │ +
624 void Set(float_type * ptr) { _fPtr = ptr; }
│ │ │ │ +
625 void Set(double_type * ptr) { _dPtr = ptr; }
│ │ │ │ +
626
│ │ │ │ +
627 template <typename REAL> StencilTableReal<REAL> * Get() const;
│ │ │ │ +
628 };
│ │ │ │ +
629
│ │ │ │ +
630private:
│ │ │ │ +
631
│ │ │ │ +
632 //
│ │ │ │ +
633 // Topology
│ │ │ │ +
634 //
│ │ │ │ +
635
│ │ │ │ +
636 int _maxValence, // highest vertex valence found in the mesh
│ │ │ │ +
637 _numPtexFaces; // total number of ptex faces
│ │ │ │ +
638
│ │ │ │ +
639 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of patches
│ │ │ │ +
640
│ │ │ │ +
641 std::vector<Index> _patchVerts; // Indices of the control vertices of the patches
│ │ │ │ +
642
│ │ │ │ +
643 PatchParamTable _paramTable; // PatchParam bitfields (one per patch)
│ │ │ │ +
644
│ │ │ │ +
645 //
│ │ │ │ +
646 // Extraordinary vertex closed-form evaluation / endcap basis conversion
│ │ │ │ +
647 //
│ │ │ │ +
648 // XXXtakahito: these data will probably be replaced with mask coefficient or something
│ │ │ │ +
649 // SchemeWorker populates.
│ │ │ │ +
650 //
│ │ │ │ +
651 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches)
│ │ │ │ +
652 VertexValenceTable _vertexValenceTable; // Vertex valence table (for Gregory patches)
│ │ │ │ +
653
│ │ │ │ +
654 StencilTablePtr _localPointStencils; // local point conversion stencils
│ │ │ │ +
655 StencilTablePtr _localPointVaryingStencils; // local point varying stencils
│ │ │ │ +
656
│ │ │ │ +
657 //
│ │ │ │ +
658 // Varying data
│ │ │ │ +
659 //
│ │ │ │ +
660 PatchDescriptor _varyingDesc;
│ │ │ │ +
661
│ │ │ │ +
662 std::vector<Index> _varyingVerts;
│ │ │ │ +
663
│ │ │ │ +
664 //
│ │ │ │ +
665 // Face-varying data
│ │ │ │ +
666 //
│ │ │ │ +
667 FVarPatchChannelVector _fvarChannels;
│ │ │ │ +
668
│ │ │ │ +
669 std::vector<StencilTablePtr> _localPointFaceVaryingStencils;
│ │ │ │ +
670
│ │ │ │ +
671 //
│ │ │ │ +
672 // 'single-crease' patch sharpness tables
│ │ │ │ +
673 //
│ │ │ │ +
674 std::vector<Index> _sharpnessIndices; // Indices of single-crease sharpness (one per patch)
│ │ │ │ +
675 std::vector<float> _sharpnessValues; // Sharpness values.
│ │ │ │ +
676
│ │ │ │ +
677 //
│ │ │ │ +
678 // Construction history -- relevant to at least one public query:
│ │ │ │ +
679 //
│ │ │ │ +
680 unsigned int _isUniformLinear : 1;
│ │ │ │ +
681
│ │ │ │ +
682 //
│ │ │ │ +
683 // Precision -- only applies to local-point stencil tables
│ │ │ │ +
684 //
│ │ │ │ +
685 unsigned int _vertexPrecisionIsDouble : 1;
│ │ │ │ +
686 unsigned int _varyingPrecisionIsDouble : 1;
│ │ │ │ +
687 unsigned int _faceVaryingPrecisionIsDouble : 1;
│ │ │ │ +
688};
│ │ │ │ +
689
│ │ │ │ +
690
│ │ │ │ +
691//
│ │ │ │ +
692// Template specializations for float/double -- to be defined before used:
│ │ │ │ +
693//
│ │ │ │ +
694template <> inline StencilTableReal<float> *
│ │ │ │ +
695PatchTable::StencilTablePtr::Get<float>() const { return _fPtr; }
│ │ │ │ +
696
│ │ │ │ +
697template <> inline StencilTableReal<double> *
│ │ │ │ +
698PatchTable::StencilTablePtr::Get<double>() const { return _dPtr; }
│ │ │ │ +
699
│ │ │ │ +
700template <> inline bool
│ │ │ │ +
701PatchTable::LocalPointStencilPrecisionMatchesType<float>() const {
│ │ │ │ +
702 return !_vertexPrecisionIsDouble;
│ │ │ │ +
703}
│ │ │ │ +
704template <> inline bool
│ │ │ │ +
705PatchTable::LocalPointVaryingStencilPrecisionMatchesType<float>() const {
│ │ │ │ +
706 return !_varyingPrecisionIsDouble;
│ │ │ │ +
707}
│ │ │ │ +
708template <> inline bool
│ │ │ │ +
709PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<float>() const {
│ │ │ │ +
710 return !_faceVaryingPrecisionIsDouble;
│ │ │ │ +
711}
│ │ │ │ +
712
│ │ │ │ +
713template <> inline bool
│ │ │ │ +
714PatchTable::LocalPointStencilPrecisionMatchesType<double>() const {
│ │ │ │ +
715 return _vertexPrecisionIsDouble;
│ │ │ │ +
716}
│ │ │ │ +
717template <> inline bool
│ │ │ │ +
718PatchTable::LocalPointVaryingStencilPrecisionMatchesType<double>() const {
│ │ │ │ +
719 return _varyingPrecisionIsDouble;
│ │ │ │ +
720}
│ │ │ │ +
721template <> inline bool
│ │ │ │ +
722PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType<double>() const {
│ │ │ │ +
723 return _faceVaryingPrecisionIsDouble;
│ │ │ │ +
724}
│ │ │ │ +
725
│ │ │ │ +
726//
│ │ │ │ +
727// StencilTable access -- backward compatible and generic:
│ │ │ │ +
728//
│ │ │ │ +
729inline StencilTable const *
│ │ │ │ + │ │ │ │ +
731 assert(LocalPointStencilPrecisionMatchesType<float>());
│ │ │ │ +
732 return static_cast<StencilTable const *>(_localPointStencils.Get<float>());
│ │ │ │ +
733}
│ │ │ │ +
734inline StencilTable const *
│ │ │ │ + │ │ │ │ +
736 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ +
737 return static_cast<StencilTable const *>(
│ │ │ │ +
738 _localPointVaryingStencils.Get<float>());
│ │ │ │ +
739}
│ │ │ │ +
740inline StencilTable const *
│ │ │ │ + │ │ │ │ +
742 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ +
743 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ +
744 return static_cast<StencilTable const *>(
│ │ │ │ +
745 _localPointFaceVaryingStencils[channel].Get<float>());
│ │ │ │ +
746 }
│ │ │ │ +
747 return NULL;
│ │ │ │ +
748}
│ │ │ │ +
749
│ │ │ │ +
750template <typename REAL>
│ │ │ │ +
751inline StencilTableReal<REAL> const *
│ │ │ │ + │ │ │ │ +
753 assert(LocalPointStencilPrecisionMatchesType<REAL>());
│ │ │ │ +
754 return _localPointStencils.Get<REAL>();
│ │ │ │ +
755}
│ │ │ │ +
756template <typename REAL>
│ │ │ │ +
757inline StencilTableReal<REAL> const *
│ │ │ │ + │ │ │ │ +
759 assert(LocalPointVaryingStencilPrecisionMatchesType<REAL>());
│ │ │ │ +
760 return _localPointVaryingStencils.Get<REAL>();
│ │ │ │ +
761}
│ │ │ │ +
762template <typename REAL>
│ │ │ │ +
763inline StencilTableReal<REAL> const *
│ │ │ │ + │ │ │ │ +
765 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<REAL>());
│ │ │ │ +
766 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ +
767 return _localPointFaceVaryingStencils[channel].Get<REAL>();
│ │ │ │ +
768 }
│ │ │ │ +
769 return NULL;
│ │ │ │ +
770}
│ │ │ │ +
771
│ │ │ │ +
772
│ │ │ │ +
773//
│ │ │ │ +
774// Computation of local point values:
│ │ │ │ +
775//
│ │ │ │ +
776template <class T>
│ │ │ │ +
777inline void
│ │ │ │ +
778PatchTable::ComputeLocalPointValues(T const *src, T *dst) const {
│ │ │ │ +
779 assert(LocalPointStencilPrecisionMatchesType<float>());
│ │ │ │ +
780 if (_localPointStencils) {
│ │ │ │ +
781 _localPointStencils.Get<float>()->UpdateValues(src, dst);
│ │ │ │ +
782 }
│ │ │ │ +
783}
│ │ │ │ +
784
│ │ │ │ +
785template <class T>
│ │ │ │ +
786inline void
│ │ │ │ + │ │ │ │ +
788 assert(LocalPointVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ +
789 if (_localPointVaryingStencils) {
│ │ │ │ +
790 _localPointVaryingStencils.Get<float>()->UpdateValues(src, dst);
│ │ │ │ +
791 }
│ │ │ │ +
792}
│ │ │ │ +
793
│ │ │ │ +
794template <class T>
│ │ │ │ +
795inline void
│ │ │ │ +
796PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel) const {
│ │ │ │ +
797 assert(LocalPointFaceVaryingStencilPrecisionMatchesType<float>());
│ │ │ │ +
798 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) {
│ │ │ │ +
799 if (_localPointFaceVaryingStencils[channel]) {
│ │ │ │ +
800 _localPointFaceVaryingStencils[channel].Get<float>()->UpdateValues(src, dst);
│ │ │ │ +
801 }
│ │ │ │ +
802 }
│ │ │ │ +
803}
│ │ │ │ +
804
│ │ │ │ +
805
│ │ │ │ +
806//
│ │ │ │ +
807// Basis evaluation overloads
│ │ │ │ +
808//
│ │ │ │ +
809inline void
│ │ │ │ +
810PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v,
│ │ │ │ +
811 float wP[], float wDu[], float wDv[],
│ │ │ │ +
812 float wDuu[], float wDuv[], float wDvv[]) const {
│ │ │ │ +
813
│ │ │ │ +
814 EvaluateBasis<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ +
815}
│ │ │ │ +
816inline void
│ │ │ │ +
817PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v,
│ │ │ │ +
818 double wP[], double wDu[], double wDv[],
│ │ │ │ +
819 double wDuu[], double wDuv[], double wDvv[]) const {
│ │ │ │ +
820
│ │ │ │ +
821 EvaluateBasis<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ +
822}
│ │ │ │ +
823
│ │ │ │ +
824inline void
│ │ │ │ +
825PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ +
826 float wP[], float wDu[], float wDv[],
│ │ │ │ +
827 float wDuu[], float wDuv[], float wDvv[]) const {
│ │ │ │ +
828
│ │ │ │ +
829 EvaluateBasisVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ +
830}
│ │ │ │ +
831inline void
│ │ │ │ +
832PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ +
833 double wP[], double wDu[], double wDv[],
│ │ │ │ +
834 double wDuu[], double wDuv[], double wDvv[]) const {
│ │ │ │ +
835
│ │ │ │ +
836 EvaluateBasisVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv);
│ │ │ │ +
837}
│ │ │ │ +
838
│ │ │ │ +
839inline void
│ │ │ │ +
840PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float v,
│ │ │ │ +
841 float wP[], float wDu[], float wDv[],
│ │ │ │ +
842 float wDuu[], float wDuv[], float wDvv[], int channel) const {
│ │ │ │ +
843
│ │ │ │ +
844 EvaluateBasisFaceVarying<float>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
│ │ │ │ +
845}
│ │ │ │ +
846inline void
│ │ │ │ +
847PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double v,
│ │ │ │ +
848 double wP[], double wDu[], double wDv[],
│ │ │ │ +
849 double wDuu[], double wDuv[], double wDvv[], int channel) const {
│ │ │ │ +
850
│ │ │ │ +
851 EvaluateBasisFaceVarying<double>(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv, channel);
│ │ │ │ +
852}
│ │ │ │ +
853
│ │ │ │ +
854} // end namespace Far
│ │ │ │ +
855
│ │ │ │ +
856} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
857using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
858
│ │ │ │ +
859} // end namespace OpenSubdiv
│ │ │ │ +
860
│ │ │ │ +
861#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */
│ │ │ │ │ │ │ │ -
An quadtree-based map connecting coarse faces to their sub-patches.
Definition: patchMap.h:49
│ │ │ │ -
PatchMap(PatchTable const &patchTable)
Constructor.
│ │ │ │ -
Handle const * FindPatch(int patchFaceId, double u, double v) const
Returns a handle to the sub-patch of the face at the given (u,v). Note that the patch face ID corresp...
Definition: patchMap.h:193
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ -
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │ +
std::vector< PatchParam > PatchParamTable
Definition: patchParam.h:243
│ │ │ │ + │ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ + │ │ │ │ +
An quadtree-based map connecting coarse faces to their sub-patches.
Definition: patchMap.h:49
│ │ │ │ + │ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ +
ConstIndexArray GetPatchArrayVaryingVertices(int array) const
Returns the varying vertex indices for the patches in array.
│ │ │ │ + │ │ │ │ +
PatchVertsTable const & GetPatchControlVerticesTable() const
Get the table of patch control vertices.
Definition: patchTable.h:378
│ │ │ │ +
void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) const
Updates local point face-varying values.
Definition: patchTable.h:796
│ │ │ │ +
ConstIndexArray GetVaryingVertices() const
Returns an array of varying vertex indices for the patches.
│ │ │ │ +
void ComputeLocalPointValuesVarying(T const *src, T *dst) const
Updates local point varying values.
Definition: patchTable.h:787
│ │ │ │ +
ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const
Returns the varying vertex indices for a given patch.
│ │ │ │ +
bool IsFeatureAdaptive() const
True if the patches are of feature adaptive types.
│ │ │ │ +
int GetMaxValence() const
Returns max vertex valence.
Definition: patchTable.h:92
│ │ │ │ +
StencilTableReal< REAL > const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
│ │ │ │ +
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Definition: patchTable.h:730
│ │ │ │ +
PatchParamArray getPatchParams(int arrayIndex)
│ │ │ │ +
ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const
Returns the value indices for the patches in array in channel.
│ │ │ │ +
std::vector< float > const & GetSharpnessValues() const
Returns sharpness values table.
Definition: patchTable.h:387
│ │ │ │ + │ │ │ │ +
PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const
Returns the face-varying params for a given patch channel.
│ │ │ │ +
ConstIndexArray GetPatchVaryingVertices(int array, int patch) const
Returns the varying vertex indices for a given patch.
│ │ │ │ +
PatchTable(PatchTable const &src)
Copy constructor.
│ │ │ │ +
int GetNumPatchArrays() const
Returns the number of patch arrays in the table.
│ │ │ │ +
ConstIndexArray GetPatchVertices(PatchHandle const &handle) const
Returns the control vertex indices for the patch identified by handle.
│ │ │ │ + │ │ │ │ +
bool LocalPointFaceVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point face-varying values matches the gi...
│ │ │ │ +
PatchParamTable const & GetPatchParamTable() const
Returns the PatchParamTable (PatchParams order matches patch array sorting)
Definition: patchTable.h:381
│ │ │ │ +
VertexValenceTable const & GetVertexValenceTable() const
Returns the 'VertexValences' table (vertex neighborhoods table)
Definition: patchTable.h:267
│ │ │ │ +
StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
Definition: patchTable.h:741
│ │ │ │ +
int GetNumControlVertices(int array) const
Returns the number of control vertices in array.
│ │ │ │ + │ │ │ │ +
void EvaluateBasisFaceVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0, int channel=0) const
Evaluate basis functions for a face-varying value and derivatives at a given (u,v) parametric locatio...
│ │ │ │ +
ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const
Returns the 'QuadOffsets' for the Gregory patch identified by handle.
│ │ │ │ +
PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const
Returns the irregular patch descriptor for channel.
│ │ │ │ +
float GetSingleCreasePatchSharpnessValue(int array, int patch) const
Returns the crease sharpness for the patch in array if it is a single-crease patch,...
│ │ │ │ + │ │ │ │ +
void ComputeLocalPointValues(T const *src, T *dst) const
Updates local point vertex values.
Definition: patchTable.h:778
│ │ │ │ +
float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const
Returns the crease sharpness for the patch identified by handle if it is a single-crease patch,...
│ │ │ │ +
PatchParam GetPatchParam(int array, int patch) const
Returns the PatchParam for patch in array.
│ │ │ │ +
ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ +
PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const
Returns the regular patch descriptor for channel.
│ │ │ │ +
PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const
Returns the PatchDescriptor for the patch identified by handle.
│ │ │ │ + │ │ │ │ +
QuadOffsetsTable const & GetQuadOffsetsTable() const
Returns the quad-offsets table.
Definition: patchTable.h:392
│ │ │ │ +
int GetNumPatches(int array) const
Returns the number of patches in array.
│ │ │ │ +
PatchDescriptor GetVaryingPatchDescriptor() const
Returns the varying patch descriptor.
│ │ │ │ +
ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ +
ConstPatchParamArray const GetPatchParams(int array) const
Returns the PatchParams for the patches in array.
│ │ │ │ +
int GetNumControlVerticesTotal() const
Returns the total number of control vertex indices in the table.
Definition: patchTable.h:84
│ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channels.
│ │ │ │ +
ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) const
Returns the face-varying for a given patch in array in channel.
│ │ │ │ +
Index getPatchIndex(int array, int patch) const
│ │ │ │ +
int GetNumLocalPoints() const
Returns the number of local vertex points.
│ │ │ │ +
bool LocalPointVaryingStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point varying values matches the given f...
│ │ │ │ +
ConstIndexArray GetPatchArrayVertices(int array) const
Returns the control vertex indices for the patches in array.
│ │ │ │ +
int GetNumPtexFaces() const
Returns the total number of ptex faces in the mesh.
Definition: patchTable.h:95
│ │ │ │ +
ConstIndexArray GetFVarValues(int channel=0) const
Returns an array of value indices for the patches in channel.
│ │ │ │ +
Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray
Accessors for the gregory patch evaluation buffers. These methods will be deprecated.
Definition: patchTable.h:259
│ │ │ │ +
void EvaluateBasis(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for position and derivatives at a given (u,v) parametric location of a patch...
│ │ │ │ +
StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int channel=0) const
Returns the stencil table to compute local point face-varying values.
│ │ │ │ +
int GetNumPatchesTotal() const
Returns the total number of patches stored in the table.
│ │ │ │ +
PatchParam GetPatchParam(PatchHandle const &handle) const
Returns a PatchParam for the patch identified by handle.
│ │ │ │ + │ │ │ │ +
Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int channel=0) const
Deprecated.
│ │ │ │ +
std::vector< Index > const & GetSharpnessIndexTable() const
Returns a sharpness index table for each patch (if exists)
Definition: patchTable.h:384
│ │ │ │ +
PatchDescriptor GetPatchArrayDescriptor(int array) const
Returns the PatchDescriptor for the patches in array.
│ │ │ │ + │ │ │ │ +
void EvaluateBasisVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const
Evaluate basis functions for a varying value and derivatives at a given (u,v) parametric location of ...
│ │ │ │ +
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
Definition: patchTable.h:735
│ │ │ │ +
std::vector< unsigned int > QuadOffsetsTable
Definition: patchTable.h:389
│ │ │ │ +
ConstIndexArray GetPatchVertices(int array, int patch) const
Returns the control vertex indices for patch in array.
│ │ │ │ +
PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) const
Returns the value indices for a given patch in channel.
│ │ │ │ +
int GetFVarValueStride(int channel=0) const
Returns the stride between patches in the value index array of channel.
│ │ │ │ +
ConstPatchParamArray GetFVarPatchParams(int channel=0) const
Returns an array of face-varying patch param for channel.
│ │ │ │ +
PatchDescriptor GetFVarPatchDescriptor(int channel=0) const
Returns the default/irregular patch descriptor for channel.
│ │ │ │ +
int GetNumLocalPointsVarying() const
Returns the number of local varying points.
│ │ │ │ +
bool LocalPointStencilPrecisionMatchesType() const
Tests if the precision of the stencil table to compute local point vertex values matches the given fl...
│ │ │ │ +
StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
│ │ │ │ +
int GetNumLocalPointsFaceVarying(int channel=0) const
Returns the number of local face-varying points for channel.
│ │ │ │ +
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -patchMap.h │ │ │ │ │ +patchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,238 +30,952 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_FAR_PATCH_MAP_H │ │ │ │ │ - 26#define OPENSUBDIV3_FAR_PATCH_MAP_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_FAR_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_FAR_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../far/patchTable.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32#include │ │ │ │ │ + 30#include "../far/patchDescriptor.h" │ │ │ │ │ + 31#include "../far/patchParam.h" │ │ │ │ │ + 32#include "../far/stencilTable.h" │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 │ │ │ │ │ -49class PatchMap { │ │ │ │ │ - 50public: │ │ │ │ │ - 51 │ │ │ │ │ -52 typedef PatchTable::PatchHandle Handle; │ │ │ │ │ - 53 │ │ │ │ │ -58 PatchMap( PatchTable const & patchTable ); │ │ │ │ │ - 59 │ │ │ │ │ - 74 Handle const * FindPatch( int patchFaceId, double u, double v ) const; │ │ │ │ │ - 75 │ │ │ │ │ - 76private: │ │ │ │ │ - 77 void initializeHandles(PatchTable const & patchTable); │ │ │ │ │ - 78 void initializeQuadtree(PatchTable const & patchTable); │ │ │ │ │ + 34#include "../sdc/options.h" │ │ │ │ │ + 35 │ │ │ │ │ + 36#include │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace OpenSubdiv { │ │ │ │ │ + 39namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 40 │ │ │ │ │ + 41namespace Far { │ │ │ │ │ + 42 │ │ │ │ │ +55class PatchTable { │ │ │ │ │ + 56 │ │ │ │ │ + 57public: │ │ │ │ │ + 58 │ │ │ │ │ +60 class PatchHandle { │ │ │ │ │ + 61 // XXXX manuelk members will eventually be made private │ │ │ │ │ + 62 public: │ │ │ │ │ + 63 │ │ │ │ │ +64 friend class PatchTable; │ │ │ │ │ +65 friend class PatchMap; │ │ │ │ │ + 66 │ │ │ │ │ +67 Index arrayIndex, // Array index of the patch │ │ │ │ │ +68 patchIndex, // Absolute Index of the patch │ │ │ │ │ +69 vertIndex; // Relative offset to the first CV of the patch in array │ │ │ │ │ + 70 }; │ │ │ │ │ + 71 │ │ │ │ │ + 72public: │ │ │ │ │ + 73 │ │ │ │ │ +75 PatchTable(PatchTable const & src); │ │ │ │ │ + 76 │ │ │ │ │ +78 ~PatchTable(); │ │ │ │ │ 79 │ │ │ │ │ - 80private: │ │ │ │ │ - 81 // Quadtree node with 4 children, tree is just a vector of nodes │ │ │ │ │ - 82 struct QuadNode { │ │ │ │ │ - 83 QuadNode() { std::memset(this, 0, sizeof(QuadNode)); } │ │ │ │ │ - 84 │ │ │ │ │ -85 struct Child { │ │ │ │ │ -86 unsigned int isSet : 1; // true if the child has been set │ │ │ │ │ -87 unsigned int isLeaf : 1; // true if the child is a QuadNode │ │ │ │ │ -88 unsigned int index : 30; // child index (either QuadNode or Handle) │ │ │ │ │ - 89 }; │ │ │ │ │ +81 bool IsFeatureAdaptive() const; │ │ │ │ │ + 82 │ │ │ │ │ +84 int GetNumControlVerticesTotal() const { │ │ │ │ │ + 85 return (int)_patchVerts.size(); │ │ │ │ │ + 86 } │ │ │ │ │ + 87 │ │ │ │ │ +89 int GetNumPatchesTotal() const; │ │ │ │ │ 90 │ │ │ │ │ - 91 // sets all the children to point to the patch of given index │ │ │ │ │ - 92 void SetChildren(int index); │ │ │ │ │ +92 int GetMaxValence() const { return _maxValence; } │ │ │ │ │ 93 │ │ │ │ │ - 94 // sets the child in "quadrant" to point to the node or patch of the given │ │ │ │ │ -index │ │ │ │ │ - 95 void SetChild(int quadrant, int index, bool isLeaf); │ │ │ │ │ +95 int GetNumPtexFaces() const { return _numPtexFaces; } │ │ │ │ │ 96 │ │ │ │ │ - 97 Child children[4]; │ │ │ │ │ - 98 }; │ │ │ │ │ - 99 typedef std::vector QuadTree; │ │ │ │ │ - 100 │ │ │ │ │ - 101 // Internal methods supporting quadtree construction and queries │ │ │ │ │ - 102 void assignRootNode(QuadNode * node, int index); │ │ │ │ │ - 103 QuadNode * assignLeafOrChildNode(QuadNode * node, bool isLeaf, int quad, │ │ │ │ │ -int index); │ │ │ │ │ - 104 │ │ │ │ │ - 105 template │ │ │ │ │ - 106 static int transformUVToQuadQuadrant(T const & median, T & u, T & v); │ │ │ │ │ - 107 template │ │ │ │ │ - 108 static int transformUVToTriQuadrant(T const & median, T & u, T & v, bool & │ │ │ │ │ -rotated); │ │ │ │ │ - 109 │ │ │ │ │ - 110private: │ │ │ │ │ - 111 bool _patchesAreTriangular; // tri and quad assembly and search │ │ │ │ │ -requirements differ │ │ │ │ │ - 112 │ │ │ │ │ - 113 int _minPatchFace; // minimum patch face index supported by the map │ │ │ │ │ - 114 int _maxPatchFace; // maximum patch face index supported by the map │ │ │ │ │ - 115 int _maxDepth; // maximum depth of a patch in the tree │ │ │ │ │ - 116 │ │ │ │ │ - 117 std::vector _handles; // all the patches in the PatchTable │ │ │ │ │ - 118 std::vector _quadtree; // quadtree nodes │ │ │ │ │ - 119}; │ │ │ │ │ - 120 │ │ │ │ │ - 121// │ │ │ │ │ - 122// Given a median value for both U and V, these methods transform a (u,v) │ │ │ │ │ -pair │ │ │ │ │ - 123// into the quadrant that contains them and returns the quadrant index. │ │ │ │ │ - 124// │ │ │ │ │ - 125// Quadrant indexing for tri and quad patches -- consistent with │ │ │ │ │ -PatchParam's │ │ │ │ │ - 126// usage of UV bits: │ │ │ │ │ - 127// │ │ │ │ │ - 128// (0,1) o-----o-----o (1,1) (0,1) o (1,0) o-----o-----o (0,0) │ │ │ │ │ - 129// | | | |\ \ 1 |\ 0 | │ │ │ │ │ - 130// | 2 | 3 | | \ \ | \ | │ │ │ │ │ - 131// | | | | 2 \ \| 3 \| │ │ │ │ │ - 132// o-----o-----o o-----o o-----o │ │ │ │ │ - 133// | | | |\ 3 |\ \ 2 | │ │ │ │ │ - 134// | 0 | 1 | | \ | \ \ | │ │ │ │ │ - 135// | | | | 0 \| 1 \ \| │ │ │ │ │ - 136// (0,0) o-----o-----o (1,0) (0,0) o-----o-----o (1,0) o (0,1) │ │ │ │ │ - 137// │ │ │ │ │ - 138// The triangular case also takes and returns/affects the rotation of the │ │ │ │ │ - 139// quadrant being searched and identified (quadrant 3 imparts a rotation). │ │ │ │ │ - 140// │ │ │ │ │ - 141template │ │ │ │ │ - 142inline int │ │ │ │ │ - 143PatchMap::transformUVToQuadQuadrant(T const & median, T & u, T & v) { │ │ │ │ │ - 144 │ │ │ │ │ - 145 int uHalf = (u >= median); │ │ │ │ │ - 146 if (uHalf) u -= median; │ │ │ │ │ - 147 │ │ │ │ │ - 148 int vHalf = (v >= median); │ │ │ │ │ - 149 if (vHalf) v -= median; │ │ │ │ │ + 97 │ │ │ │ │ + 99 │ │ │ │ │ + 105 │ │ │ │ │ +107 PatchDescriptor GetPatchDescriptor(PatchHandle const & handle) const; │ │ │ │ │ + 108 │ │ │ │ │ +110 ConstIndexArray GetPatchVertices(PatchHandle const & handle) const; │ │ │ │ │ + 111 │ │ │ │ │ +113 PatchParam GetPatchParam(PatchHandle const & handle) const; │ │ │ │ │ + 114 │ │ │ │ │ +116 ConstIndexArray GetPatchVertices(int array, int patch) const; │ │ │ │ │ + 117 │ │ │ │ │ +119 PatchParam GetPatchParam(int array, int patch) const; │ │ │ │ │ + 121 │ │ │ │ │ + 122 │ │ │ │ │ + 124 │ │ │ │ │ + 130 │ │ │ │ │ +132 int GetNumPatchArrays() const; │ │ │ │ │ + 133 │ │ │ │ │ +135 int GetNumPatches(int array) const; │ │ │ │ │ + 136 │ │ │ │ │ +138 int GetNumControlVertices(int array) const; │ │ │ │ │ + 139 │ │ │ │ │ +141 PatchDescriptor GetPatchArrayDescriptor(int array) const; │ │ │ │ │ + 142 │ │ │ │ │ +144 ConstIndexArray GetPatchArrayVertices(int array) const; │ │ │ │ │ + 145 │ │ │ │ │ +147 ConstPatchParamArray const GetPatchParams(int array) const; │ │ │ │ │ + 149 │ │ │ │ │ 150 │ │ │ │ │ - 151 return (vHalf << 1) | uHalf; │ │ │ │ │ - 152} │ │ │ │ │ - 153 │ │ │ │ │ - 154template │ │ │ │ │ - 155int inline │ │ │ │ │ - 156PatchMap::transformUVToTriQuadrant(T const & median, T & u, T & v, bool & │ │ │ │ │ -rotated) { │ │ │ │ │ - 157 │ │ │ │ │ - 158 if (!rotated) { │ │ │ │ │ - 159 if (u >= median) { │ │ │ │ │ - 160 u -= median; │ │ │ │ │ - 161 return 1; │ │ │ │ │ - 162 } │ │ │ │ │ - 163 if (v >= median) { │ │ │ │ │ - 164 v -= median; │ │ │ │ │ - 165 return 2; │ │ │ │ │ - 166 } │ │ │ │ │ - 167 if ((u + v) >= median) { │ │ │ │ │ - 168 rotated = true; │ │ │ │ │ - 169 return 3; │ │ │ │ │ - 170 } │ │ │ │ │ - 171 return 0; │ │ │ │ │ - 172 } else { │ │ │ │ │ - 173 if (u < median) { │ │ │ │ │ - 174 v -= median; │ │ │ │ │ - 175 return 1; │ │ │ │ │ - 176 } │ │ │ │ │ - 177 if (v < median) { │ │ │ │ │ - 178 u -= median; │ │ │ │ │ - 179 return 2; │ │ │ │ │ - 180 } │ │ │ │ │ - 181 u -= median; │ │ │ │ │ - 182 v -= median; │ │ │ │ │ - 183 if ((u + v) < median) { │ │ │ │ │ - 184 rotated = false; │ │ │ │ │ - 185 return 3; │ │ │ │ │ - 186 } │ │ │ │ │ - 187 return 0; │ │ │ │ │ - 188 } │ │ │ │ │ - 189} │ │ │ │ │ - 190 │ │ │ │ │ - 192inline PatchMap::Handle const * │ │ │ │ │ -193PatchMap::FindPatch( int faceid, double u, double v ) const { │ │ │ │ │ - 194 │ │ │ │ │ - 195 // │ │ │ │ │ - 196 // Reject patch faces not supported by this map, or those corresponding │ │ │ │ │ - 197 // to holes or otherwise unassigned (the root node for a patch will │ │ │ │ │ - 198 // have all or no quadrants set): │ │ │ │ │ - 199 // │ │ │ │ │ - 200 if ((faceid < _minPatchFace) || (faceid > _maxPatchFace)) return 0; │ │ │ │ │ - 201 │ │ │ │ │ - 202 QuadNode const * node = &_quadtree[faceid - _minPatchFace]; │ │ │ │ │ + 152 │ │ │ │ │ + 159 │ │ │ │ │ +161 int GetNumLocalPoints() const; │ │ │ │ │ + 162 │ │ │ │ │ + 164 StencilTable const *GetLocalPointStencilTable() const; │ │ │ │ │ + 165 │ │ │ │ │ + 167 template │ │ │ │ │ +168 StencilTableReal const *GetLocalPointStencilTable() const; │ │ │ │ │ + 169 │ │ │ │ │ +172 template bool LocalPointStencilPrecisionMatchesType() │ │ │ │ │ +const; │ │ │ │ │ + 173 │ │ │ │ │ + 186 template void │ │ │ │ │ + 187 ComputeLocalPointValues(T const *src, T *dst) const; │ │ │ │ │ + 188 │ │ │ │ │ + 189 │ │ │ │ │ +191 int GetNumLocalPointsVarying() const; │ │ │ │ │ + 192 │ │ │ │ │ + 194 StencilTable const *GetLocalPointVaryingStencilTable() const; │ │ │ │ │ + 195 │ │ │ │ │ + 197 template │ │ │ │ │ +198 StencilTableReal const *GetLocalPointVaryingStencilTable() const; │ │ │ │ │ + 199 │ │ │ │ │ +202 template bool LocalPointVaryingStencilPrecisionMatchesType │ │ │ │ │ +() const; │ │ │ │ │ 203 │ │ │ │ │ - 204 if (!node->children[0].isSet) return 0; │ │ │ │ │ - 205 │ │ │ │ │ - 206 // │ │ │ │ │ - 207 // Search the tree for the sub-patch containing the given (u,v) │ │ │ │ │ - 208 // │ │ │ │ │ - 209 assert( (u>=0.0) && (u<=1.0) && (v>=0.0) && (v<=1.0) ); │ │ │ │ │ - 210 │ │ │ │ │ - 211 double median = 0.5; │ │ │ │ │ - 212 bool triRotated = false; │ │ │ │ │ - 213 │ │ │ │ │ - 214 for (int depth = 0; depth <= _maxDepth; ++depth, median *= 0.5) { │ │ │ │ │ - 215 │ │ │ │ │ - 216 int quadrant = _patchesAreTriangular │ │ │ │ │ - 217 ? transformUVToTriQuadrant(median, u, v, triRotated) │ │ │ │ │ - 218 : transformUVToQuadQuadrant(median, u, v); │ │ │ │ │ + 216 template void │ │ │ │ │ + 217 ComputeLocalPointValuesVarying(T const *src, T *dst) const; │ │ │ │ │ + 218 │ │ │ │ │ 219 │ │ │ │ │ - 220 // holes should have been rejected at the root node of the face │ │ │ │ │ - 221 assert(node->children[quadrant].isSet); │ │ │ │ │ +221 int GetNumLocalPointsFaceVarying(int channel = 0) const; │ │ │ │ │ 222 │ │ │ │ │ - 223 if (node->children[quadrant].isLeaf) { │ │ │ │ │ - 224 return &_handles[node->children[quadrant].index]; │ │ │ │ │ - 225 } else { │ │ │ │ │ - 226 node = &_quadtree[node->children[quadrant].index]; │ │ │ │ │ - 227 } │ │ │ │ │ - 228 } │ │ │ │ │ - 229 assert(0); │ │ │ │ │ - 230 return 0; │ │ │ │ │ - 231} │ │ │ │ │ - 232 │ │ │ │ │ - 233} // end namespace Far │ │ │ │ │ - 234 │ │ │ │ │ - 235} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 236using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 237 │ │ │ │ │ - 238} // end namespace OpenSubdiv │ │ │ │ │ - 239 │ │ │ │ │ - 240#endif /* OPENSUBDIV3_FAR_PATCH_PARAM */ │ │ │ │ │ + 224 StencilTable const *GetLocalPointFaceVaryingStencilTable(int channel = 0) │ │ │ │ │ +const; │ │ │ │ │ + 225 │ │ │ │ │ + 227 template │ │ │ │ │ +228 StencilTableReal const * GetLocalPointFaceVaryingStencilTable(int │ │ │ │ │ +channel = 0) const; │ │ │ │ │ + 229 │ │ │ │ │ +232 template bool │ │ │ │ │ +LocalPointFaceVaryingStencilPrecisionMatchesType() const; │ │ │ │ │ + 233 │ │ │ │ │ + 248 template void │ │ │ │ │ + 249 ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel = 0) │ │ │ │ │ +const; │ │ │ │ │ + 251 │ │ │ │ │ + 252 │ │ │ │ │ + 254 │ │ │ │ │ + 255 │ │ │ │ │ +259 typedef Vtr::ConstArray ConstQuadOffsetsArray; │ │ │ │ │ + 260 │ │ │ │ │ +262 ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const & handle) │ │ │ │ │ +const; │ │ │ │ │ + 263 │ │ │ │ │ +264 typedef std::vector VertexValenceTable; │ │ │ │ │ + 265 │ │ │ │ │ +267 VertexValenceTable const & GetVertexValenceTable() const { │ │ │ │ │ + 268 return _vertexValenceTable; │ │ │ │ │ + 269 } │ │ │ │ │ + 271 │ │ │ │ │ + 272 │ │ │ │ │ + 274 │ │ │ │ │ + 280 │ │ │ │ │ +283 float GetSingleCreasePatchSharpnessValue(PatchHandle const & handle) const; │ │ │ │ │ + 284 │ │ │ │ │ +287 float GetSingleCreasePatchSharpnessValue(int array, int patch) const; │ │ │ │ │ + 289 │ │ │ │ │ + 290 │ │ │ │ │ + 292 │ │ │ │ │ + 298 │ │ │ │ │ +300 PatchDescriptor GetVaryingPatchDescriptor() const; │ │ │ │ │ + 301 │ │ │ │ │ +303 ConstIndexArray GetPatchVaryingVertices(PatchHandle const & handle) const; │ │ │ │ │ + 304 │ │ │ │ │ +306 ConstIndexArray GetPatchVaryingVertices(int array, int patch) const; │ │ │ │ │ + 307 │ │ │ │ │ +309 ConstIndexArray GetPatchArrayVaryingVertices(int array) const; │ │ │ │ │ + 310 │ │ │ │ │ +312 ConstIndexArray GetVaryingVertices() const; │ │ │ │ │ + 314 │ │ │ │ │ + 315 │ │ │ │ │ + 317 │ │ │ │ │ + 323 │ │ │ │ │ +325 int GetNumFVarChannels() const; │ │ │ │ │ + 326 │ │ │ │ │ +328 PatchDescriptor GetFVarPatchDescriptorRegular(int channel = 0) const; │ │ │ │ │ + 329 │ │ │ │ │ +331 PatchDescriptor GetFVarPatchDescriptorIrregular(int channel = 0) const; │ │ │ │ │ + 332 │ │ │ │ │ +334 PatchDescriptor GetFVarPatchDescriptor(int channel = 0) const; │ │ │ │ │ + 335 │ │ │ │ │ +337 ConstIndexArray GetPatchFVarValues(PatchHandle const & handle, int channel │ │ │ │ │ += 0) const; │ │ │ │ │ + 338 │ │ │ │ │ +340 ConstIndexArray GetPatchFVarValues(int array, int patch, int channel = 0) │ │ │ │ │ +const; │ │ │ │ │ + 341 │ │ │ │ │ +343 ConstIndexArray GetPatchArrayFVarValues(int array, int channel = 0) const; │ │ │ │ │ + 344 │ │ │ │ │ +346 ConstIndexArray GetFVarValues(int channel = 0) const; │ │ │ │ │ + 347 │ │ │ │ │ +349 int GetFVarValueStride(int channel = 0) const; │ │ │ │ │ + 350 │ │ │ │ │ +352 PatchParam GetPatchFVarPatchParam(PatchHandle const & handle, int channel = │ │ │ │ │ +0) const; │ │ │ │ │ + 353 │ │ │ │ │ +355 PatchParam GetPatchFVarPatchParam(int array, int patch, int channel = 0) │ │ │ │ │ +const; │ │ │ │ │ + 356 │ │ │ │ │ +358 ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel = │ │ │ │ │ +0) const; │ │ │ │ │ + 359 │ │ │ │ │ +361 ConstPatchParamArray GetFVarPatchParams(int channel = 0) const; │ │ │ │ │ + 362 │ │ │ │ │ +364 Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int │ │ │ │ │ +channel = 0) const; │ │ │ │ │ + 366 │ │ │ │ │ + 367 │ │ │ │ │ + 369 │ │ │ │ │ + 374 │ │ │ │ │ +375 typedef std::vector PatchVertsTable; │ │ │ │ │ + 376 │ │ │ │ │ +378 PatchVertsTable const & GetPatchControlVerticesTable() const { return │ │ │ │ │ +_patchVerts; } │ │ │ │ │ + 379 │ │ │ │ │ +381 PatchParamTable const & GetPatchParamTable() const { return _paramTable; } │ │ │ │ │ + 382 │ │ │ │ │ +384 std::vector const &GetSharpnessIndexTable() const { return │ │ │ │ │ +_sharpnessIndices; } │ │ │ │ │ + 385 │ │ │ │ │ +387 std::vector const &GetSharpnessValues() const { return │ │ │ │ │ +_sharpnessValues; } │ │ │ │ │ + 388 │ │ │ │ │ +389 typedef std::vector QuadOffsetsTable; │ │ │ │ │ + 390 │ │ │ │ │ +392 QuadOffsetsTable const & GetQuadOffsetsTable() const { │ │ │ │ │ + 393 return _quadOffsetsTable; │ │ │ │ │ + 394 } │ │ │ │ │ + 396 │ │ │ │ │ +398 void print() const; │ │ │ │ │ + 399 │ │ │ │ │ + 400public: │ │ │ │ │ + 401 │ │ │ │ │ + 403 │ │ │ │ │ + 405 │ │ │ │ │ + 428 template │ │ │ │ │ +429 void EvaluateBasis(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ + 430 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ + 431 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const; │ │ │ │ │ + 432 │ │ │ │ │ + 435 void EvaluateBasis(PatchHandle const & handle, float u, float v, │ │ │ │ │ + 436 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ + 437 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const; │ │ │ │ │ + 438 │ │ │ │ │ + 441 void EvaluateBasis(PatchHandle const & handle, double u, double v, │ │ │ │ │ + 442 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ + 443 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const; │ │ │ │ │ + 444 │ │ │ │ │ + 467 template │ │ │ │ │ +468 void EvaluateBasisVarying(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ + 469 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ + 470 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0) const; │ │ │ │ │ + 471 │ │ │ │ │ + 474 void EvaluateBasisVarying(PatchHandle const & handle, float u, float v, │ │ │ │ │ + 475 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ + 476 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0) const; │ │ │ │ │ + 477 │ │ │ │ │ + 480 void EvaluateBasisVarying(PatchHandle const & handle, double u, double v, │ │ │ │ │ + 481 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ + 482 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0) const; │ │ │ │ │ + 483 │ │ │ │ │ + 508 template │ │ │ │ │ +509 void EvaluateBasisFaceVarying(PatchHandle const & handle, REAL u, REAL v, │ │ │ │ │ + 510 REAL wP[], REAL wDu[] = 0, REAL wDv[] = 0, │ │ │ │ │ + 511 REAL wDuu[] = 0, REAL wDuv[] = 0, REAL wDvv[] = 0, │ │ │ │ │ + 512 int channel = 0) const; │ │ │ │ │ + 513 │ │ │ │ │ + 516 void EvaluateBasisFaceVarying(PatchHandle const & handle, float u, float │ │ │ │ │ +v, │ │ │ │ │ + 517 float wP[], float wDu[] = 0, float wDv[] = 0, │ │ │ │ │ + 518 float wDuu[] = 0, float wDuv[] = 0, float wDvv[] = 0, │ │ │ │ │ + 519 int channel = 0) const; │ │ │ │ │ + 520 │ │ │ │ │ + 523 void EvaluateBasisFaceVarying(PatchHandle const & handle, double u, double │ │ │ │ │ +v, │ │ │ │ │ + 524 double wP[], double wDu[] = 0, double wDv[] = 0, │ │ │ │ │ + 525 double wDuu[] = 0, double wDuv[] = 0, double wDvv[] = 0, │ │ │ │ │ + 526 int channel = 0) const; │ │ │ │ │ + 528 │ │ │ │ │ + 529protected: │ │ │ │ │ + 530 │ │ │ │ │ +531 friend class PatchTableBuilder; │ │ │ │ │ + 532 │ │ │ │ │ + 533 // Factory constructor │ │ │ │ │ +534 PatchTable(int maxvalence); │ │ │ │ │ + 535 │ │ │ │ │ +536 Index getPatchIndex(int array, int patch) const; │ │ │ │ │ + 537 │ │ │ │ │ +538 PatchParamArray getPatchParams(int arrayIndex); │ │ │ │ │ + 539 │ │ │ │ │ +540 Index * getSharpnessIndices(Index arrayIndex); │ │ │ │ │ +541 float * getSharpnessValues(Index arrayIndex); │ │ │ │ │ + 542 │ │ │ │ │ + 543private: │ │ │ │ │ + 544 │ │ │ │ │ + 545 // │ │ │ │ │ + 546 // Patch arrays │ │ │ │ │ + 547 // │ │ │ │ │ + 548 │ │ │ │ │ + 549 struct PatchArray; │ │ │ │ │ + 550 typedef std::vector PatchArrayVector; │ │ │ │ │ + 551 │ │ │ │ │ + 552 PatchArray & getPatchArray(Index arrayIndex); │ │ │ │ │ + 553 PatchArray const & getPatchArray(Index arrayIndex) const; │ │ │ │ │ + 554 │ │ │ │ │ + 555 void reservePatchArrays(int numPatchArrays); │ │ │ │ │ + 556 void pushPatchArray(PatchDescriptor desc, int npatches, │ │ │ │ │ + 557 Index * vidx, Index * pidx, Index * qoidx=0); │ │ │ │ │ + 558 │ │ │ │ │ + 559 IndexArray getPatchArrayVertices(int arrayIndex); │ │ │ │ │ + 560 │ │ │ │ │ + 561 Index findPatchArray(PatchDescriptor desc); │ │ │ │ │ + 562 │ │ │ │ │ + 563 │ │ │ │ │ + 564 // │ │ │ │ │ + 565 // Varying patch arrays │ │ │ │ │ + 566 // │ │ │ │ │ + 567 IndexArray getPatchArrayVaryingVertices(int arrayIndex); │ │ │ │ │ + 568 │ │ │ │ │ + 569 void allocateVaryingVertices( │ │ │ │ │ + 570 PatchDescriptor desc, int numPatches); │ │ │ │ │ + 571 void populateVaryingVertices(); │ │ │ │ │ + 572 │ │ │ │ │ + 573 // │ │ │ │ │ + 574 // Face-varying patch channels │ │ │ │ │ + 575 // │ │ │ │ │ + 576 │ │ │ │ │ + 577 struct FVarPatchChannel; │ │ │ │ │ + 578 typedef std::vector FVarPatchChannelVector; │ │ │ │ │ + 579 │ │ │ │ │ + 580 FVarPatchChannel & getFVarPatchChannel(int channel); │ │ │ │ │ + 581 FVarPatchChannel const & getFVarPatchChannel(int channel) const; │ │ │ │ │ + 582 │ │ │ │ │ + 583 void allocateFVarPatchChannels(int numChannels); │ │ │ │ │ + 584 void allocateFVarPatchChannelValues( │ │ │ │ │ + 585 PatchDescriptor regDesc, PatchDescriptor irregDesc, │ │ │ │ │ + 586 int numPatches, int channel); │ │ │ │ │ + 587 │ │ │ │ │ + 588 // deprecated │ │ │ │ │ + 589 void setFVarPatchChannelLinearInterpolation( │ │ │ │ │ + 590 Sdc::Options::FVarLinearInterpolation interpolation, int channel); │ │ │ │ │ + 591 │ │ │ │ │ + 592 IndexArray getFVarValues(int channel); │ │ │ │ │ + 593 ConstIndexArray getPatchFVarValues(int patch, int channel) const; │ │ │ │ │ + 594 │ │ │ │ │ + 595 PatchParamArray getFVarPatchParams(int channel); │ │ │ │ │ + 596 PatchParam getPatchFVarPatchParam(int patch, int channel) const; │ │ │ │ │ + 597 │ │ │ │ │ + 598private: │ │ │ │ │ + 599 // │ │ │ │ │ + 600 // Simple private class to hold stencil table pointers of varying │ │ │ │ │ +precision, │ │ │ │ │ + 601 // where the discriminant of the precision is external. │ │ │ │ │ + 602 // │ │ │ │ │ + 603 // NOTE that this is a simple pointer container and NOT a smart pointer │ │ │ │ │ +that │ │ │ │ │ + 604 // manages the ownership of the object referred to by it. │ │ │ │ │ + 605 // │ │ │ │ │ + 606 class StencilTablePtr { │ │ │ │ │ + 607 private: │ │ │ │ │ + 608 typedef StencilTableReal float_type; │ │ │ │ │ + 609 typedef StencilTableReal double_type; │ │ │ │ │ + 610 │ │ │ │ │ + 611 union { │ │ │ │ │ + 612 float_type * _fPtr; │ │ │ │ │ + 613 double_type * _dPtr; │ │ │ │ │ + 614 }; │ │ │ │ │ + 615 │ │ │ │ │ + 616 public: │ │ │ │ │ + 617 StencilTablePtr() { _fPtr = 0; } │ │ │ │ │ + 618 StencilTablePtr(float_type * ptr) { _fPtr = ptr; } │ │ │ │ │ + 619 StencilTablePtr(double_type * ptr) { _dPtr = ptr; } │ │ │ │ │ + 620 │ │ │ │ │ + 621 operator bool() const { return _fPtr != 0; } │ │ │ │ │ + 622 │ │ │ │ │ + 623 void Set() { _fPtr = 0; } │ │ │ │ │ + 624 void Set(float_type * ptr) { _fPtr = ptr; } │ │ │ │ │ + 625 void Set(double_type * ptr) { _dPtr = ptr; } │ │ │ │ │ + 626 │ │ │ │ │ + 627 template StencilTableReal * Get() const; │ │ │ │ │ + 628 }; │ │ │ │ │ + 629 │ │ │ │ │ + 630private: │ │ │ │ │ + 631 │ │ │ │ │ + 632 // │ │ │ │ │ + 633 // Topology │ │ │ │ │ + 634 // │ │ │ │ │ + 635 │ │ │ │ │ + 636 int _maxValence, // highest vertex valence found in the mesh │ │ │ │ │ + 637 _numPtexFaces; // total number of ptex faces │ │ │ │ │ + 638 │ │ │ │ │ + 639 PatchArrayVector _patchArrays; // Vector of descriptors for arrays of │ │ │ │ │ +patches │ │ │ │ │ + 640 │ │ │ │ │ + 641 std::vector _patchVerts; // Indices of the control vertices of the │ │ │ │ │ +patches │ │ │ │ │ + 642 │ │ │ │ │ + 643 PatchParamTable _paramTable; // PatchParam bitfields (one per patch) │ │ │ │ │ + 644 │ │ │ │ │ + 645 // │ │ │ │ │ + 646 // Extraordinary vertex closed-form evaluation / endcap basis conversion │ │ │ │ │ + 647 // │ │ │ │ │ + 648 // XXXtakahito: these data will probably be replaced with mask coefficient │ │ │ │ │ +or something │ │ │ │ │ + 649 // SchemeWorker populates. │ │ │ │ │ + 650 // │ │ │ │ │ + 651 QuadOffsetsTable _quadOffsetsTable; // Quad offsets (for Gregory patches) │ │ │ │ │ + 652 VertexValenceTable _vertexValenceTable; // Vertex valence table (for │ │ │ │ │ +Gregory patches) │ │ │ │ │ + 653 │ │ │ │ │ + 654 StencilTablePtr _localPointStencils; // local point conversion stencils │ │ │ │ │ + 655 StencilTablePtr _localPointVaryingStencils; // local point varying │ │ │ │ │ +stencils │ │ │ │ │ + 656 │ │ │ │ │ + 657 // │ │ │ │ │ + 658 // Varying data │ │ │ │ │ + 659 // │ │ │ │ │ + 660 PatchDescriptor _varyingDesc; │ │ │ │ │ + 661 │ │ │ │ │ + 662 std::vector _varyingVerts; │ │ │ │ │ + 663 │ │ │ │ │ + 664 // │ │ │ │ │ + 665 // Face-varying data │ │ │ │ │ + 666 // │ │ │ │ │ + 667 FVarPatchChannelVector _fvarChannels; │ │ │ │ │ + 668 │ │ │ │ │ + 669 std::vector _localPointFaceVaryingStencils; │ │ │ │ │ + 670 │ │ │ │ │ + 671 // │ │ │ │ │ + 672 // 'single-crease' patch sharpness tables │ │ │ │ │ + 673 // │ │ │ │ │ + 674 std::vector _sharpnessIndices; // Indices of single-crease │ │ │ │ │ +sharpness (one per patch) │ │ │ │ │ + 675 std::vector _sharpnessValues; // Sharpness values. │ │ │ │ │ + 676 │ │ │ │ │ + 677 // │ │ │ │ │ + 678 // Construction history -- relevant to at least one public query: │ │ │ │ │ + 679 // │ │ │ │ │ + 680 unsigned int _isUniformLinear : 1; │ │ │ │ │ + 681 │ │ │ │ │ + 682 // │ │ │ │ │ + 683 // Precision -- only applies to local-point stencil tables │ │ │ │ │ + 684 // │ │ │ │ │ + 685 unsigned int _vertexPrecisionIsDouble : 1; │ │ │ │ │ + 686 unsigned int _varyingPrecisionIsDouble : 1; │ │ │ │ │ + 687 unsigned int _faceVaryingPrecisionIsDouble : 1; │ │ │ │ │ + 688}; │ │ │ │ │ + 689 │ │ │ │ │ + 690 │ │ │ │ │ + 691// │ │ │ │ │ + 692// Template specializations for float/double -- to be defined before used: │ │ │ │ │ + 693// │ │ │ │ │ + 694template <> inline StencilTableReal * │ │ │ │ │ + 695PatchTable::StencilTablePtr::Get() const { return _fPtr; } │ │ │ │ │ + 696 │ │ │ │ │ + 697template <> inline StencilTableReal * │ │ │ │ │ + 698PatchTable::StencilTablePtr::Get() const { return _dPtr; } │ │ │ │ │ + 699 │ │ │ │ │ +700template <> inline bool │ │ │ │ │ + 701PatchTable::LocalPointStencilPrecisionMatchesType() const { │ │ │ │ │ + 702 return !_vertexPrecisionIsDouble; │ │ │ │ │ + 703} │ │ │ │ │ +704template <> inline bool │ │ │ │ │ + 705PatchTable::LocalPointVaryingStencilPrecisionMatchesType() const { │ │ │ │ │ + 706 return !_varyingPrecisionIsDouble; │ │ │ │ │ + 707} │ │ │ │ │ +708template <> inline bool │ │ │ │ │ + 709PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType() const │ │ │ │ │ +{ │ │ │ │ │ + 710 return !_faceVaryingPrecisionIsDouble; │ │ │ │ │ + 711} │ │ │ │ │ + 712 │ │ │ │ │ +713template <> inline bool │ │ │ │ │ + 714PatchTable::LocalPointStencilPrecisionMatchesType() const { │ │ │ │ │ + 715 return _vertexPrecisionIsDouble; │ │ │ │ │ + 716} │ │ │ │ │ +717template <> inline bool │ │ │ │ │ + 718PatchTable::LocalPointVaryingStencilPrecisionMatchesType() const { │ │ │ │ │ + 719 return _varyingPrecisionIsDouble; │ │ │ │ │ + 720} │ │ │ │ │ +721template <> inline bool │ │ │ │ │ + 722PatchTable::LocalPointFaceVaryingStencilPrecisionMatchesType() │ │ │ │ │ +const { │ │ │ │ │ + 723 return _faceVaryingPrecisionIsDouble; │ │ │ │ │ + 724} │ │ │ │ │ + 725 │ │ │ │ │ + 726// │ │ │ │ │ + 727// StencilTable access -- backward compatible and generic: │ │ │ │ │ + 728// │ │ │ │ │ + 729inline StencilTable const * │ │ │ │ │ +730PatchTable::GetLocalPointStencilTable() const { │ │ │ │ │ + 731 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ + 732 return static_cast(_localPointStencils.Get │ │ │ │ │ +()); │ │ │ │ │ + 733} │ │ │ │ │ + 734inline StencilTable const * │ │ │ │ │ +735PatchTable::GetLocalPointVaryingStencilTable() const { │ │ │ │ │ + 736 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 737 return static_cast( │ │ │ │ │ + 738 _localPointVaryingStencils.Get()); │ │ │ │ │ + 739} │ │ │ │ │ + 740inline StencilTable const * │ │ │ │ │ +741PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const { │ │ │ │ │ + 742 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 743 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ +{ │ │ │ │ │ + 744 return static_cast( │ │ │ │ │ + 745 _localPointFaceVaryingStencils[channel].Get()); │ │ │ │ │ + 746 } │ │ │ │ │ + 747 return NULL; │ │ │ │ │ + 748} │ │ │ │ │ + 749 │ │ │ │ │ + 750template │ │ │ │ │ + 751inline StencilTableReal const * │ │ │ │ │ +752PatchTable::GetLocalPointStencilTable() const { │ │ │ │ │ + 753 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ + 754 return _localPointStencils.Get(); │ │ │ │ │ + 755} │ │ │ │ │ + 756template │ │ │ │ │ + 757inline StencilTableReal const * │ │ │ │ │ +758PatchTable::GetLocalPointVaryingStencilTable() const { │ │ │ │ │ + 759 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 760 return _localPointVaryingStencils.Get(); │ │ │ │ │ + 761} │ │ │ │ │ + 762template │ │ │ │ │ + 763inline StencilTableReal const * │ │ │ │ │ +764PatchTable::GetLocalPointFaceVaryingStencilTable(int channel) const { │ │ │ │ │ + 765 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 766 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ +{ │ │ │ │ │ + 767 return _localPointFaceVaryingStencils[channel].Get(); │ │ │ │ │ + 768 } │ │ │ │ │ + 769 return NULL; │ │ │ │ │ + 770} │ │ │ │ │ + 771 │ │ │ │ │ + 772 │ │ │ │ │ + 773// │ │ │ │ │ + 774// Computation of local point values: │ │ │ │ │ + 775// │ │ │ │ │ + 776template │ │ │ │ │ + 777inline void │ │ │ │ │ +778PatchTable::ComputeLocalPointValues(T const *src, T *dst) const { │ │ │ │ │ + 779 assert(LocalPointStencilPrecisionMatchesType()); │ │ │ │ │ + 780 if (_localPointStencils) { │ │ │ │ │ + 781 _localPointStencils.Get()->UpdateValues(src, dst); │ │ │ │ │ + 782 } │ │ │ │ │ + 783} │ │ │ │ │ + 784 │ │ │ │ │ + 785template │ │ │ │ │ + 786inline void │ │ │ │ │ +787PatchTable::ComputeLocalPointValuesVarying(T const *src, T *dst) const { │ │ │ │ │ + 788 assert(LocalPointVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 789 if (_localPointVaryingStencils) { │ │ │ │ │ + 790 _localPointVaryingStencils.Get()->UpdateValues(src, dst); │ │ │ │ │ + 791 } │ │ │ │ │ + 792} │ │ │ │ │ + 793 │ │ │ │ │ + 794template │ │ │ │ │ + 795inline void │ │ │ │ │ +796PatchTable::ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int │ │ │ │ │ +channel) const { │ │ │ │ │ + 797 assert(LocalPointFaceVaryingStencilPrecisionMatchesType()); │ │ │ │ │ + 798 if (channel >= 0 && channel < (int)_localPointFaceVaryingStencils.size()) │ │ │ │ │ +{ │ │ │ │ │ + 799 if (_localPointFaceVaryingStencils[channel]) { │ │ │ │ │ + 800 _localPointFaceVaryingStencils[channel].Get()->UpdateValues(src, │ │ │ │ │ +dst); │ │ │ │ │ + 801 } │ │ │ │ │ + 802 } │ │ │ │ │ + 803} │ │ │ │ │ + 804 │ │ │ │ │ + 805 │ │ │ │ │ + 806// │ │ │ │ │ + 807// Basis evaluation overloads │ │ │ │ │ + 808// │ │ │ │ │ + 809inline void │ │ │ │ │ +810PatchTable::EvaluateBasis(PatchHandle const & handle, float u, float v, │ │ │ │ │ + 811 float wP[], float wDu[], float wDv[], │ │ │ │ │ + 812 float wDuu[], float wDuv[], float wDvv[]) const { │ │ │ │ │ + 813 │ │ │ │ │ + 814 EvaluateBasis(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ + 815} │ │ │ │ │ + 816inline void │ │ │ │ │ +817PatchTable::EvaluateBasis(PatchHandle const & handle, double u, double v, │ │ │ │ │ + 818 double wP[], double wDu[], double wDv[], │ │ │ │ │ + 819 double wDuu[], double wDuv[], double wDvv[]) const { │ │ │ │ │ + 820 │ │ │ │ │ + 821 EvaluateBasis(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ + 822} │ │ │ │ │ + 823 │ │ │ │ │ + 824inline void │ │ │ │ │ +825PatchTable::EvaluateBasisVarying(PatchHandle const & handle, float u, float │ │ │ │ │ +v, │ │ │ │ │ + 826 float wP[], float wDu[], float wDv[], │ │ │ │ │ + 827 float wDuu[], float wDuv[], float wDvv[]) const { │ │ │ │ │ + 828 │ │ │ │ │ + 829 EvaluateBasisVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, wDvv); │ │ │ │ │ + 830} │ │ │ │ │ + 831inline void │ │ │ │ │ +832PatchTable::EvaluateBasisVarying(PatchHandle const & handle, double u, │ │ │ │ │ +double v, │ │ │ │ │ + 833 double wP[], double wDu[], double wDv[], │ │ │ │ │ + 834 double wDuu[], double wDuv[], double wDvv[]) const { │ │ │ │ │ + 835 │ │ │ │ │ + 836 EvaluateBasisVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ +wDvv); │ │ │ │ │ + 837} │ │ │ │ │ + 838 │ │ │ │ │ + 839inline void │ │ │ │ │ +840PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, float u, │ │ │ │ │ +float v, │ │ │ │ │ + 841 float wP[], float wDu[], float wDv[], │ │ │ │ │ + 842 float wDuu[], float wDuv[], float wDvv[], int channel) const { │ │ │ │ │ + 843 │ │ │ │ │ + 844 EvaluateBasisFaceVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ +wDvv, channel); │ │ │ │ │ + 845} │ │ │ │ │ + 846inline void │ │ │ │ │ +847PatchTable::EvaluateBasisFaceVarying(PatchHandle const & handle, double u, │ │ │ │ │ +double v, │ │ │ │ │ + 848 double wP[], double wDu[], double wDv[], │ │ │ │ │ + 849 double wDuu[], double wDuv[], double wDvv[], int channel) const { │ │ │ │ │ + 850 │ │ │ │ │ + 851 EvaluateBasisFaceVarying(handle, u, v, wP, wDu, wDv, wDuu, wDuv, │ │ │ │ │ +wDvv, channel); │ │ │ │ │ + 852} │ │ │ │ │ + 853 │ │ │ │ │ + 854} // end namespace Far │ │ │ │ │ + 855 │ │ │ │ │ + 856} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 857using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 858 │ │ │ │ │ + 859} // end namespace OpenSubdiv │ │ │ │ │ + 860 │ │ │ │ │ + 861#endif /* OPENSUBDIV3_FAR_PATCH_TABLE */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParamTable │ │ │ │ │ +std::vector< PatchParam > PatchParamTable │ │ │ │ │ +Definition: patchParam.h:243 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::Index │ │ │ │ │ +Vtr::Index Index │ │ │ │ │ +Definition: types.h:41 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor │ │ │ │ │ +Describes the type of a patch. │ │ │ │ │ +Definition: patchDescriptor.h:44 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap │ │ │ │ │ An quadtree-based map connecting coarse faces to their sub-patches. │ │ │ │ │ Definition: patchMap.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::PatchMap │ │ │ │ │ -PatchMap(PatchTable const &patchTable) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::FindPatch │ │ │ │ │ -Handle const * FindPatch(int patchFaceId, double u, double v) const │ │ │ │ │ -Returns a handle to the sub-patch of the face at the given (u,v). Note that the │ │ │ │ │ -patch face ID corresp... │ │ │ │ │ -Definition: patchMap.h:193 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::Handle │ │ │ │ │ -PatchTable::PatchHandle Handle │ │ │ │ │ -Definition: patchMap.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child │ │ │ │ │ -Definition: patchMap.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::isLeaf │ │ │ │ │ -unsigned int isLeaf │ │ │ │ │ -Definition: patchMap.h:87 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::index │ │ │ │ │ -unsigned int index │ │ │ │ │ -Definition: patchMap.h:88 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchMap::QuadNode::Child::isSet │ │ │ │ │ -unsigned int isSet │ │ │ │ │ -Definition: patchMap.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchParam │ │ │ │ │ +Patch parameterization. │ │ │ │ │ +Definition: patchParam.h:152 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ Container for arrays of parametric patches. │ │ │ │ │ Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVaryingVertices │ │ │ │ │ +ConstIndexArray GetPatchArrayVaryingVertices(int array) const │ │ │ │ │ +Returns the varying vertex indices for the patches in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessValues │ │ │ │ │ +float * getSharpnessValues(Index arrayIndex) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchControlVerticesTable │ │ │ │ │ +PatchVertsTable const & GetPatchControlVerticesTable() const │ │ │ │ │ +Get the table of patch control vertices. │ │ │ │ │ +Definition: patchTable.h:378 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +ComputeLocalPointValuesFaceVarying │ │ │ │ │ +void ComputeLocalPointValuesFaceVarying(T const *src, T *dst, int channel=0) │ │ │ │ │ +const │ │ │ │ │ +Updates local point face-varying values. │ │ │ │ │ +Definition: patchTable.h:796 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingVertices │ │ │ │ │ +ConstIndexArray GetVaryingVertices() const │ │ │ │ │ +Returns an array of varying vertex indices for the patches. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValuesVarying │ │ │ │ │ +void ComputeLocalPointValuesVarying(T const *src, T *dst) const │ │ │ │ │ +Updates local point varying values. │ │ │ │ │ +Definition: patchTable.h:787 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices │ │ │ │ │ +ConstIndexArray GetPatchVaryingVertices(PatchHandle const &handle) const │ │ │ │ │ +Returns the varying vertex indices for a given patch. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::IsFeatureAdaptive │ │ │ │ │ +bool IsFeatureAdaptive() const │ │ │ │ │ +True if the patches are of feature adaptive types. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetMaxValence │ │ │ │ │ +int GetMaxValence() const │ │ │ │ │ +Returns max vertex valence. │ │ │ │ │ +Definition: patchTable.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable │ │ │ │ │ +StencilTableReal< REAL > const * GetLocalPointStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point vertex values. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable │ │ │ │ │ +StencilTable const * GetLocalPointStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point vertex values. │ │ │ │ │ +Definition: patchTable.h:730 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchParams │ │ │ │ │ +PatchParamArray getPatchParams(int arrayIndex) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarValues │ │ │ │ │ +ConstIndexArray GetPatchArrayFVarValues(int array, int channel=0) const │ │ │ │ │ +Returns the value indices for the patches in array in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessValues │ │ │ │ │ +std::vector< float > const & GetSharpnessValues() const │ │ │ │ │ +Returns sharpness values table. │ │ │ │ │ +Definition: patchTable.h:387 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::VertexValenceTable │ │ │ │ │ +std::vector< Index > VertexValenceTable │ │ │ │ │ +Definition: patchTable.h:264 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam │ │ │ │ │ +PatchParam GetPatchFVarPatchParam(int array, int patch, int channel=0) const │ │ │ │ │ +Returns the face-varying params for a given patch channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVaryingVertices │ │ │ │ │ +ConstIndexArray GetPatchVaryingVertices(int array, int patch) const │ │ │ │ │ +Returns the varying vertex indices for a given patch. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable │ │ │ │ │ +PatchTable(PatchTable const &src) │ │ │ │ │ +Copy constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchArrays │ │ │ │ │ +int GetNumPatchArrays() const │ │ │ │ │ +Returns the number of patch arrays in the table. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices │ │ │ │ │ +ConstIndexArray GetPatchVertices(PatchHandle const &handle) const │ │ │ │ │ +Returns the control vertex indices for the patch identified by handle. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTable │ │ │ │ │ +PatchTable(int maxvalence) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +LocalPointFaceVaryingStencilPrecisionMatchesType │ │ │ │ │ +bool LocalPointFaceVaryingStencilPrecisionMatchesType() const │ │ │ │ │ +Tests if the precision of the stencil table to compute local point face-varying │ │ │ │ │ +values matches the gi... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParamTable │ │ │ │ │ +PatchParamTable const & GetPatchParamTable() const │ │ │ │ │ +Returns the PatchParamTable (PatchParams order matches patch array sorting) │ │ │ │ │ +Definition: patchTable.h:381 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVertexValenceTable │ │ │ │ │ +VertexValenceTable const & GetVertexValenceTable() const │ │ │ │ │ +Returns the 'VertexValences' table (vertex neighborhoods table) │ │ │ │ │ +Definition: patchTable.h:267 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetLocalPointFaceVaryingStencilTable │ │ │ │ │ +StencilTable const * GetLocalPointFaceVaryingStencilTable(int channel=0) const │ │ │ │ │ +Returns the stencil table to compute local point face-varying values. │ │ │ │ │ +Definition: patchTable.h:741 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVertices │ │ │ │ │ +int GetNumControlVertices(int array) const │ │ │ │ │ +Returns the number of control vertices in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::~PatchTable │ │ │ │ │ +~PatchTable() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisFaceVarying │ │ │ │ │ +void EvaluateBasisFaceVarying(PatchHandle const &handle, REAL u, REAL v, REAL │ │ │ │ │ +wP[], REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0, │ │ │ │ │ +int channel=0) const │ │ │ │ │ +Evaluate basis functions for a face-varying value and derivatives at a given │ │ │ │ │ +(u,v) parametric locatio... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchQuadOffsets │ │ │ │ │ +ConstQuadOffsetsArray GetPatchQuadOffsets(PatchHandle const &handle) const │ │ │ │ │ +Returns the 'QuadOffsets' for the Gregory patch identified by handle. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetFVarPatchDescriptorIrregular │ │ │ │ │ +PatchDescriptor GetFVarPatchDescriptorIrregular(int channel=0) const │ │ │ │ │ +Returns the irregular patch descriptor for channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetSingleCreasePatchSharpnessValue │ │ │ │ │ +float GetSingleCreasePatchSharpnessValue(int array, int patch) const │ │ │ │ │ +Returns the crease sharpness for the patch in array if it is a single-crease │ │ │ │ │ +patch,... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getSharpnessIndices │ │ │ │ │ +Index * getSharpnessIndices(Index arrayIndex) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ComputeLocalPointValues │ │ │ │ │ +void ComputeLocalPointValues(T const *src, T *dst) const │ │ │ │ │ +Updates local point vertex values. │ │ │ │ │ +Definition: patchTable.h:778 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetSingleCreasePatchSharpnessValue │ │ │ │ │ +float GetSingleCreasePatchSharpnessValue(PatchHandle const &handle) const │ │ │ │ │ +Returns the crease sharpness for the patch identified by handle if it is a │ │ │ │ │ +single-crease patch,... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam │ │ │ │ │ +PatchParam GetPatchParam(int array, int patch) const │ │ │ │ │ +Returns the PatchParam for patch in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues │ │ │ │ │ +ConstIndexArray GetPatchFVarValues(int array, int patch, int channel=0) const │ │ │ │ │ +Returns the value indices for a given patch in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptorRegular │ │ │ │ │ +PatchDescriptor GetFVarPatchDescriptorRegular(int channel=0) const │ │ │ │ │ +Returns the regular patch descriptor for channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchDescriptor │ │ │ │ │ +PatchDescriptor GetPatchDescriptor(PatchHandle const &handle) const │ │ │ │ │ +Returns the PatchDescriptor for the patch identified by handle. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchVertsTable │ │ │ │ │ +std::vector< Index > PatchVertsTable │ │ │ │ │ +Definition: patchTable.h:375 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetQuadOffsetsTable │ │ │ │ │ +QuadOffsetsTable const & GetQuadOffsetsTable() const │ │ │ │ │ +Returns the quad-offsets table. │ │ │ │ │ +Definition: patchTable.h:392 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatches │ │ │ │ │ +int GetNumPatches(int array) const │ │ │ │ │ +Returns the number of patches in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetVaryingPatchDescriptor │ │ │ │ │ +PatchDescriptor GetVaryingPatchDescriptor() const │ │ │ │ │ +Returns the varying patch descriptor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarValues │ │ │ │ │ +ConstIndexArray GetPatchFVarValues(PatchHandle const &handle, int channel=0) │ │ │ │ │ +const │ │ │ │ │ +Returns the value indices for a given patch in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParams │ │ │ │ │ +ConstPatchParamArray const GetPatchParams(int array) const │ │ │ │ │ +Returns the PatchParams for the patches in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumControlVerticesTotal │ │ │ │ │ +int GetNumControlVerticesTotal() const │ │ │ │ │ +Returns the total number of control vertex indices in the table. │ │ │ │ │ +Definition: patchTable.h:84 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channels. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayFVarPatchParams │ │ │ │ │ +ConstPatchParamArray GetPatchArrayFVarPatchParams(int array, int channel=0) │ │ │ │ │ +const │ │ │ │ │ +Returns the face-varying for a given patch in array in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::getPatchIndex │ │ │ │ │ +Index getPatchIndex(int array, int patch) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPoints │ │ │ │ │ +int GetNumLocalPoints() const │ │ │ │ │ +Returns the number of local vertex points. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +LocalPointVaryingStencilPrecisionMatchesType │ │ │ │ │ +bool LocalPointVaryingStencilPrecisionMatchesType() const │ │ │ │ │ +Tests if the precision of the stencil table to compute local point varying │ │ │ │ │ +values matches the given f... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayVertices │ │ │ │ │ +ConstIndexArray GetPatchArrayVertices(int array) const │ │ │ │ │ +Returns the control vertex indices for the patches in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPtexFaces │ │ │ │ │ +int GetNumPtexFaces() const │ │ │ │ │ +Returns the total number of ptex faces in the mesh. │ │ │ │ │ +Definition: patchTable.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValues │ │ │ │ │ +ConstIndexArray GetFVarValues(int channel=0) const │ │ │ │ │ +Returns an array of value indices for the patches in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::ConstQuadOffsetsArray │ │ │ │ │ +Vtr::ConstArray< unsigned int > ConstQuadOffsetsArray │ │ │ │ │ +Accessors for the gregory patch evaluation buffers. These methods will be │ │ │ │ │ +deprecated. │ │ │ │ │ +Definition: patchTable.h:259 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasis │ │ │ │ │ +void EvaluateBasis(PatchHandle const &handle, REAL u, REAL v, REAL wP[], REAL │ │ │ │ │ +wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const │ │ │ │ │ +Evaluate basis functions for position and derivatives at a given (u,v) │ │ │ │ │ +parametric location of a patch... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetLocalPointFaceVaryingStencilTable │ │ │ │ │ +StencilTableReal< REAL > const * GetLocalPointFaceVaryingStencilTable(int │ │ │ │ │ +channel=0) const │ │ │ │ │ +Returns the stencil table to compute local point face-varying values. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumPatchesTotal │ │ │ │ │ +int GetNumPatchesTotal() const │ │ │ │ │ +Returns the total number of patches stored in the table. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchParam │ │ │ │ │ +PatchParam GetPatchParam(PatchHandle const &handle) const │ │ │ │ │ +Returns a PatchParam for the patch identified by handle. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::print │ │ │ │ │ +void print() const │ │ │ │ │ +debug helper │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetFVarChannelLinearInterpolation │ │ │ │ │ +Sdc::Options::FVarLinearInterpolation GetFVarChannelLinearInterpolation(int │ │ │ │ │ +channel=0) const │ │ │ │ │ +Deprecated. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetSharpnessIndexTable │ │ │ │ │ +std::vector< Index > const & GetSharpnessIndexTable() const │ │ │ │ │ +Returns a sharpness index table for each patch (if exists) │ │ │ │ │ +Definition: patchTable.h:384 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchArrayDescriptor │ │ │ │ │ +PatchDescriptor GetPatchArrayDescriptor(int array) const │ │ │ │ │ +Returns the PatchDescriptor for the patches in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchTableBuilder │ │ │ │ │ +friend class PatchTableBuilder │ │ │ │ │ +Definition: patchTable.h:531 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::EvaluateBasisVarying │ │ │ │ │ +void EvaluateBasisVarying(PatchHandle const &handle, REAL u, REAL v, REAL wP[], │ │ │ │ │ +REAL wDu[]=0, REAL wDv[]=0, REAL wDuu[]=0, REAL wDuv[]=0, REAL wDvv[]=0) const │ │ │ │ │ +Evaluate basis functions for a varying value and derivatives at a given (u,v) │ │ │ │ │ +parametric location of ... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetLocalPointVaryingStencilTable │ │ │ │ │ +StencilTable const * GetLocalPointVaryingStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point varying values. │ │ │ │ │ +Definition: patchTable.h:735 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::QuadOffsetsTable │ │ │ │ │ +std::vector< unsigned int > QuadOffsetsTable │ │ │ │ │ +Definition: patchTable.h:389 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchVertices │ │ │ │ │ +ConstIndexArray GetPatchVertices(int array, int patch) const │ │ │ │ │ +Returns the control vertex indices for patch in array. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetPatchFVarPatchParam │ │ │ │ │ +PatchParam GetPatchFVarPatchParam(PatchHandle const &handle, int channel=0) │ │ │ │ │ +const │ │ │ │ │ +Returns the value indices for a given patch in channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarValueStride │ │ │ │ │ +int GetFVarValueStride(int channel=0) const │ │ │ │ │ +Returns the stride between patches in the value index array of channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchParams │ │ │ │ │ +ConstPatchParamArray GetFVarPatchParams(int channel=0) const │ │ │ │ │ +Returns an array of face-varying patch param for channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetFVarPatchDescriptor │ │ │ │ │ +PatchDescriptor GetFVarPatchDescriptor(int channel=0) const │ │ │ │ │ +Returns the default/irregular patch descriptor for channel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsVarying │ │ │ │ │ +int GetNumLocalPointsVarying() const │ │ │ │ │ +Returns the number of local varying points. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +LocalPointStencilPrecisionMatchesType │ │ │ │ │ +bool LocalPointStencilPrecisionMatchesType() const │ │ │ │ │ +Tests if the precision of the stencil table to compute local point vertex │ │ │ │ │ +values matches the given fl... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetLocalPointVaryingStencilTable │ │ │ │ │ +StencilTableReal< REAL > const * GetLocalPointVaryingStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point varying values. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetNumLocalPointsFaceVarying │ │ │ │ │ +int GetNumLocalPointsFaceVarying(int channel=0) const │ │ │ │ │ +Returns the number of local face-varying points for channel. │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle │ │ │ │ │ Handle that can be used as unique patch identifier within PatchTable. │ │ │ │ │ Definition: patchTable.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::patchIndex │ │ │ │ │ +Index patchIndex │ │ │ │ │ +Definition: patchTable.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::arrayIndex │ │ │ │ │ +Index arrayIndex │ │ │ │ │ +Definition: patchTable.h:67 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::PatchHandle::vertIndex │ │ │ │ │ +Index vertIndex │ │ │ │ │ +Definition: patchTable.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal │ │ │ │ │ +Table of subdivision stencils. │ │ │ │ │ +Definition: stencilTable.h:141 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ +FVarLinearInterpolation │ │ │ │ │ +Definition: options.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray │ │ │ │ │ +Definition: array.h:53 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Array │ │ │ │ │ +Definition: array.h:105 │ │ │ │ │ * opensubdiv │ │ │ │ │ * far │ │ │ │ │ - * patchMap.h │ │ │ │ │ + * patchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00746.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/vtr/sparseSelector.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/vtr/stackBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -82,21 +82,18 @@ │ │ │ │ name="MSearchResults" id="MSearchResults"> │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces
│ │ │ │ -
sparseSelector.h File Reference
│ │ │ │ +
stackBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../vtr/types.h"
│ │ │ │ -#include "../vtr/refinement.h"
│ │ │ │ -#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -106,13 +103,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,24 +5,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Namespaces │ │ │ │ │ -sparseSelector.h File Reference │ │ │ │ │ +stackBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../vtr/types.h" │ │ │ │ │ -#include "../vtr/refinement.h" │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * vtr │ │ │ │ │ - * sparseSelector.h │ │ │ │ │ + * stackBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00746_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/vtr/sparseSelector.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/vtr/stackBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
sparseSelector.h
│ │ │ │ +
stackBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2015 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,98 +106,223 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_VTR_SPARSE_SELECTOR_H
│ │ │ │ -
25#define OPENSUBDIV3_VTR_SPARSE_SELECTOR_H
│ │ │ │ +
24#ifndef OPENSUBDIV3_VTR_STACK_BUFFER_H
│ │ │ │ +
25#define OPENSUBDIV3_VTR_STACK_BUFFER_H
│ │ │ │
26
│ │ │ │
27#include "../version.h"
│ │ │ │
28
│ │ │ │ -
29#include "../vtr/types.h"
│ │ │ │ -
30#include "../vtr/refinement.h"
│ │ │ │ +
29namespace OpenSubdiv {
│ │ │ │ +
30namespace OPENSUBDIV_VERSION {
│ │ │ │
31
│ │ │ │ -
32#include <vector>
│ │ │ │ -
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Vtr {
│ │ │ │ -
38namespace internal {
│ │ │ │ -
39
│ │ │ │ -
40//
│ │ │ │ -
41// SparseSelector:
│ │ │ │ -
42// Class supporting "selection" of components in a Level for sparse Refinement.
│ │ │ │ -
43// The term "selection" here implies interest in the limit for that component, i.e.
│ │ │ │ -
44// the limit point for a selected vertex, the limit patch for a face, etc. So this
│ │ │ │ -
45// class is responsible for ensuring that all neighboring components required to
│ │ │ │ -
46// support the limit of those selected are included in the refinement.
│ │ │ │ +
32namespace Vtr {
│ │ │ │ +
33namespace internal {
│ │ │ │ +
34
│ │ │ │ +
35//
│ │ │ │ +
36// The StackBuffer class is intended solely to take the place of VLAs (Variable
│ │ │ │ +
37// Length Arrays) which most compilers support, but are not strictly standard C++.
│ │ │ │ +
38// Portability concerns forces us to make use of either alloca() or some other
│ │ │ │ +
39// mechanism to create small arrays on the stack that are typically based on the
│ │ │ │ +
40// valence of a vertex -- small in general, but occasionally large.
│ │ │ │ +
41//
│ │ │ │ +
42// Note also that since the intent of this is to replace VLAs -- not general
│ │ │ │ +
43// std::vectors -- support for std::vector functionality is intentionally limited
│ │ │ │ +
44// and STL-like naming is avoided. Like a VLA there is no incremental growth.
│ │ │ │ +
45// Support for resizing is available to reuse an instance at the beginning of a
│ │ │ │ +
46// loop with a new size, but resizing in this case reinitializes all elements.
│ │ │ │
47//
│ │ │ │ -
48// This class is associated with (and constructed given) a Refinement and its role
│ │ │ │ -
49// is to initialize that Refinement instance for eventual sparse refinement. So it
│ │ │ │ -
50// is a friend of and expected to modify the Refinement as part of the selection.
│ │ │ │ -
51// Given its simplicity and scope it may be worth nesting it in Vtr::Refinement.
│ │ │ │ -
52//
│ │ │ │ -
53// While all three component types -- vertices, edges and faces -- can be selected,
│ │ │ │ -
54// only selection of faces is currently used and actively supported as part of the
│ │ │ │ -
55// feature-adaptive refinement.
│ │ │ │ -
56//
│ │ │ │ -
57class SparseSelector {
│ │ │ │ -
58
│ │ │ │ -
59public:
│ │ │ │ -
60 SparseSelector(Refinement& refine) : _refine(&refine), _selected(false) { }
│ │ │ │ -
61 ~SparseSelector() { }
│ │ │ │ -
62
│ │ │ │ -
63 void setRefinement(Refinement& refine) { _refine = &refine; }
│ │ │ │ -
64 Refinement& getRefinement() const { return *_refine; }
│ │ │ │ -
65
│ │ │ │ -
66 bool isSelectionEmpty() const { return !_selected; }
│ │ │ │ -
67
│ │ │ │ -
68 //
│ │ │ │ -
69 // Methods for selecting (and marking) components for refinement. All component indices
│ │ │ │ -
70 // refer to components in the parent:
│ │ │ │ -
71 //
│ │ │ │ -
72 void selectVertex(Index pVertex);
│ │ │ │ -
73 void selectEdge( Index pEdge);
│ │ │ │ -
74 void selectFace( Index pFace);
│ │ │ │ -
75
│ │ │ │ -
76private:
│ │ │ │ -
77 SparseSelector() : _refine(0), _selected(false) { }
│ │ │ │ -
78
│ │ │ │ -
79 bool wasVertexSelected(Index pVertex) const { return _refine->getParentVertexSparseTag(pVertex)._selected; }
│ │ │ │ -
80 bool wasEdgeSelected( Index pEdge) const { return _refine->getParentEdgeSparseTag(pEdge)._selected; }
│ │ │ │ -
81 bool wasFaceSelected( Index pFace) const { return _refine->getParentFaceSparseTag(pFace)._selected; }
│ │ │ │ -
82
│ │ │ │ -
83 void markVertexSelected(Index pVertex) const { _refine->getParentVertexSparseTag(pVertex)._selected = true; }
│ │ │ │ -
84 void markEdgeSelected( Index pEdge) const { _refine->getParentEdgeSparseTag(pEdge)._selected = true; }
│ │ │ │ -
85 void markFaceSelected( Index pFace) const { _refine->getParentFaceSparseTag(pFace)._selected = true; }
│ │ │ │ -
86
│ │ │ │ -
87 void initializeSelection();
│ │ │ │ -
88
│ │ │ │ -
89private:
│ │ │ │ -
90 Refinement* _refine;
│ │ │ │ -
91 bool _selected;
│ │ │ │ -
92};
│ │ │ │ -
93
│ │ │ │ -
94} // end namespace internal
│ │ │ │ -
95} // end namespace Vtr
│ │ │ │ +
48
│ │ │ │ +
49template <typename TYPE, unsigned int SIZE, bool POD_TYPE = false>
│ │ │ │ +
50class StackBuffer
│ │ │ │ +
51{
│ │ │ │ +
52public:
│ │ │ │ +
53 typedef unsigned int size_type;
│ │ │ │ +
54
│ │ │ │ +
55public:
│ │ │ │ +
56 // Constructors and destructor -- declared inline below:
│ │ │ │ +
57 StackBuffer();
│ │ │ │ +
58 StackBuffer(size_type size);
│ │ │ │ +
59 ~StackBuffer();
│ │ │ │ +
60
│ │ │ │ +
61public:
│ │ │ │ +
62 // Note the reliance on implicit casting so that it can be used similar to
│ │ │ │ +
63 // a VLA. This removes the need for operator[] as the resulting TYPE* will
│ │ │ │ +
64 // natively support []. (The presence of both TYPE* and operator[] also
│ │ │ │ +
65 // causes an ambiguous overloading error with 32-bit MSVC builds.)
│ │ │ │ +
66
│ │ │ │ +
67 operator TYPE const * () const { return _data; }
│ │ │ │ +
68 operator TYPE * () { return _data; }
│ │ │ │ +
69
│ │ │ │ +
70 size_type GetSize() const { return _size; }
│ │ │ │ +
71
│ │ │ │ +
72 void SetSize(size_type size);
│ │ │ │ +
73 void Reserve(size_type capacity);
│ │ │ │ +
74
│ │ │ │ +
75private:
│ │ │ │ +
76 // Non-copyable:
│ │ │ │ +
77 StackBuffer(const StackBuffer<TYPE,SIZE,POD_TYPE> &) { }
│ │ │ │ +
78 StackBuffer& operator=(const StackBuffer<TYPE,SIZE,POD_TYPE> &) { return *this; }
│ │ │ │ +
79
│ │ │ │ +
80 void allocate(size_type capacity);
│ │ │ │ +
81 void deallocate();
│ │ │ │ +
82 void construct();
│ │ │ │ +
83 void destruct();
│ │ │ │ +
84
│ │ │ │ +
85private:
│ │ │ │ +
86 TYPE * _data;
│ │ │ │ +
87 size_type _size;
│ │ │ │ +
88 size_type _capacity;
│ │ │ │ +
89
│ │ │ │ +
90 // Is alignment an issue here? The staticData arena will at least be double-word
│ │ │ │ +
91 // aligned within this struct, which meets current and most anticipated needs.
│ │ │ │ +
92 char _staticData[SIZE * sizeof(TYPE)];
│ │ │ │ +
93 char * _dynamicData;
│ │ │ │ +
94};
│ │ │ │ +
95
│ │ │ │
96
│ │ │ │ -
97} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
98using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
99} // end namespace OpenSubdiv
│ │ │ │ -
100
│ │ │ │ -
101#endif /* OPENSUBDIV3_VTR_SPARSE_SELECTOR_H */
│ │ │ │ +
97//
│ │ │ │ +
98// Core allocation/deallocation methods:
│ │ │ │ +
99//
│ │ │ │ +
100template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
101inline void
│ │ │ │ +
102StackBuffer<TYPE,SIZE,POD_TYPE>::allocate(size_type capacity) {
│ │ │ │ +
103
│ │ │ │ +
104 // Again, is alignment an issue here? C++ spec says new will return pointer
│ │ │ │ +
105 // "suitably aligned" for conversion to pointers of other types, which implies
│ │ │ │ +
106 // at least an alignment of 16.
│ │ │ │ +
107 _dynamicData = static_cast<char*>(::operator new(capacity * sizeof(TYPE)));
│ │ │ │ +
108
│ │ │ │ +
109 _data = reinterpret_cast<TYPE*>(_dynamicData);
│ │ │ │ +
110 _capacity = capacity;
│ │ │ │ +
111}
│ │ │ │ +
112
│ │ │ │ +
113template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
114inline void
│ │ │ │ +
115StackBuffer<TYPE,SIZE,POD_TYPE>::deallocate() {
│ │ │ │ +
116
│ │ │ │ +
117 ::operator delete(_dynamicData);
│ │ │ │ +
118
│ │ │ │ +
119 _data = reinterpret_cast<TYPE*>(_staticData);
│ │ │ │ +
120 _capacity = SIZE;
│ │ │ │ +
121}
│ │ │ │ +
122
│ │ │ │ +
123//
│ │ │ │ +
124// Explicit element-wise construction and destruction within allocated memory.
│ │ │ │ +
125// Compilers do not always optimize out the iteration here even when there is
│ │ │ │ +
126// no construction or destruction, so the POD_TYPE arguement can be used to
│ │ │ │ +
127// force this when/if it becomes an issue (and it has been in some cases).
│ │ │ │ +
128//
│ │ │ │ +
129template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
130inline void
│ │ │ │ +
131StackBuffer<TYPE,SIZE,POD_TYPE>::construct() {
│ │ │ │ +
132
│ │ │ │ +
133 for (size_type i = 0; i < _size; ++i) {
│ │ │ │ +
134 (void) new (&_data[i]) TYPE;
│ │ │ │ +
135 }
│ │ │ │ +
136}
│ │ │ │ +
137template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
138inline void
│ │ │ │ +
139StackBuffer<TYPE,SIZE,POD_TYPE>::destruct() {
│ │ │ │ +
140
│ │ │ │ +
141 for (size_type i = 0; i < _size; ++i) {
│ │ │ │ +
142 _data[i].~TYPE();
│ │ │ │ +
143 }
│ │ │ │ +
144}
│ │ │ │ +
145
│ │ │ │ +
146//
│ │ │ │ +
147// Inline constructors and destructor:
│ │ │ │ +
148//
│ │ │ │ +
149template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
150inline
│ │ │ │ +
151StackBuffer<TYPE,SIZE,POD_TYPE>::StackBuffer() :
│ │ │ │ +
152 _data(reinterpret_cast<TYPE*>(_staticData)),
│ │ │ │ +
153 _size(0),
│ │ │ │ +
154 _capacity(SIZE),
│ │ │ │ +
155 _dynamicData(0) {
│ │ │ │ +
156
│ │ │ │ +
157}
│ │ │ │ +
158
│ │ │ │ +
159template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
160inline
│ │ │ │ +
161StackBuffer<TYPE,SIZE,POD_TYPE>::StackBuffer(size_type size) :
│ │ │ │ +
162 _data(reinterpret_cast<TYPE*>(_staticData)),
│ │ │ │ +
163 _size(size),
│ │ │ │ +
164 _capacity(SIZE),
│ │ │ │ +
165 _dynamicData(0) {
│ │ │ │ +
166
│ │ │ │ +
167 if (size > SIZE) {
│ │ │ │ +
168 allocate(size);
│ │ │ │ +
169 }
│ │ │ │ +
170 if (!POD_TYPE) {
│ │ │ │ +
171 construct();
│ │ │ │ +
172 }
│ │ │ │ +
173}
│ │ │ │ +
174
│ │ │ │ +
175template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
176inline
│ │ │ │ +
177StackBuffer<TYPE,SIZE,POD_TYPE>::~StackBuffer() {
│ │ │ │ +
178
│ │ │ │ +
179 if (!POD_TYPE) {
│ │ │ │ +
180 destruct();
│ │ │ │ +
181 }
│ │ │ │ +
182 deallocate();
│ │ │ │ +
183}
│ │ │ │ +
184
│ │ │ │ +
185//
│ │ │ │ +
186// Inline sizing methods:
│ │ │ │ +
187//
│ │ │ │ +
188template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
189inline void
│ │ │ │ +
190StackBuffer<TYPE,SIZE,POD_TYPE>::Reserve(size_type capacity) {
│ │ │ │ +
191
│ │ │ │ +
192 if (capacity > _capacity) {
│ │ │ │ +
193 if (!POD_TYPE) {
│ │ │ │ +
194 destruct();
│ │ │ │ +
195 }
│ │ │ │ +
196 deallocate();
│ │ │ │ +
197 allocate(capacity);
│ │ │ │ +
198 }
│ │ │ │ +
199}
│ │ │ │ +
200
│ │ │ │ +
201template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ +
202inline void
│ │ │ │ +
203StackBuffer<TYPE,SIZE,POD_TYPE>::SetSize(size_type size)
│ │ │ │ +
204{
│ │ │ │ +
205 if (!POD_TYPE) {
│ │ │ │ +
206 destruct();
│ │ │ │ +
207 }
│ │ │ │ +
208 if (size == 0) {
│ │ │ │ +
209 deallocate();
│ │ │ │ +
210 } else if (size > _capacity) {
│ │ │ │ +
211 deallocate();
│ │ │ │ +
212 allocate(size);
│ │ │ │ +
213 }
│ │ │ │ +
214 _size = size;
│ │ │ │ +
215 if (!POD_TYPE) {
│ │ │ │ +
216 construct();
│ │ │ │ +
217 }
│ │ │ │ +
218}
│ │ │ │ +
219
│ │ │ │ +
220} // end namespace internal
│ │ │ │ +
221} // end namespace Vtr
│ │ │ │ +
222
│ │ │ │ +
223} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
224using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
225} // end namespace OpenSubdiv
│ │ │ │ +
226
│ │ │ │ +
227#endif /* OPENSUBDIV3_VTR_STACK_BUFFER_H */
│ │ │ │ │ │ │ │ - │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -sparseSelector.h │ │ │ │ │ +stackBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2015 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,111 +29,233 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_VTR_SPARSE_SELECTOR_H │ │ │ │ │ - 25#define OPENSUBDIV3_VTR_SPARSE_SELECTOR_H │ │ │ │ │ + 24#ifndef OPENSUBDIV3_VTR_STACK_BUFFER_H │ │ │ │ │ + 25#define OPENSUBDIV3_VTR_STACK_BUFFER_H │ │ │ │ │ 26 │ │ │ │ │ 27#include "../version.h" │ │ │ │ │ 28 │ │ │ │ │ - 29#include "../vtr/types.h" │ │ │ │ │ - 30#include "../vtr/refinement.h" │ │ │ │ │ + 29namespace OpenSubdiv { │ │ │ │ │ + 30namespace OPENSUBDIV_VERSION { │ │ │ │ │ 31 │ │ │ │ │ - 32#include │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Vtr { │ │ │ │ │ - 38namespace internal { │ │ │ │ │ - 39 │ │ │ │ │ - 40// │ │ │ │ │ - 41// SparseSelector: │ │ │ │ │ - 42// Class supporting "selection" of components in a Level for sparse │ │ │ │ │ -Refinement. │ │ │ │ │ - 43// The term "selection" here implies interest in the limit for that │ │ │ │ │ -component, i.e. │ │ │ │ │ - 44// the limit point for a selected vertex, the limit patch for a face, etc. │ │ │ │ │ -So this │ │ │ │ │ - 45// class is responsible for ensuring that all neighboring components │ │ │ │ │ -required to │ │ │ │ │ - 46// support the limit of those selected are included in the refinement. │ │ │ │ │ + 32namespace Vtr { │ │ │ │ │ + 33namespace internal { │ │ │ │ │ + 34 │ │ │ │ │ + 35// │ │ │ │ │ + 36// The StackBuffer class is intended solely to take the place of VLAs │ │ │ │ │ +(Variable │ │ │ │ │ + 37// Length Arrays) which most compilers support, but are not strictly │ │ │ │ │ +standard C++. │ │ │ │ │ + 38// Portability concerns forces us to make use of either alloca() or some │ │ │ │ │ +other │ │ │ │ │ + 39// mechanism to create small arrays on the stack that are typically based on │ │ │ │ │ +the │ │ │ │ │ + 40// valence of a vertex -- small in general, but occasionally large. │ │ │ │ │ + 41// │ │ │ │ │ + 42// Note also that since the intent of this is to replace VLAs -- not general │ │ │ │ │ + 43// std::vectors -- support for std::vector functionality is intentionally │ │ │ │ │ +limited │ │ │ │ │ + 44// and STL-like naming is avoided. Like a VLA there is no incremental │ │ │ │ │ +growth. │ │ │ │ │ + 45// Support for resizing is available to reuse an instance at the beginning │ │ │ │ │ +of a │ │ │ │ │ + 46// loop with a new size, but resizing in this case reinitializes all │ │ │ │ │ +elements. │ │ │ │ │ 47// │ │ │ │ │ - 48// This class is associated with (and constructed given) a Refinement and │ │ │ │ │ -its role │ │ │ │ │ - 49// is to initialize that Refinement instance for eventual sparse refinement. │ │ │ │ │ -So it │ │ │ │ │ - 50// is a friend of and expected to modify the Refinement as part of the │ │ │ │ │ -selection. │ │ │ │ │ - 51// Given its simplicity and scope it may be worth nesting it in Vtr:: │ │ │ │ │ -Refinement. │ │ │ │ │ - 52// │ │ │ │ │ - 53// While all three component types -- vertices, edges and faces -- can be │ │ │ │ │ -selected, │ │ │ │ │ - 54// only selection of faces is currently used and actively supported as part │ │ │ │ │ -of the │ │ │ │ │ - 55// feature-adaptive refinement. │ │ │ │ │ - 56// │ │ │ │ │ - 57class SparseSelector { │ │ │ │ │ - 58 │ │ │ │ │ - 59public: │ │ │ │ │ - 60 SparseSelector(Refinement& refine) : _refine(&refine), _selected(false) { } │ │ │ │ │ - 61 ~SparseSelector() { } │ │ │ │ │ - 62 │ │ │ │ │ - 63 void setRefinement(Refinement& refine) { _refine = &refine; } │ │ │ │ │ - 64 Refinement& getRefinement() const { return *_refine; } │ │ │ │ │ - 65 │ │ │ │ │ - 66 bool isSelectionEmpty() const { return !_selected; } │ │ │ │ │ - 67 │ │ │ │ │ - 68 // │ │ │ │ │ - 69 // Methods for selecting (and marking) components for refinement. All │ │ │ │ │ -component indices │ │ │ │ │ - 70 // refer to components in the parent: │ │ │ │ │ - 71 // │ │ │ │ │ - 72 void selectVertex(Index pVertex); │ │ │ │ │ - 73 void selectEdge( Index pEdge); │ │ │ │ │ - 74 void selectFace( Index pFace); │ │ │ │ │ - 75 │ │ │ │ │ - 76private: │ │ │ │ │ - 77 SparseSelector() : _refine(0), _selected(false) { } │ │ │ │ │ - 78 │ │ │ │ │ - 79 bool wasVertexSelected(Index pVertex) const { return _refine- │ │ │ │ │ ->getParentVertexSparseTag(pVertex)._selected; } │ │ │ │ │ - 80 bool wasEdgeSelected( Index pEdge) const { return _refine- │ │ │ │ │ ->getParentEdgeSparseTag(pEdge)._selected; } │ │ │ │ │ - 81 bool wasFaceSelected( Index pFace) const { return _refine- │ │ │ │ │ ->getParentFaceSparseTag(pFace)._selected; } │ │ │ │ │ - 82 │ │ │ │ │ - 83 void markVertexSelected(Index pVertex) const { _refine- │ │ │ │ │ ->getParentVertexSparseTag(pVertex)._selected = true; } │ │ │ │ │ - 84 void markEdgeSelected( Index pEdge) const { _refine->getParentEdgeSparseTag │ │ │ │ │ -(pEdge)._selected = true; } │ │ │ │ │ - 85 void markFaceSelected( Index pFace) const { _refine->getParentFaceSparseTag │ │ │ │ │ -(pFace)._selected = true; } │ │ │ │ │ - 86 │ │ │ │ │ - 87 void initializeSelection(); │ │ │ │ │ - 88 │ │ │ │ │ - 89private: │ │ │ │ │ - 90 Refinement* _refine; │ │ │ │ │ - 91 bool _selected; │ │ │ │ │ - 92}; │ │ │ │ │ - 93 │ │ │ │ │ - 94} // end namespace internal │ │ │ │ │ - 95} // end namespace Vtr │ │ │ │ │ + 48 │ │ │ │ │ + 49template │ │ │ │ │ + 50class StackBuffer │ │ │ │ │ + 51{ │ │ │ │ │ + 52public: │ │ │ │ │ + 53 typedef unsigned int size_type; │ │ │ │ │ + 54 │ │ │ │ │ + 55public: │ │ │ │ │ + 56 // Constructors and destructor -- declared inline below: │ │ │ │ │ + 57 StackBuffer(); │ │ │ │ │ + 58 StackBuffer(size_type size); │ │ │ │ │ + 59 ~StackBuffer(); │ │ │ │ │ + 60 │ │ │ │ │ + 61public: │ │ │ │ │ + 62 // Note the reliance on implicit casting so that it can be used similar to │ │ │ │ │ + 63 // a VLA. This removes the need for operator[] as the resulting TYPE* will │ │ │ │ │ + 64 // natively support []. (The presence of both TYPE* and operator[] also │ │ │ │ │ + 65 // causes an ambiguous overloading error with 32-bit MSVC builds.) │ │ │ │ │ + 66 │ │ │ │ │ + 67 operator TYPE const * () const { return _data; } │ │ │ │ │ + 68 operator TYPE * () { return _data; } │ │ │ │ │ + 69 │ │ │ │ │ + 70 size_type GetSize() const { return _size; } │ │ │ │ │ + 71 │ │ │ │ │ + 72 void SetSize(size_type size); │ │ │ │ │ + 73 void Reserve(size_type capacity); │ │ │ │ │ + 74 │ │ │ │ │ + 75private: │ │ │ │ │ + 76 // Non-copyable: │ │ │ │ │ + 77 StackBuffer(const StackBuffer &) { } │ │ │ │ │ + 78 StackBuffer& operator=(const StackBuffer &) { return │ │ │ │ │ +*this; } │ │ │ │ │ + 79 │ │ │ │ │ + 80 void allocate(size_type capacity); │ │ │ │ │ + 81 void deallocate(); │ │ │ │ │ + 82 void construct(); │ │ │ │ │ + 83 void destruct(); │ │ │ │ │ + 84 │ │ │ │ │ + 85private: │ │ │ │ │ + 86 TYPE * _data; │ │ │ │ │ + 87 size_type _size; │ │ │ │ │ + 88 size_type _capacity; │ │ │ │ │ + 89 │ │ │ │ │ + 90 // Is alignment an issue here? The staticData arena will at least be │ │ │ │ │ +double-word │ │ │ │ │ + 91 // aligned within this struct, which meets current and most anticipated │ │ │ │ │ +needs. │ │ │ │ │ + 92 char _staticData[SIZE * sizeof(TYPE)]; │ │ │ │ │ + 93 char * _dynamicData; │ │ │ │ │ + 94}; │ │ │ │ │ + 95 │ │ │ │ │ 96 │ │ │ │ │ - 97} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 98using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 99} // end namespace OpenSubdiv │ │ │ │ │ - 100 │ │ │ │ │ - 101#endif /* OPENSUBDIV3_VTR_SPARSE_SELECTOR_H */ │ │ │ │ │ + 97// │ │ │ │ │ + 98// Core allocation/deallocation methods: │ │ │ │ │ + 99// │ │ │ │ │ + 100template │ │ │ │ │ + 101inline void │ │ │ │ │ + 102StackBuffer::allocate(size_type capacity) { │ │ │ │ │ + 103 │ │ │ │ │ + 104 // Again, is alignment an issue here? C++ spec says new will return │ │ │ │ │ +pointer │ │ │ │ │ + 105 // "suitably aligned" for conversion to pointers of other types, which │ │ │ │ │ +implies │ │ │ │ │ + 106 // at least an alignment of 16. │ │ │ │ │ + 107 _dynamicData = static_cast(::operator new(capacity * sizeof │ │ │ │ │ +(TYPE))); │ │ │ │ │ + 108 │ │ │ │ │ + 109 _data = reinterpret_cast(_dynamicData); │ │ │ │ │ + 110 _capacity = capacity; │ │ │ │ │ + 111} │ │ │ │ │ + 112 │ │ │ │ │ + 113template │ │ │ │ │ + 114inline void │ │ │ │ │ + 115StackBuffer::deallocate() { │ │ │ │ │ + 116 │ │ │ │ │ + 117 ::operator delete(_dynamicData); │ │ │ │ │ + 118 │ │ │ │ │ + 119 _data = reinterpret_cast(_staticData); │ │ │ │ │ + 120 _capacity = SIZE; │ │ │ │ │ + 121} │ │ │ │ │ + 122 │ │ │ │ │ + 123// │ │ │ │ │ + 124// Explicit element-wise construction and destruction within allocated │ │ │ │ │ +memory. │ │ │ │ │ + 125// Compilers do not always optimize out the iteration here even when there │ │ │ │ │ +is │ │ │ │ │ + 126// no construction or destruction, so the POD_TYPE arguement can be used to │ │ │ │ │ + 127// force this when/if it becomes an issue (and it has been in some cases). │ │ │ │ │ + 128// │ │ │ │ │ + 129template │ │ │ │ │ + 130inline void │ │ │ │ │ + 131StackBuffer::construct() { │ │ │ │ │ + 132 │ │ │ │ │ + 133 for (size_type i = 0; i < _size; ++i) { │ │ │ │ │ + 134 (void) new (&_data[i]) TYPE; │ │ │ │ │ + 135 } │ │ │ │ │ + 136} │ │ │ │ │ + 137template │ │ │ │ │ + 138inline void │ │ │ │ │ + 139StackBuffer::destruct() { │ │ │ │ │ + 140 │ │ │ │ │ + 141 for (size_type i = 0; i < _size; ++i) { │ │ │ │ │ + 142 _data[i].~TYPE(); │ │ │ │ │ + 143 } │ │ │ │ │ + 144} │ │ │ │ │ + 145 │ │ │ │ │ + 146// │ │ │ │ │ + 147// Inline constructors and destructor: │ │ │ │ │ + 148// │ │ │ │ │ + 149template │ │ │ │ │ + 150inline │ │ │ │ │ + 151StackBuffer::StackBuffer() : │ │ │ │ │ + 152 _data(reinterpret_cast(_staticData)), │ │ │ │ │ + 153 _size(0), │ │ │ │ │ + 154 _capacity(SIZE), │ │ │ │ │ + 155 _dynamicData(0) { │ │ │ │ │ + 156 │ │ │ │ │ + 157} │ │ │ │ │ + 158 │ │ │ │ │ + 159template │ │ │ │ │ + 160inline │ │ │ │ │ + 161StackBuffer::StackBuffer(size_type size) : │ │ │ │ │ + 162 _data(reinterpret_cast(_staticData)), │ │ │ │ │ + 163 _size(size), │ │ │ │ │ + 164 _capacity(SIZE), │ │ │ │ │ + 165 _dynamicData(0) { │ │ │ │ │ + 166 │ │ │ │ │ + 167 if (size > SIZE) { │ │ │ │ │ + 168 allocate(size); │ │ │ │ │ + 169 } │ │ │ │ │ + 170 if (!POD_TYPE) { │ │ │ │ │ + 171 construct(); │ │ │ │ │ + 172 } │ │ │ │ │ + 173} │ │ │ │ │ + 174 │ │ │ │ │ + 175template │ │ │ │ │ + 176inline │ │ │ │ │ + 177StackBuffer::~StackBuffer() { │ │ │ │ │ + 178 │ │ │ │ │ + 179 if (!POD_TYPE) { │ │ │ │ │ + 180 destruct(); │ │ │ │ │ + 181 } │ │ │ │ │ + 182 deallocate(); │ │ │ │ │ + 183} │ │ │ │ │ + 184 │ │ │ │ │ + 185// │ │ │ │ │ + 186// Inline sizing methods: │ │ │ │ │ + 187// │ │ │ │ │ + 188template │ │ │ │ │ + 189inline void │ │ │ │ │ + 190StackBuffer::Reserve(size_type capacity) { │ │ │ │ │ + 191 │ │ │ │ │ + 192 if (capacity > _capacity) { │ │ │ │ │ + 193 if (!POD_TYPE) { │ │ │ │ │ + 194 destruct(); │ │ │ │ │ + 195 } │ │ │ │ │ + 196 deallocate(); │ │ │ │ │ + 197 allocate(capacity); │ │ │ │ │ + 198 } │ │ │ │ │ + 199} │ │ │ │ │ + 200 │ │ │ │ │ + 201template │ │ │ │ │ + 202inline void │ │ │ │ │ + 203StackBuffer::SetSize(size_type size) │ │ │ │ │ + 204{ │ │ │ │ │ + 205 if (!POD_TYPE) { │ │ │ │ │ + 206 destruct(); │ │ │ │ │ + 207 } │ │ │ │ │ + 208 if (size == 0) { │ │ │ │ │ + 209 deallocate(); │ │ │ │ │ + 210 } else if (size > _capacity) { │ │ │ │ │ + 211 deallocate(); │ │ │ │ │ + 212 allocate(size); │ │ │ │ │ + 213 } │ │ │ │ │ + 214 _size = size; │ │ │ │ │ + 215 if (!POD_TYPE) { │ │ │ │ │ + 216 construct(); │ │ │ │ │ + 217 } │ │ │ │ │ + 218} │ │ │ │ │ + 219 │ │ │ │ │ + 220} // end namespace internal │ │ │ │ │ + 221} // end namespace Vtr │ │ │ │ │ + 222 │ │ │ │ │ + 223} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 224using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 225} // end namespace OpenSubdiv │ │ │ │ │ + 226 │ │ │ │ │ + 227#endif /* OPENSUBDIV3_VTR_STACK_BUFFER_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Index │ │ │ │ │ -int Index │ │ │ │ │ -Definition: types.h:54 │ │ │ │ │ * opensubdiv │ │ │ │ │ * vtr │ │ │ │ │ - * sparseSelector.h │ │ │ │ │ + * stackBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00749.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/vtr/stackBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/vtr/sparseSelector.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -82,18 +82,21 @@ │ │ │ │ name="MSearchResults" id="MSearchResults"> │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces
│ │ │ │ -
stackBuffer.h File Reference
│ │ │ │ +
sparseSelector.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include "../vtr/types.h"
│ │ │ │ +#include "../vtr/refinement.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -103,13 +106,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,24 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Namespaces │ │ │ │ │ -stackBuffer.h File Reference │ │ │ │ │ +sparseSelector.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../vtr/types.h" │ │ │ │ │ +#include "../vtr/refinement.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Vtr │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * vtr │ │ │ │ │ - * stackBuffer.h │ │ │ │ │ + * sparseSelector.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00749_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/vtr/stackBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/vtr/sparseSelector.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
stackBuffer.h
│ │ │ │ +
sparseSelector.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,223 +106,98 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_VTR_STACK_BUFFER_H
│ │ │ │ -
25#define OPENSUBDIV3_VTR_STACK_BUFFER_H
│ │ │ │ +
24#ifndef OPENSUBDIV3_VTR_SPARSE_SELECTOR_H
│ │ │ │ +
25#define OPENSUBDIV3_VTR_SPARSE_SELECTOR_H
│ │ │ │
26
│ │ │ │
27#include "../version.h"
│ │ │ │
28
│ │ │ │ -
29namespace OpenSubdiv {
│ │ │ │ -
30namespace OPENSUBDIV_VERSION {
│ │ │ │ +
29#include "../vtr/types.h"
│ │ │ │ +
30#include "../vtr/refinement.h"
│ │ │ │
31
│ │ │ │ -
32namespace Vtr {
│ │ │ │ -
33namespace internal {
│ │ │ │ -
34
│ │ │ │ -
35//
│ │ │ │ -
36// The StackBuffer class is intended solely to take the place of VLAs (Variable
│ │ │ │ -
37// Length Arrays) which most compilers support, but are not strictly standard C++.
│ │ │ │ -
38// Portability concerns forces us to make use of either alloca() or some other
│ │ │ │ -
39// mechanism to create small arrays on the stack that are typically based on the
│ │ │ │ -
40// valence of a vertex -- small in general, but occasionally large.
│ │ │ │ -
41//
│ │ │ │ -
42// Note also that since the intent of this is to replace VLAs -- not general
│ │ │ │ -
43// std::vectors -- support for std::vector functionality is intentionally limited
│ │ │ │ -
44// and STL-like naming is avoided. Like a VLA there is no incremental growth.
│ │ │ │ -
45// Support for resizing is available to reuse an instance at the beginning of a
│ │ │ │ -
46// loop with a new size, but resizing in this case reinitializes all elements.
│ │ │ │ +
32#include <vector>
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Vtr {
│ │ │ │ +
38namespace internal {
│ │ │ │ +
39
│ │ │ │ +
40//
│ │ │ │ +
41// SparseSelector:
│ │ │ │ +
42// Class supporting "selection" of components in a Level for sparse Refinement.
│ │ │ │ +
43// The term "selection" here implies interest in the limit for that component, i.e.
│ │ │ │ +
44// the limit point for a selected vertex, the limit patch for a face, etc. So this
│ │ │ │ +
45// class is responsible for ensuring that all neighboring components required to
│ │ │ │ +
46// support the limit of those selected are included in the refinement.
│ │ │ │
47//
│ │ │ │ -
48
│ │ │ │ -
49template <typename TYPE, unsigned int SIZE, bool POD_TYPE = false>
│ │ │ │ -
50class StackBuffer
│ │ │ │ -
51{
│ │ │ │ -
52public:
│ │ │ │ -
53 typedef unsigned int size_type;
│ │ │ │ -
54
│ │ │ │ -
55public:
│ │ │ │ -
56 // Constructors and destructor -- declared inline below:
│ │ │ │ -
57 StackBuffer();
│ │ │ │ -
58 StackBuffer(size_type size);
│ │ │ │ -
59 ~StackBuffer();
│ │ │ │ -
60
│ │ │ │ -
61public:
│ │ │ │ -
62 // Note the reliance on implicit casting so that it can be used similar to
│ │ │ │ -
63 // a VLA. This removes the need for operator[] as the resulting TYPE* will
│ │ │ │ -
64 // natively support []. (The presence of both TYPE* and operator[] also
│ │ │ │ -
65 // causes an ambiguous overloading error with 32-bit MSVC builds.)
│ │ │ │ -
66
│ │ │ │ -
67 operator TYPE const * () const { return _data; }
│ │ │ │ -
68 operator TYPE * () { return _data; }
│ │ │ │ -
69
│ │ │ │ -
70 size_type GetSize() const { return _size; }
│ │ │ │ -
71
│ │ │ │ -
72 void SetSize(size_type size);
│ │ │ │ -
73 void Reserve(size_type capacity);
│ │ │ │ -
74
│ │ │ │ -
75private:
│ │ │ │ -
76 // Non-copyable:
│ │ │ │ -
77 StackBuffer(const StackBuffer<TYPE,SIZE,POD_TYPE> &) { }
│ │ │ │ -
78 StackBuffer& operator=(const StackBuffer<TYPE,SIZE,POD_TYPE> &) { return *this; }
│ │ │ │ -
79
│ │ │ │ -
80 void allocate(size_type capacity);
│ │ │ │ -
81 void deallocate();
│ │ │ │ -
82 void construct();
│ │ │ │ -
83 void destruct();
│ │ │ │ -
84
│ │ │ │ -
85private:
│ │ │ │ -
86 TYPE * _data;
│ │ │ │ -
87 size_type _size;
│ │ │ │ -
88 size_type _capacity;
│ │ │ │ -
89
│ │ │ │ -
90 // Is alignment an issue here? The staticData arena will at least be double-word
│ │ │ │ -
91 // aligned within this struct, which meets current and most anticipated needs.
│ │ │ │ -
92 char _staticData[SIZE * sizeof(TYPE)];
│ │ │ │ -
93 char * _dynamicData;
│ │ │ │ -
94};
│ │ │ │ -
95
│ │ │ │ +
48// This class is associated with (and constructed given) a Refinement and its role
│ │ │ │ +
49// is to initialize that Refinement instance for eventual sparse refinement. So it
│ │ │ │ +
50// is a friend of and expected to modify the Refinement as part of the selection.
│ │ │ │ +
51// Given its simplicity and scope it may be worth nesting it in Vtr::Refinement.
│ │ │ │ +
52//
│ │ │ │ +
53// While all three component types -- vertices, edges and faces -- can be selected,
│ │ │ │ +
54// only selection of faces is currently used and actively supported as part of the
│ │ │ │ +
55// feature-adaptive refinement.
│ │ │ │ +
56//
│ │ │ │ +
57class SparseSelector {
│ │ │ │ +
58
│ │ │ │ +
59public:
│ │ │ │ +
60 SparseSelector(Refinement& refine) : _refine(&refine), _selected(false) { }
│ │ │ │ +
61 ~SparseSelector() { }
│ │ │ │ +
62
│ │ │ │ +
63 void setRefinement(Refinement& refine) { _refine = &refine; }
│ │ │ │ +
64 Refinement& getRefinement() const { return *_refine; }
│ │ │ │ +
65
│ │ │ │ +
66 bool isSelectionEmpty() const { return !_selected; }
│ │ │ │ +
67
│ │ │ │ +
68 //
│ │ │ │ +
69 // Methods for selecting (and marking) components for refinement. All component indices
│ │ │ │ +
70 // refer to components in the parent:
│ │ │ │ +
71 //
│ │ │ │ +
72 void selectVertex(Index pVertex);
│ │ │ │ +
73 void selectEdge( Index pEdge);
│ │ │ │ +
74 void selectFace( Index pFace);
│ │ │ │ +
75
│ │ │ │ +
76private:
│ │ │ │ +
77 SparseSelector() : _refine(0), _selected(false) { }
│ │ │ │ +
78
│ │ │ │ +
79 bool wasVertexSelected(Index pVertex) const { return _refine->getParentVertexSparseTag(pVertex)._selected; }
│ │ │ │ +
80 bool wasEdgeSelected( Index pEdge) const { return _refine->getParentEdgeSparseTag(pEdge)._selected; }
│ │ │ │ +
81 bool wasFaceSelected( Index pFace) const { return _refine->getParentFaceSparseTag(pFace)._selected; }
│ │ │ │ +
82
│ │ │ │ +
83 void markVertexSelected(Index pVertex) const { _refine->getParentVertexSparseTag(pVertex)._selected = true; }
│ │ │ │ +
84 void markEdgeSelected( Index pEdge) const { _refine->getParentEdgeSparseTag(pEdge)._selected = true; }
│ │ │ │ +
85 void markFaceSelected( Index pFace) const { _refine->getParentFaceSparseTag(pFace)._selected = true; }
│ │ │ │ +
86
│ │ │ │ +
87 void initializeSelection();
│ │ │ │ +
88
│ │ │ │ +
89private:
│ │ │ │ +
90 Refinement* _refine;
│ │ │ │ +
91 bool _selected;
│ │ │ │ +
92};
│ │ │ │ +
93
│ │ │ │ +
94} // end namespace internal
│ │ │ │ +
95} // end namespace Vtr
│ │ │ │
96
│ │ │ │ -
97//
│ │ │ │ -
98// Core allocation/deallocation methods:
│ │ │ │ -
99//
│ │ │ │ -
100template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
101inline void
│ │ │ │ -
102StackBuffer<TYPE,SIZE,POD_TYPE>::allocate(size_type capacity) {
│ │ │ │ -
103
│ │ │ │ -
104 // Again, is alignment an issue here? C++ spec says new will return pointer
│ │ │ │ -
105 // "suitably aligned" for conversion to pointers of other types, which implies
│ │ │ │ -
106 // at least an alignment of 16.
│ │ │ │ -
107 _dynamicData = static_cast<char*>(::operator new(capacity * sizeof(TYPE)));
│ │ │ │ -
108
│ │ │ │ -
109 _data = reinterpret_cast<TYPE*>(_dynamicData);
│ │ │ │ -
110 _capacity = capacity;
│ │ │ │ -
111}
│ │ │ │ -
112
│ │ │ │ -
113template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
114inline void
│ │ │ │ -
115StackBuffer<TYPE,SIZE,POD_TYPE>::deallocate() {
│ │ │ │ -
116
│ │ │ │ -
117 ::operator delete(_dynamicData);
│ │ │ │ -
118
│ │ │ │ -
119 _data = reinterpret_cast<TYPE*>(_staticData);
│ │ │ │ -
120 _capacity = SIZE;
│ │ │ │ -
121}
│ │ │ │ -
122
│ │ │ │ -
123//
│ │ │ │ -
124// Explicit element-wise construction and destruction within allocated memory.
│ │ │ │ -
125// Compilers do not always optimize out the iteration here even when there is
│ │ │ │ -
126// no construction or destruction, so the POD_TYPE arguement can be used to
│ │ │ │ -
127// force this when/if it becomes an issue (and it has been in some cases).
│ │ │ │ -
128//
│ │ │ │ -
129template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
130inline void
│ │ │ │ -
131StackBuffer<TYPE,SIZE,POD_TYPE>::construct() {
│ │ │ │ -
132
│ │ │ │ -
133 for (size_type i = 0; i < _size; ++i) {
│ │ │ │ -
134 (void) new (&_data[i]) TYPE;
│ │ │ │ -
135 }
│ │ │ │ -
136}
│ │ │ │ -
137template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
138inline void
│ │ │ │ -
139StackBuffer<TYPE,SIZE,POD_TYPE>::destruct() {
│ │ │ │ -
140
│ │ │ │ -
141 for (size_type i = 0; i < _size; ++i) {
│ │ │ │ -
142 _data[i].~TYPE();
│ │ │ │ -
143 }
│ │ │ │ -
144}
│ │ │ │ -
145
│ │ │ │ -
146//
│ │ │ │ -
147// Inline constructors and destructor:
│ │ │ │ -
148//
│ │ │ │ -
149template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
150inline
│ │ │ │ -
151StackBuffer<TYPE,SIZE,POD_TYPE>::StackBuffer() :
│ │ │ │ -
152 _data(reinterpret_cast<TYPE*>(_staticData)),
│ │ │ │ -
153 _size(0),
│ │ │ │ -
154 _capacity(SIZE),
│ │ │ │ -
155 _dynamicData(0) {
│ │ │ │ -
156
│ │ │ │ -
157}
│ │ │ │ -
158
│ │ │ │ -
159template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
160inline
│ │ │ │ -
161StackBuffer<TYPE,SIZE,POD_TYPE>::StackBuffer(size_type size) :
│ │ │ │ -
162 _data(reinterpret_cast<TYPE*>(_staticData)),
│ │ │ │ -
163 _size(size),
│ │ │ │ -
164 _capacity(SIZE),
│ │ │ │ -
165 _dynamicData(0) {
│ │ │ │ -
166
│ │ │ │ -
167 if (size > SIZE) {
│ │ │ │ -
168 allocate(size);
│ │ │ │ -
169 }
│ │ │ │ -
170 if (!POD_TYPE) {
│ │ │ │ -
171 construct();
│ │ │ │ -
172 }
│ │ │ │ -
173}
│ │ │ │ -
174
│ │ │ │ -
175template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
176inline
│ │ │ │ -
177StackBuffer<TYPE,SIZE,POD_TYPE>::~StackBuffer() {
│ │ │ │ -
178
│ │ │ │ -
179 if (!POD_TYPE) {
│ │ │ │ -
180 destruct();
│ │ │ │ -
181 }
│ │ │ │ -
182 deallocate();
│ │ │ │ -
183}
│ │ │ │ -
184
│ │ │ │ -
185//
│ │ │ │ -
186// Inline sizing methods:
│ │ │ │ -
187//
│ │ │ │ -
188template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
189inline void
│ │ │ │ -
190StackBuffer<TYPE,SIZE,POD_TYPE>::Reserve(size_type capacity) {
│ │ │ │ -
191
│ │ │ │ -
192 if (capacity > _capacity) {
│ │ │ │ -
193 if (!POD_TYPE) {
│ │ │ │ -
194 destruct();
│ │ │ │ -
195 }
│ │ │ │ -
196 deallocate();
│ │ │ │ -
197 allocate(capacity);
│ │ │ │ -
198 }
│ │ │ │ -
199}
│ │ │ │ -
200
│ │ │ │ -
201template <typename TYPE, unsigned int SIZE, bool POD_TYPE>
│ │ │ │ -
202inline void
│ │ │ │ -
203StackBuffer<TYPE,SIZE,POD_TYPE>::SetSize(size_type size)
│ │ │ │ -
204{
│ │ │ │ -
205 if (!POD_TYPE) {
│ │ │ │ -
206 destruct();
│ │ │ │ -
207 }
│ │ │ │ -
208 if (size == 0) {
│ │ │ │ -
209 deallocate();
│ │ │ │ -
210 } else if (size > _capacity) {
│ │ │ │ -
211 deallocate();
│ │ │ │ -
212 allocate(size);
│ │ │ │ -
213 }
│ │ │ │ -
214 _size = size;
│ │ │ │ -
215 if (!POD_TYPE) {
│ │ │ │ -
216 construct();
│ │ │ │ -
217 }
│ │ │ │ -
218}
│ │ │ │ -
219
│ │ │ │ -
220} // end namespace internal
│ │ │ │ -
221} // end namespace Vtr
│ │ │ │ -
222
│ │ │ │ -
223} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
224using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
225} // end namespace OpenSubdiv
│ │ │ │ -
226
│ │ │ │ -
227#endif /* OPENSUBDIV3_VTR_STACK_BUFFER_H */
│ │ │ │ +
97} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
98using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
99} // end namespace OpenSubdiv
│ │ │ │ +
100
│ │ │ │ +
101#endif /* OPENSUBDIV3_VTR_SPARSE_SELECTOR_H */
│ │ │ │ │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -stackBuffer.h │ │ │ │ │ +sparseSelector.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,233 +29,111 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_VTR_STACK_BUFFER_H │ │ │ │ │ - 25#define OPENSUBDIV3_VTR_STACK_BUFFER_H │ │ │ │ │ + 24#ifndef OPENSUBDIV3_VTR_SPARSE_SELECTOR_H │ │ │ │ │ + 25#define OPENSUBDIV3_VTR_SPARSE_SELECTOR_H │ │ │ │ │ 26 │ │ │ │ │ 27#include "../version.h" │ │ │ │ │ 28 │ │ │ │ │ - 29namespace OpenSubdiv { │ │ │ │ │ - 30namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 29#include "../vtr/types.h" │ │ │ │ │ + 30#include "../vtr/refinement.h" │ │ │ │ │ 31 │ │ │ │ │ - 32namespace Vtr { │ │ │ │ │ - 33namespace internal { │ │ │ │ │ - 34 │ │ │ │ │ - 35// │ │ │ │ │ - 36// The StackBuffer class is intended solely to take the place of VLAs │ │ │ │ │ -(Variable │ │ │ │ │ - 37// Length Arrays) which most compilers support, but are not strictly │ │ │ │ │ -standard C++. │ │ │ │ │ - 38// Portability concerns forces us to make use of either alloca() or some │ │ │ │ │ -other │ │ │ │ │ - 39// mechanism to create small arrays on the stack that are typically based on │ │ │ │ │ -the │ │ │ │ │ - 40// valence of a vertex -- small in general, but occasionally large. │ │ │ │ │ - 41// │ │ │ │ │ - 42// Note also that since the intent of this is to replace VLAs -- not general │ │ │ │ │ - 43// std::vectors -- support for std::vector functionality is intentionally │ │ │ │ │ -limited │ │ │ │ │ - 44// and STL-like naming is avoided. Like a VLA there is no incremental │ │ │ │ │ -growth. │ │ │ │ │ - 45// Support for resizing is available to reuse an instance at the beginning │ │ │ │ │ -of a │ │ │ │ │ - 46// loop with a new size, but resizing in this case reinitializes all │ │ │ │ │ -elements. │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Vtr { │ │ │ │ │ + 38namespace internal { │ │ │ │ │ + 39 │ │ │ │ │ + 40// │ │ │ │ │ + 41// SparseSelector: │ │ │ │ │ + 42// Class supporting "selection" of components in a Level for sparse │ │ │ │ │ +Refinement. │ │ │ │ │ + 43// The term "selection" here implies interest in the limit for that │ │ │ │ │ +component, i.e. │ │ │ │ │ + 44// the limit point for a selected vertex, the limit patch for a face, etc. │ │ │ │ │ +So this │ │ │ │ │ + 45// class is responsible for ensuring that all neighboring components │ │ │ │ │ +required to │ │ │ │ │ + 46// support the limit of those selected are included in the refinement. │ │ │ │ │ 47// │ │ │ │ │ - 48 │ │ │ │ │ - 49template │ │ │ │ │ - 50class StackBuffer │ │ │ │ │ - 51{ │ │ │ │ │ - 52public: │ │ │ │ │ - 53 typedef unsigned int size_type; │ │ │ │ │ - 54 │ │ │ │ │ - 55public: │ │ │ │ │ - 56 // Constructors and destructor -- declared inline below: │ │ │ │ │ - 57 StackBuffer(); │ │ │ │ │ - 58 StackBuffer(size_type size); │ │ │ │ │ - 59 ~StackBuffer(); │ │ │ │ │ - 60 │ │ │ │ │ - 61public: │ │ │ │ │ - 62 // Note the reliance on implicit casting so that it can be used similar to │ │ │ │ │ - 63 // a VLA. This removes the need for operator[] as the resulting TYPE* will │ │ │ │ │ - 64 // natively support []. (The presence of both TYPE* and operator[] also │ │ │ │ │ - 65 // causes an ambiguous overloading error with 32-bit MSVC builds.) │ │ │ │ │ - 66 │ │ │ │ │ - 67 operator TYPE const * () const { return _data; } │ │ │ │ │ - 68 operator TYPE * () { return _data; } │ │ │ │ │ - 69 │ │ │ │ │ - 70 size_type GetSize() const { return _size; } │ │ │ │ │ - 71 │ │ │ │ │ - 72 void SetSize(size_type size); │ │ │ │ │ - 73 void Reserve(size_type capacity); │ │ │ │ │ - 74 │ │ │ │ │ - 75private: │ │ │ │ │ - 76 // Non-copyable: │ │ │ │ │ - 77 StackBuffer(const StackBuffer &) { } │ │ │ │ │ - 78 StackBuffer& operator=(const StackBuffer &) { return │ │ │ │ │ -*this; } │ │ │ │ │ - 79 │ │ │ │ │ - 80 void allocate(size_type capacity); │ │ │ │ │ - 81 void deallocate(); │ │ │ │ │ - 82 void construct(); │ │ │ │ │ - 83 void destruct(); │ │ │ │ │ - 84 │ │ │ │ │ - 85private: │ │ │ │ │ - 86 TYPE * _data; │ │ │ │ │ - 87 size_type _size; │ │ │ │ │ - 88 size_type _capacity; │ │ │ │ │ - 89 │ │ │ │ │ - 90 // Is alignment an issue here? The staticData arena will at least be │ │ │ │ │ -double-word │ │ │ │ │ - 91 // aligned within this struct, which meets current and most anticipated │ │ │ │ │ -needs. │ │ │ │ │ - 92 char _staticData[SIZE * sizeof(TYPE)]; │ │ │ │ │ - 93 char * _dynamicData; │ │ │ │ │ - 94}; │ │ │ │ │ - 95 │ │ │ │ │ + 48// This class is associated with (and constructed given) a Refinement and │ │ │ │ │ +its role │ │ │ │ │ + 49// is to initialize that Refinement instance for eventual sparse refinement. │ │ │ │ │ +So it │ │ │ │ │ + 50// is a friend of and expected to modify the Refinement as part of the │ │ │ │ │ +selection. │ │ │ │ │ + 51// Given its simplicity and scope it may be worth nesting it in Vtr:: │ │ │ │ │ +Refinement. │ │ │ │ │ + 52// │ │ │ │ │ + 53// While all three component types -- vertices, edges and faces -- can be │ │ │ │ │ +selected, │ │ │ │ │ + 54// only selection of faces is currently used and actively supported as part │ │ │ │ │ +of the │ │ │ │ │ + 55// feature-adaptive refinement. │ │ │ │ │ + 56// │ │ │ │ │ + 57class SparseSelector { │ │ │ │ │ + 58 │ │ │ │ │ + 59public: │ │ │ │ │ + 60 SparseSelector(Refinement& refine) : _refine(&refine), _selected(false) { } │ │ │ │ │ + 61 ~SparseSelector() { } │ │ │ │ │ + 62 │ │ │ │ │ + 63 void setRefinement(Refinement& refine) { _refine = &refine; } │ │ │ │ │ + 64 Refinement& getRefinement() const { return *_refine; } │ │ │ │ │ + 65 │ │ │ │ │ + 66 bool isSelectionEmpty() const { return !_selected; } │ │ │ │ │ + 67 │ │ │ │ │ + 68 // │ │ │ │ │ + 69 // Methods for selecting (and marking) components for refinement. All │ │ │ │ │ +component indices │ │ │ │ │ + 70 // refer to components in the parent: │ │ │ │ │ + 71 // │ │ │ │ │ + 72 void selectVertex(Index pVertex); │ │ │ │ │ + 73 void selectEdge( Index pEdge); │ │ │ │ │ + 74 void selectFace( Index pFace); │ │ │ │ │ + 75 │ │ │ │ │ + 76private: │ │ │ │ │ + 77 SparseSelector() : _refine(0), _selected(false) { } │ │ │ │ │ + 78 │ │ │ │ │ + 79 bool wasVertexSelected(Index pVertex) const { return _refine- │ │ │ │ │ +>getParentVertexSparseTag(pVertex)._selected; } │ │ │ │ │ + 80 bool wasEdgeSelected( Index pEdge) const { return _refine- │ │ │ │ │ +>getParentEdgeSparseTag(pEdge)._selected; } │ │ │ │ │ + 81 bool wasFaceSelected( Index pFace) const { return _refine- │ │ │ │ │ +>getParentFaceSparseTag(pFace)._selected; } │ │ │ │ │ + 82 │ │ │ │ │ + 83 void markVertexSelected(Index pVertex) const { _refine- │ │ │ │ │ +>getParentVertexSparseTag(pVertex)._selected = true; } │ │ │ │ │ + 84 void markEdgeSelected( Index pEdge) const { _refine->getParentEdgeSparseTag │ │ │ │ │ +(pEdge)._selected = true; } │ │ │ │ │ + 85 void markFaceSelected( Index pFace) const { _refine->getParentFaceSparseTag │ │ │ │ │ +(pFace)._selected = true; } │ │ │ │ │ + 86 │ │ │ │ │ + 87 void initializeSelection(); │ │ │ │ │ + 88 │ │ │ │ │ + 89private: │ │ │ │ │ + 90 Refinement* _refine; │ │ │ │ │ + 91 bool _selected; │ │ │ │ │ + 92}; │ │ │ │ │ + 93 │ │ │ │ │ + 94} // end namespace internal │ │ │ │ │ + 95} // end namespace Vtr │ │ │ │ │ 96 │ │ │ │ │ - 97// │ │ │ │ │ - 98// Core allocation/deallocation methods: │ │ │ │ │ - 99// │ │ │ │ │ - 100template │ │ │ │ │ - 101inline void │ │ │ │ │ - 102StackBuffer::allocate(size_type capacity) { │ │ │ │ │ - 103 │ │ │ │ │ - 104 // Again, is alignment an issue here? C++ spec says new will return │ │ │ │ │ -pointer │ │ │ │ │ - 105 // "suitably aligned" for conversion to pointers of other types, which │ │ │ │ │ -implies │ │ │ │ │ - 106 // at least an alignment of 16. │ │ │ │ │ - 107 _dynamicData = static_cast(::operator new(capacity * sizeof │ │ │ │ │ -(TYPE))); │ │ │ │ │ - 108 │ │ │ │ │ - 109 _data = reinterpret_cast(_dynamicData); │ │ │ │ │ - 110 _capacity = capacity; │ │ │ │ │ - 111} │ │ │ │ │ - 112 │ │ │ │ │ - 113template │ │ │ │ │ - 114inline void │ │ │ │ │ - 115StackBuffer::deallocate() { │ │ │ │ │ - 116 │ │ │ │ │ - 117 ::operator delete(_dynamicData); │ │ │ │ │ - 118 │ │ │ │ │ - 119 _data = reinterpret_cast(_staticData); │ │ │ │ │ - 120 _capacity = SIZE; │ │ │ │ │ - 121} │ │ │ │ │ - 122 │ │ │ │ │ - 123// │ │ │ │ │ - 124// Explicit element-wise construction and destruction within allocated │ │ │ │ │ -memory. │ │ │ │ │ - 125// Compilers do not always optimize out the iteration here even when there │ │ │ │ │ -is │ │ │ │ │ - 126// no construction or destruction, so the POD_TYPE arguement can be used to │ │ │ │ │ - 127// force this when/if it becomes an issue (and it has been in some cases). │ │ │ │ │ - 128// │ │ │ │ │ - 129template │ │ │ │ │ - 130inline void │ │ │ │ │ - 131StackBuffer::construct() { │ │ │ │ │ - 132 │ │ │ │ │ - 133 for (size_type i = 0; i < _size; ++i) { │ │ │ │ │ - 134 (void) new (&_data[i]) TYPE; │ │ │ │ │ - 135 } │ │ │ │ │ - 136} │ │ │ │ │ - 137template │ │ │ │ │ - 138inline void │ │ │ │ │ - 139StackBuffer::destruct() { │ │ │ │ │ - 140 │ │ │ │ │ - 141 for (size_type i = 0; i < _size; ++i) { │ │ │ │ │ - 142 _data[i].~TYPE(); │ │ │ │ │ - 143 } │ │ │ │ │ - 144} │ │ │ │ │ - 145 │ │ │ │ │ - 146// │ │ │ │ │ - 147// Inline constructors and destructor: │ │ │ │ │ - 148// │ │ │ │ │ - 149template │ │ │ │ │ - 150inline │ │ │ │ │ - 151StackBuffer::StackBuffer() : │ │ │ │ │ - 152 _data(reinterpret_cast(_staticData)), │ │ │ │ │ - 153 _size(0), │ │ │ │ │ - 154 _capacity(SIZE), │ │ │ │ │ - 155 _dynamicData(0) { │ │ │ │ │ - 156 │ │ │ │ │ - 157} │ │ │ │ │ - 158 │ │ │ │ │ - 159template │ │ │ │ │ - 160inline │ │ │ │ │ - 161StackBuffer::StackBuffer(size_type size) : │ │ │ │ │ - 162 _data(reinterpret_cast(_staticData)), │ │ │ │ │ - 163 _size(size), │ │ │ │ │ - 164 _capacity(SIZE), │ │ │ │ │ - 165 _dynamicData(0) { │ │ │ │ │ - 166 │ │ │ │ │ - 167 if (size > SIZE) { │ │ │ │ │ - 168 allocate(size); │ │ │ │ │ - 169 } │ │ │ │ │ - 170 if (!POD_TYPE) { │ │ │ │ │ - 171 construct(); │ │ │ │ │ - 172 } │ │ │ │ │ - 173} │ │ │ │ │ - 174 │ │ │ │ │ - 175template │ │ │ │ │ - 176inline │ │ │ │ │ - 177StackBuffer::~StackBuffer() { │ │ │ │ │ - 178 │ │ │ │ │ - 179 if (!POD_TYPE) { │ │ │ │ │ - 180 destruct(); │ │ │ │ │ - 181 } │ │ │ │ │ - 182 deallocate(); │ │ │ │ │ - 183} │ │ │ │ │ - 184 │ │ │ │ │ - 185// │ │ │ │ │ - 186// Inline sizing methods: │ │ │ │ │ - 187// │ │ │ │ │ - 188template │ │ │ │ │ - 189inline void │ │ │ │ │ - 190StackBuffer::Reserve(size_type capacity) { │ │ │ │ │ - 191 │ │ │ │ │ - 192 if (capacity > _capacity) { │ │ │ │ │ - 193 if (!POD_TYPE) { │ │ │ │ │ - 194 destruct(); │ │ │ │ │ - 195 } │ │ │ │ │ - 196 deallocate(); │ │ │ │ │ - 197 allocate(capacity); │ │ │ │ │ - 198 } │ │ │ │ │ - 199} │ │ │ │ │ - 200 │ │ │ │ │ - 201template │ │ │ │ │ - 202inline void │ │ │ │ │ - 203StackBuffer::SetSize(size_type size) │ │ │ │ │ - 204{ │ │ │ │ │ - 205 if (!POD_TYPE) { │ │ │ │ │ - 206 destruct(); │ │ │ │ │ - 207 } │ │ │ │ │ - 208 if (size == 0) { │ │ │ │ │ - 209 deallocate(); │ │ │ │ │ - 210 } else if (size > _capacity) { │ │ │ │ │ - 211 deallocate(); │ │ │ │ │ - 212 allocate(size); │ │ │ │ │ - 213 } │ │ │ │ │ - 214 _size = size; │ │ │ │ │ - 215 if (!POD_TYPE) { │ │ │ │ │ - 216 construct(); │ │ │ │ │ - 217 } │ │ │ │ │ - 218} │ │ │ │ │ - 219 │ │ │ │ │ - 220} // end namespace internal │ │ │ │ │ - 221} // end namespace Vtr │ │ │ │ │ - 222 │ │ │ │ │ - 223} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 224using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 225} // end namespace OpenSubdiv │ │ │ │ │ - 226 │ │ │ │ │ - 227#endif /* OPENSUBDIV3_VTR_STACK_BUFFER_H */ │ │ │ │ │ + 97} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 98using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 99} // end namespace OpenSubdiv │ │ │ │ │ + 100 │ │ │ │ │ + 101#endif /* OPENSUBDIV3_VTR_SPARSE_SELECTOR_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Index │ │ │ │ │ +int Index │ │ │ │ │ +Definition: types.h:54 │ │ │ │ │ * opensubdiv │ │ │ │ │ * vtr │ │ │ │ │ - * stackBuffer.h │ │ │ │ │ + * sparseSelector.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00752.html │ │ │ │ @@ -87,15 +87,15 @@ │ │ │ │
│ │ │ │ Namespaces
│ │ │ │
refinement.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ #include "../vtr/types.h"
│ │ │ │ #include "../vtr/level.h"
│ │ │ │ #include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00755.html │ │ │ │ @@ -87,16 +87,16 @@ │ │ │ │
│ │ │ │ Namespaces
│ │ │ │
level.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/crease.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/crease.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ #include "../vtr/types.h"
│ │ │ │ #include <algorithm>
│ │ │ │ #include <vector>
│ │ │ │ #include <cassert>
│ │ │ │ #include <cstring>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00755_source.html │ │ │ │ @@ -969,15 +969,15 @@ │ │ │ │ │ │ │ │
ConstArray< LocalIndex > ConstLocalIndexArray
Definition: types.h:83
│ │ │ │
Array< LocalIndex > LocalIndexArray
Definition: types.h:82
│ │ │ │ │ │ │ │
ConstArray< Index > ConstIndexArray
Definition: types.h:80
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/crease.h"
│ │ │ │ +#include "../sdc/crease.h"
│ │ │ │ #include "../vtr/types.h"
│ │ │ │ #include "../vtr/refinement.h"
│ │ │ │ #include "../vtr/fvarLevel.h"
│ │ │ │ #include <vector>
│ │ │ │ #include <cassert>
│ │ │ │ #include <cstring>
│ │ │ │
│ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00761.html │ │ │ │ @@ -87,16 +87,16 @@ │ │ │ │
│ │ │ │ Namespaces
│ │ │ │
fvarLevel.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/crease.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/crease.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ #include "../vtr/types.h"
│ │ │ │ #include "../vtr/level.h"
│ │ │ │ #include <vector>
│ │ │ │ #include <cassert>
│ │ │ │ #include <cstring>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00761_source.html │ │ │ │ @@ -529,16 +529,16 @@ │ │ │ │ │ │ │ │
ConstArray< LocalIndex > ConstLocalIndexArray
Definition: types.h:83
│ │ │ │
Array< LocalIndex > LocalIndexArray
Definition: types.h:82
│ │ │ │ │ │ │ │
ConstArray< Index > ConstIndexArray
Definition: types.h:80
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ #include "../sdc/types.h"
│ │ │ │ -#include "../sdc/crease.h"
│ │ │ │ +#include "../sdc/crease.h"
│ │ │ │ #include "../vtr/types.h"
│ │ │ │ -#include "../vtr/stackBuffer.h"
│ │ │ │ +#include "../vtr/stackBuffer.h"
│ │ │ │ #include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00770.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/options.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cudaPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,40 +83,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
options.h File Reference
│ │ │ │ +
cudaPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Options
 All supported options applying to subdivision scheme. More...
class  CudaPatchTable
 CUDA patch table. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,25 +5,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -options.h File Reference │ │ │ │ │ +cudaPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Options │ │ │ │ │ -  All supported options applying to subdivision scheme. More... │ │ │ │ │ +class  CudaPatchTable │ │ │ │ │ +  CUDA patch table. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * options.h │ │ │ │ │ + * osd │ │ │ │ │ + * cudaPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00770.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00770 = [ │ │ │ │ │ - ["Options", "a01329.html", "a01329"] │ │ │ │ │ + ["CudaPatchTable", "a01181.html", "a01181"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00770_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/options.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cudaPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
options.h
│ │ │ │ +
cudaPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,125 +106,120 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_SDC_OPTIONS_H
│ │ │ │ -
25#define OPENSUBDIV3_SDC_OPTIONS_H
│ │ │ │ -
26
│ │ │ │ -
27#include "../version.h"
│ │ │ │ -
28
│ │ │ │ -
29namespace OpenSubdiv {
│ │ │ │ -
30namespace OPENSUBDIV_VERSION {
│ │ │ │ -
31
│ │ │ │ -
32namespace Sdc {
│ │ │ │ -
33
│ │ │ │ -
50
│ │ │ │ -
51class Options {
│ │ │ │ +
24
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ +
27
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/nonCopyable.h"
│ │ │ │ +
31#include "../osd/types.h"
│ │ │ │ +
32
│ │ │ │ +
33#include <vector>
│ │ │ │ +
34
│ │ │ │ +
35namespace OpenSubdiv {
│ │ │ │ +
36namespace OPENSUBDIV_VERSION {
│ │ │ │ +
37
│ │ │ │ +
38namespace Far{
│ │ │ │ +
39 class PatchTable;
│ │ │ │ +
40};
│ │ │ │ +
41
│ │ │ │ +
42namespace Osd {
│ │ │ │ +
43
│ │ │ │ +
51class CudaPatchTable : private NonCopyable<CudaPatchTable> {
│ │ │ │
52public:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
59 };
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
67 };
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
71 };
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
75 };
│ │ │ │ +
54 static CudaPatchTable *Create(Far::PatchTable const *patchTable,
│ │ │ │ +
55 void *deviceContext = NULL);
│ │ │ │ + │ │ │ │ +
58
│ │ │ │ +
60 void *GetPatchArrayBuffer() const { return _patchArrays; }
│ │ │ │ +
61
│ │ │ │ +
63 void *GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │ +
64
│ │ │ │ +
66 void *GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ +
67
│ │ │ │ + │ │ │ │ + │ │ │ │ +
71 }
│ │ │ │ + │ │ │ │ + │ │ │ │ +
75 }
│ │ │ │
76
│ │ │ │ -
77public:
│ │ │ │ -
78
│ │ │ │ -
79 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
│ │ │ │ -
80 _fvarLinInterp(FVAR_LINEAR_ALL),
│ │ │ │ -
81 _creasingMethod(CREASE_UNIFORM),
│ │ │ │ -
82 _triangleSub(TRI_SUB_CATMARK) { }
│ │ │ │ -
83
│ │ │ │ -
84 //
│ │ │ │ -
85 // Trivial get/set methods:
│ │ │ │ -
86 //
│ │ │ │ -
87
│ │ │ │ - │ │ │ │ -
90
│ │ │ │ -
92 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = (EnumIntType) b; }
│ │ │ │ -
93
│ │ │ │ - │ │ │ │ -
96
│ │ │ │ -
98 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = (EnumIntType) b; }
│ │ │ │ +
78 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ +
79
│ │ │ │ +
81 void *GetFVarPatchArrayBuffer(int fvarChannel) const {
│ │ │ │ +
82 return _fvarPatchArrays[fvarChannel];
│ │ │ │ +
83 }
│ │ │ │ +
84
│ │ │ │ +
86 void *GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ +
87 return _fvarIndexBuffers[fvarChannel];
│ │ │ │ +
88 }
│ │ │ │ +
89
│ │ │ │ +
91 void *GetFVarPatchParamBuffer(int fvarChannel = 0) const {
│ │ │ │ +
92 return _fvarParamBuffers[fvarChannel];
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
95protected:
│ │ │ │ + │ │ │ │ +
97
│ │ │ │ +
98 bool allocate(Far::PatchTable const *patchTable);
│ │ │ │
99
│ │ │ │ -
101 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
│ │ │ │ -
102
│ │ │ │ -
104 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) c; }
│ │ │ │ -
105
│ │ │ │ - │ │ │ │ -
108
│ │ │ │ -
110 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = (EnumIntType) t; }
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
103
│ │ │ │ + │ │ │ │ + │ │ │ │ +
106
│ │ │ │ +
107 std::vector<void *> _fvarPatchArrays;
│ │ │ │ +
108 std::vector<void *> _fvarIndexBuffers;
│ │ │ │ +
109 std::vector<void *> _fvarParamBuffers;
│ │ │ │ +
110};
│ │ │ │
111
│ │ │ │ -
112private:
│ │ │ │ -
113 // Use a small integer type to pack these rather than bitfields:
│ │ │ │ -
114 typedef unsigned char EnumIntType;
│ │ │ │ -
115
│ │ │ │ -
116 EnumIntType _vtxBoundInterp;
│ │ │ │ -
117 EnumIntType _fvarLinInterp;
│ │ │ │ -
118 EnumIntType _creasingMethod;
│ │ │ │ -
119 EnumIntType _triangleSub;
│ │ │ │ -
120};
│ │ │ │ -
121
│ │ │ │ -
122} // end namespace sdc
│ │ │ │ -
123
│ │ │ │ -
124} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
125using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
126} // end namespace OpenSubdiv
│ │ │ │ -
127
│ │ │ │ -
128#endif /* OPENSUBDIV3_SDC_OPTIONS_H */
│ │ │ │ +
112} // end namespace Osd
│ │ │ │ +
113
│ │ │ │ +
114} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
115using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
116
│ │ │ │ +
117} // end namespace OpenSubdiv
│ │ │ │ +
118
│ │ │ │ +
119#endif // OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ - │ │ │ │ -
@ TRI_SUB_CATMARK
Catmark weights (Catmark scheme only)
Definition: options.h:73
│ │ │ │ -
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:74
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:107
│ │ │ │ -
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:101
│ │ │ │ - │ │ │ │ -
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:98
│ │ │ │ -
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:110
│ │ │ │ -
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:89
│ │ │ │ - │ │ │ │ -
@ FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition: options.h:62
│ │ │ │ -
@ FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition: options.h:65
│ │ │ │ -
@ FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition: options.h:64
│ │ │ │ - │ │ │ │ -
@ FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition: options.h:66
│ │ │ │ -
@ FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition: options.h:61
│ │ │ │ -
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition: options.h:92
│ │ │ │ -
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:95
│ │ │ │ - │ │ │ │ - │ │ │ │ -
@ VTX_BOUNDARY_EDGE_ONLY
all boundary edges sharpened and interpolated
Definition: options.h:56
│ │ │ │ - │ │ │ │ -
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition: options.h:104
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ +
void * GetFVarPatchArrayBuffer(int fvarChannel) const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ + │ │ │ │ +
static CudaPatchTable * Create(Far::PatchTable const *patchTable, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ + │ │ │ │ +
void * GetVaryingPatchIndexBuffer() const
Returns the cuda memory of the array of varying control vertices.
│ │ │ │ + │ │ │ │ +
void * GetVaryingPatchArrayBuffer() const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
void * GetPatchArrayBuffer() const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ + │ │ │ │ +
bool allocate(Far::PatchTable const *patchTable)
│ │ │ │ +
void * GetPatchIndexBuffer() const
Returns the cuda memory of the patch control vertices.
│ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channels buffers.
│ │ │ │ + │ │ │ │ +
void * GetPatchParamBuffer() const
Returns the cuda memory of the array of Osd::PatchParam buffer.
│ │ │ │ +
void * GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the cuda memory of the array of face-varying control vertices.
│ │ │ │ +
void * GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the cuda memory of the array of face-varying param.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -options.h │ │ │ │ │ +cudaPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,200 +29,168 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_OPTIONS_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_OPTIONS_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29namespace OpenSubdiv { │ │ │ │ │ - 30namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 31 │ │ │ │ │ - 32namespace Sdc { │ │ │ │ │ - 33 │ │ │ │ │ - 50 │ │ │ │ │ -51class Options { │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/nonCopyable.h" │ │ │ │ │ + 31#include "../osd/types.h" │ │ │ │ │ + 32 │ │ │ │ │ + 33#include │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace OpenSubdiv { │ │ │ │ │ + 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace Far{ │ │ │ │ │ + 39 class PatchTable; │ │ │ │ │ + 40}; │ │ │ │ │ + 41 │ │ │ │ │ + 42namespace Osd { │ │ │ │ │ + 43 │ │ │ │ │ +51class CudaPatchTable : private NonCopyable { │ │ │ │ │ 52public: │ │ │ │ │ -53 enum VtxBoundaryInterpolation { │ │ │ │ │ - 54 VTX_BOUNDARY_NONE = 0, │ │ │ │ │ -56 VTX_BOUNDARY_EDGE_ONLY, │ │ │ │ │ - 57 VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ -59 }; │ │ │ │ │ -60 enum FVarLinearInterpolation { │ │ │ │ │ -61 FVAR_LINEAR_NONE = 0, │ │ │ │ │ -62 FVAR_LINEAR_CORNERS_ONLY, │ │ │ │ │ -63 FVAR_LINEAR_CORNERS_PLUS1, │ │ │ │ │ -64 FVAR_LINEAR_CORNERS_PLUS2, │ │ │ │ │ -65 FVAR_LINEAR_BOUNDARIES, │ │ │ │ │ - 66 FVAR_LINEAR_ALL │ │ │ │ │ -67 }; │ │ │ │ │ -68 enum CreasingMethod { │ │ │ │ │ -69 CREASE_UNIFORM = 0, │ │ │ │ │ - 70 CREASE_CHAIKIN │ │ │ │ │ -71 }; │ │ │ │ │ -72 enum TriangleSubdivision { │ │ │ │ │ -73 TRI_SUB_CATMARK = 0, │ │ │ │ │ - 74 TRI_SUB_SMOOTH │ │ │ │ │ -75 }; │ │ │ │ │ +54 static CudaPatchTable *Create(Far::PatchTable const *patchTable, │ │ │ │ │ + 55 void *deviceContext = NULL); │ │ │ │ │ +57 ~CudaPatchTable(); │ │ │ │ │ + 58 │ │ │ │ │ +60 void *GetPatchArrayBuffer() const { return _patchArrays; } │ │ │ │ │ + 61 │ │ │ │ │ +63 void *GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ + 64 │ │ │ │ │ +66 void *GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ + 67 │ │ │ │ │ +69 void *GetVaryingPatchArrayBuffer() const { │ │ │ │ │ + 70 return _varyingPatchArrays; │ │ │ │ │ + 71 } │ │ │ │ │ +73 void *GetVaryingPatchIndexBuffer() const { │ │ │ │ │ + 74 return _varyingIndexBuffer; │ │ │ │ │ + 75 } │ │ │ │ │ 76 │ │ │ │ │ - 77public: │ │ │ │ │ - 78 │ │ │ │ │ -79 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE), │ │ │ │ │ - 80 _fvarLinInterp(FVAR_LINEAR_ALL), │ │ │ │ │ - 81 _creasingMethod(CREASE_UNIFORM), │ │ │ │ │ - 82 _triangleSub(TRI_SUB_CATMARK) { } │ │ │ │ │ - 83 │ │ │ │ │ - 84 // │ │ │ │ │ - 85 // Trivial get/set methods: │ │ │ │ │ - 86 // │ │ │ │ │ - 87 │ │ │ │ │ -89 VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const { return │ │ │ │ │ -(VtxBoundaryInterpolation) _vtxBoundInterp; } │ │ │ │ │ - 90 │ │ │ │ │ -92 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) │ │ │ │ │ -{ _vtxBoundInterp = (EnumIntType) b; } │ │ │ │ │ - 93 │ │ │ │ │ -95 FVarLinearInterpolation GetFVarLinearInterpolation() const { return │ │ │ │ │ -(FVarLinearInterpolation) _fvarLinInterp; } │ │ │ │ │ - 96 │ │ │ │ │ -98 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp │ │ │ │ │ -= (EnumIntType) b; } │ │ │ │ │ +78 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ + 79 │ │ │ │ │ +81 void *GetFVarPatchArrayBuffer(int fvarChannel) const { │ │ │ │ │ + 82 return _fvarPatchArrays[fvarChannel]; │ │ │ │ │ + 83 } │ │ │ │ │ + 84 │ │ │ │ │ +86 void *GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 87 return _fvarIndexBuffers[fvarChannel]; │ │ │ │ │ + 88 } │ │ │ │ │ + 89 │ │ │ │ │ +91 void *GetFVarPatchParamBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 92 return _fvarParamBuffers[fvarChannel]; │ │ │ │ │ + 93 } │ │ │ │ │ + 94 │ │ │ │ │ + 95protected: │ │ │ │ │ +96 CudaPatchTable(); │ │ │ │ │ + 97 │ │ │ │ │ +98 bool allocate(Far::PatchTable const *patchTable); │ │ │ │ │ 99 │ │ │ │ │ -101 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) │ │ │ │ │ -_creasingMethod; } │ │ │ │ │ - 102 │ │ │ │ │ -104 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) │ │ │ │ │ -c; } │ │ │ │ │ - 105 │ │ │ │ │ -107 TriangleSubdivision GetTriangleSubdivision() const { return │ │ │ │ │ -(TriangleSubdivision) _triangleSub; } │ │ │ │ │ - 108 │ │ │ │ │ -110 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = │ │ │ │ │ -(EnumIntType) t; } │ │ │ │ │ +100 void *_patchArrays; │ │ │ │ │ +101 void *_indexBuffer; │ │ │ │ │ +102 void *_patchParamBuffer; │ │ │ │ │ + 103 │ │ │ │ │ +104 void *_varyingPatchArrays; │ │ │ │ │ +105 void *_varyingIndexBuffer; │ │ │ │ │ + 106 │ │ │ │ │ +107 std::vector _fvarPatchArrays; │ │ │ │ │ +108 std::vector _fvarIndexBuffers; │ │ │ │ │ +109 std::vector _fvarParamBuffers; │ │ │ │ │ + 110}; │ │ │ │ │ 111 │ │ │ │ │ - 112private: │ │ │ │ │ - 113 // Use a small integer type to pack these rather than bitfields: │ │ │ │ │ - 114 typedef unsigned char EnumIntType; │ │ │ │ │ - 115 │ │ │ │ │ - 116 EnumIntType _vtxBoundInterp; │ │ │ │ │ - 117 EnumIntType _fvarLinInterp; │ │ │ │ │ - 118 EnumIntType _creasingMethod; │ │ │ │ │ - 119 EnumIntType _triangleSub; │ │ │ │ │ - 120}; │ │ │ │ │ - 121 │ │ │ │ │ - 122} // end namespace sdc │ │ │ │ │ - 123 │ │ │ │ │ - 124} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 125using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 126} // end namespace OpenSubdiv │ │ │ │ │ - 127 │ │ │ │ │ - 128#endif /* OPENSUBDIV3_SDC_OPTIONS_H */ │ │ │ │ │ + 112} // end namespace Osd │ │ │ │ │ + 113 │ │ │ │ │ + 114} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 115using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 116 │ │ │ │ │ + 117} // end namespace OpenSubdiv │ │ │ │ │ + 118 │ │ │ │ │ + 119#endif // OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ -All supported options applying to subdivision scheme. │ │ │ │ │ -Definition: options.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TriangleSubdivision │ │ │ │ │ -TriangleSubdivision │ │ │ │ │ -Definition: options.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_CATMARK │ │ │ │ │ -@ TRI_SUB_CATMARK │ │ │ │ │ -Catmark weights (Catmark scheme only) │ │ │ │ │ -Definition: options.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH │ │ │ │ │ -@ TRI_SUB_SMOOTH │ │ │ │ │ -"smooth triangle" weights (Catmark scheme only) │ │ │ │ │ -Definition: options.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CreasingMethod │ │ │ │ │ -CreasingMethod │ │ │ │ │ -Definition: options.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM │ │ │ │ │ -@ CREASE_UNIFORM │ │ │ │ │ -Catmark rule. │ │ │ │ │ -Definition: options.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_CHAIKIN │ │ │ │ │ -@ CREASE_CHAIKIN │ │ │ │ │ -Chaikin rule. │ │ │ │ │ -Definition: options.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetTriangleSubdivision │ │ │ │ │ -TriangleSubdivision GetTriangleSubdivision() const │ │ │ │ │ -Get triangle subdivision weights rule (Catmark scheme only !) │ │ │ │ │ -Definition: options.h:107 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod │ │ │ │ │ -CreasingMethod GetCreasingMethod() const │ │ │ │ │ -Get edge crease rule. │ │ │ │ │ -Definition: options.h:101 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::Options │ │ │ │ │ -Options() │ │ │ │ │ -Definition: options.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation │ │ │ │ │ -void SetFVarLinearInterpolation(FVarLinearInterpolation b) │ │ │ │ │ -Set face-varying interpolation rule. │ │ │ │ │ -Definition: options.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetTriangleSubdivision │ │ │ │ │ -void SetTriangleSubdivision(TriangleSubdivision t) │ │ │ │ │ -Set triangle subdivision weights rule (Catmark scheme only !) │ │ │ │ │ -Definition: options.h:110 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation │ │ │ │ │ -VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const │ │ │ │ │ -Get vertex boundary interpolation rule. │ │ │ │ │ -Definition: options.h:89 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ -FVarLinearInterpolation │ │ │ │ │ -Definition: options.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_ONLY │ │ │ │ │ -@ FVAR_LINEAR_CORNERS_ONLY │ │ │ │ │ -sharpen corners only │ │ │ │ │ -Definition: options.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_BOUNDARIES │ │ │ │ │ -@ FVAR_LINEAR_BOUNDARIES │ │ │ │ │ -sharpen all boundaries ("always sharp") │ │ │ │ │ -Definition: options.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2 │ │ │ │ │ -@ FVAR_LINEAR_CORNERS_PLUS2 │ │ │ │ │ -("edge and corner + propagate corner") │ │ │ │ │ -Definition: options.h:64 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1 │ │ │ │ │ -@ FVAR_LINEAR_CORNERS_PLUS1 │ │ │ │ │ -("edge corner") │ │ │ │ │ -Definition: options.h:63 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_ALL │ │ │ │ │ -@ FVAR_LINEAR_ALL │ │ │ │ │ -bilinear interpolation ("bilinear") │ │ │ │ │ -Definition: options.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_NONE │ │ │ │ │ -@ FVAR_LINEAR_NONE │ │ │ │ │ -smooth everywhere ("edge only") │ │ │ │ │ -Definition: options.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetVtxBoundaryInterpolation │ │ │ │ │ -void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) │ │ │ │ │ -Set vertex boundary interpolation rule. │ │ │ │ │ -Definition: options.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation │ │ │ │ │ -FVarLinearInterpolation GetFVarLinearInterpolation() const │ │ │ │ │ -Get face-varying interpolation rule. │ │ │ │ │ -Definition: options.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VtxBoundaryInterpolation │ │ │ │ │ -VtxBoundaryInterpolation │ │ │ │ │ -Definition: options.h:53 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_NONE │ │ │ │ │ -@ VTX_BOUNDARY_NONE │ │ │ │ │ -Definition: options.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_ONLY │ │ │ │ │ -@ VTX_BOUNDARY_EDGE_ONLY │ │ │ │ │ -all boundary edges sharpened and interpolated │ │ │ │ │ -Definition: options.h:56 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ -@ VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ -Definition: options.h:57 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetCreasingMethod │ │ │ │ │ -void SetCreasingMethod(CreasingMethod c) │ │ │ │ │ -Set edge crease rule. │ │ │ │ │ -Definition: options.h:104 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable │ │ │ │ │ +CUDA patch table. │ │ │ │ │ +Definition: cudaPatchTable.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ +void * GetFVarPatchArrayBuffer(int fvarChannel) const │ │ │ │ │ +Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: cudaPatchTable.h:81 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarParamBuffers │ │ │ │ │ +std::vector< void * > _fvarParamBuffers │ │ │ │ │ +Definition: cudaPatchTable.h:109 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::Create │ │ │ │ │ +static CudaPatchTable * Create(Far::PatchTable const *patchTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_varyingPatchArrays │ │ │ │ │ +void * _varyingPatchArrays │ │ │ │ │ +Definition: cudaPatchTable.h:104 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ +void * GetVaryingPatchIndexBuffer() const │ │ │ │ │ +Returns the cuda memory of the array of varying control vertices. │ │ │ │ │ +Definition: cudaPatchTable.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarIndexBuffers │ │ │ │ │ +std::vector< void * > _fvarIndexBuffers │ │ │ │ │ +Definition: cudaPatchTable.h:108 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ +void * GetVaryingPatchArrayBuffer() const │ │ │ │ │ +Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: cudaPatchTable.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_varyingIndexBuffer │ │ │ │ │ +void * _varyingIndexBuffer │ │ │ │ │ +Definition: cudaPatchTable.h:105 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::~CudaPatchTable │ │ │ │ │ +~CudaPatchTable() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchArrayBuffer │ │ │ │ │ +void * GetPatchArrayBuffer() const │ │ │ │ │ +Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: cudaPatchTable.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarPatchArrays │ │ │ │ │ +std::vector< void * > _fvarPatchArrays │ │ │ │ │ +Definition: cudaPatchTable.h:107 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::allocate │ │ │ │ │ +bool allocate(Far::PatchTable const *patchTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchIndexBuffer │ │ │ │ │ +void * GetPatchIndexBuffer() const │ │ │ │ │ +Returns the cuda memory of the patch control vertices. │ │ │ │ │ +Definition: cudaPatchTable.h:63 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channels buffers. │ │ │ │ │ +Definition: cudaPatchTable.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_patchArrays │ │ │ │ │ +void * _patchArrays │ │ │ │ │ +Definition: cudaPatchTable.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchParamBuffer │ │ │ │ │ +void * GetPatchParamBuffer() const │ │ │ │ │ +Returns the cuda memory of the array of Osd::PatchParam buffer. │ │ │ │ │ +Definition: cudaPatchTable.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ +void * GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the cuda memory of the array of face-varying control vertices. │ │ │ │ │ +Definition: cudaPatchTable.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ +void * GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the cuda memory of the array of face-varying param. │ │ │ │ │ +Definition: cudaPatchTable.h:91 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::CudaPatchTable │ │ │ │ │ +CudaPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_patchParamBuffer │ │ │ │ │ +void * _patchParamBuffer │ │ │ │ │ +Definition: cudaPatchTable.h:102 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_indexBuffer │ │ │ │ │ +void * _indexBuffer │ │ │ │ │ +Definition: cudaPatchTable.h:101 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * options.h │ │ │ │ │ + * osd │ │ │ │ │ + * cudaPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00773.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/scheme.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cudaEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,49 +83,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
scheme.h File Reference
│ │ │ │ +
cudaEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../sdc/types.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ -#include "../sdc/crease.h"
│ │ │ │ -#include <cassert>
│ │ │ │ -#include <cstdlib>
│ │ │ │ #include <vector>
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Scheme< SCHEME_TYPE >
 Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
│ │ │ │ - More...
class  CudaStencilTable
 CUDA stencil table. More...
 
class  Scheme< SCHEME_TYPE >::LocalMask< WEIGHT >
class  CudaEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,37 +5,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -scheme.h File Reference │ │ │ │ │ +cudaEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../sdc/types.h" │ │ │ │ │ -#include "../sdc/options.h" │ │ │ │ │ -#include "../sdc/crease.h" │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Scheme<_SCHEME_TYPE_> │ │ │ │ │ - Scheme is a class template which provides all implementation for the │ │ │ │ │ - subdivision schemes supported by OpenSubdiv through specializations of │ │ │ │ │ -  the methods of each. An instance of Scheme includes a set │ │ │ │ │ - of Options that will dictate the variable aspects of its behavior. │ │ │ │ │ - More... │ │ │ │ │ +class  CudaStencilTable │ │ │ │ │ +  CUDA stencil table. More... │ │ │ │ │   │ │ │ │ │ -class  Scheme<_SCHEME_TYPE_>::LocalMask<_WEIGHT_> │ │ │ │ │ +class  CudaEvaluator │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * scheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * cudaEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00773.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ │ var a00773 = [ │ │ │ │ │ - ["Scheme< SCHEME_TYPE >", "a01333.html", "a01333"], │ │ │ │ │ - ["Scheme< SCHEME_TYPE >::LocalMask< WEIGHT >", "a01337.html", "a01337"] │ │ │ │ │ + ["CudaStencilTable", "a01173.html", "a01173"], │ │ │ │ │ + ["CudaEvaluator", "a01177.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00773_source.html │ │ │ │ @@ -21,8403 +21,7947 @@ │ │ │ │ 00000140: 6f6e 7465 6e74 3d22 446f 7879 6765 6e20 ontent="Doxygen │ │ │ │ 00000150: 312e 392e 3422 2f3e 0a3c 6d65 7461 206e 1.9.4"/>..< │ │ │ │ 000001a0: 7469 746c 653e 4f70 656e 5375 6264 6976 title>OpenSubdiv │ │ │ │ -000001b0: 3a20 6f70 656e 7375 6264 6976 2f73 6463 : opensubdiv/sdc │ │ │ │ -000001c0: 2f73 6368 656d 652e 6820 536f 7572 6365 /scheme.h Source │ │ │ │ -000001d0: 2046 696c 653c 2f74 6974 6c65 3e0a 3c6c File... │ │ │ │ -00000250: 3c73 6372 6970 7420 7479 7065 3d22 7465 ... │ │ │ │ -00000340: 0a3c 7363 7269 7074 2074 7970 653d 2274 ... │ │ │ │ -00000400: 0a3c 7363 7269 7074 2074 7970 653d 2274 . │ │ │ │ -00000440: 0a3c 6c69 6e6b 2068 7265 663d 2264 6f78 ....< │ │ │ │ -000004c0: 626f 6479 3e0a 3c64 6976 2069 643d 2274 body>.
... . . . . . │ │ │ │ -00000610: 3c2f 7462 6f64 793e 0a3c 2f74 6162 6c65 .
.
OpenS │ │ │ │ -000005f0: 7562 6469 760a 2020 203c 2f64 6976 3e0a ubdiv.
. │ │ │ │ -00000600: 2020 3c2f 7464 3e0a 203c 2f74 723e 0a20
.
...
.../* │ │ │ │ -000007e0: 406c 6963 656e 7365 206d 6167 6e65 743a @license magnet: │ │ │ │ -000007f0: 3f78 743d 7572 6e3a 6274 6968 3a64 3364 ?xt=urn:btih:d3d │ │ │ │ -00000800: 3961 3961 3635 3935 3532 3166 3936 3636 9a9a6595521f9666 │ │ │ │ -00000810: 6135 6539 3463 6338 3330 6461 6238 3362 a5e94cc830dab83b │ │ │ │ -00000820: 3635 3639 3926 616d 703b 646e 3d65 7870 65699&dn=exp │ │ │ │ -00000830: 6174 2e74 7874 204d 4954 202a 2f0a 2428 at.txt MIT */.$( │ │ │ │ -00000840: 6675 6e63 7469 6f6e 2829 207b 0a20 2069 function() {. i │ │ │ │ -00000850: 6e69 744d 656e 7528 2727 2c74 7275 652c nitMenu('',true, │ │ │ │ -00000860: 6661 6c73 652c 2773 6561 7263 682e 7068 false,'search.ph │ │ │ │ -00000870: 7027 2c27 5365 6172 6368 2729 3b0a 2020 p','Search');. │ │ │ │ -00000880: 2428 646f 6375 6d65 6e74 292e 7265 6164 $(document).read │ │ │ │ -00000890: 7928 6675 6e63 7469 6f6e 2829 207b 2069 y(function() { i │ │ │ │ -000008a0: 6e69 745f 7365 6172 6368 2829 3b20 7d29 nit_search(); }) │ │ │ │ -000008b0: 3b0a 7d29 3b0a 2f2a 2040 6c69 6365 6e73 ;.});./* @licens │ │ │ │ -000008c0: 652d 656e 6420 2a2f 0a3c 2f73 6372 6970 e-end */..
.. │ │ │ │ -00000900: 3c64 6976 2069 643d 2273 6964 652d 6e61
. .
.
. │ │ │ │ -000009a0: 2020 2020 3c2f 6469 763e 0a20 203c 2f64
.
.
. < │ │ │ │ -00000a10: 2f64 6976 3e0a 3c2f 6469 763e 0a3c 7363 /div>.
../* │ │ │ │ -00000a40: 406c 6963 656e 7365 206d 6167 6e65 743a @license magnet: │ │ │ │ -00000a50: 3f78 743d 7572 6e3a 6274 6968 3a64 3364 ?xt=urn:btih:d3d │ │ │ │ -00000a60: 3961 3961 3635 3935 3532 3166 3936 3636 9a9a6595521f9666 │ │ │ │ -00000a70: 6135 6539 3463 6338 3330 6461 6238 3362 a5e94cc830dab83b │ │ │ │ -00000a80: 3635 3639 3926 616d 703b 646e 3d65 7870 65699&dn=exp │ │ │ │ -00000a90: 6174 2e74 7874 204d 4954 202a 2f0a 2428 at.txt MIT */.$( │ │ │ │ -00000aa0: 646f 6375 6d65 6e74 292e 7265 6164 7928 document).ready( │ │ │ │ -00000ab0: 6675 6e63 7469 6f6e 2829 7b69 6e69 744e function(){initN │ │ │ │ -00000ac0: 6176 5472 6565 2827 6130 3037 3733 5f73 avTree('a00773_s │ │ │ │ -00000ad0: 6f75 7263 652e 6874 6d6c 272c 2727 293b ource.html',''); │ │ │ │ -00000ae0: 2069 6e69 7452 6573 697a 6162 6c65 2829 initResizable() │ │ │ │ -00000af0: 3b20 7d29 3b0a 2f2a 2040 6c69 6365 6e73 ; });./* @licens │ │ │ │ -00000b00: 652d 656e 6420 2a2f 0a3c 2f73 6372 6970 e-end */..
..
. │ │ │ │ -00000c20: 3c2f 6469 763e 0a0a 3c21 2d2d 2069 6672
...
....
.
cudaEval │ │ │ │ +00000d50: 7561 746f 722e 683c 2f64 6976 3e3c 2f64 uator.h
.
.
.< │ │ │ │ +00000d90: 6120 6872 6566 3d22 6130 3037 3733 2e68 a href="a00773.h │ │ │ │ +00000da0: 746d 6c22 3e47 6f20 746f 2074 6865 2064 tml">Go to the d │ │ │ │ +00000db0: 6f63 756d 656e 7461 7469 6f6e 206f 6620 ocumentation of │ │ │ │ +00000dc0: 7468 6973 2066 696c 652e 3c2f 613e 3c64 this file.
│ │ │ │ +00000e30: 313c 2f73 7061 6e3e 3c73 7061 6e20 636c 1// │ │ │ │ +00000e50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +00000e70: 3c61 2069 643d 226c 3030 3030 3222 206e 2// Cop │ │ │ │ +00000ed0: 7972 6967 6874 2032 3031 3520 5069 7861 yright 2015 Pixa │ │ │ │ +00000ee0: 723c 2f73 7061 6e3e 3c2f 6469 763e 0a3c r
.< │ │ │ │ +00000ef0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00000f00: 3e3c 6120 6964 3d22 6c30 3030 3033 2220 > 3//
.
4// Licensed │ │ │ │ +00000fe0: 2075 6e64 6572 2074 6865 2041 7061 6368 under the Apach │ │ │ │ +00000ff0: 6520 4c69 6365 6e73 652c 2056 6572 7369 e License, Versi │ │ │ │ +00001000: 6f6e 2032 2e30 2028 7468 6520 2671 756f on 2.0 (the &quo │ │ │ │ +00001010: 743b 4170 6163 6865 204c 6963 656e 7365 t;Apache License │ │ │ │ +00001020: 2671 756f 743b 293c 2f73 7061 6e3e 3c2f ").
│ │ │ │ +00001080: 2035 3c2f 7370 616e 3e3c 7370 616e 2063 5/ │ │ │ │ +000010a0: 2f20 2020 7769 7468 2074 6865 2066 6f6c / with the fol │ │ │ │ +000010b0: 6c6f 7769 6e67 206d 6f64 6966 6963 6174 lowing modificat │ │ │ │ +000010c0: 696f 6e3b 2079 6f75 206d 6179 206e 6f74 ion; you may not │ │ │ │ +000010d0: 2075 7365 2074 6869 7320 6669 6c65 2065 use this file e │ │ │ │ +000010e0: 7863 6570 7420 696e 3c2f 7370 616e 3e3c xcept in< │ │ │ │ +000010f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00001140: 2020 363c 2f73 7061 6e3e 3c73 7061 6e20 6 │ │ │ │ +00001160: 2f2f 2020 2063 6f6d 706c 6961 6e63 6520 // compliance │ │ │ │ +00001170: 7769 7468 2074 6865 2041 7061 6368 6520 with the Apache │ │ │ │ +00001180: 4c69 6365 6e73 6520 616e 6420 7468 6520 License and the │ │ │ │ +00001190: 666f 6c6c 6f77 696e 6720 6d6f 6469 6669 following modifi │ │ │ │ +000011a0: 6361 7469 6f6e 2074 6f20 6974 3a3c 2f73 cation to it:
.
7< │ │ │ │ +00001210: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00001220: 656e 7422 3e2f 2f20 2020 5365 6374 696f ent">// Sectio │ │ │ │ +00001230: 6e20 362e 2054 7261 6465 6d61 726b 732e n 6. Trademarks. │ │ │ │ +00001240: 2069 7320 6465 6c65 7465 6420 616e 6420 is deleted and │ │ │ │ +00001250: 7265 706c 6163 6564 2077 6974 683a 3c2f replaced with:
.
< │ │ │ │ +000012a0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +000012b0: 6e6f 223e 2020 2020 383c 2f73 7061 6e3e no"> 8 │ │ │ │ +000012c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ +000012e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00001330: 2020 393c 2f73 7061 6e3e 3c73 7061 6e20 9 │ │ │ │ +00001350: 2f2f 2020 2036 2e20 5472 6164 656d 6172 // 6. Trademar │ │ │ │ +00001360: 6b73 2e20 5468 6973 204c 6963 656e 7365 ks. This License │ │ │ │ +00001370: 2064 6f65 7320 6e6f 7420 6772 616e 7420 does not grant │ │ │ │ +00001380: 7065 726d 6973 7369 6f6e 2074 6f20 7573 permission to us │ │ │ │ +00001390: 6520 7468 6520 7472 6164 653c 2f73 7061 e the trade
.
10// names │ │ │ │ +00001420: 2c20 7472 6164 656d 6172 6b73 2c20 7365 , trademarks, se │ │ │ │ +00001430: 7276 6963 6520 6d61 726b 732c 206f 7220 rvice marks, or │ │ │ │ +00001440: 7072 6f64 7563 7420 6e61 6d65 7320 6f66 product names of │ │ │ │ +00001450: 2074 6865 204c 6963 656e 736f 723c 2f73 the Licensor
.
11< │ │ │ │ +000014c0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000014d0: 656e 7422 3e2f 2f20 2020 2020 2061 6e64 ent">// and │ │ │ │ +000014e0: 2069 7473 2061 6666 696c 6961 7465 732c its affiliates, │ │ │ │ +000014f0: 2065 7863 6570 7420 6173 2072 6571 7569 except as requi │ │ │ │ +00001500: 7265 6420 746f 2063 6f6d 706c 7920 7769 red to comply wi │ │ │ │ +00001510: 7468 2053 6563 7469 6f6e 2034 2863 2920 th Section 4(c) │ │ │ │ +00001520: 6f66 3c2f 7370 616e 3e3c 2f64 6976 3e0a of
. │ │ │ │ +00001530: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
< │ │ │ │ +00001620: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00001630: 6e6f 223e 2020 2031 333c 2f73 7061 6e3e no"> 13 │ │ │ │ +00001640: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ +00001660: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000016b0: 2031 343c 2f73 7061 6e3e 3c73 7061 6e20 14 │ │ │ │ +000016d0: 2f2f 2020 2059 6f75 206d 6179 206f 6274 // You may obt │ │ │ │ +000016e0: 6169 6e20 6120 636f 7079 206f 6620 7468 ain a copy of th │ │ │ │ +000016f0: 6520 4170 6163 6865 204c 6963 656e 7365 e Apache License │ │ │ │ +00001700: 2061 743c 2f73 7061 6e3e 3c2f 6469 763e at
│ │ │ │ +00001710: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
16< │ │ │ │ +000017e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000017f0: 656e 7422 3e2f 2f20 2020 2020 2020 6874 ent">// ht │ │ │ │ +00001800: 7470 3a2f 2f77 7777 2e61 7061 6368 652e tp://www.apache. │ │ │ │ +00001810: 6f72 672f 6c69 6365 6e73 6573 2f4c 4943 org/licenses/LIC │ │ │ │ +00001820: 454e 5345 2d32 2e30 3c2f 7370 616e 3e3c ENSE-2.0< │ │ │ │ +00001830: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00001880: 2031 373c 2f73 7061 6e3e 3c73 7061 6e20 17 │ │ │ │ +000018a0: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
. │ │ │ │ +000018b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
. │ │ │ │ +00001970: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ +00001a30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ │ +00001b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00001b10: 3e3c 6120 6964 3d22 6c30 3030 3231 2220 > 21// KI │ │ │ │ +00001b70: 4e44 2c20 6569 7468 6572 2065 7870 7265 ND, either expre │ │ │ │ +00001b80: 7373 206f 7220 696d 706c 6965 642e 2053 ss or implied. S │ │ │ │ +00001b90: 6565 2074 6865 2041 7061 6368 6520 4c69 ee the Apache Li │ │ │ │ +00001ba0: 6365 6e73 6520 666f 7220 7468 6520 7370 cense for the sp │ │ │ │ +00001bb0: 6563 6966 6963 3c2f 7370 616e 3e3c 2f64 ecific.
2 │ │ │ │ +00001c10: 323c 2f73 7061 6e3e 3c73 7061 6e20 636c 2// │ │ │ │ +00001c30: 2020 206c 616e 6775 6167 6520 676f 7665 language gove │ │ │ │ +00001c40: 726e 696e 6720 7065 726d 6973 7369 6f6e rning permission │ │ │ │ +00001c50: 7320 616e 6420 6c69 6d69 7461 7469 6f6e s and limitation │ │ │ │ +00001c60: 7320 756e 6465 7220 7468 6520 4170 6163 s under the Apac │ │ │ │ +00001c70: 6865 204c 6963 656e 7365 2e3c 2f73 7061 he License.
.
23//.
24 │ │ │ │ +00001d50: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ +00001d60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00001d70: 3e3c 6120 6964 3d22 6c30 3030 3235 2220 > 25
#i │ │ │ │ +00001dd0: 666e 6465 6620 4f50 454e 5355 4244 4956 fndef OPENSUBDIV │ │ │ │ +00001de0: 335f 4f53 445f 4355 4441 5f45 5641 4c55 3_OSD_CUDA_EVALU │ │ │ │ +00001df0: 4154 4f52 5f48 3c2f 7370 616e 3e3c 2f64 ATOR_H.
2 │ │ │ │ +00001e50: 363c 2f73 7061 6e3e 3c73 7061 6e20 636c 6#define OPENS │ │ │ │ +00001e80: 5542 4449 5633 5f4f 5344 5f43 5544 415f UBDIV3_OSD_CUDA_ │ │ │ │ +00001e90: 4556 414c 5541 544f 525f 483c 2f73 7061 EVALUATOR_H
.
27 .
│ │ │ │ +00001f50: 3238 3c2f 7370 616e 3e3c 7370 616e 2063 28#include &qu │ │ │ │ +00001f80: 6f74 3b2e 2e2f 7665 7273 696f 6e2e 6826 ot;../version.h& │ │ │ │ +00001f90: 7175 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 quot;.
29 │ │ │ │ +00001ff0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ +00002000: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00002010: 3e3c 6120 6964 3d22 6c30 3030 3330 2220 > 30#i │ │ │ │ +00002070: 6e63 6c75 6465 2026 6c74 3b76 6563 746f nclude <vecto │ │ │ │ +00002080: 7226 6774 3b3c 2f73 7061 6e3e 3c2f 6469 r>.
31 │ │ │ │ +000020e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 #include " │ │ │ │ +00002110: 3b2e 2e2f 6f73 642f 6275 6666 6572 4465 ;../osd/bufferDe │ │ │ │ +00002120: 7363 7269 7074 6f72 2e68 2671 756f 743b scriptor.h" │ │ │ │ +00002130: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +00002150: 3c61 2069 643d 226c 3030 3033 3222 206e 32#in │ │ │ │ +000021b0: 636c 7564 6520 2671 756f 743b 2e2e 2f6f clude "../o │ │ │ │ +000021c0: 7364 2f74 7970 6573 2e68 2671 756f 743b sd/types.h" │ │ │ │ +000021d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +000021f0: 3c61 2069 643d 226c 3030 3033 3322 206e 33
..
< │ │ │ │ +00002330: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00002340: 6e6f 223e 2020 2033 353c 2f73 7061 6e3e no"> 35 │ │ │ │ +00002350: 3c73 7061 6e20 636c 6173 733d 226b 6579 namespace │ │ │ │ +00002370: 3c2f 7370 616e 3e4f 5045 4e53 5542 4449 OPENSUBDI │ │ │ │ +00002380: 565f 5645 5253 494f 4e20 7b3c 2f64 6976 V_VERSION {
.
36< │ │ │ │ +000023e0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ +00002400: 3c61 2069 643d 226c 3030 3033 3722 206e 37
namespac │ │ │ │ +00002460: 6520 3c2f 7370 616e 3e46 6172 207b 3c2f e Far {.
│ │ │ │ +000024c0: 3338 3c2f 7370 616e 3e20 2020 203c 7370 38 class │ │ │ │ +000024f0: 5061 7463 6854 6162 6c65 3b3c 2f64 6976 PatchTable;
.
39< │ │ │ │ +00002550: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ +00002570: 636c 6173 7320 3c2f 7370 616e 3e53 7465 class Ste │ │ │ │ +00002580: 6e63 696c 5461 626c 653b 3c2f 6469 763e ncilTable;
│ │ │ │ +00002590: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +000025c0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 40 c │ │ │ │ +00002600: 6c61 7373 203c 2f73 7061 6e3e 4c69 6d69 lass Limi │ │ │ │ +00002610: 7453 7465 6e63 696c 5461 626c 653b 3c2f tStencilTable;.
│ │ │ │ +00002670: 3431 3c2f 7370 616e 3e7d 3c2f 6469 763e 41}
│ │ │ │ +00002680: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +000026f0: 6120 6964 3d22 6c30 3030 3433 2220 6e61 a id="l00043" na │ │ │ │ +00002700: 6d65 3d22 6c30 3030 3433 223e 3c2f 613e me="l00043"> │ │ │ │ +00002710: 3c73 7061 6e20 636c 6173 733d 226c 696e 43namespace │ │ │ │ +00002750: 203c 2f73 7061 6e3e 4f73 6420 7b3c 2f64 Osd {.
4 │ │ │ │ +000027b0: 343c 2f73 7061 6e3e 203c 2f64 6976 3e0a 4
. │ │ │ │ +000027c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
│ │ │ │ +000028f0: 2020 3533 3c2f 7370 616e 3e3c 7370 616e 53public:< │ │ │ │ +00002920: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
54 sta │ │ │ │ +000029e0: 7469 633c 2f73 7061 6e3e 203c 6120 636c tic CudaStenc │ │ │ │ +00002a20: 696c 5461 626c 653c 2f61 3e20 2a3c 6120 ilTable *Cr │ │ │ │ +00002a80: 6561 7465 3c2f 613e 283c 6120 636c 6173 eate(Far::Stenci │ │ │ │ +00002ac0: 6c54 6162 6c65 3c2f 613e 203c 7370 616e lTable const *s │ │ │ │ +00002af0: 7465 6e63 696c 5461 626c 652c 3c2f 6469 tencilTable,.
55 │ │ │ │ +00002b50: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00002b60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00002b70: 2020 2020 2020 2020 2020 203c 7370 616e void │ │ │ │ +00002ba0: 202a 6465 7669 6365 436f 6e74 6578 7420 *deviceContext │ │ │ │ +00002bb0: 3d20 4e55 4c4c 2920 7b3c 2f64 6976 3e0a = NULL) {
. │ │ │ │ +00002bc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +00002c60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00002c70: 3e3c 6120 6964 3d22 6c30 3030 3537 2220 > 57 return new CudaStencil │ │ │ │ +00002d60: 5461 626c 653c 2f61 3e28 7374 656e 6369 Table(stenci │ │ │ │ +00002d70: 6c54 6162 6c65 293b 3c2f 6469 763e 0a3c lTable);
.< │ │ │ │ +00002d80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00002d90: 3e3c 6120 6964 3d22 6c30 3030 3538 2220 > 58 }
.< │ │ │ │ +00002de0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00002df0: 3e3c 6120 6964 3d22 6c30 3030 3539 2220 > 5 │ │ │ │ +00002e70: 393c 2f61 3e3c 2f73 7061 6e3e 2020 2020 9 │ │ │ │ +00002e80: 3c73 7061 6e20 636c 6173 733d 226b 6579 static │ │ │ │ +00002ed0: 4375 6461 5374 656e 6369 6c54 6162 6c65 CudaStencilTable │ │ │ │ +00002ee0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *Create(Fa │ │ │ │ +00002f70: 723a 3a4c 696d 6974 5374 656e 6369 6c54 r::LimitStencilT │ │ │ │ +00002f80: 6162 6c65 3c2f 613e 203c 7370 616e 2063 able c │ │ │ │ +00002fa0: 6f6e 7374 3c2f 7370 616e 3e20 2a6c 696d onst *lim │ │ │ │ +00002fb0: 6974 5374 656e 6369 6c54 6162 6c65 2c3c itStencilTable,< │ │ │ │ +00002fc0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00003010: 2036 303c 2f73 7061 6e3e 2020 2020 2020 60 │ │ │ │ +00003020: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00003030: 2020 2020 2020 2020 2020 2020 2020 3c73 void *deviceConte │ │ │ │ +00003070: 7874 203d 204e 554c 4c29 207b 3c2f 6469 xt = NULL) {.
61 │ │ │ │ +000030d0: 3c2f 7370 616e 3e20 2020 2020 2020 2028 ( │ │ │ │ +000030e0: 766f 6964 2964 6576 6963 6543 6f6e 7465 void)deviceConte │ │ │ │ +000030f0: 7874 3b20 203c 7370 616e 2063 6c61 7373 xt; // un │ │ │ │ +00003110: 7573 6564 3c2f 7370 616e 3e3c 2f64 6976 used
.
62< │ │ │ │ +00003170: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> return new< │ │ │ │ +000031c0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> CudaSten │ │ │ │ +00003220: 6369 6c54 6162 6c65 3c2f 613e 286c 696d cilTable(lim │ │ │ │ +00003230: 6974 5374 656e 6369 6c54 6162 6c65 293b itStencilTable); │ │ │ │ +00003240: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00003290: 2020 3633 3c2f 7370 616e 3e20 2020 207d 63 } │ │ │ │ +000032a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +000032f0: 2020 3634 3c2f 7370 616e 3e20 3c2f 6469 64 .
│ │ │ │ +00003390: 2020 2036 353c 2f61 3e3c 2f73 7061 6e3e 65 │ │ │ │ +000033a0: 2020 2020 3c73 7061 6e20 636c 6173 733d explic │ │ │ │ +000033c0: 6974 3c2f 7370 616e 3e20 3c61 2063 6c61 it CudaS │ │ │ │ +00003420: 7465 6e63 696c 5461 626c 653c 2f61 3e28 tencilTable( │ │ │ │ +00003430: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Far: │ │ │ │ +00003460: 3a53 7465 6e63 696c 5461 626c 653c 2f61 :StencilTable const *stencilTab │ │ │ │ +000034a0: 6c65 293b 3c2f 6469 763e 0a3c 6469 7620 le);
.
66 explicit CudaStencilTa │ │ │ │ +000035d0: 626c 653c 2f61 3e28 3c61 2063 6c61 7373 ble(Far::LimitSt │ │ │ │ +00003610: 656e 6369 6c54 6162 6c65 3c2f 613e 203c encilTable < │ │ │ │ +00003620: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00003630: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const *limitStencilT │ │ │ │ +00003650: 6162 6c65 293b 3c2f 6469 763e 0a3c 6469 able);
.< │ │ │ │ +00003670: 6120 6964 3d22 6c30 3030 3637 2220 6e61 a id="l00067" na │ │ │ │ +00003680: 6d65 3d22 6c30 3030 3637 223e 3c2f 613e me="l00067"> │ │ │ │ +00003690: 3c73 7061 6e20 636c 6173 733d 226c 696e 67< │ │ │ │ +000036f0: 2f61 3e3c 2f73 7061 6e3e 2020 2020 3c61 /a> ~ │ │ │ │ +00003750: 4375 6461 5374 656e 6369 6c54 6162 6c65 CudaStencilTable │ │ │ │ +00003760: 3c2f 613e 2829 3b3c 2f64 6976 3e0a 3c64 ();
. │ │ │ │ +00003780: 3c61 2069 643d 226c 3030 3036 3822 206e 68
.
69 │ │ │ │ +00003820: 2020 3c73 7061 6e20 636c 6173 733d 2263 // inter │ │ │ │ +00003840: 6661 6365 7320 6e65 6564 6564 2066 6f72 faces needed for │ │ │ │ +00003850: 2043 7564 6143 6f6d 7075 7465 3c2f 7370 CudaCompute
.
70 │ │ │ │ +00003900: 3c2f 7370 616e 3e20 2020 203c 7370 616e void │ │ │ │ +00003930: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *GetSizesBuffe │ │ │ │ +00003990: 723c 2f61 3e28 293c 7370 616e 2063 6c61 r() co │ │ │ │ +000039b0: 6e73 7420 3c2f 7370 616e 3e7b 203c 7370 nst { void ComputeVerte │ │ │ │ -00003a40: 7856 6572 7465 784d 6173 6b3c 2f61 3e28 xVertexMask( │ │ │ │ -00003a50: 5645 5254 4558 203c 7370 616e 2063 6c61 VERTEX con │ │ │ │ -00003a70: 7374 3c2f 7370 616e 3e26 616d 703b 2076 st& v │ │ │ │ -00003a80: 6572 7465 784e 6569 6768 626f 7268 6f6f ertexNeighborhoo │ │ │ │ -00003a90: 642c 204d 4153 4b26 616d 703b 2076 6572 d, MASK& ver │ │ │ │ -00003aa0: 7465 7856 6572 7465 784d 6173 6b2c 3c2f texVertexMask,.
1 │ │ │ │ -00003b00: 3134 3c2f 7370 616e 3e20 2020 2020 2020 14 │ │ │ │ -00003b10: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00003b20: 2020 2020 2020 2020 2020 2020 203c 6120 Crease::Rule parentRule = < │ │ │ │ -00003ba0: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ -00003bb0: 5f65 6e75 6d76 616c 7565 2220 6872 6566 _enumvalue" href │ │ │ │ -00003bc0: 3d22 6130 3133 3235 2e68 746d 6c23 6131 ="a01325.html#a1 │ │ │ │ -00003bd0: 3166 6364 3531 6566 3836 3131 3866 3635 1fcd51ef86118f65 │ │ │ │ -00003be0: 6536 3033 6331 3437 3433 3737 6137 3861 e603c1474377a78a │ │ │ │ -00003bf0: 6232 3939 6165 6662 3236 3031 3361 3739 b299aefb26013a79 │ │ │ │ -00003c00: 6435 3231 3931 6137 3838 3766 6561 3533 d52191a7887fea53 │ │ │ │ -00003c10: 223e 4372 6561 7365 3a3a 5255 4c45 5f55 ">Crease::RULE_U │ │ │ │ -00003c20: 4e4b 4e4f 574e 3c2f 613e 2c3c 2f64 6976 NKNOWN,
.
115< │ │ │ │ -00003c80: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -00003c90: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00003ca0: 2020 2020 2020 2020 2020 3c61 2063 6c61 Cr │ │ │ │ -00003d00: 6561 7365 3a3a 5275 6c65 3c2f 613e 2063 ease::Rule c │ │ │ │ -00003d10: 6869 6c64 5275 6c65 203d 203c 6120 636c hildRule = Cr │ │ │ │ -00003d90: 6561 7365 3a3a 5255 4c45 5f55 4e4b 4e4f ease::RULE_UNKNO │ │ │ │ -00003da0: 574e 3c2f 613e 2920 3c73 7061 6e20 636c WN) co │ │ │ │ -00003dc0: 6e73 743c 2f73 7061 6e3e 3b3c 2f64 6976 nst;
.
116< │ │ │ │ -00003e20: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -00003e40: 3c61 2069 643d 226c 3030 3134 3122 206e 141 temp │ │ │ │ -00003ea0: 6c61 7465 3c2f 7370 616e 3e20 266c 743b late < │ │ │ │ -00003eb0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename VERTEX, typename
MASK>.
142 │ │ │ │ -00003f60: 3c2f 7370 616e 3e20 2020 203c 7370 616e void │ │ │ │ -00003f90: 203c 6120 636c 6173 733d 2263 6f64 6520 ComputeVertexL │ │ │ │ -00003ff0: 696d 6974 4d61 736b 3c2f 613e 2856 4552 imitMask(VER │ │ │ │ -00004000: 5445 5820 3c73 7061 6e20 636c 6173 733d TEX const< │ │ │ │ -00004020: 2f73 7061 6e3e 2661 6d70 3b20 7665 7274 /span>& vert │ │ │ │ -00004030: 6578 4e65 6967 6862 6f72 686f 6f64 2c20 exNeighborhood, │ │ │ │ -00004040: 4d41 534b 2661 6d70 3b20 706f 7369 7469 MASK& positi │ │ │ │ -00004050: 6f6e 4d61 736b 2c3c 2f64 6976 3e0a 3c64 onMask,
. │ │ │ │ -00004070: 3c61 2069 643d 226c 3030 3134 3322 206e 143 │ │ │ │ -000040c0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000040d0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 Crease::Ru │ │ │ │ -00004130: 6c65 3c2f 613e 2076 6572 7465 7852 756c le vertexRul │ │ │ │ -00004140: 6529 203c 7370 616e 2063 6c61 7373 3d22 e) const;
.< │ │ │ │ -00004180: 6120 6964 3d22 6c30 3031 3434 2220 6e61 a id="l00144" na │ │ │ │ -00004190: 6d65 3d22 6c30 3031 3434 223e 3c2f 613e me="l00144"> │ │ │ │ -000041a0: 3c73 7061 6e20 636c 6173 733d 226c 696e 144
.
145 │ │ │ │ -00004220: 203c 7370 616e 2063 6c61 7373 3d22 6b65 template< │ │ │ │ -00004240: 2f73 7061 6e3e 2026 6c74 3b3c 7370 616e /span> <typename │ │ │ │ -00004270: 2056 4552 5445 582c 203c 7370 616e 2063 VERTEX, t │ │ │ │ -00004290: 7970 656e 616d 653c 2f73 7061 6e3e 204d ypename M │ │ │ │ -000042a0: 4153 4b26 6774 3b3c 2f64 6976 3e0a 3c64 ASK>
. │ │ │ │ -000042c0: 3c61 2069 643d 226c 3030 3134 3622 206e 146 │ │ │ │ -00004320: 766f 6964 3c2f 7370 616e 3e20 3c61 2063 void Com │ │ │ │ -00004380: 7075 7465 5665 7274 6578 4c69 6d69 744d puteVertexLimitM │ │ │ │ -00004390: 6173 6b3c 2f61 3e28 5645 5254 4558 203c ask(VERTEX < │ │ │ │ -000043a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000043b0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const& vertexNei │ │ │ │ -000043d0: 6768 626f 7268 6f6f 642c 204d 4153 4b26 ghborhood, MASK& │ │ │ │ -000043e0: 616d 703b 2070 6f73 6974 696f 6e4d 6173 amp; positionMas │ │ │ │ -000043f0: 6b2c 3c2f 6469 763e 0a3c 6469 7620 636c k,
.
147 │ │ │ │ -00004450: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00004460: 2020 2020 2020 2020 2020 2020 204d 4153 MAS │ │ │ │ -00004470: 4b26 616d 703b 2074 616e 6765 6e74 314d K& tangent1M │ │ │ │ -00004480: 6173 6b2c 204d 4153 4b26 616d 703b 2074 ask, MASK& t │ │ │ │ -00004490: 616e 6765 6e74 324d 6173 6b2c 3c2f 6469 angent2Mask,.
148 │ │ │ │ -000044f0: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ -00004500: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00004510: 2020 2020 2020 203c 6120 636c 6173 733d Creas │ │ │ │ -00004570: 653a 3a52 756c 653c 2f61 3e20 7665 7274 e::Rule vert │ │ │ │ -00004580: 6578 5275 6c65 2920 3c73 7061 6e20 636c exRule) co │ │ │ │ -000045a0: 6e73 743c 2f73 7061 6e3e 3b3c 2f64 6976 nst;
.
149< │ │ │ │ -00004600: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -00004620: 3c61 2069 643d 226c 3030 3135 3022 206e 150
//
.
< │ │ │ │ -000046c0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000046d0: 6e6f 223e 2020 3135 313c 2f73 7061 6e3e no"> 151 │ │ │ │ -000046e0: 2020 2020 3c73 7061 6e20 636c 6173 733d // St │ │ │ │ -00004700: 6174 6963 206d 6574 686f 6473 2064 6566 atic methods def │ │ │ │ -00004710: 696e 696e 6720 7472 6169 7473 2f70 726f ining traits/pro │ │ │ │ -00004720: 7065 7274 6965 7320 6f66 2074 6865 2073 perties of the s │ │ │ │ -00004730: 6368 656d 653a 3c2f 7370 616e 3e3c 2f64 cheme:.
15 │ │ │ │ -00004790: 323c 2f73 7061 6e3e 2020 2020 3c73 7061 2 //
..
154 static │ │ │ │ -00004a20: 3c73 7061 6e20 636c 6173 733d 226b 6579 int GetRegul │ │ │ │ -00004aa0: 6172 4661 6365 5369 7a65 3c2f 613e 2829 arFaceSize() │ │ │ │ -00004ab0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -00004b00: 3c61 2063 6c61 7373 3d22 6c69 6e65 2220 155 s │ │ │ │ -00004b70: 7461 7469 633c 2f73 7061 6e3e 203c 7370 tatic int GetRegularV │ │ │ │ -00004c00: 6572 7465 7856 616c 656e 6365 3c2f 613e ertexValence │ │ │ │ -00004c10: 2829 3b3c 2f64 6976 3e0a 3c64 6976 2063 ();
.
156 │ │ │ │ -00004cb0: 3c2f 7370 616e 3e20 2020 203c 7370 616e static < │ │ │ │ -00004ce0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00004cf0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int GetLocalN │ │ │ │ -00004d60: 6569 6768 626f 7268 6f6f 6453 697a 653c eighborhoodSize< │ │ │ │ -00004d70: 2f61 3e28 293b 3c2f 6469 763e 0a3c 6469 /a>();
.< │ │ │ │ -00004d90: 6120 6964 3d22 6c30 3031 3537 2220 6e61 a id="l00157" na │ │ │ │ -00004da0: 6d65 3d22 6c30 3031 3537 223e 3c2f 613e me="l00157"> │ │ │ │ -00004db0: 3c73 7061 6e20 636c 6173 733d 226c 696e 157
.
158protected:
.
159 │ │ │ │ -00004eb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00004f00: 2031 3630 3c2f 7370 616e 3e20 2020 203c 160 < │ │ │ │ -00004f10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00004f20: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
1 │ │ │ │ -00004f80: 3631 3c2f 7370 616e 3e20 2020 203c 7370 61 // Supportin │ │ │ │ -00004fb0: 6720 696e 7465 726e 616c 206d 6574 686f g internal metho │ │ │ │ -00004fc0: 6473 202d 2d20 6f70 7469 6f6e 616c 6c79 ds -- optionally │ │ │ │ -00004fd0: 2069 6d70 6c65 6d65 6e74 6564 2c20 6465 implemented, de │ │ │ │ -00004fe0: 7065 6e64 696e 6720 6f6e 2073 7065 6369 pending on speci │ │ │ │ -00004ff0: 616c 697a 6174 696f 6e3a 3c2f 7370 616e alization:
.
│ │ │ │ -00005050: 2020 3136 323c 2f73 7061 6e3e 2020 2020 162 │ │ │ │ -00005060: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ -00005080: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000050d0: 3136 333c 2f73 7061 6e3e 203c 2f64 6976 163
.
164< │ │ │ │ -00005130: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00005150: 2f2f 2020 5375 6264 6976 6973 696f 6e2f // Subdivision/ │ │ │ │ -00005160: 7265 6669 6e65 6d65 6e74 206d 6173 6b73 refinement masks │ │ │ │ -00005170: 202d 2d20 7477 6f20 666f 7220 6564 6765 -- two for edge │ │ │ │ -00005180: 2d76 6572 7469 6365 7320 616e 6420 7468 -vertices and th │ │ │ │ -00005190: 7265 6520 666f 7220 7665 7274 6578 2d76 ree for vertex-v │ │ │ │ -000051a0: 6572 7469 6365 733a 3c2f 7370 616e 3e3c ertices:< │ │ │ │ -000051b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00005200: 3136 353c 2f73 7061 6e3e 2020 2020 3c73 165 //.
16 │ │ │ │ -00005280: 363c 2f73 7061 6e3e 2020 2020 3c73 7061 6 template <type │ │ │ │ -000052d0: 6e61 6d65 3c2f 7370 616e 3e20 4544 4745 name EDGE │ │ │ │ -000052e0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , typename │ │ │ │ -00005300: 3c2f 7370 616e 3e20 4d41 534b 2667 743b MASK> │ │ │ │ -00005310: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00005360: 2031 3637 3c2f 7370 616e 3e20 2020 203c 167 < │ │ │ │ -00005370: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00005380: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void assignCrea │ │ │ │ -000053f0: 7365 4d61 736b 466f 7245 6467 653c 2f61 seMaskForEdge(EDGE con │ │ │ │ -00005420: 7374 3c2f 7370 616e 3e26 616d 703b 2065 st& e │ │ │ │ -00005430: 6467 652c 204d 4153 4b26 616d 703b 206d dge, MASK& m │ │ │ │ -00005440: 6173 6b29 203c 7370 616e 2063 6c61 7373 ask) const │ │ │ │ -00005460: 3c2f 7370 616e 3e3b 3c2f 6469 763e 0a3c ;
.< │ │ │ │ -00005470: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00005480: 3e3c 6120 6964 3d22 6c30 3031 3638 2220 > 168 tem │ │ │ │ -000054e0: 706c 6174 653c 2f73 7061 6e3e 2026 6c74 plate < │ │ │ │ -000054f0: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;typename< │ │ │ │ -00005510: 2f73 7061 6e3e 2045 4447 452c 203c 7370 /span> EDGE, typename MASK>
.
│ │ │ │ -000055e0: 2031 3639 3c2f 613e 3c2f 7370 616e 3e20 169 │ │ │ │ -000055f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 voi │ │ │ │ -00005610: 643c 2f73 7061 6e3e 203c 6120 636c 6173 d assign │ │ │ │ -00005670: 536d 6f6f 7468 4d61 736b 466f 7245 6467 SmoothMaskForEdg │ │ │ │ -00005680: 653c 2f61 3e28 4544 4745 203c 7370 616e e(EDGE const&am │ │ │ │ -000056b0: 703b 2065 6467 652c 204d 4153 4b26 616d p; edge, MASK&am │ │ │ │ -000056c0: 703b 206d 6173 6b29 203c 7370 616e 2063 p; mask) c │ │ │ │ -000056e0: 6f6e 7374 3c2f 7370 616e 3e3b 3c2f 6469 onst;.
170 │ │ │ │ -00005740: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ -00005750: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00005760: 3e3c 6120 6964 3d22 6c30 3031 3731 2220 > 171 tem │ │ │ │ -000057c0: 706c 6174 653c 2f73 7061 6e3e 2026 6c74 plate < │ │ │ │ -000057d0: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;typename< │ │ │ │ -000057f0: 2f73 7061 6e3e 2056 4552 5445 582c 203c /span> VERTEX, < │ │ │ │ -00005800: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00005810: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename
MASK>.
17 │ │ │ │ -00005880: 323c 2f73 7061 6e3e 2020 2020 3c73 7061 2 void assignCornerM │ │ │ │ -00005910: 6173 6b46 6f72 5665 7274 6578 3c2f 613e askForVertex │ │ │ │ -00005920: 2856 4552 5445 5820 3c73 7061 6e20 636c (VERTEX co │ │ │ │ -00005940: 6e73 743c 2f73 7061 6e3e 2661 6d70 3b20 nst& │ │ │ │ -00005950: 6564 6765 2c20 4d41 534b 2661 6d70 3b20 edge, MASK& │ │ │ │ -00005960: 6d61 736b 2920 3c73 7061 6e20 636c 6173 mask) cons │ │ │ │ -00005980: 743c 2f73 7061 6e3e 3b3c 2f64 6976 3e0a t;
. │ │ │ │ -00005990: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -000059c0: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 173 te │ │ │ │ -00005a00: 6d70 6c61 7465 3c2f 7370 616e 3e20 266c mplate &l │ │ │ │ -00005a10: 743b 3c73 7061 6e20 636c 6173 733d 226b t;typename │ │ │ │ -00005a30: 3c2f 7370 616e 3e20 5645 5254 4558 2c20 VERTEX, │ │ │ │ -00005a40: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename MASK>.
174 │ │ │ │ -00005b30: 766f 6964 3c2f 7370 616e 3e20 3c61 2063 void ass │ │ │ │ -00005b90: 6967 6e43 7265 6173 654d 6173 6b46 6f72 ignCreaseMaskFor │ │ │ │ -00005ba0: 5665 7274 6578 3c2f 613e 2856 4552 5445 Vertex(VERTE │ │ │ │ -00005bb0: 5820 3c73 7061 6e20 636c 6173 733d 226b X const& edge, │ │ │ │ -00005be0: 4d41 534b 2661 6d70 3b20 6d61 736b 2c20 MASK& mask, │ │ │ │ -00005bf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int const │ │ │ │ -00005c30: 3c2f 7370 616e 3e20 6372 6561 7365 456e creaseEn │ │ │ │ -00005c40: 6473 5b32 5d29 203c 7370 616e 2063 6c61 ds[2]) con │ │ │ │ -00005c60: 7374 3c2f 7370 616e 3e3b 3c2f 6469 763e st;
│ │ │ │ -00005c70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00005ca0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 175 t │ │ │ │ -00005ce0: 656d 706c 6174 653c 2f73 7061 6e3e 2026 emplate & │ │ │ │ -00005cf0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;typenam │ │ │ │ -00005d10: 653c 2f73 7061 6e3e 2056 4552 5445 582c e VERTEX, │ │ │ │ -00005d20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typename< │ │ │ │ -00005d40: 2f73 7061 6e3e 204d 4153 4b26 6774 3b3c /span> MASK>< │ │ │ │ -00005d50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
176 void as │ │ │ │ -00005e70: 7369 676e 536d 6f6f 7468 4d61 736b 466f signSmoothMaskFo │ │ │ │ -00005e80: 7256 6572 7465 783c 2f61 3e28 5645 5254 rVertex(VERT │ │ │ │ -00005e90: 4558 203c 7370 616e 2063 6c61 7373 3d22 EX const& edge, │ │ │ │ -00005ec0: 204d 4153 4b26 616d 703b 206d 6173 6b29 MASK& mask) │ │ │ │ -00005ed0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const;
.
177 │ │ │ │ -00005f50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00005fa0: 2031 3738 3c2f 7370 616e 3e20 2020 203c 178 < │ │ │ │ -00005fb0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00005fc0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
1 │ │ │ │ -00006020: 3739 3c2f 7370 616e 3e20 2020 203c 7370 79 // Limit mas │ │ │ │ -00006050: 6b73 2066 6f72 2070 6f73 6974 696f 6e20 ks for position │ │ │ │ -00006060: 616e 6420 7461 6e67 656e 7473 2061 7420 and tangents at │ │ │ │ -00006070: 7665 7274 6963 6573 202d 2d20 7468 7265 vertices -- thre │ │ │ │ -00006080: 6520 6361 7365 7320 666f 7220 6561 6368 e cases for each │ │ │ │ -00006090: 3a3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c :
.< │ │ │ │ -000060a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000060b0: 3e3c 6120 6964 3d22 6c30 3031 3830 2220 > 180 //< │ │ │ │ -00006110: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -00006130: 6120 6964 3d22 6c30 3031 3831 2220 6e61 a id="l00181" na │ │ │ │ -00006140: 6d65 3d22 6c30 3031 3831 223e 3c2f 613e me="l00181"> │ │ │ │ -00006150: 3c73 7061 6e20 636c 6173 733d 226c 696e 181 templ │ │ │ │ -00006190: 6174 653c 2f73 7061 6e3e 2026 6c74 3b3c ate << │ │ │ │ -000061a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000061b0: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename
VERTEX, typename MASK>
.
│ │ │ │ -00006290: 2031 3832 3c2f 613e 3c2f 7370 616e 3e20 182 │ │ │ │ -000062a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 voi │ │ │ │ -000062c0: 643c 2f73 7061 6e3e 203c 6120 636c 6173 d assign │ │ │ │ -00006320: 436f 726e 6572 4c69 6d69 744d 6173 6b3c CornerLimitMask< │ │ │ │ -00006330: 2f61 3e28 5645 5254 4558 203c 7370 616e /a>(VERTEX const&am │ │ │ │ -00006360: 703b 2076 6572 7465 782c 204d 4153 4b26 p; vertex, MASK& │ │ │ │ -00006370: 616d 703b 2070 6f73 2920 3c73 7061 6e20 amp; pos) │ │ │ │ -00006390: 636f 6e73 743c 2f73 7061 6e3e 3b3c 2f64 const;.
18 │ │ │ │ -000063f0: 333c 2f73 7061 6e3e 2020 2020 3c73 7061 3 template <type │ │ │ │ -00006440: 6e61 6d65 3c2f 7370 616e 3e20 5645 5254 name VERT │ │ │ │ -00006450: 4558 2c20 3c73 7061 6e20 636c 6173 733d EX, typena │ │ │ │ -00006470: 6d65 3c2f 7370 616e 3e20 4d41 534b 2667 me MASK&g │ │ │ │ -00006480: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
184< │ │ │ │ -00006520: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> void │ │ │ │ -00006550: 3c61 2063 6c61 7373 3d22 636f 6465 2068 assignCreaseLim │ │ │ │ -000065b0: 6974 4d61 736b 3c2f 613e 2856 4552 5445 itMask(VERTE │ │ │ │ -000065c0: 5820 3c73 7061 6e20 636c 6173 733d 226b X const& vertex │ │ │ │ -000065f0: 2c20 4d41 534b 2661 6d70 3b20 706f 732c , MASK& pos, │ │ │ │ -00006600: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int cons │ │ │ │ -00006640: 743c 2f73 7061 6e3e 2063 7265 6173 6545 t creaseE │ │ │ │ -00006650: 6e64 735b 325d 2920 3c73 7061 6e20 636c nds[2]) co │ │ │ │ -00006670: 6e73 743c 2f73 7061 6e3e 3b3c 2f64 6976 nst;
.
185< │ │ │ │ -000066d0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -000066f0: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ -00006700: 266c 743b 3c73 7061 6e20 636c 6173 733d <typena │ │ │ │ -00006720: 6d65 3c2f 7370 616e 3e20 5645 5254 4558 me VERTEX │ │ │ │ -00006730: 2c20 3c73 7061 6e20 636c 6173 733d 226b , typename │ │ │ │ -00006750: 3c2f 7370 616e 3e20 4d41 534b 2667 743b MASK> │ │ │ │ -00006760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ │ -000067b0: 6120 636c 6173 733d 226c 696e 6522 2068 a class="line" h │ │ │ │ -000067c0: 7265 663d 2261 3031 3333 332e 6874 6d6c ref="a01333.html │ │ │ │ -000067d0: 2361 3733 3663 3130 3934 3463 6239 3231 #a736c10944cb921 │ │ │ │ -000067e0: 6233 3334 6662 6438 6238 3138 3636 6435 b334fbd8b81866d5 │ │ │ │ -000067f0: 3966 223e 2020 3138 363c 2f61 3e3c 2f73 9f"> 186 void a │ │ │ │ -00006880: 7373 6967 6e53 6d6f 6f74 684c 696d 6974 ssignSmoothLimit │ │ │ │ -00006890: 4d61 736b 3c2f 613e 2856 4552 5445 5820 Mask(VERTEX │ │ │ │ -000068a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const& vertex, │ │ │ │ -000068d0: 4d41 534b 2661 6d70 3b20 706f 7329 203c MASK& pos) < │ │ │ │ -000068e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000068f0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const;
.
187 .
1 │ │ │ │ -000069b0: 3838 3c2f 7370 616e 3e20 2020 203c 7370 88 template <typ │ │ │ │ -00006a00: 656e 616d 653c 2f73 7061 6e3e 2056 4552 ename VER │ │ │ │ -00006a10: 5445 582c 203c 7370 616e 2063 6c61 7373 TEX, typen │ │ │ │ -00006a30: 616d 653c 2f73 7061 6e3e 204d 4153 4b26 ame MASK& │ │ │ │ -00006a40: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
189 │ │ │ │ -00006ae0: 3c2f 7370 616e 3e20 2020 203c 7370 616e void │ │ │ │ -00006b10: 203c 6120 636c 6173 733d 2263 6f64 6520 assignCornerLi │ │ │ │ -00006b70: 6d69 7454 616e 6765 6e74 4d61 736b 733c mitTangentMasks< │ │ │ │ -00006b80: 2f61 3e28 5645 5254 4558 203c 7370 616e /a>(VERTEX const&am │ │ │ │ -00006bb0: 703b 2076 6572 7465 782c 204d 4153 4b26 p; vertex, MASK& │ │ │ │ -00006bc0: 616d 703b 2074 616e 312c 204d 4153 4b26 amp; tan1, MASK& │ │ │ │ -00006bd0: 616d 703b 2074 616e 3229 203c 7370 616e amp; tan2) const;.
1 │ │ │ │ -00006c50: 3930 3c2f 7370 616e 3e20 2020 203c 7370 90 template <typ │ │ │ │ -00006ca0: 656e 616d 653c 2f73 7061 6e3e 2056 4552 ename VER │ │ │ │ -00006cb0: 5445 582c 203c 7370 616e 2063 6c61 7373 TEX, typen │ │ │ │ -00006cd0: 616d 653c 2f73 7061 6e3e 204d 4153 4b26 ame MASK& │ │ │ │ -00006ce0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
..
< │ │ │ │ -00006f30: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00006f40: 6e6f 223e 2020 3139 323c 2f73 7061 6e3e no"> 192 │ │ │ │ -00006f50: 2020 2020 3c73 7061 6e20 636c 6173 733d templa │ │ │ │ -00006f70: 7465 3c2f 7370 616e 3e20 266c 743b 3c73 te <typename VERTEX, typename MASK>
│ │ │ │ -00006fe0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00007010: 3c2f 613e 3c73 7061 6e20 636c 6173 733d │ │ │ │ -00007070: 3139 333c 2f61 3e3c 2f73 7061 6e3e 2020 193 │ │ │ │ -00007080: 2020 3c73 7061 6e20 636c 6173 733d 226b void │ │ │ │ -000070a0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 assignS │ │ │ │ -00007100: 6d6f 6f74 684c 696d 6974 5461 6e67 656e moothLimitTangen │ │ │ │ -00007110: 744d 6173 6b73 3c2f 613e 2856 4552 5445 tMasks(VERTE │ │ │ │ -00007120: 5820 3c73 7061 6e20 636c 6173 733d 226b X const& vertex │ │ │ │ -00007150: 2c20 4d41 534b 2661 6d70 3b20 7461 6e31 , MASK& tan1 │ │ │ │ -00007160: 2c20 4d41 534b 2661 6d70 3b20 7461 6e32 , MASK& tan2 │ │ │ │ -00007170: 2920 3c73 7061 6e20 636c 6173 733d 226b ) const;
.
< │ │ │ │ -000071d0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000071e0: 6e6f 223e 2020 3139 343c 2f73 7061 6e3e no"> 194 │ │ │ │ -000071f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00007240: 2020 3139 353c 2f73 7061 6e3e 3c73 7061 195private │ │ │ │ -00007270: 3a3c 2f64 6976 3e0a 3c64 6976 2063 6c61 :
.
│ │ │ │ -000072c0: 2020 3139 363c 2f73 7061 6e3e 2020 2020 196 │ │ │ │ -000072d0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Opti │ │ │ │ -00007300: 6f6e 733c 2f61 3e20 5f6f 7074 696f 6e73 ons _options │ │ │ │ -00007310: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -00007360: 2020 3139 373c 2f73 7061 6e3e 203c 2f64 197 .
19 │ │ │ │ -000073c0: 383c 2f73 7061 6e3e 3c73 7061 6e20 636c 8pr │ │ │ │ -000073e0: 6f74 6563 7465 643c 2f73 7061 6e3e 3a3c otected:< │ │ │ │ -000073f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00007440: 3139 393c 2f73 7061 6e3e 203c 2f64 6976 199
.
200< │ │ │ │ -000074a0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -000074c0: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
. │ │ │ │ -000074d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ -00007570: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ -00007600: 3c61 2069 643d 226c 3030 3230 3322 206e 203 // │ │ │ │ -00007660: 5765 206e 6565 6420 6120 6c6f 6361 6c20 We need a local │ │ │ │ -00007670: 2671 756f 743b 6d61 736b 2671 756f 743b "mask" │ │ │ │ -00007680: 2063 6c61 7373 2074 6f20 6265 2064 6563 class to be dec │ │ │ │ -00007690: 6c61 7265 6420 6c6f 6361 6c6c 7920 7769 lared locally wi │ │ │ │ -000076a0: 7468 696e 2074 6865 2076 6572 7465 782d thin the vertex- │ │ │ │ -000076b0: 7665 7274 6578 206d 6173 6b20 7175 6572 vertex mask quer │ │ │ │ -000076c0: 793c 2f73 7061 6e3e 3c2f 6469 763e 0a3c y
.< │ │ │ │ -000076d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000076e0: 3e3c 6120 6964 3d22 6c30 3032 3034 2220 > 204 // │ │ │ │ -00007740: 2074 6f20 686f 6c64 206f 6e65 206f 6620 to hold one of │ │ │ │ -00007750: 7468 6520 7477 6f20 706f 7373 6962 6c65 the two possible │ │ │ │ -00007760: 206d 6173 6b73 2072 6571 7569 7265 6420 masks required │ │ │ │ -00007770: 616e 6420 746f 2063 6f6d 6269 6e65 2074 and to combine t │ │ │ │ -00007780: 6865 206c 6f63 616c 206d 6173 6b20 7769 he local mask wi │ │ │ │ -00007790: 7468 2074 6865 206d 6173 6b3c 2f73 7061 th the mask
.
205 │ │ │ │ -00007800: 203c 7370 616e 2063 6c61 7373 3d22 636f // the c │ │ │ │ -00007820: 616c 6c65 7220 7072 6f76 6964 6573 2e20 aller provides. │ │ │ │ -00007830: 2049 7420 6861 7320 6265 656e 2070 6172 It has been par │ │ │ │ -00007840: 616d 6574 6572 697a 6564 2062 7920 266c ameterized by &l │ │ │ │ -00007850: 743b 5745 4947 4854 2667 743b 2073 6f20 t;WEIGHT> so │ │ │ │ -00007860: 7468 6174 2061 2076 6572 7369 6f6e 2063 that a version c │ │ │ │ -00007870: 6f6d 7061 7469 626c 653c 2f73 7061 6e3e ompatible │ │ │ │ -00007880: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000078d0: 2032 3036 3c2f 7370 616e 3e20 2020 203c 206 < │ │ │ │ -000078e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000078f0: 656e 7422 3e2f 2f20 2077 6974 6820 7468 ent">// with th │ │ │ │ -00007900: 6520 6361 6c6c 6572 2623 3339 3b73 206d e caller's m │ │ │ │ -00007910: 6173 6b20 636c 6173 7320 6973 2063 7265 ask class is cre │ │ │ │ -00007920: 6174 6564 2e3c 2f73 7061 6e3e 3c2f 6469 ated..
207 │ │ │ │ -00007980: 3c2f 7370 616e 3e20 2020 203c 7370 616e //
│ │ │ │ -000079b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -000079e0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 208 t │ │ │ │ -00007a20: 656d 706c 6174 653c 2f73 7061 6e3e 2026 emplate & │ │ │ │ -00007a30: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;typenam │ │ │ │ -00007a50: 653c 2f73 7061 6e3e 2057 4549 4748 5426 e WEIGHT& │ │ │ │ -00007a60: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
209 c │ │ │ │ -00007b00: 6c61 7373 203c 2f73 7061 6e3e 3c61 2063 lass LocalMas │ │ │ │ -00007b40: 6b3c 2f61 3e20 7b3c 2f64 6976 3e0a 3c64 k {
. │ │ │ │ -00007b60: 3c61 2069 643d 226c 3030 3231 3022 206e 210
.
211 │ │ │ │ -00007c00: 2020 3c73 7061 6e20 636c 6173 733d 226b public:
.< │ │ │ │ -00007c40: 6120 6964 3d22 6c30 3032 3132 2220 6e61 a id="l00212" na │ │ │ │ -00007c50: 6d65 3d22 6c30 3032 3132 223e 3c2f 613e me="l00212"> │ │ │ │ -00007c60: 3c73 7061 6e20 636c 6173 733d 226c 696e 212< │ │ │ │ -00007cc0: 2f61 3e3c 2f73 7061 6e3e 2020 2020 2020 /a> │ │ │ │ -00007cd0: 2020 3c73 7061 6e20 636c 6173 733d 226b typedef< │ │ │ │ -00007cf0: 2f73 7061 6e3e 2057 4549 4748 5420 3c61 /span> WEIGHT We │ │ │ │ -00007d50: 6967 6874 3c2f 613e 3b3c 2f64 6976 3e0a ight;
. │ │ │ │ -00007d60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
< │ │ │ │ -00007df0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00007e00: 6e6f 223e 2020 3231 343c 2f73 7061 6e3e no"> 214 │ │ │ │ -00007e10: 2020 2020 3c73 7061 6e20 636c 6173 733d public │ │ │ │ -00007e30: 3c2f 7370 616e 3e3a 3c2f 6469 763e 0a3c :
.< │ │ │ │ -00007e40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00007e50: 3e3c 6120 6964 3d22 6c30 3032 3135 2220 > 21 │ │ │ │ -00007ed0: 353c 2f61 3e3c 2f73 7061 6e3e 2020 2020 5 │ │ │ │ -00007ee0: 2020 2020 3c61 2063 6c61 7373 3d22 636f LocalMask(Weight* v │ │ │ │ -00007fa0: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , Weight* e, │ │ │ │ -00008000: 203c 6120 636c 6173 733d 2263 6f64 6520 Weight* f) │ │ │ │ -00008060: 3a20 5f76 5765 6967 6874 7328 7629 2c20 : _vWeights(v), │ │ │ │ -00008070: 5f65 5765 6967 6874 7328 6529 2c20 5f66 _eWeights(e), _f │ │ │ │ -00008080: 5765 6967 6874 7328 6629 207b 207d 3c2f Weights(f) { }.
216 ~Loca │ │ │ │ -00008190: 6c4d 6173 6b3c 2f61 3e28 2920 7b20 7d3c lMask() { }< │ │ │ │ -000081a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000081f0: 3231 373c 2f73 7061 6e3e 203c 2f64 6976 217
.
218< │ │ │ │ -00008250: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00008270: 7075 626c 6963 3c2f 7370 616e 3e3a 3c2f public:.
2 │ │ │ │ -000082d0: 3139 3c2f 7370 616e 3e20 3c2f 6469 763e 19
│ │ │ │ -000082e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00008310: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 220 //.
221 │ │ │ │ -000083b0: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ -000083c0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000083d0: 656e 7422 3e2f 2f20 204d 6574 686f 6473 ent">// Methods │ │ │ │ -000083e0: 2072 6571 7569 7265 6420 666f 7220 6765 required for ge │ │ │ │ -000083f0: 6e65 7261 6c20 6d61 736b 2061 7373 6967 neral mask assig │ │ │ │ -00008400: 6e6d 656e 7473 2061 6e64 2071 7565 7269 nments and queri │ │ │ │ -00008410: 6573 3a3c 2f73 7061 6e3e 3c2f 6469 763e es:
│ │ │ │ -00008420: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00008450: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 222 //.
│ │ │ │ -00008530: 2020 3232 333c 2f61 3e3c 2f73 7061 6e3e 223 │ │ │ │ -00008540: 2020 2020 2020 2020 3c73 7061 6e20 636c int Ge │ │ │ │ -000085c0: 744e 756d 5665 7274 6578 5765 6967 6874 tNumVertexWeight │ │ │ │ -000085d0: 733c 2f61 3e28 293c 7370 616e 2063 6c61 s() co │ │ │ │ -000085f0: 6e73 7420 3c2f 7370 616e 3e7b 203c 7370 nst { return _vCount; }< │ │ │ │ -00008630: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
224 int │ │ │ │ -00008700: 3c61 2063 6c61 7373 3d22 636f 6465 2068 GetNumEdgeWeigh │ │ │ │ -00008760: 7473 3c2f 613e 2829 3c73 7061 6e20 636c ts() │ │ │ │ -00008780: 2063 6f6e 7374 203c 2f73 7061 6e3e 7b20 const { │ │ │ │ -00008790: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ -000087b0: 3c2f 7370 616e 3e20 5f65 436f 756e 743b _eCount; │ │ │ │ -000087c0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
.
225< │ │ │ │ -00008860: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> int GetNumFaceWe │ │ │ │ -000088f0: 6967 6874 733c 2f61 3e28 293c 7370 616e ights() const { ret │ │ │ │ -00008940: 7572 6e3c 2f73 7061 6e3e 205f 6643 6f75 urn _fCou │ │ │ │ -00008950: 6e74 3b20 7d3c 2f64 6976 3e0a 3c64 6976 nt; }
.
< │ │ │ │ -00008990: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000089a0: 6e6f 223e 2020 3232 363c 2f73 7061 6e3e no"> 226 │ │ │ │ -000089b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00008a00: 3c61 2063 6c61 7373 3d22 6c69 6e65 2220 227 void SetNumVertex │ │ │ │ -00008ae0: 5765 6967 6874 733c 2f61 3e28 3c73 7061 Weights(int │ │ │ │ -00008b10: 2063 6f75 6e74 2920 7b20 5f76 436f 756e count) { _vCoun │ │ │ │ -00008b20: 7420 3d20 636f 756e 743b 207d 3c2f 6469 t = count; }.
│ │ │ │ -00008bc0: 2020 3232 383c 2f61 3e3c 2f73 7061 6e3e 228 │ │ │ │ -00008bd0: 2020 2020 2020 2020 3c73 7061 6e20 636c void S │ │ │ │ -00008c50: 6574 4e75 6d45 6467 6557 6569 6768 7473 etNumEdgeWeights │ │ │ │ -00008c60: 3c2f 613e 2820 203c 7370 616e 2063 6c61 ( int coun │ │ │ │ -00008c90: 7429 207b 205f 6543 6f75 6e74 203d 2063 t) { _eCount = c │ │ │ │ -00008ca0: 6f75 6e74 3b20 7d3c 2f64 6976 3e0a 3c64 ount; }
. │ │ │ │ -00008cc0: 3c61 2069 643d 226c 3030 3232 3922 206e 229 │ │ │ │ -00008d40: 3c2f 613e 3c2f 7370 616e 3e20 2020 2020 │ │ │ │ -00008d50: 2020 203c 7370 616e 2063 6c61 7373 3d22 voi │ │ │ │ -00008d70: 643c 2f73 7061 6e3e 203c 6120 636c 6173 d SetNum │ │ │ │ -00008dd0: 4661 6365 5765 6967 6874 733c 2f61 3e28 FaceWeights( │ │ │ │ -00008de0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ -00008e00: 2f73 7061 6e3e 2063 6f75 6e74 2920 7b20 /span> count) { │ │ │ │ -00008e10: 5f66 436f 756e 7420 3d20 636f 756e 743b _fCount = count; │ │ │ │ -00008e20: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
.
230 .
231 Weight │ │ │ │ -00008f80: 3c2f 613e 203c 7370 616e 2063 6c61 7373 const │ │ │ │ -00008fa0: 3c2f 7370 616e 3e26 616d 703b 203c 6120 & Ve │ │ │ │ -00009000: 7274 6578 5765 6967 6874 3c2f 613e 283c rtexWeight(< │ │ │ │ -00009010: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00009020: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int index) │ │ │ │ -00009050: 2063 6f6e 7374 203c 2f73 7061 6e3e 7b20 const { │ │ │ │ -00009060: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ -00009080: 3c2f 7370 616e 3e20 5f76 5765 6967 6874 _vWeight │ │ │ │ -00009090: 735b 696e 6465 785d 3b20 7d3c 2f64 6976 s[index]; }
.
│ │ │ │ -00009130: 2032 3332 3c2f 613e 3c2f 7370 616e 3e20 232 │ │ │ │ -00009140: 2020 2020 2020 203c 6120 636c 6173 733d Weight const& EdgeW │ │ │ │ -00009220: 6569 6768 743c 2f61 3e28 2020 3c73 7061 eight( int │ │ │ │ -00009250: 2069 6e64 6578 293c 7370 616e 2063 6c61 index) co │ │ │ │ -00009270: 6e73 7420 3c2f 7370 616e 3e7b 203c 7370 nst { return _eWeights[i │ │ │ │ -000092b0: 6e64 6578 5d3b 207d 3c2f 6469 763e 0a3c ndex]; }
.< │ │ │ │ -000092c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000092d0: 3e3c 6120 6964 3d22 6c30 3032 3333 2220 > 23 │ │ │ │ -00009350: 333c 2f61 3e3c 2f73 7061 6e3e 2020 2020 3 │ │ │ │ -00009360: 2020 2020 3c61 2063 6c61 7373 3d22 636f Weight < │ │ │ │ -000093c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000093d0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const& FaceWeig │ │ │ │ -00009440: 6874 3c2f 613e 2820 203c 7370 616e 2063 ht( int in │ │ │ │ -00009470: 6465 7829 3c73 7061 6e20 636c 6173 733d dex) const │ │ │ │ -00009490: 203c 2f73 7061 6e3e 7b20 3c73 7061 6e20 { return _fWeights[inde │ │ │ │ -000094d0: 785d 3b20 7d3c 2f64 6976 3e0a 3c64 6976 x]; }
.
< │ │ │ │ -00009510: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00009520: 6e6f 223e 2020 3233 343c 2f73 7061 6e3e no"> 234 │ │ │ │ -00009530: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00009580: 3c61 2063 6c61 7373 3d22 6c69 6e65 2220 235 Wei │ │ │ │ -00009630: 6768 743c 2f61 3e26 616d 703b 203c 6120 ght& Ve │ │ │ │ -00009690: 7274 6578 5765 6967 6874 3c2f 613e 283c rtexWeight(< │ │ │ │ -000096a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000096b0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int index) { return _vWeights[i │ │ │ │ -00009700: 6e64 6578 5d3b 207d 3c2f 6469 763e 0a3c ndex]; }
.< │ │ │ │ -00009710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00009720: 3e3c 6120 6964 3d22 6c30 3032 3336 2220 > 23 │ │ │ │ -000097a0: 363c 2f61 3e3c 2f73 7061 6e3e 2020 2020 6 │ │ │ │ -000097b0: 2020 2020 3c61 2063 6c61 7373 3d22 636f Weight&a │ │ │ │ -00009810: 6d70 3b20 3c61 2063 6c61 7373 3d22 636f mp; EdgeWeight< │ │ │ │ -00009870: 2f61 3e28 2020 3c73 7061 6e20 636c 6173 /a>( │ │ │ │ -00009890: 696e 743c 2f73 7061 6e3e 2069 6e64 6578 int index │ │ │ │ -000098a0: 2920 7b20 3c73 7061 6e20 636c 6173 733d ) { re │ │ │ │ -000098c0: 7475 726e 3c2f 7370 616e 3e20 5f65 5765 turn _eWe │ │ │ │ -000098d0: 6967 6874 735b 696e 6465 785d 3b20 7d3c ights[index]; }< │ │ │ │ -000098e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
237 Weigh │ │ │ │ -000099e0: 743c 2f61 3e26 616d 703b 203c 6120 636c t& Face │ │ │ │ -00009a40: 5765 6967 6874 3c2f 613e 2820 203c 7370 Weight( int index) { return _fWeights[ind │ │ │ │ -00009ab0: 6578 5d3b 207d 3c2f 6469 763e 0a3c 6469 ex]; }
.< │ │ │ │ -00009ad0: 6120 6964 3d22 6c30 3032 3338 2220 6e61 a id="l00238" na │ │ │ │ -00009ae0: 6d65 3d22 6c30 3032 3338 223e 3c2f 613e me="l00238"> │ │ │ │ -00009af0: 3c73 7061 6e20 636c 6173 733d 226c 696e 238
.
239< │ │ │ │ -00009bb0: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> bool AreFaceWeig │ │ │ │ -00009c40: 6874 7346 6f72 4661 6365 4365 6e74 6572 htsForFaceCenter │ │ │ │ -00009c50: 733c 2f61 3e28 293c 7370 616e 2063 6c61 s() co │ │ │ │ -00009c70: 6e73 7420 203c 2f73 7061 6e3e 7b20 3c73 nst { return _fWeightsF │ │ │ │ -00009cb0: 6f72 4365 6e74 6572 733b 207d 3c2f 6469 orCenters; }.
│ │ │ │ -00009d50: 2020 3234 303c 2f61 3e3c 2f73 7061 6e3e 240 │ │ │ │ -00009d60: 2020 2020 2020 2020 3c73 7061 6e20 636c void S │ │ │ │ -00009de0: 6574 4661 6365 5765 6967 6874 7346 6f72 etFaceWeightsFor │ │ │ │ -00009df0: 4661 6365 4365 6e74 6572 733c 2f61 3e28 FaceCenters( │ │ │ │ -00009e00: 3c73 7061 6e20 636c 6173 733d 226b 6579 bool on) { _fWe │ │ │ │ -00009e30: 6967 6874 7346 6f72 4365 6e74 6572 7320 ightsForCenters │ │ │ │ -00009e40: 3d20 6f6e 3b20 7d3c 2f64 6976 3e0a 3c64 = on; }
. │ │ │ │ -00009e60: 3c61 2069 643d 226c 3030 3234 3122 206e 241
.
242 │ │ │ │ -00009f00: 2020 3c73 7061 6e20 636c 6173 733d 226b public:
.< │ │ │ │ -00009f40: 6120 6964 3d22 6c30 3032 3433 2220 6e61 a id="l00243" na │ │ │ │ -00009f50: 6d65 3d22 6c30 3032 3433 223e 3c2f 613e me="l00243"> │ │ │ │ -00009f60: 3c73 7061 6e20 636c 6173 733d 226c 696e 243
.
244 │ │ │ │ -00009fe0: 2020 2020 203c 7370 616e 2063 6c61 7373 //
.
245 │ │ │ │ -0000a060: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -0000a080: 2041 6464 6974 696f 6e61 6c20 6d65 7468 Additional meth │ │ │ │ -0000a090: 6f64 7320 2d2d 206d 6169 6e6c 7920 7468 ods -- mainly th │ │ │ │ -0000a0a0: 6520 626c 656e 6469 6e67 206d 6574 686f e blending metho │ │ │ │ -0000a0b0: 6420 666f 7220 7665 7274 6578 2d76 6572 d for vertex-ver │ │ │ │ -0000a0c0: 7465 7820 6d61 736b 733a 3c2f 7370 616e tex masks:
.
│ │ │ │ -0000a120: 2020 3234 363c 2f73 7061 6e3e 2020 2020 246 │ │ │ │ -0000a130: 2020 2020 3c73 7061 6e20 636c 6173 733d //
.
247 │ │ │ │ -0000a1b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 temp │ │ │ │ -0000a1d0: 6c61 7465 3c2f 7370 616e 3e20 266c 743b late < │ │ │ │ -0000a1e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename USER_MASK& │ │ │ │ -0000a210: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
248 │ │ │ │ -0000a270: 2020 2020 2020 3c73 7061 6e20 636c 6173 inli │ │ │ │ -0000a290: 6e65 3c2f 7370 616e 3e20 3c73 7061 6e20 ne void< │ │ │ │ -0000a2c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
249 Comb │ │ │ │ -0000a3c0: 696e 6556 6572 7465 7856 6572 7465 784d ineVertexVertexM │ │ │ │ -0000a3d0: 6173 6b73 3c2f 613e 283c 6120 636c 6173 asks(Weight< │ │ │ │ -0000a430: 2f61 3e20 7468 6973 436f 6566 662c 203c /a> thisCoeff, < │ │ │ │ -0000a440: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ -0000a450: 5f74 7970 6564 6566 2220 6872 6566 3d22 _typedef" href=" │ │ │ │ -0000a460: 6130 3133 3337 2e68 746d 6c23 6131 3733 a01337.html#a173 │ │ │ │ -0000a470: 6539 3865 3064 3162 3364 3135 6635 6333 e98e0d1b3d15f5c3 │ │ │ │ -0000a480: 6164 3433 3664 3066 6564 3430 3122 3e57 ad436d0fed401">W │ │ │ │ -0000a490: 6569 6768 743c 2f61 3e20 6473 7443 6f65 eight dstCoe │ │ │ │ -0000a4a0: 6666 2c20 5553 4552 5f4d 4153 4b26 616d ff, USER_MASK&am │ │ │ │ -0000a4b0: 703b 2064 7374 293c 7370 616e 2063 6c61 p; dst) co │ │ │ │ -0000a4d0: 6e73 7420 3c2f 7370 616e 3e7b 3c2f 6469 nst {.
250 │ │ │ │ -0000a530: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ -0000a540: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000a550: 3e3c 6120 6964 3d22 6c30 3032 3531 2220 > 251 < │ │ │ │ -0000a5a0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0000a5b0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
2 │ │ │ │ -0000a610: 3532 3c2f 7370 616e 3e20 2020 2020 2020 52 │ │ │ │ -0000a620: 2020 2020 203c 7370 616e 2063 6c61 7373 // T │ │ │ │ -0000a640: 6869 7320 696d 706c 656d 656e 7461 7469 his implementati │ │ │ │ -0000a650: 6f6e 2069 7320 636f 6e76 6f6c 7574 6564 on is convoluted │ │ │ │ -0000a660: 2062 7920 7468 6520 706f 7465 6e74 6961 by the potentia │ │ │ │ -0000a670: 6c20 7370 6172 7369 7479 206f 6620 6561 l sparsity of ea │ │ │ │ -0000a680: 6368 206d 6173 6b2e 2020 5369 6e63 653c ch mask. Since< │ │ │ │ -0000a690: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -0000a6b0: 6120 6964 3d22 6c30 3032 3533 2220 6e61 a id="l00253" na │ │ │ │ -0000a6c0: 6d65 3d22 6c30 3032 3533 223e 3c2f 613e me="l00253"> │ │ │ │ -0000a6d0: 3c73 7061 6e20 636c 6173 733d 226c 696e 253 // it is spe │ │ │ │ -0000a720: 6369 6669 6320 746f 2061 2076 6572 7465 cific to a verte │ │ │ │ -0000a730: 782d 7665 7274 6578 206d 6173 6b2c 2077 x-vertex mask, w │ │ │ │ -0000a740: 6520 6172 6520 6775 6172 616e 7465 6564 e are guaranteed │ │ │ │ -0000a750: 2074 6f20 6861 7665 2065 7861 6374 6c79 to have exactly │ │ │ │ -0000a760: 206f 6e65 3c2f 7370 616e 3e3c 2f64 6976 one
.
254< │ │ │ │ -0000a7c0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -0000a7d0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // vert │ │ │ │ -0000a7f0: 6578 2d77 6569 6768 7420 666f 7220 626f ex-weight for bo │ │ │ │ -0000a800: 7468 206d 6173 6b73 2c20 6275 7420 7468 th masks, but th │ │ │ │ -0000a810: 6520 6564 6765 2d20 616e 6420 6661 6365 e edge- and face │ │ │ │ -0000a820: 2d77 6569 6768 7473 2061 7265 206f 7074 -weights are opt │ │ │ │ -0000a830: 696f 6e61 6c2e 2020 5468 653c 2f73 7061 ional. The
.
255 │ │ │ │ -0000a8a0: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ │ -0000a8c0: 2f20 2063 6869 6c64 206d 6173 6b20 2874 / child mask (t │ │ │ │ -0000a8d0: 6865 2026 7175 6f74 3b73 6f75 7263 6526 he "source& │ │ │ │ -0000a8e0: 7175 6f74 3b29 2073 686f 756c 6420 6861 quot;) should ha │ │ │ │ -0000a8f0: 7665 2061 2073 7570 6572 7365 7420 6f66 ve a superset of │ │ │ │ -0000a900: 2074 6865 2077 6569 6768 7473 206f 6620 the weights of │ │ │ │ -0000a910: 7468 6520 7061 7265 6e74 3c2f 7370 616e the parent
.
│ │ │ │ -0000a970: 2020 3235 363c 2f73 7061 6e3e 2020 2020 256 │ │ │ │ -0000a980: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ │ -0000a9a0: 2020 2874 6865 2026 7175 6f74 3b64 6573 (the "des │ │ │ │ -0000a9b0: 7469 6e61 7469 6f6e 2671 756f 743b 2920 tination") │ │ │ │ -0000a9c0: 6769 7665 6e20 6974 7320 7265 6475 6365 given its reduce │ │ │ │ -0000a9d0: 6420 7368 6172 706e 6573 732c 2073 6f20 d sharpness, so │ │ │ │ -0000a9e0: 7765 2066 6f72 7475 6e61 7465 6c79 2064 we fortunately d │ │ │ │ -0000a9f0: 6f6e 2623 3339 3b74 206e 6565 6420 746f on't need to │ │ │ │ -0000aa00: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000aa20: 3c61 2069 643d 226c 3030 3235 3722 206e 257 // test all │ │ │ │ -0000aa90: 2070 6572 6d75 7461 7469 6f6e 732e 3c2f permutations.
.
< │ │ │ │ -0000aae0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000aaf0: 6e6f 223e 2020 3235 383c 2f73 7061 6e3e no"> 258 │ │ │ │ -0000ab00: 2020 2020 2020 2020 2020 2020 3c73 7061 //
.
259< │ │ │ │ -0000ab80: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -0000ab90: 2020 6473 742e 5665 7274 6578 5765 6967 dst.VertexWeig │ │ │ │ -0000aba0: 6874 2830 2920 3d20 6473 7443 6f65 6666 ht(0) = dstCoeff │ │ │ │ -0000abb0: 202a 2064 7374 2e56 6572 7465 7857 6569 * dst.VertexWei │ │ │ │ -0000abc0: 6768 7428 3029 202b 2074 6869 7343 6f65 ght(0) + thisCoe │ │ │ │ -0000abd0: 6666 202a 2074 6869 732d 2667 743b 3c61 ff * this->V │ │ │ │ -0000ac30: 6572 7465 7857 6569 6768 743c 2f61 3e28 ertexWeight( │ │ │ │ -0000ac40: 3029 3b3c 2f64 6976 3e0a 3c64 6976 2063 0);
.
260 < │ │ │ │ -0000aca0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000acf0: 3236 313c 2f73 7061 6e3e 2020 2020 2020 261 │ │ │ │ -0000ad00: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ -0000ad20: 696e 743c 2f73 7061 6e3e 2065 6467 6557 int edgeW │ │ │ │ -0000ad30: 6569 6768 7443 6f75 6e74 203d 2074 6869 eightCount = thi │ │ │ │ -0000ad40: 732d 2667 743b 3c61 2063 6c61 7373 3d22 s->GetNumEdg │ │ │ │ -0000ada0: 6557 6569 6768 7473 3c2f 613e 2829 3b3c eWeights();< │ │ │ │ -0000adb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000ae00: 3236 323c 2f73 7061 6e3e 2020 2020 2020 262 │ │ │ │ -0000ae10: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ -0000ae30: 6966 3c2f 7370 616e 3e20 2865 6467 6557 if (edgeW │ │ │ │ -0000ae40: 6569 6768 7443 6f75 6e74 2920 7b3c 2f64 eightCount) {.
26 │ │ │ │ -0000aea0: 333c 2f73 7061 6e3e 2020 2020 2020 2020 3 │ │ │ │ -0000aeb0: 2020 2020 2020 2020 3c73 7061 6e20 636c if (dst │ │ │ │ -0000aee0: 2e47 6574 4e75 6d45 6467 6557 6569 6768 .GetNumEdgeWeigh │ │ │ │ -0000aef0: 7473 2829 203d 3d20 3029 207b 3c2f 6469 ts() == 0) {.
264 │ │ │ │ -0000af50: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ -0000af60: 2020 2020 2020 2020 2020 2064 7374 2e53 dst.S │ │ │ │ -0000af70: 6574 4e75 6d45 6467 6557 6569 6768 7473 etNumEdgeWeights │ │ │ │ -0000af80: 2865 6467 6557 6569 6768 7443 6f75 6e74 (edgeWeightCount │ │ │ │ -0000af90: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
265 │ │ │ │ -0000aff0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000b000: 203c 7370 616e 2063 6c61 7373 3d22 6b65 for (int i = │ │ │ │ -0000b050: 303b 2069 2026 6c74 3b20 6564 6765 5765 0; i < edgeWe │ │ │ │ -0000b060: 6967 6874 436f 756e 743b 202b 2b69 2920 ightCount; ++i) │ │ │ │ -0000b070: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ │ -0000b0c0: 2020 3236 363c 2f73 7061 6e3e 2020 2020 266 │ │ │ │ -0000b0d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000b0e0: 2020 2020 6473 742e 4564 6765 5765 6967 dst.EdgeWeig │ │ │ │ -0000b0f0: 6874 2869 2920 3d20 7468 6973 436f 6566 ht(i) = thisCoef │ │ │ │ -0000b100: 6620 2a20 7468 6973 2d26 6774 3b3c 6120 f * this->Ed │ │ │ │ -0000b160: 6765 5765 6967 6874 3c2f 613e 2869 293b geWeight(i); │ │ │ │ -0000b170: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000b1c0: 2032 3637 3c2f 7370 616e 3e20 2020 2020 267 │ │ │ │ -0000b1d0: 2020 2020 2020 2020 2020 2020 2020 207d } │ │ │ │ -0000b1e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000b230: 2032 3638 3c2f 7370 616e 3e20 2020 2020 268 │ │ │ │ -0000b240: 2020 2020 2020 2020 2020 207d 203c 7370 } else {
.
269 │ │ │ │ -0000b2d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000b2e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 for │ │ │ │ -0000b300: 3c2f 7370 616e 3e20 283c 7370 616e 2063 (int i │ │ │ │ -0000b330: 3d20 303b 2069 2026 6c74 3b20 6564 6765 = 0; i < edge │ │ │ │ -0000b340: 5765 6967 6874 436f 756e 743b 202b 2b69 WeightCount; ++i │ │ │ │ -0000b350: 2920 7b3c 2f64 6976 3e0a 3c64 6976 2063 ) {
.
270 │ │ │ │ -0000b3b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000b3c0: 2020 2020 2020 6473 742e 4564 6765 5765 dst.EdgeWe │ │ │ │ -0000b3d0: 6967 6874 2869 2920 3d20 6473 7443 6f65 ight(i) = dstCoe │ │ │ │ -0000b3e0: 6666 202a 2064 7374 2e45 6467 6557 6569 ff * dst.EdgeWei │ │ │ │ -0000b3f0: 6768 7428 6929 202b 2074 6869 7343 6f65 ght(i) + thisCoe │ │ │ │ -0000b400: 6666 202a 2074 6869 732d 2667 743b 3c61 ff * this->E │ │ │ │ -0000b460: 6467 6557 6569 6768 743c 2f61 3e28 6929 dgeWeight(i) │ │ │ │ -0000b470: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -0000b4c0: 2020 3237 313c 2f73 7061 6e3e 2020 2020 271 │ │ │ │ -0000b4d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000b4e0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
.
│ │ │ │ -0000b530: 2020 3237 323c 2f73 7061 6e3e 2020 2020 272 │ │ │ │ -0000b540: 2020 2020 2020 2020 2020 2020 7d3c 2f64 }.
27 │ │ │ │ -0000b5a0: 333c 2f73 7061 6e3e 2020 2020 2020 2020 3 │ │ │ │ -0000b5b0: 2020 2020 7d3c 2f64 6976 3e0a 3c64 6976 }
.
< │ │ │ │ -0000b5f0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000b600: 6e6f 223e 2020 3237 343c 2f73 7061 6e3e no"> 274 │ │ │ │ -0000b610: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -0000b660: 2020 3237 353c 2f73 7061 6e3e 2020 2020 275 │ │ │ │ -0000b670: 2020 2020 2020 2020 3c73 7061 6e20 636c int fac │ │ │ │ -0000b6a0: 6557 6569 6768 7443 6f75 6e74 203d 2074 eWeightCount = t │ │ │ │ -0000b6b0: 6869 732d 2667 743b 3c61 2063 6c61 7373 his->GetNumF │ │ │ │ -0000b710: 6163 6557 6569 6768 7473 3c2f 613e 2829 aceWeights() │ │ │ │ -0000b720: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -0000b770: 2020 3237 363c 2f73 7061 6e3e 2020 2020 276 │ │ │ │ -0000b780: 2020 2020 2020 2020 3c73 7061 6e20 636c if (fac │ │ │ │ -0000b7b0: 6557 6569 6768 7443 6f75 6e74 2920 7b3c eWeightCount) {< │ │ │ │ -0000b7c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000b810: 3237 373c 2f73 7061 6e3e 2020 2020 2020 277 │ │ │ │ -0000b820: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ │ -0000b840: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
. │ │ │ │ -0000b850: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -0000b880: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 278 │ │ │ │ -0000b8b0: 2020 2020 3c73 7061 6e20 636c 6173 733d // If │ │ │ │ -0000b8d0: 2063 6f6d 6269 6e69 6e67 2066 6163 6520 combining face │ │ │ │ -0000b8e0: 7765 6967 6874 732c 2062 6520 7375 7265 weights, be sure │ │ │ │ -0000b8f0: 2074 6865 6972 2069 6e74 6572 7072 6574 their interpret │ │ │ │ -0000b900: 6174 696f 6e20 2869 2e65 2e20 6661 6365 ation (i.e. face │ │ │ │ -0000b910: 2d63 656e 7465 7273 3c2f 7370 616e 3e3c -centers< │ │ │ │ -0000b920: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000b970: 3237 393c 2f73 7061 6e3e 2020 2020 2020 279 │ │ │ │ -0000b980: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ │ -0000b9a0: 2f2f 2020 6f72 206f 7070 6f73 6974 6520 // or opposite │ │ │ │ -0000b9b0: 7665 7274 6963 6573 2920 6973 2070 726f vertices) is pro │ │ │ │ -0000b9c0: 7065 726c 7920 7365 7420 696e 2074 6865 perly set in the │ │ │ │ -0000b9d0: 2064 6573 7469 6e61 7469 6f6e 206d 6173 destination mas │ │ │ │ -0000b9e0: 6b3a 3c2f 7370 616e 3e3c 2f64 6976 3e0a k:
. │ │ │ │ -0000b9f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
281 │ │ │ │ -0000bad0: 2020 2020 2020 2020 2020 2020 2020 3c73 if (dst.GetNumFac │ │ │ │ -0000bb10: 6557 6569 6768 7473 2829 203d 3d20 3029 eWeights() == 0) │ │ │ │ -0000bb20: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
282 │ │ │ │ -0000bb80: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000bb90: 2064 7374 2e53 6574 4e75 6d46 6163 6557 dst.SetNumFaceW │ │ │ │ -0000bba0: 6569 6768 7473 2866 6163 6557 6569 6768 eights(faceWeigh │ │ │ │ -0000bbb0: 7443 6f75 6e74 293b 3c2f 6469 763e 0a3c tCount);
.< │ │ │ │ -0000bbc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000bbd0: 3e3c 6120 6964 3d22 6c30 3032 3833 2220 > 283 │ │ │ │ -0000bc20: 2020 2020 2020 2064 7374 2e53 6574 4661 dst.SetFa │ │ │ │ -0000bc30: 6365 5765 6967 6874 7346 6f72 4661 6365 ceWeightsForFace │ │ │ │ -0000bc40: 4365 6e74 6572 7328 7468 6973 2d26 6774 Centers(this-> │ │ │ │ -0000bc50: 3b3c 6120 636c 6173 733d 2263 6f64 6520 ;AreFaceWeights │ │ │ │ -0000bcb0: 466f 7246 6163 6543 656e 7465 7273 3c2f ForFaceCenters());
.< │ │ │ │ -0000bce0: 6120 6964 3d22 6c30 3032 3834 2220 6e61 a id="l00284" na │ │ │ │ -0000bcf0: 6d65 3d22 6c30 3032 3834 223e 3c2f 613e me="l00284"> │ │ │ │ -0000bd00: 3c73 7061 6e20 636c 6173 733d 226c 696e 284
.
285 │ │ │ │ -0000bd80: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000bd90: 203c 7370 616e 2063 6c61 7373 3d22 6b65 for (int i = │ │ │ │ -0000bde0: 303b 2069 2026 6c74 3b20 6661 6365 5765 0; i < faceWe │ │ │ │ -0000bdf0: 6967 6874 436f 756e 743b 202b 2b69 2920 ightCount; ++i) │ │ │ │ -0000be00: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ │ -0000be50: 2020 3238 363c 2f73 7061 6e3e 2020 2020 286 │ │ │ │ +000039d0: 6466 6c6f 7722 3e72 6574 7572 6e3c 2f73 dflow">return _sizes; }.
71 │ │ │ │ +00003ab0: 766f 6964 3c2f 7370 616e 3e20 2a3c 6120 void *Ge │ │ │ │ +00003b10: 744f 6666 7365 7473 4275 6666 6572 3c2f tOffsetsBuffer() const │ │ │ │ +00003b40: 203c 2f73 7061 6e3e 7b20 3c73 7061 6e20 { return _offsets; }.
72 v │ │ │ │ +00003c40: 6f69 643c 2f73 7061 6e3e 202a 3c61 2063 oid *Get │ │ │ │ +00003ca0: 496e 6469 6365 7342 7566 6665 723c 2f61 IndicesBuffer() const │ │ │ │ +00003cd0: 3c2f 7370 616e 3e7b 203c 7370 616e 2063 { return │ │ │ │ +00003d00: 205f 696e 6469 6365 733b 207d 3c2f 6469 _indices; }.
│ │ │ │ +00003da0: 2020 2037 333c 2f61 3e3c 2f73 7061 6e3e 73 │ │ │ │ +00003db0: 2020 2020 3c73 7061 6e20 636c 6173 733d vo │ │ │ │ +00003dd0: 6964 3c2f 7370 616e 3e20 2a3c 6120 636c id *GetW │ │ │ │ +00003e30: 6569 6768 7473 4275 6666 6572 3c2f 613e eightsBuffer │ │ │ │ +00003e40: 2829 3c73 7061 6e20 636c 6173 733d 226b () const < │ │ │ │ +00003e60: 2f73 7061 6e3e 7b20 3c73 7061 6e20 636c /span>{ return │ │ │ │ +00003e90: 5f77 6569 6768 7473 3b20 7d3c 2f64 6976 _weights; }
.
│ │ │ │ +00003f30: 2020 3734 3c2f 613e 3c2f 7370 616e 3e20 74 │ │ │ │ +00003f40: 2020 203c 7370 616e 2063 6c61 7373 3d22 voi │ │ │ │ +00003f60: 643c 2f73 7061 6e3e 202a 3c61 2063 6c61 d *GetDu │ │ │ │ +00003fc0: 5765 6967 6874 7342 7566 6665 723c 2f61 WeightsBuffer() const │ │ │ │ +00003ff0: 3c2f 7370 616e 3e7b 203c 7370 616e 2063 { return │ │ │ │ +00004020: 205f 6475 5765 6967 6874 733b 207d 3c2f _duWeights; }.
75 │ │ │ │ +000040f0: 766f 6964 3c2f 7370 616e 3e20 2a3c 6120 void *Ge │ │ │ │ +00004150: 7444 7657 6569 6768 7473 4275 6666 6572 tDvWeightsBuffer │ │ │ │ +00004160: 3c2f 613e 2829 3c73 7061 6e20 636c 6173 () con │ │ │ │ +00004180: 7374 203c 2f73 7061 6e3e 7b20 3c73 7061 st { return _dvWeights; │ │ │ │ +000041c0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
.
│ │ │ │ +00004210: 3c61 2063 6c61 7373 3d22 6c69 6e65 2220 76 void * │ │ │ │ +00004290: 3c61 2063 6c61 7373 3d22 636f 6465 2068 GetDuuWeightsBu │ │ │ │ +000042f0: 6666 6572 3c2f 613e 2829 3c73 7061 6e20 ffer() │ │ │ │ +00004310: 2063 6f6e 7374 203c 2f73 7061 6e3e 7b20 const { │ │ │ │ +00004320: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +00004340: 3c2f 7370 616e 3e20 5f64 7575 5765 6967 _duuWeig │ │ │ │ +00004350: 6874 733b 207d 3c2f 6469 763e 0a3c 6469 hts; }
.< │ │ │ │ +00004370: 6120 6964 3d22 6c30 3030 3737 2220 6e61 a id="l00077" na │ │ │ │ +00004380: 6d65 3d22 6c30 3030 3737 223e 3c2f 613e me="l00077"> │ │ │ │ +00004390: 3c73 7061 6e20 636c 6173 733d 226c 696e 77< │ │ │ │ +000043f0: 2f61 3e3c 2f73 7061 6e3e 2020 2020 3c73 /a> void *GetDuvWeig │ │ │ │ +00004480: 6874 7342 7566 6665 723c 2f61 3e28 293c htsBuffer()< │ │ │ │ +00004490: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000044a0: 6f72 6422 3e20 636f 6e73 7420 3c2f 7370 ord"> const { r │ │ │ │ +000044d0: 6574 7572 6e3c 2f73 7061 6e3e 205f 6475 eturn _du │ │ │ │ +000044e0: 7657 6569 6768 7473 3b20 7d3c 2f64 6976 vWeights; }
..
< │ │ │ │ +000046d0: 6120 636c 6173 733d 226c 696e 6522 2068 a class="line" h │ │ │ │ +000046e0: 7265 663d 2261 3031 3137 332e 6874 6d6c ref="a01173.html │ │ │ │ +000046f0: 2361 3635 3833 3664 3230 3730 6239 3433 #a65836d2070b943 │ │ │ │ +00004700: 6338 6665 6362 6164 3932 3664 3037 3464 c8fecbad926d074d │ │ │ │ +00004710: 6532 223e 2020 2037 393c 2f61 3e3c 2f73 e2"> 79 int Ge │ │ │ │ +000047a0: 744e 756d 5374 656e 6369 6c73 3c2f 613e tNumStencils │ │ │ │ +000047b0: 2829 3c73 7061 6e20 636c 6173 733d 226b () const < │ │ │ │ +000047d0: 2f73 7061 6e3e 7b20 3c73 7061 6e20 636c /span>{ return │ │ │ │ +00004800: 5f6e 756d 5374 656e 6369 6c73 3b20 7d3c _numStencils; }< │ │ │ │ +00004810: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00004860: 2038 303c 2f73 7061 6e3e 203c 2f64 6976 80
.
81< │ │ │ │ +000048c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>priv │ │ │ │ +000048e0: 6174 653c 2f73 7061 6e3e 3a3c 2f64 6976 ate:
.
82< │ │ │ │ +00004940: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> void │ │ │ │ +00004970: 2a20 5f73 697a 6573 2c3c 2f64 6976 3e0a * _sizes,
. │ │ │ │ +00004980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +000049f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00004a00: 3e3c 6120 6964 3d22 6c30 3030 3834 2220 > 84 * _i │ │ │ │ +00004a50: 6e64 6963 6573 2c3c 2f64 6976 3e0a 3c64 ndices,
. │ │ │ │ +00004a70: 3c61 2069 643d 226c 3030 3038 3522 206e 85 * _we │ │ │ │ +00004ac0: 6967 6874 732c 3c2f 6469 763e 0a3c 6469 ights,
.< │ │ │ │ +00004ae0: 6120 6964 3d22 6c30 3030 3836 2220 6e61 a id="l00086" na │ │ │ │ +00004af0: 6d65 3d22 6c30 3030 3836 223e 3c2f 613e me="l00086"> │ │ │ │ +00004b00: 3c73 7061 6e20 636c 6173 733d 226c 696e 86 * _duW │ │ │ │ +00004b30: 6569 6768 7473 2c3c 2f64 6976 3e0a 3c64 eights,
. │ │ │ │ +00004b50: 3c61 2069 643d 226c 3030 3038 3722 206e 87 * _dv │ │ │ │ +00004ba0: 5765 6967 6874 732c 3c2f 6469 763e 0a3c Weights,
.< │ │ │ │ +00004bb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00004bc0: 3e3c 6120 6964 3d22 6c30 3030 3838 2220 > 88 * _d │ │ │ │ +00004c10: 7575 5765 6967 6874 732c 3c2f 6469 763e uuWeights,
│ │ │ │ +00004c20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00004c50: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 89 * │ │ │ │ +00004c80: 5f64 7576 5765 6967 6874 732c 3c2f 6469 _duvWeights,.
90 │ │ │ │ +00004ce0: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00004cf0: 2a20 5f64 7676 5765 6967 6874 733b 3c2f * _dvvWeights;.
│ │ │ │ +00004d50: 3931 3c2f 7370 616e 3e20 2020 203c 7370 91 int _numStencils;< │ │ │ │ +00004d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00004de0: 2039 323c 2f73 7061 6e3e 7d3b 3c2f 6469 92};.
93 │ │ │ │ +00004e40: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ +00004e50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00004e60: 3e3c 6120 6964 3d22 6c30 3030 3934 2220 > 94< │ │ │ │ +00004ec0: 2f61 3e3c 2f73 7061 6e3e 3c73 7061 6e20 /a> │ │ │ │ +00004ee0: 636c 6173 7320 3c2f 7370 616e 3e3c 6120 class CudaEva │ │ │ │ +00004f20: 6c75 6174 6f72 3c2f 613e 207b 3c2f 6469 luator {.
95 │ │ │ │ +00004f80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 pub │ │ │ │ +00004fa0: 6c69 633c 2f73 7061 6e3e 3a3c 2f64 6976 lic:
.
101< │ │ │ │ +00005000: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ +00005020: 3c61 2069 643d 226c 3030 3132 3522 206e 125 temp │ │ │ │ +00005080: 6c61 7465 3c2f 7370 616e 3e20 266c 743b late < │ │ │ │ +00005090: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename SRC_BUFFER │ │ │ │ +000050c0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , typename │ │ │ │ +000050e0: 3c2f 7370 616e 3e20 4453 545f 4255 4646 DST_BUFF │ │ │ │ +000050f0: 4552 2c20 3c73 7061 6e20 636c 6173 733d ER, typena │ │ │ │ +00005110: 6d65 3c2f 7370 616e 3e20 5354 454e 4349 me STENCI │ │ │ │ +00005120: 4c5f 5441 424c 4526 6774 3b3c 2f64 6976 L_TABLE>
.
│ │ │ │ +000051c0: 2031 3236 3c2f 613e 3c2f 7370 616e 3e20 126 │ │ │ │ +000051d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 static< │ │ │ │ +000051f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> bool Ev │ │ │ │ +00005270: 616c 5374 656e 6369 6c73 3c2f 613e 283c alStencils(< │ │ │ │ +00005280: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000052d0: 3132 373c 2f73 7061 6e3e 2020 2020 2020 127 │ │ │ │ +000052e0: 2020 5352 435f 4255 4646 4552 202a 7372 SRC_BUFFER *sr │ │ │ │ +000052f0: 6342 7566 6665 722c 203c 6120 636c 6173 cBuffer, BufferDesc │ │ │ │ +00005330: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +00005360: 6d70 3b73 7263 4465 7363 2c3c 2f64 6976 mp;srcDesc,
.
128< │ │ │ │ +000053c0: 2f73 7061 6e3e 2020 2020 2020 2020 4453 /span> DS │ │ │ │ +000053d0: 545f 4255 4646 4552 202a 6473 7442 7566 T_BUFFER *dstBuf │ │ │ │ +000053e0: 6665 722c 203c 6120 636c 6173 733d 2263 fer, BufferDescript │ │ │ │ +00005420: 6f72 3c2f 613e 203c 7370 616e 2063 6c61 or con │ │ │ │ +00005440: 7374 3c2f 7370 616e 3e20 2661 6d70 3b64 st &d │ │ │ │ +00005450: 7374 4465 7363 2c3c 2f64 6976 3e0a 3c64 stDesc,
. │ │ │ │ +00005470: 3c61 2069 643d 226c 3030 3132 3922 206e 129 STENCI │ │ │ │ +000054c0: 4c5f 5441 424c 4520 3c73 7061 6e20 636c L_TABLE co │ │ │ │ +000054e0: 6e73 743c 2f73 7061 6e3e 202a 7374 656e nst *sten │ │ │ │ +000054f0: 6369 6c54 6162 6c65 2c3c 2f64 6976 3e0a cilTable,
. │ │ │ │ +00005500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +000055d0: 6120 6964 3d22 6c30 3031 3331 2220 6e61 a id="l00131" na │ │ │ │ +000055e0: 6d65 3d22 6c30 3031 3331 223e 3c2f 613e me="l00131"> │ │ │ │ +000055f0: 3c73 7061 6e20 636c 6173 733d 226c 696e 131 void * │ │ │ │ +00005640: 2064 6576 6963 6543 6f6e 7465 7874 203d deviceContext = │ │ │ │ +00005650: 204e 554c 4c29 207b 3c2f 6469 763e 0a3c NULL) {
.< │ │ │ │ +00005660: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00005670: 3e3c 6120 6964 3d22 6c30 3031 3332 2220 > 132
.
133 │ │ │ │ +00005710: 2020 2020 2020 2028 766f 6964 2969 6e73 (void)ins │ │ │ │ +00005720: 7461 6e63 653b 2020 3c73 7061 6e20 636c tance; // │ │ │ │ +00005740: 2075 6e75 7365 643c 2f73 7061 6e3e 3c2f unused.
1 │ │ │ │ +000057a0: 3334 3c2f 7370 616e 3e20 2020 2020 2020 34 │ │ │ │ +000057b0: 2028 766f 6964 2964 6576 6963 6543 6f6e (void)deviceCon │ │ │ │ +000057c0: 7465 7874 3b20 203c 7370 616e 2063 6c61 text; // │ │ │ │ +000057e0: 756e 7573 6564 3c2f 7370 616e 3e3c 2f64 unused.
13 │ │ │ │ +00005840: 353c 2f73 7061 6e3e 2020 2020 2020 2020 5 │ │ │ │ +00005850: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +00005870: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 EvalSte │ │ │ │ +000058d0: 6e63 696c 733c 2f61 3e28 7372 6342 7566 ncils(srcBuf │ │ │ │ +000058e0: 6665 722d 2667 743b 4269 6e64 4375 6461 fer->BindCuda │ │ │ │ +000058f0: 4275 6666 6572 2829 2c20 7372 6344 6573 Buffer(), srcDes │ │ │ │ +00005900: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
136 │ │ │ │ +00005960: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005970: 2020 2020 2020 2020 2064 7374 4275 6666 dstBuff │ │ │ │ +00005980: 6572 2d26 6774 3b42 696e 6443 7564 6142 er->BindCudaB │ │ │ │ +00005990: 7566 6665 7228 292c 2064 7374 4465 7363 uffer(), dstDesc │ │ │ │ +000059a0: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +000059f0: 2020 3133 373c 2f73 7061 6e3e 2020 2020 137 │ │ │ │ +00005a00: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005a10: 2020 2020 2020 2020 283c 7370 616e 2063 (int const │ │ │ │ +00005a60: 202a 2973 7465 6e63 696c 5461 626c 652d *)stencilTable- │ │ │ │ +00005a70: 2667 743b 4765 7453 697a 6573 4275 6666 >GetSizesBuff │ │ │ │ +00005a80: 6572 2829 2c3c 2f64 6976 3e0a 3c64 6976 er(),
.
< │ │ │ │ +00005ac0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00005ad0: 6e6f 223e 2020 3133 383c 2f73 7061 6e3e no"> 138 │ │ │ │ +00005ae0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005af0: 2020 2020 2020 2020 2020 2020 283c 7370 (int const *)stencilTa │ │ │ │ +00005b50: 626c 652d 2667 743b 4765 744f 6666 7365 ble->GetOffse │ │ │ │ +00005b60: 7473 4275 6666 6572 2829 2c3c 2f64 6976 tsBuffer(),
.
139< │ │ │ │ +00005bc0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +00005bd0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005be0: 2020 283c 7370 616e 2063 6c61 7373 3d22 (int │ │ │ │ +00005c00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c co │ │ │ │ +00005c20: 6e73 743c 2f73 7061 6e3e 202a 2973 7465 nst *)ste │ │ │ │ +00005c30: 6e63 696c 5461 626c 652d 2667 743b 4765 ncilTable->Ge │ │ │ │ +00005c40: 7449 6e64 6963 6573 4275 6666 6572 2829 tIndicesBuffer() │ │ │ │ +00005c50: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00005ca0: 2020 3134 303c 2f73 7061 6e3e 2020 2020 140 │ │ │ │ +00005cb0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005cc0: 2020 2020 2020 2020 283c 7370 616e 2063 (float │ │ │ │ +00005cf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const *)stencilTabl │ │ │ │ +00005d20: 652d 2667 743b 4765 7457 6569 6768 7473 e->GetWeights │ │ │ │ +00005d30: 4275 6666 6572 2829 2c3c 2f64 6976 3e0a Buffer(),
. │ │ │ │ +00005d40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +00005d70: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 141 │ │ │ │ +00005da0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005db0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /*start = │ │ │ │ +00005dd0: 2a2f 3c2f 7370 616e 3e20 302c 3c2f 6469 */ 0,.
142 │ │ │ │ +00005e30: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00005e40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00005e50: 2020 203c 7370 616e 2063 6c61 7373 3d22 /*end │ │ │ │ +00005e70: 203d 202a 2f3c 2f73 7061 6e3e 2073 7465 = */ ste │ │ │ │ +00005e80: 6e63 696c 5461 626c 652d 2667 743b 4765 ncilTable->Ge │ │ │ │ +00005e90: 744e 756d 5374 656e 6369 6c73 2829 293b tNumStencils()); │ │ │ │ +00005ea0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00005ef0: 2031 3433 3c2f 7370 616e 3e20 2020 207d 143 } │ │ │ │ +00005f00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00005f50: 2031 3434 3c2f 7370 616e 3e20 3c2f 6469 144 .
│ │ │ │ +00005ff0: 2020 3137 313c 2f61 3e3c 2f73 7061 6e3e 171 │ │ │ │ +00006000: 2020 2020 3c73 7061 6e20 636c 6173 733d static │ │ │ │ +00006020: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c bool E │ │ │ │ +000060a0: 7661 6c53 7465 6e63 696c 733c 2f61 3e28 valStencils( │ │ │ │ +000060b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00006100: 2031 3732 3c2f 7370 616e 3e20 2020 2020 172 │ │ │ │ +00006110: 2020 203c 7370 616e 2063 6c61 7373 3d22 const │ │ │ │ +00006150: 666c 6f61 743c 2f73 7061 6e3e 202a 7372 float *sr │ │ │ │ +00006160: 632c 203c 6120 636c 6173 733d 2263 6f64 c, │ │ │ │ +00006190: 4275 6666 6572 4465 7363 7269 7074 6f72 BufferDescriptor │ │ │ │ +000061a0: 3c2f 613e 203c 7370 616e 2063 6c61 7373 const │ │ │ │ +000061c0: 3c2f 7370 616e 3e20 2661 6d70 3b73 7263 &src │ │ │ │ +000061d0: 4465 7363 2c3c 2f64 6976 3e0a 3c64 6976 Desc,
.
< │ │ │ │ +00006210: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00006220: 6e6f 223e 2020 3137 333c 2f73 7061 6e3e no"> 173 │ │ │ │ +00006230: 2020 2020 2020 2020 3c73 7061 6e20 636c float * │ │ │ │ +00006260: 6473 742c 2020 2020 2020 203c 6120 636c dst, BufferDe │ │ │ │ +000062a0: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +000062d0: 2661 6d70 3b64 7374 4465 7363 2c3c 2f64 &dstDesc,.
17 │ │ │ │ +00006330: 343c 2f73 7061 6e3e 2020 2020 2020 2020 4 │ │ │ │ +00006340: 3c73 7061 6e20 636c 6173 733d 226b 6579 const int │ │ │ │ +00006380: 3c2f 7370 616e 3e20 2a20 7369 7a65 732c * sizes, │ │ │ │ +00006390: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +000063e0: 2031 3735 3c2f 7370 616e 3e20 2020 2020 175 │ │ │ │ +000063f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 const │ │ │ │ +00006430: 696e 743c 2f73 7061 6e3e 202a 206f 6666 int * off │ │ │ │ +00006440: 7365 7473 2c3c 2f64 6976 3e0a 3c64 6976 sets,
.
< │ │ │ │ +00006480: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00006490: 6e6f 223e 2020 3137 363c 2f73 7061 6e3e no"> 176 │ │ │ │ +000064a0: 2020 2020 2020 2020 3c73 7061 6e20 636c co │ │ │ │ +000064c0: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst int │ │ │ │ +000064f0: 2a20 696e 6469 6365 732c 3c2f 6469 763e * indices,
│ │ │ │ +00006500: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00006530: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 177 const │ │ │ │ +00006580: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ │ +000065a0: 2f73 7061 6e3e 202a 2077 6569 6768 7473 /span> * weights │ │ │ │ +000065b0: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00006600: 2020 3137 383c 2f73 7061 6e3e 2020 2020 178 │ │ │ │ +00006610: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ +00006630: 743c 2f73 7061 6e3e 2073 7461 7274 2c20 t start, │ │ │ │ +00006640: 3c73 7061 6e20 636c 6173 733d 226b 6579 int end);
│ │ │ │ +00006670: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +000066e0: 6120 6964 3d22 6c30 3032 3137 2220 6e61 a id="l00217" na │ │ │ │ +000066f0: 6d65 3d22 6c30 3032 3137 223e 3c2f 613e me="l00217"> │ │ │ │ +00006700: 3c73 7061 6e20 636c 6173 733d 226c 696e 217 templ │ │ │ │ +00006740: 6174 653c 2f73 7061 6e3e 2026 6c74 3b3c ate << │ │ │ │ +00006750: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00006760: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename
SRC_BUFFER, │ │ │ │ +00006780: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typename< │ │ │ │ +000067a0: 2f73 7061 6e3e 2044 5354 5f42 5546 4645 /span> DST_BUFFE │ │ │ │ +000067b0: 522c 203c 7370 616e 2063 6c61 7373 3d22 R, typenam │ │ │ │ +000067d0: 653c 2f73 7061 6e3e 2053 5445 4e43 494c e STENCIL │ │ │ │ +000067e0: 5f54 4142 4c45 2667 743b 3c2f 6469 763e _TABLE>
│ │ │ │ +000067f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00006820: 3c2f 613e 3c73 7061 6e20 636c 6173 733d │ │ │ │ +00006880: 3231 383c 2f61 3e3c 2f73 7061 6e3e 2020 218 │ │ │ │ +00006890: 2020 3c73 7061 6e20 636c 6173 733d 226b static │ │ │ │ +000068d0: 626f 6f6c 3c2f 7370 616e 3e20 3c61 2063 bool Eva │ │ │ │ +00006930: 6c53 7465 6e63 696c 733c 2f61 3e28 3c2f lStencils(.
2 │ │ │ │ +00006990: 3139 3c2f 7370 616e 3e20 2020 2020 2020 19 │ │ │ │ +000069a0: 2053 5243 5f42 5546 4645 5220 2a73 7263 SRC_BUFFER *src │ │ │ │ +000069b0: 4275 6666 6572 2c20 3c61 2063 6c61 7373 Buffer, BufferDescr │ │ │ │ +000069f0: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +00006a10: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +00006a20: 703b 7372 6344 6573 632c 3c2f 6469 763e p;srcDesc,
│ │ │ │ +00006a30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00006a60: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 220 DST │ │ │ │ +00006a90: 5f42 5546 4645 5220 2a64 7374 4275 6666 _BUFFER *dstBuff │ │ │ │ +00006aa0: 6572 2c20 3c61 2063 6c61 7373 3d22 636f er, BufferDescripto │ │ │ │ +00006ae0: 723c 2f61 3e20 3c73 7061 6e20 636c 6173 r cons │ │ │ │ +00006b00: 743c 2f73 7061 6e3e 2026 616d 703b 6473 t &ds │ │ │ │ +00006b10: 7444 6573 632c 3c2f 6469 763e 0a3c 6469 tDesc,
.< │ │ │ │ +00006b30: 6120 6964 3d22 6c30 3032 3231 2220 6e61 a id="l00221" na │ │ │ │ +00006b40: 6d65 3d22 6c30 3032 3231 223e 3c2f 613e me="l00221"> │ │ │ │ +00006b50: 3c73 7061 6e20 636c 6173 733d 226c 696e 221 DST_BUF │ │ │ │ +00006b80: 4645 5220 2a64 7542 7566 6665 722c 2020 FER *duBuffer, │ │ │ │ +00006b90: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Buf │ │ │ │ +00006bc0: 6665 7244 6573 6372 6970 746f 723c 2f61 ferDescriptor const &duDesc │ │ │ │ +00006c00: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00006c50: 2020 3232 323c 2f73 7061 6e3e 2020 2020 222 │ │ │ │ +00006c60: 2020 2020 4453 545f 4255 4646 4552 202a DST_BUFFER * │ │ │ │ +00006c70: 6476 4275 6666 6572 2c20 203c 6120 636c dvBuffer, BufferDe │ │ │ │ +00006cb0: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +00006ce0: 2661 6d70 3b64 7644 6573 632c 3c2f 6469 &dvDesc,.
223 │ │ │ │ +00006d40: 3c2f 7370 616e 3e20 2020 2020 2020 2053 S │ │ │ │ +00006d50: 5445 4e43 494c 5f54 4142 4c45 203c 7370 TENCIL_TABLE const │ │ │ │ +00006d80: 2a73 7465 6e63 696c 5461 626c 652c 3c2f *stencilTable,.
2 │ │ │ │ +00006de0: 3234 3c2f 7370 616e 3e20 2020 2020 2020 24 │ │ │ │ +00006df0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const │ │ │ │ +00006e40: 4375 6461 4576 616c 7561 746f 723c 2f61 CudaEvaluator *instance = NU │ │ │ │ +00006e60: 4c4c 2c3c 2f64 6976 3e0a 3c64 6976 2063 LL,
.
225 │ │ │ │ +00006ec0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +00006ee0: 766f 6964 3c2f 7370 616e 3e20 2a20 6465 void * de │ │ │ │ +00006ef0: 7669 6365 436f 6e74 6578 7420 3d20 4e55 viceContext = NU │ │ │ │ +00006f00: 4c4c 2920 7b3c 2f64 6976 3e0a 3c64 6976 LL) {
.
< │ │ │ │ +00006f40: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00006f50: 6e6f 223e 2020 3232 363c 2f73 7061 6e3e no"> 226 │ │ │ │ +00006f60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ +00006fb0: 2020 3232 373c 2f73 7061 6e3e 2020 2020 227 │ │ │ │ +00006fc0: 2020 2020 2876 6f69 6429 696e 7374 616e (void)instan │ │ │ │ +00006fd0: 6365 3b20 2020 2020 2020 3c73 7061 6e20 ce; │ │ │ │ +00006ff0: 2f2f 2075 6e75 7365 643c 2f73 7061 6e3e // unused │ │ │ │ +00007000: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00007050: 2032 3238 3c2f 7370 616e 3e20 2020 2020 228 │ │ │ │ +00007060: 2020 2028 766f 6964 2964 6576 6963 6543 (void)deviceC │ │ │ │ +00007070: 6f6e 7465 7874 3b20 203c 7370 616e 2063 ontext; / │ │ │ │ +00007090: 2f20 756e 7573 6564 3c2f 7370 616e 3e3c / unused< │ │ │ │ +000070a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000070f0: 3232 393c 2f73 7061 6e3e 203c 2f64 6976 229
.
230< │ │ │ │ +00007150: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> return EvalStenc │ │ │ │ +000071e0: 696c 733c 2f61 3e28 7372 6342 7566 6665 ils(srcBuffe │ │ │ │ +000071f0: 722d 2667 743b 4269 6e64 4375 6461 4275 r->BindCudaBu │ │ │ │ +00007200: 6666 6572 2829 2c20 7372 6344 6573 632c ffer(), srcDesc, │ │ │ │ +00007210: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00007260: 2032 3331 3c2f 7370 616e 3e20 2020 2020 231 │ │ │ │ +00007270: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007280: 2020 2020 2020 2064 7374 4275 6666 6572 dstBuffer │ │ │ │ +00007290: 2d26 6774 3b42 696e 6443 7564 6142 7566 ->BindCudaBuf │ │ │ │ +000072a0: 6665 7228 292c 2064 7374 4465 7363 2c3c fer(), dstDesc,< │ │ │ │ +000072b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00007300: 3233 323c 2f73 7061 6e3e 2020 2020 2020 232 │ │ │ │ +00007310: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007320: 2020 2020 2020 6475 4275 6666 6572 2d26 duBuffer-& │ │ │ │ +00007330: 6774 3b42 696e 6443 7564 6142 7566 6665 gt;BindCudaBuffe │ │ │ │ +00007340: 7228 292c 2020 6475 4465 7363 2c3c 2f64 r(), duDesc,.
23 │ │ │ │ +000073a0: 333c 2f73 7061 6e3e 2020 2020 2020 2020 3 │ │ │ │ +000073b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000073c0: 2020 2020 6476 4275 6666 6572 2d26 6774 dvBuffer-> │ │ │ │ +000073d0: 3b42 696e 6443 7564 6142 7566 6665 7228 ;BindCudaBuffer( │ │ │ │ +000073e0: 292c 2020 6476 4465 7363 2c3c 2f64 6976 ), dvDesc,
.
234< │ │ │ │ +00007440: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +00007450: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007460: 2020 283c 7370 616e 2063 6c61 7373 3d22 (int │ │ │ │ +00007480: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c co │ │ │ │ +000074a0: 6e73 743c 2f73 7061 6e3e 202a 2973 7465 nst *)ste │ │ │ │ +000074b0: 6e63 696c 5461 626c 652d 2667 743b 4765 ncilTable->Ge │ │ │ │ +000074c0: 7453 697a 6573 4275 6666 6572 2829 2c3c tSizesBuffer(),< │ │ │ │ +000074d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00007520: 3233 353c 2f73 7061 6e3e 2020 2020 2020 235 │ │ │ │ +00007530: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007540: 2020 2020 2020 283c 7370 616e 2063 6c61 (int const * │ │ │ │ +00007590: 2973 7465 6e63 696c 5461 626c 652d 2667 )stencilTable-&g │ │ │ │ +000075a0: 743b 4765 744f 6666 7365 7473 4275 6666 t;GetOffsetsBuff │ │ │ │ +000075b0: 6572 2829 2c3c 2f64 6976 3e0a 3c64 6976 er(),
.
< │ │ │ │ +000075f0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00007600: 6e6f 223e 2020 3233 363c 2f73 7061 6e3e no"> 236 │ │ │ │ +00007610: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007620: 2020 2020 2020 2020 2020 2020 283c 7370 (int const *)stencilTa │ │ │ │ +00007680: 626c 652d 2667 743b 4765 7449 6e64 6963 ble->GetIndic │ │ │ │ +00007690: 6573 4275 6666 6572 2829 2c3c 2f64 6976 esBuffer(),
.
237< │ │ │ │ +000076f0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +00007700: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007710: 2020 283c 7370 616e 2063 6c61 7373 3d22 (flo │ │ │ │ +00007730: 6174 3c2f 7370 616e 3e20 3c73 7061 6e20 at │ │ │ │ +00007750: 636f 6e73 743c 2f73 7061 6e3e 202a 2973 const *)s │ │ │ │ +00007760: 7465 6e63 696c 5461 626c 652d 2667 743b tencilTable-> │ │ │ │ +00007770: 4765 7457 6569 6768 7473 4275 6666 6572 GetWeightsBuffer │ │ │ │ +00007780: 2829 2c3c 2f64 6976 3e0a 3c64 6976 2063 (),
.
238 │ │ │ │ +000077e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000077f0: 2020 2020 2020 2020 2020 283c 7370 616e (float const *)stencilTa │ │ │ │ +00007850: 626c 652d 2667 743b 4765 7444 7557 6569 ble->GetDuWei │ │ │ │ +00007860: 6768 7473 4275 6666 6572 2829 2c3c 2f64 ghtsBuffer(),.
23 │ │ │ │ +000078c0: 393c 2f73 7061 6e3e 2020 2020 2020 2020 9 │ │ │ │ +000078d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000078e0: 2020 2020 283c 7370 616e 2063 6c61 7373 (f │ │ │ │ +00007900: 6c6f 6174 3c2f 7370 616e 3e20 3c73 7061 loat const * │ │ │ │ +00007930: 2973 7465 6e63 696c 5461 626c 652d 2667 )stencilTable-&g │ │ │ │ +00007940: 743b 4765 7444 7657 6569 6768 7473 4275 t;GetDvWeightsBu │ │ │ │ +00007950: 6666 6572 2829 2c3c 2f64 6976 3e0a 3c64 ffer(),
. │ │ │ │ +00007970: 3c61 2069 643d 226c 3030 3234 3022 206e 240 │ │ │ │ +000079c0: 2020 2020 2020 2020 2020 2020 2020 3c73 /*start = */ │ │ │ │ +000079f0: 3c2f 7370 616e 3e20 302c 3c2f 6469 763e 0,
│ │ │ │ +00007a00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00007a30: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 241 │ │ │ │ +00007a60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00007a70: 203c 7370 616e 2063 6c61 7373 3d22 636f /*end = │ │ │ │ +00007a90: 202a 2f3c 2f73 7061 6e3e 2073 7465 6e63 */ stenc │ │ │ │ +00007aa0: 696c 5461 626c 652d 2667 743b 4765 744e ilTable->GetN │ │ │ │ +00007ab0: 756d 5374 656e 6369 6c73 2829 293b 3c2f umStencils());.
2 │ │ │ │ +00007b10: 3432 3c2f 7370 616e 3e20 2020 207d 3c2f 42 }.
2 │ │ │ │ +00007b70: 3433 3c2f 7370 616e 3e20 3c2f 6469 763e 43
│ │ │ │ +00007b80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00007bb0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d │ │ │ │ +00007c10: 3238 343c 2f61 3e3c 2f73 7061 6e3e 2020 284 │ │ │ │ +00007c20: 2020 3c73 7061 6e20 636c 6173 733d 226b static │ │ │ │ +00007c60: 626f 6f6c 3c2f 7370 616e 3e20 3c61 2063 bool Eva │ │ │ │ +00007cc0: 6c53 7465 6e63 696c 733c 2f61 3e28 3c2f lStencils(.
2 │ │ │ │ +00007d20: 3835 3c2f 7370 616e 3e20 2020 2020 2020 85 │ │ │ │ +00007d30: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const fl │ │ │ │ +00007d70: 6f61 743c 2f73 7061 6e3e 202a 7372 632c oat *src, │ │ │ │ +00007d80: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +00007db0: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &srcDe │ │ │ │ +00007df0: 7363 2c3c 2f64 6976 3e0a 3c64 6976 2063 sc,
.
286 │ │ │ │ +00007e50: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +00007e70: 666c 6f61 743c 2f73 7061 6e3e 202a 6473 float *ds │ │ │ │ +00007e80: 742c 2020 2020 2020 203c 6120 636c 6173 t, BufferDesc │ │ │ │ +00007ec0: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +00007ef0: 6d70 3b64 7374 4465 7363 2c3c 2f64 6976 mp;dstDesc,
.
287< │ │ │ │ +00007f50: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> float *du, │ │ │ │ +00007f90: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +00007fc0: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &duDes │ │ │ │ +00008000: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
288 │ │ │ │ +00008060: 2020 2020 203c 7370 616e 2063 6c61 7373 f │ │ │ │ +00008080: 6c6f 6174 3c2f 7370 616e 3e20 2a64 762c loat *dv, │ │ │ │ +00008090: 2020 2020 2020 2020 3c61 2063 6c61 7373 BufferDescr │ │ │ │ +000080d0: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +000080f0: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +00008100: 703b 6476 4465 7363 2c3c 2f64 6976 3e0a p;dvDesc,
. │ │ │ │ +00008110: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +00008140: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 289 const < │ │ │ │ +00008190: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000081a0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int * sizes,.
290 │ │ │ │ +00008210: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ +00008220: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00008230: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const int< │ │ │ │ +00008260: 2f73 7061 6e3e 202a 206f 6666 7365 7473 /span> * offsets │ │ │ │ +00008270: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +000082c0: 2020 3239 313c 2f73 7061 6e3e 2020 2020 291 │ │ │ │ +000082d0: 2020 2020 3c73 7061 6e20 636c 6173 733d const< │ │ │ │ +000082f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> int * in │ │ │ │ +00008320: 6469 6365 732c 3c2f 6469 763e 0a3c 6469 dices,
.< │ │ │ │ +00008340: 6120 6964 3d22 6c30 3032 3932 2220 6e61 a id="l00292" na │ │ │ │ +00008350: 6d65 3d22 6c30 3032 3932 223e 3c2f 613e me="l00292"> │ │ │ │ +00008360: 3c73 7061 6e20 636c 6173 733d 226c 696e 292 c │ │ │ │ +000083a0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst float * weights,.
29 │ │ │ │ +00008430: 333c 2f73 7061 6e3e 2020 2020 2020 2020 3 │ │ │ │ +00008440: 3c73 7061 6e20 636c 6173 733d 226b 6579 const flo │ │ │ │ +00008480: 6174 3c2f 7370 616e 3e20 2a20 6475 5765 at * duWe │ │ │ │ +00008490: 6967 6874 732c 3c2f 6469 763e 0a3c 6469 ights,
.< │ │ │ │ +000084b0: 6120 6964 3d22 6c30 3032 3934 2220 6e61 a id="l00294" na │ │ │ │ +000084c0: 6d65 3d22 6c30 3032 3934 223e 3c2f 613e me="l00294"> │ │ │ │ +000084d0: 3c73 7061 6e20 636c 6173 733d 226c 696e 294 c │ │ │ │ +00008510: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst float * dvWeights,< │ │ │ │ +00008550: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000085a0: 3239 353c 2f73 7061 6e3e 2020 2020 2020 295 │ │ │ │ +000085b0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +000085d0: 2f73 7061 6e3e 2073 7461 7274 2c20 3c73 /span> start, int end);
.< │ │ │ │ +00008610: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00008620: 3e3c 6120 6964 3d22 6c30 3032 3936 2220 > 296
.
352 │ │ │ │ +000086c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 templat │ │ │ │ +000086e0: 653c 2f73 7061 6e3e 2026 6c74 3b3c 7370 e <typename SRC_BUFFER, < │ │ │ │ +00008720: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00008730: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename DST_BUFFER, │ │ │ │ +00008750: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typename< │ │ │ │ +00008770: 2f73 7061 6e3e 2053 5445 4e43 494c 5f54 /span> STENCIL_T │ │ │ │ +00008780: 4142 4c45 2667 743b 3c2f 6469 763e 0a3c ABLE>
.< │ │ │ │ +00008790: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000087a0: 3e3c 6120 6964 3d22 6c30 3033 3533 2220 > 35 │ │ │ │ +00008820: 333c 2f61 3e3c 2f73 7061 6e3e 2020 2020 3 │ │ │ │ +00008830: 3c73 7061 6e20 636c 6173 733d 226b 6579 static bo │ │ │ │ +00008870: 6f6c 3c2f 7370 616e 3e20 3c61 2063 6c61 ol EvalS │ │ │ │ +000088d0: 7465 6e63 696c 733c 2f61 3e28 3c2f 6469 tencils(.
354 │ │ │ │ +00008930: 3c2f 7370 616e 3e20 2020 2020 2020 2053 S │ │ │ │ +00008940: 5243 5f42 5546 4645 5220 2a73 7263 4275 RC_BUFFER *srcBu │ │ │ │ +00008950: 6666 6572 2c20 3c61 2063 6c61 7373 3d22 ffer, BufferDescrip │ │ │ │ +00008990: 746f 723c 2f61 3e20 3c73 7061 6e20 636c tor co │ │ │ │ +000089b0: 6e73 743c 2f73 7061 6e3e 2026 616d 703b nst & │ │ │ │ +000089c0: 7372 6344 6573 632c 3c2f 6469 763e 0a3c srcDesc,
.< │ │ │ │ +000089d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000089e0: 3e3c 6120 6964 3d22 6c30 3033 3535 2220 > 355 DST_B │ │ │ │ +00008a30: 5546 4645 5220 2a64 7374 4275 6666 6572 UFFER *dstBuffer │ │ │ │ +00008a40: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , B │ │ │ │ +00008a70: 7566 6665 7244 6573 6372 6970 746f 723c ufferDescriptor< │ │ │ │ +00008a80: 2f61 3e20 3c73 7061 6e20 636c 6173 733d /a> const< │ │ │ │ +00008aa0: 2f73 7061 6e3e 2026 616d 703b 6473 7444 /span> &dstD │ │ │ │ +00008ab0: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
356 │ │ │ │ +00008b10: 2020 2020 2020 2044 5354 5f42 5546 4645 DST_BUFFE │ │ │ │ +00008b20: 5220 2a64 7542 7566 6665 722c 2020 3c61 R *duBuffer, Buffe │ │ │ │ +00008b60: 7244 6573 6372 6970 746f 723c 2f61 3e20 rDescriptor │ │ │ │ +00008b70: 3c73 7061 6e20 636c 6173 733d 226b 6579 const &duDesc,< │ │ │ │ +00008ba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00008bf0: 3335 373c 2f73 7061 6e3e 2020 2020 2020 357 │ │ │ │ +00008c00: 2020 4453 545f 4255 4646 4552 202a 6476 DST_BUFFER *dv │ │ │ │ +00008c10: 4275 6666 6572 2c20 203c 6120 636c 6173 Buffer, BufferDesc │ │ │ │ +00008c50: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +00008c80: 6d70 3b64 7644 6573 632c 3c2f 6469 763e mp;dvDesc,
│ │ │ │ +00008c90: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00008cc0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 358 DST │ │ │ │ +00008cf0: 5f42 5546 4645 5220 2a64 7575 4275 6666 _BUFFER *duuBuff │ │ │ │ +00008d00: 6572 2c20 3c61 2063 6c61 7373 3d22 636f er, BufferDescripto │ │ │ │ +00008d40: 723c 2f61 3e20 3c73 7061 6e20 636c 6173 r cons │ │ │ │ +00008d60: 743c 2f73 7061 6e3e 2026 616d 703b 6475 t &du │ │ │ │ +00008d70: 7544 6573 632c 3c2f 6469 763e 0a3c 6469 uDesc,
.< │ │ │ │ +00008d90: 6120 6964 3d22 6c30 3033 3539 2220 6e61 a id="l00359" na │ │ │ │ +00008da0: 6d65 3d22 6c30 3033 3539 223e 3c2f 613e me="l00359"> │ │ │ │ +00008db0: 3c73 7061 6e20 636c 6173 733d 226c 696e 359 DST_BUF │ │ │ │ +00008de0: 4645 5220 2a64 7576 4275 6666 6572 2c20 FER *duvBuffer, │ │ │ │ +00008df0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Buf │ │ │ │ +00008e20: 6665 7244 6573 6372 6970 746f 723c 2f61 ferDescriptor const
&duvDes │ │ │ │ +00008e60: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
360 │ │ │ │ +00008ec0: 2020 2020 2044 5354 5f42 5546 4645 5220 DST_BUFFER │ │ │ │ +00008ed0: 2a64 7676 4275 6666 6572 2c20 3c61 2063 *dvvBuffer, BufferD │ │ │ │ +00008f10: 6573 6372 6970 746f 723c 2f61 3e20 3c73 escriptor const │ │ │ │ +00008f40: 2026 616d 703b 6476 7644 6573 632c 3c2f &dvvDesc,.
3 │ │ │ │ +00008fa0: 3631 3c2f 7370 616e 3e20 2020 2020 2020 61 │ │ │ │ +00008fb0: 2053 5445 4e43 494c 5f54 4142 4c45 203c STENCIL_TABLE < │ │ │ │ +00008fc0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00008fd0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const *stencilTable, │ │ │ │ +00008ff0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00009040: 2033 3632 3c2f 7370 616e 3e20 2020 2020 362 │ │ │ │ +00009050: 2020 203c 7370 616e 2063 6c61 7373 3d22 const CudaEvaluator< │ │ │ │ +000090b0: 2f61 3e20 2a69 6e73 7461 6e63 6520 3d20 /a> *instance = │ │ │ │ +000090c0: 4e55 4c4c 2c3c 2f64 6976 3e0a 3c64 6976 NULL,
.
< │ │ │ │ +00009100: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00009110: 6e6f 223e 2020 3336 333c 2f73 7061 6e3e no"> 363 │ │ │ │ +00009120: 2020 2020 2020 2020 3c73 7061 6e20 636c void * │ │ │ │ +00009150: 6465 7669 6365 436f 6e74 6578 7420 3d20 deviceContext = │ │ │ │ +00009160: 4e55 4c4c 2920 7b3c 2f64 6976 3e0a 3c64 NULL) {
. │ │ │ │ +00009180: 3c61 2069 643d 226c 3030 3336 3422 206e 364
.
365 │ │ │ │ +00009220: 2020 2020 2020 2876 6f69 6429 696e 7374 (void)inst │ │ │ │ +00009230: 616e 6365 3b20 2020 2020 2020 3c73 7061 ance; // unused
.
366 │ │ │ │ +000092c0: 2020 2020 2028 766f 6964 2964 6576 6963 (void)devic │ │ │ │ +000092d0: 6543 6f6e 7465 7874 3b20 203c 7370 616e eContext; // unused
.
│ │ │ │ +00009350: 2020 3336 373c 2f73 7061 6e3e 203c 2f64 367 .
36 │ │ │ │ +000093b0: 383c 2f73 7061 6e3e 2020 2020 2020 2020 8 │ │ │ │ +000093c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +000093e0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 EvalSte │ │ │ │ +00009440: 6e63 696c 733c 2f61 3e28 7372 6342 7566 ncils(srcBuf │ │ │ │ +00009450: 6665 722d 2667 743b 4269 6e64 4375 6461 fer->BindCuda │ │ │ │ +00009460: 4275 6666 6572 2829 2c20 7372 6344 6573 Buffer(), srcDes │ │ │ │ +00009470: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
369 │ │ │ │ +000094d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000094e0: 2020 2020 2020 2020 2064 7374 4275 6666 dstBuff │ │ │ │ +000094f0: 6572 2d26 6774 3b42 696e 6443 7564 6142 er->BindCudaB │ │ │ │ +00009500: 7566 6665 7228 292c 2064 7374 4465 7363 uffer(), dstDesc │ │ │ │ +00009510: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00009560: 2020 3337 303c 2f73 7061 6e3e 2020 2020 370 │ │ │ │ +00009570: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009580: 2020 2020 2020 2020 6475 4275 6666 6572 duBuffer │ │ │ │ +00009590: 2d26 6774 3b42 696e 6443 7564 6142 7566 ->BindCudaBuf │ │ │ │ +000095a0: 6665 7228 292c 2020 6475 4465 7363 2c3c fer(), duDesc,< │ │ │ │ +000095b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00009600: 3337 313c 2f73 7061 6e3e 2020 2020 2020 371 │ │ │ │ +00009610: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009620: 2020 2020 2020 6476 4275 6666 6572 2d26 dvBuffer-& │ │ │ │ +00009630: 6774 3b42 696e 6443 7564 6142 7566 6665 gt;BindCudaBuffe │ │ │ │ +00009640: 7228 292c 2020 6476 4465 7363 2c3c 2f64 r(), dvDesc,.
37 │ │ │ │ +000096a0: 323c 2f73 7061 6e3e 2020 2020 2020 2020 2 │ │ │ │ +000096b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000096c0: 2020 2020 6475 7542 7566 6665 722d 2667 duuBuffer-&g │ │ │ │ +000096d0: 743b 4269 6e64 4375 6461 4275 6666 6572 t;BindCudaBuffer │ │ │ │ +000096e0: 2829 2c20 6475 7544 6573 632c 3c2f 6469 (), duuDesc,.
373 │ │ │ │ +00009740: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00009750: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009760: 2020 2064 7576 4275 6666 6572 2d26 6774 duvBuffer-> │ │ │ │ +00009770: 3b42 696e 6443 7564 6142 7566 6665 7228 ;BindCudaBuffer( │ │ │ │ +00009780: 292c 2064 7576 4465 7363 2c3c 2f64 6976 ), duvDesc,
.
374< │ │ │ │ +000097e0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +000097f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009800: 2020 6476 7642 7566 6665 722d 2667 743b dvvBuffer-> │ │ │ │ +00009810: 4269 6e64 4375 6461 4275 6666 6572 2829 BindCudaBuffer() │ │ │ │ +00009820: 2c20 6476 7644 6573 632c 3c2f 6469 763e , dvvDesc,
│ │ │ │ +00009830: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00009860: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 375 │ │ │ │ +00009890: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000098a0: 2028 3c73 7061 6e20 636c 6173 733d 226b (int< │ │ │ │ +000098c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> con │ │ │ │ +000098e0: 7374 3c2f 7370 616e 3e20 2a29 7374 656e st *)sten │ │ │ │ +000098f0: 6369 6c54 6162 6c65 2d26 6774 3b47 6574 cilTable->Get │ │ │ │ +00009900: 5369 7a65 7342 7566 6665 7228 292c 3c2f SizesBuffer(),.
3 │ │ │ │ +00009960: 3736 3c2f 7370 616e 3e20 2020 2020 2020 76 │ │ │ │ +00009970: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009980: 2020 2020 2028 3c73 7061 6e20 636c 6173 ( │ │ │ │ +000099a0: 696e 743c 2f73 7061 6e3e 203c 7370 616e int const *) │ │ │ │ +000099d0: 7374 656e 6369 6c54 6162 6c65 2d26 6774 stencilTable-> │ │ │ │ +000099e0: 3b47 6574 4f66 6673 6574 7342 7566 6665 ;GetOffsetsBuffe │ │ │ │ +000099f0: 7228 292c 3c2f 6469 763e 0a3c 6469 7620 r(),
.
377 │ │ │ │ +00009a50: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009a60: 2020 2020 2020 2020 2020 2028 3c73 7061 (int │ │ │ │ +00009a90: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const *)stencilTab │ │ │ │ +00009ac0: 6c65 2d26 6774 3b47 6574 496e 6469 6365 le->GetIndice │ │ │ │ +00009ad0: 7342 7566 6665 7228 292c 3c2f 6469 763e sBuffer(),
│ │ │ │ +00009ae0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00009b10: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 378 │ │ │ │ +00009b40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009b50: 2028 3c73 7061 6e20 636c 6173 733d 226b (floa │ │ │ │ +00009b70: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t c │ │ │ │ +00009b90: 6f6e 7374 3c2f 7370 616e 3e20 2a29 7374 onst *)st │ │ │ │ +00009ba0: 656e 6369 6c54 6162 6c65 2d26 6774 3b47 encilTable->G │ │ │ │ +00009bb0: 6574 5765 6967 6874 7342 7566 6665 7228 etWeightsBuffer( │ │ │ │ +00009bc0: 292c 3c2f 6469 763e 0a3c 6469 7620 636c ),
.
379 │ │ │ │ +00009c20: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009c30: 2020 2020 2020 2020 2028 3c73 7061 6e20 (float │ │ │ │ +00009c60: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const *)stencilTab │ │ │ │ +00009c90: 6c65 2d26 6774 3b47 6574 4475 5765 6967 le->GetDuWeig │ │ │ │ +00009ca0: 6874 7342 7566 6665 7228 292c 3c2f 6469 htsBuffer(),.
380 │ │ │ │ +00009d00: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00009d10: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009d20: 2020 2028 3c73 7061 6e20 636c 6173 733d (fl │ │ │ │ +00009d40: 6f61 743c 2f73 7061 6e3e 203c 7370 616e oat const *) │ │ │ │ +00009d70: 7374 656e 6369 6c54 6162 6c65 2d26 6774 stencilTable-> │ │ │ │ +00009d80: 3b47 6574 4476 5765 6967 6874 7342 7566 ;GetDvWeightsBuf │ │ │ │ +00009d90: 6665 7228 292c 3c2f 6469 763e 0a3c 6469 fer(),
.< │ │ │ │ +00009db0: 6120 6964 3d22 6c30 3033 3831 2220 6e61 a id="l00381" na │ │ │ │ +00009dc0: 6d65 3d22 6c30 3033 3831 223e 3c2f 613e me="l00381"> │ │ │ │ +00009dd0: 3c73 7061 6e20 636c 6173 733d 226c 696e 381 │ │ │ │ +00009e00: 2020 2020 2020 2020 2020 2020 2028 3c73 (float const │ │ │ │ +00009e50: 3c2f 7370 616e 3e20 2a29 7374 656e 6369 *)stenci │ │ │ │ +00009e60: 6c54 6162 6c65 2d26 6774 3b47 6574 4475 lTable->GetDu │ │ │ │ +00009e70: 7557 6569 6768 7473 4275 6666 6572 2829 uWeightsBuffer() │ │ │ │ +00009e80: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00009ed0: 2020 3338 323c 2f73 7061 6e3e 2020 2020 382 │ │ │ │ +00009ee0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009ef0: 2020 2020 2020 2020 283c 7370 616e 2063 (float │ │ │ │ +00009f20: 3c73 7061 6e20 636c 6173 733d 226b 6579 const *)stencilTabl │ │ │ │ +00009f50: 652d 2667 743b 4765 7444 7576 5765 6967 e->GetDuvWeig │ │ │ │ +00009f60: 6874 7342 7566 6665 7228 292c 3c2f 6469 htsBuffer(),.
383 │ │ │ │ +00009fc0: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00009fd0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00009fe0: 2020 2028 3c73 7061 6e20 636c 6173 733d (fl │ │ │ │ +0000a000: 6f61 743c 2f73 7061 6e3e 203c 7370 616e oat const *) │ │ │ │ +0000a030: 7374 656e 6369 6c54 6162 6c65 2d26 6774 stencilTable-> │ │ │ │ +0000a040: 3b47 6574 4476 7657 6569 6768 7473 4275 ;GetDvvWeightsBu │ │ │ │ +0000a050: 6666 6572 2829 2c3c 2f64 6976 3e0a 3c64 ffer(),
. │ │ │ │ +0000a070: 3c61 2069 643d 226c 3030 3338 3422 206e 384 │ │ │ │ +0000a0c0: 2020 2020 2020 2020 2020 2020 2020 3c73 /*start = */ │ │ │ │ +0000a0f0: 3c2f 7370 616e 3e20 302c 3c2f 6469 763e 0,
│ │ │ │ +0000a100: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000a130: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 385 │ │ │ │ +0000a160: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000a170: 203c 7370 616e 2063 6c61 7373 3d22 636f /*end = │ │ │ │ +0000a190: 202a 2f3c 2f73 7061 6e3e 2073 7465 6e63 */ stenc │ │ │ │ +0000a1a0: 696c 5461 626c 652d 2667 743b 4765 744e ilTable->GetN │ │ │ │ +0000a1b0: 756d 5374 656e 6369 6c73 2829 293b 3c2f umStencils());.
3 │ │ │ │ +0000a210: 3836 3c2f 7370 616e 3e20 2020 207d 3c2f 86 }.
3 │ │ │ │ +0000a270: 3837 3c2f 7370 616e 3e20 3c2f 6469 763e 87
│ │ │ │ +0000a280: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000a2b0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d │ │ │ │ +0000a310: 3434 393c 2f61 3e3c 2f73 7061 6e3e 2020 449 │ │ │ │ +0000a320: 2020 3c73 7061 6e20 636c 6173 733d 226b static │ │ │ │ +0000a360: 626f 6f6c 3c2f 7370 616e 3e20 3c61 2063 bool Eva │ │ │ │ +0000a3c0: 6c53 7465 6e63 696c 733c 2f61 3e28 3c2f lStencils(.
4 │ │ │ │ +0000a420: 3530 3c2f 7370 616e 3e20 2020 2020 2020 50 │ │ │ │ +0000a430: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const fl │ │ │ │ +0000a470: 6f61 743c 2f73 7061 6e3e 202a 7372 632c oat *src, │ │ │ │ +0000a480: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +0000a4b0: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &srcDe │ │ │ │ +0000a4f0: 7363 2c3c 2f64 6976 3e0a 3c64 6976 2063 sc,
.
451 │ │ │ │ +0000a550: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +0000a570: 666c 6f61 743c 2f73 7061 6e3e 202a 6473 float *ds │ │ │ │ +0000a580: 742c 2020 2020 2020 203c 6120 636c 6173 t, BufferDesc │ │ │ │ +0000a5c0: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +0000a5f0: 6d70 3b64 7374 4465 7363 2c3c 2f64 6976 mp;dstDesc,
.
452< │ │ │ │ +0000a650: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> float *du, │ │ │ │ +0000a690: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +0000a6c0: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &duDes │ │ │ │ +0000a700: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
453 │ │ │ │ +0000a760: 2020 2020 203c 7370 616e 2063 6c61 7373 f │ │ │ │ +0000a780: 6c6f 6174 3c2f 7370 616e 3e20 2a64 762c loat *dv, │ │ │ │ +0000a790: 2020 2020 2020 2020 3c61 2063 6c61 7373 BufferDescr │ │ │ │ +0000a7d0: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +0000a7f0: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +0000a800: 703b 6476 4465 7363 2c3c 2f64 6976 3e0a p;dvDesc,
. │ │ │ │ +0000a810: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
│ │ │ │ +0000a960: 2020 3435 353c 2f73 7061 6e3e 2020 2020 455 │ │ │ │ +0000a970: 2020 2020 3c73 7061 6e20 636c 6173 733d fl │ │ │ │ +0000a990: 6f61 743c 2f73 7061 6e3e 202a 6475 762c oat *duv, │ │ │ │ +0000a9a0: 2020 2020 2020 203c 6120 636c 6173 733d BufferDescri │ │ │ │ +0000a9e0: 7074 6f72 3c2f 613e 203c 7370 616e 2063 ptor c │ │ │ │ +0000aa00: 6f6e 7374 3c2f 7370 616e 3e20 2661 6d70 onst & │ │ │ │ +0000aa10: 3b64 7576 4465 7363 2c3c 2f64 6976 3e0a ;duvDesc,
. │ │ │ │ +0000aa20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
│ │ │ │ +0000ab70: 2020 3435 373c 2f73 7061 6e3e 2020 2020 457 │ │ │ │ +0000ab80: 2020 2020 3c73 7061 6e20 636c 6173 733d const< │ │ │ │ +0000aba0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> int * si │ │ │ │ +0000abd0: 7a65 732c 3c2f 6469 763e 0a3c 6469 7620 zes,
.
458 │ │ │ │ +0000ac30: 2020 2020 2020 203c 7370 616e 2063 6c61 con │ │ │ │ +0000ac50: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st int * │ │ │ │ +0000ac80: 206f 6666 7365 7473 2c3c 2f64 6976 3e0a offsets,
. │ │ │ │ +0000ac90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +0000acc0: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 459 const < │ │ │ │ +0000ad10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0000ad20: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int * indices,.
4 │ │ │ │ +0000ad90: 3630 3c2f 7370 616e 3e20 2020 2020 2020 60 │ │ │ │ +0000ada0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const fl │ │ │ │ +0000ade0: 6f61 743c 2f73 7061 6e3e 202a 2077 6569 oat * wei │ │ │ │ +0000adf0: 6768 7473 2c3c 2f64 6976 3e0a 3c64 6976 ghts,
.
< │ │ │ │ +0000ae30: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +0000ae40: 6e6f 223e 2020 3436 313c 2f73 7061 6e3e no"> 461 │ │ │ │ +0000ae50: 2020 2020 2020 2020 3c73 7061 6e20 636c co │ │ │ │ +0000ae70: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst float * duWeights,.
4 │ │ │ │ +0000af00: 3632 3c2f 7370 616e 3e20 2020 2020 2020 62 │ │ │ │ +0000af10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const fl │ │ │ │ +0000af50: 6f61 743c 2f73 7061 6e3e 202a 2064 7657 oat * dvW │ │ │ │ +0000af60: 6569 6768 7473 2c3c 2f64 6976 3e0a 3c64 eights,
. │ │ │ │ +0000af80: 3c61 2069 643d 226c 3030 3436 3322 206e 463 │ │ │ │ +0000afe0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const float * duuWeights │ │ │ │ +0000b020: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000b070: 2020 3436 343c 2f73 7061 6e3e 2020 2020 464 │ │ │ │ +0000b080: 2020 2020 3c73 7061 6e20 636c 6173 733d const< │ │ │ │ +0000b0a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> float * │ │ │ │ +0000b0d0: 6475 7657 6569 6768 7473 2c3c 2f64 6976 duvWeights,
.
465< │ │ │ │ +0000b130: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> const │ │ │ │ +0000b160: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ │ +0000b180: 3c2f 7370 616e 3e20 2a20 6476 7657 6569 * dvvWei │ │ │ │ +0000b190: 6768 7473 2c3c 2f64 6976 3e0a 3c64 6976 ghts,
.
< │ │ │ │ +0000b1d0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +0000b1e0: 6e6f 223e 2020 3436 363c 2f73 7061 6e3e no"> 466 │ │ │ │ +0000b1f0: 2020 2020 2020 2020 3c73 7061 6e20 636c int sta │ │ │ │ +0000b220: 7274 2c20 3c73 7061 6e20 636c 6173 733d rt, in │ │ │ │ +0000b240: 743c 2f73 7061 6e3e 2065 6e64 293b 3c2f t end);.
4 │ │ │ │ +0000b2a0: 3637 3c2f 7370 616e 3e20 3c2f 6469 763e 67
│ │ │ │ +0000b2b0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +0000b320: 6120 6964 3d22 6c30 3035 3032 2220 6e61 a id="l00502" na │ │ │ │ +0000b330: 6d65 3d22 6c30 3035 3032 223e 3c2f 613e me="l00502"> │ │ │ │ +0000b340: 3c73 7061 6e20 636c 6173 733d 226c 696e 502 templ │ │ │ │ +0000b380: 6174 653c 2f73 7061 6e3e 2026 6c74 3b3c ate << │ │ │ │ +0000b390: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0000b3a0: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename
SRC_BUFFER, │ │ │ │ +0000b3c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typename< │ │ │ │ +0000b3e0: 2f73 7061 6e3e 2044 5354 5f42 5546 4645 /span> DST_BUFFE │ │ │ │ +0000b3f0: 522c 3c2f 6469 763e 0a3c 6469 7620 636c R,
.
503 │ │ │ │ +0000b450: 2020 2020 2020 2020 2020 203c 7370 616e typename │ │ │ │ +0000b480: 2050 4154 4348 434f 4f52 445f 4255 4646 PATCHCOORD_BUFF │ │ │ │ +0000b490: 4552 2c20 3c73 7061 6e20 636c 6173 733d ER, typena │ │ │ │ +0000b4b0: 6d65 3c2f 7370 616e 3e20 5041 5443 485f me PATCH_ │ │ │ │ +0000b4c0: 5441 424c 4526 6774 3b3c 2f64 6976 3e0a TABLE>
. │ │ │ │ +0000b4d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +0000b500: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 5 │ │ │ │ +0000b560: 3034 3c2f 613e 3c2f 7370 616e 3e20 2020 04 │ │ │ │ +0000b570: 203c 7370 616e 2063 6c61 7373 3d22 6b65 static b │ │ │ │ +0000b5b0: 6f6f 6c3c 2f73 7061 6e3e 203c 6120 636c ool Eval │ │ │ │ +0000b610: 5061 7463 6865 733c 2f61 3e28 3c2f 6469 Patches(.
505 │ │ │ │ +0000b670: 3c2f 7370 616e 3e20 2020 2020 2020 2053 S │ │ │ │ +0000b680: 5243 5f42 5546 4645 5220 2a73 7263 4275 RC_BUFFER *srcBu │ │ │ │ +0000b690: 6666 6572 2c20 3c61 2063 6c61 7373 3d22 ffer, BufferDescrip │ │ │ │ +0000b6d0: 746f 723c 2f61 3e20 3c73 7061 6e20 636c tor co │ │ │ │ +0000b6f0: 6e73 743c 2f73 7061 6e3e 2026 616d 703b nst & │ │ │ │ +0000b700: 7372 6344 6573 632c 3c2f 6469 763e 0a3c srcDesc,
.< │ │ │ │ +0000b710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000b720: 3e3c 6120 6964 3d22 6c30 3035 3036 2220 > 506 DST_B │ │ │ │ +0000b770: 5546 4645 5220 2a64 7374 4275 6666 6572 UFFER *dstBuffer │ │ │ │ +0000b780: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , B │ │ │ │ +0000b7b0: 7566 6665 7244 6573 6372 6970 746f 723c ufferDescriptor< │ │ │ │ +0000b7c0: 2f61 3e20 3c73 7061 6e20 636c 6173 733d /a> const< │ │ │ │ +0000b7e0: 2f73 7061 6e3e 2026 616d 703b 6473 7444 /span> &dstD │ │ │ │ +0000b7f0: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
507 │ │ │ │ +0000b850: 2020 2020 2020 203c 7370 616e 2063 6c61 int numP │ │ │ │ +0000b880: 6174 6368 436f 6f72 6473 2c3c 2f64 6976 atchCoords,
.
508< │ │ │ │ +0000b8e0: 2f73 7061 6e3e 2020 2020 2020 2020 5041 /span> PA │ │ │ │ +0000b8f0: 5443 4843 4f4f 5244 5f42 5546 4645 5220 TCHCOORD_BUFFER │ │ │ │ +0000b900: 2a70 6174 6368 436f 6f72 6473 2c3c 2f64 *patchCoords,.
50 │ │ │ │ +0000b960: 393c 2f73 7061 6e3e 2020 2020 2020 2020 9 │ │ │ │ +0000b970: 5041 5443 485f 5441 424c 4520 2a70 6174 PATCH_TABLE *pat │ │ │ │ +0000b980: 6368 5461 626c 652c 3c2f 6469 763e 0a3c chTable,
.< │ │ │ │ +0000b990: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000b9a0: 3e3c 6120 6964 3d22 6c30 3035 3130 2220 > 510 CudaEvalu │ │ │ │ +0000ba20: 6174 6f72 3c2f 613e 203c 7370 616e 2063 ator c │ │ │ │ +0000ba40: 6f6e 7374 3c2f 7370 616e 3e20 2a69 6e73 onst *ins │ │ │ │ +0000ba50: 7461 6e63 652c 3c2f 6469 763e 0a3c 6469 tance,
.< │ │ │ │ +0000ba70: 6120 6964 3d22 6c30 3035 3131 2220 6e61 a id="l00511" na │ │ │ │ +0000ba80: 6d65 3d22 6c30 3035 3131 223e 3c2f 613e me="l00511"> │ │ │ │ +0000ba90: 3c73 7061 6e20 636c 6173 733d 226c 696e 511 void * │ │ │ │ +0000bae0: 2064 6576 6963 6543 6f6e 7465 7874 203d deviceContext = │ │ │ │ +0000baf0: 204e 554c 4c29 207b 3c2f 6469 763e 0a3c NULL) {
.< │ │ │ │ +0000bb00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000bb10: 3e3c 6120 6964 3d22 6c30 3035 3132 2220 > 512
.
513 │ │ │ │ +0000bbb0: 2020 2020 2020 2028 766f 6964 2969 6e73 (void)ins │ │ │ │ +0000bbc0: 7461 6e63 653b 2020 2020 2020 203c 7370 tance; // unused
.
514 │ │ │ │ +0000bc50: 2020 2020 2020 2876 6f69 6429 6465 7669 (void)devi │ │ │ │ +0000bc60: 6365 436f 6e74 6578 743b 2020 3c73 7061 ceContext; // unused
.
515 .
5 │ │ │ │ +0000bd40: 3136 3c2f 7370 616e 3e20 2020 2020 2020 16 │ │ │ │ +0000bd50: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +0000bd70: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n EvalPa │ │ │ │ +0000bdd0: 7463 6865 733c 2f61 3e28 7372 6342 7566 tches(srcBuf │ │ │ │ +0000bde0: 6665 722d 2667 743b 4269 6e64 4375 6461 fer->BindCuda │ │ │ │ +0000bdf0: 4275 6666 6572 2829 2c20 7372 6344 6573 Buffer(), srcDes │ │ │ │ +0000be00: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
517 │ │ │ │ 0000be60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000be70: 2020 2020 6473 742e 4661 6365 5765 6967 dst.FaceWeig │ │ │ │ -0000be80: 6874 2869 2920 3d20 7468 6973 436f 6566 ht(i) = thisCoef │ │ │ │ -0000be90: 6620 2a20 7468 6973 2d26 6774 3b3c 6120 f * this->Fa │ │ │ │ -0000bef0: 6365 5765 6967 6874 3c2f 613e 2869 293b ceWeight(i); │ │ │ │ -0000bf00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000bf50: 2032 3837 3c2f 7370 616e 3e20 2020 2020 287 │ │ │ │ -0000bf60: 2020 2020 2020 2020 2020 2020 2020 207d } │ │ │ │ -0000bf70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000bfc0: 2032 3838 3c2f 7370 616e 3e20 2020 2020 288 │ │ │ │ -0000bfd0: 2020 2020 2020 2020 2020 207d 203c 7370 } else {
.
289 │ │ │ │ -0000c060: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000c070: 2020 2061 7373 6572 7428 7468 6973 2d26 assert(this-& │ │ │ │ -0000c080: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;AreFaceWeigh │ │ │ │ -0000c0e0: 7473 466f 7246 6163 6543 656e 7465 7273 tsForFaceCenters │ │ │ │ -0000c0f0: 3c2f 613e 2829 203d 3d20 6473 742e 4172 () == dst.Ar │ │ │ │ -0000c100: 6546 6163 6557 6569 6768 7473 466f 7246 eFaceWeightsForF │ │ │ │ -0000c110: 6163 6543 656e 7465 7273 2829 293b 3c2f aceCenters());.
2 │ │ │ │ -0000c170: 3930 3c2f 7370 616e 3e20 3c2f 6469 763e 90
│ │ │ │ -0000c180: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -0000c1b0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 291 │ │ │ │ -0000c1e0: 2020 2020 2020 2020 203c 7370 616e 2063 for (< │ │ │ │ -0000c210: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0000c220: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int i = 0; i < │ │ │ │ -0000c240: 3b20 6661 6365 5765 6967 6874 436f 756e ; faceWeightCoun │ │ │ │ -0000c250: 743b 202b 2b69 2920 7b3c 2f64 6976 3e0a t; ++i) {
. │ │ │ │ -0000c260: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
. │ │ │ │ -0000c390: 3c61 2069 643d 226c 3030 3239 3322 206e 293 │ │ │ │ -0000c3e0: 2020 2020 2020 7d3c 2f64 6976 3e0a 3c64 }
. │ │ │ │ -0000c400: 3c61 2069 643d 226c 3030 3239 3422 206e 294
│ │ │ │ -0000c450: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
295 │ │ │ │ -0000c4b0: 2020 2020 2020 2020 2020 7d3c 2f64 6976 }
.
296< │ │ │ │ -0000c510: 2f73 7061 6e3e 2020 2020 2020 2020 7d3c /span> }< │ │ │ │ -0000c520: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000c570: 3239 373c 2f73 7061 6e3e 203c 2f64 6976 297
.
298< │ │ │ │ -0000c5d0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -0000c5f0: 7072 6976 6174 653c 2f73 7061 6e3e 3a3c private:< │ │ │ │ -0000c600: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000c650: 3239 393c 2f73 7061 6e3e 2020 2020 2020 299 │ │ │ │ -0000c660: 2020 3c61 2063 6c61 7373 3d22 636f 6465 Weight* _v │ │ │ │ -0000c6c0: 5765 6967 6874 733b 3c2f 6469 763e 0a3c Weights;
.< │ │ │ │ -0000c6d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000c6e0: 3e3c 6120 6964 3d22 6c30 3033 3030 2220 > 300 Weigh │ │ │ │ -0000c780: 743c 2f61 3e2a 205f 6557 6569 6768 7473 t* _eWeights │ │ │ │ -0000c790: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -0000c7e0: 2020 3330 313c 2f73 7061 6e3e 2020 2020 301 │ │ │ │ -0000c7f0: 2020 2020 3c61 2063 6c61 7373 3d22 636f Weight* │ │ │ │ -0000c850: 5f66 5765 6967 6874 733b 3c2f 6469 763e _fWeights;
│ │ │ │ -0000c860: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -0000c8f0: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -0000c980: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -0000ca10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -0000ca40: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 305 bool _fWeightsForC │ │ │ │ -0000caa0: 656e 7465 7273 3b3c 2f64 6976 3e0a 3c64 enters;
. │ │ │ │ -0000cac0: 3c61 2069 643d 226c 3030 3330 3622 206e 306 };
.< │ │ │ │ -0000cb10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000cb20: 3e3c 6120 6964 3d22 6c30 3033 3037 2220 > 307};
.
< │ │ │ │ -0000cba0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000cbb0: 6e6f 223e 2020 3330 383c 2f73 7061 6e3e no"> 308 │ │ │ │ -0000cbc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -0000cc10: 2020 3330 393c 2f73 7061 6e3e 203c 2f64 309 .
31 │ │ │ │ -0000cc70: 303c 2f73 7061 6e3e 3c73 7061 6e20 636c 0// │ │ │ │ -0000cc90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000ccb0: 3c61 2069 643d 226c 3030 3331 3122 206e 311// Crea │ │ │ │ -0000cd10: 7365 2061 6e64 2063 6f72 6e65 7220 6d61 se and corner ma │ │ │ │ -0000cd20: 736b 7320 6172 6520 636f 6d6d 6f6e 2074 sks are common t │ │ │ │ -0000cd30: 6f20 6d6f 7374 2073 6368 656d 6573 202d o most schemes - │ │ │ │ -0000cd40: 2d20 7468 6520 7265 7374 206e 6565 6420 - the rest need │ │ │ │ -0000cd50: 746f 2062 6520 7072 6f76 6964 6564 3c2f to be provided
.
< │ │ │ │ -0000cda0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000cdb0: 6e6f 223e 2020 3331 323c 2f73 7061 6e3e no"> 312 │ │ │ │ -0000cdc0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // for ea │ │ │ │ -0000cde0: 6368 2053 6368 656d 6520 7370 6563 6961 ch Scheme specia │ │ │ │ -0000cdf0: 6c69 7a61 7469 6f6e 2e3c 2f73 7061 6e3e lization. │ │ │ │ -0000ce00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000ce50: 2033 3133 3c2f 7370 616e 3e3c 7370 616e 313//
│ │ │ │ -0000ce80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -0000ceb0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 314templ │ │ │ │ -0000cef0: 6174 653c 2f73 7061 6e3e 2026 6c74 3b53 ate <S │ │ │ │ -0000cf00: 6368 656d 6554 7970 6520 5343 4845 4d45 chemeType SCHEME │ │ │ │ -0000cf10: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
315< │ │ │ │ -0000cf70: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0000cf80: 6f72 6422 3e74 656d 706c 6174 653c 2f73 ord">template <t │ │ │ │ -0000cfb0: 7970 656e 616d 653c 2f73 7061 6e3e 2045 ypename E │ │ │ │ -0000cfc0: 4447 452c 203c 7370 616e 2063 6c61 7373 DGE, typen │ │ │ │ -0000cfe0: 616d 653c 2f73 7061 6e3e 204d 4153 4b26 ame MASK& │ │ │ │ -0000cff0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
316inline void │ │ │ │ -0000d090: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000d0b0: 3c61 2069 643d 226c 3030 3331 3722 206e 317 │ │ │ │ -0000d130: 3c2f 613e 3c2f 7370 616e 3e3c 6120 636c Sche │ │ │ │ -0000d190: 6d65 266c 743b 5343 4845 4d45 2667 743b me<SCHEME> │ │ │ │ -0000d1a0: 3a3a 6173 7369 676e 4372 6561 7365 4d61 ::assignCreaseMa │ │ │ │ -0000d1b0: 736b 466f 7245 6467 653c 2f61 3e28 4544 skForEdge(ED │ │ │ │ -0000d1c0: 4745 203c 7370 616e 2063 6c61 7373 3d22 GE const&, MASK │ │ │ │ -0000d1f0: 2661 6d70 3b20 6d61 736b 293c 7370 616e & mask) const { │ │ │ │ -0000d220: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000d270: 2033 3138 3c2f 7370 616e 3e20 3c2f 6469 318 .
319 │ │ │ │ -0000d2d0: 3c2f 7370 616e 3e20 2020 206d 6173 6b2e mask. │ │ │ │ -0000d2e0: 5365 744e 756d 5665 7274 6578 5765 6967 SetNumVertexWeig │ │ │ │ -0000d2f0: 6874 7328 3229 3b3c 2f64 6976 3e0a 3c64 hts(2);
. │ │ │ │ -0000d310: 3c61 2069 643d 226c 3030 3332 3022 206e 320 mask.SetNu │ │ │ │ -0000d360: 6d45 6467 6557 6569 6768 7473 2830 293b mEdgeWeights(0); │ │ │ │ -0000d370: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000d3c0: 2033 3231 3c2f 7370 616e 3e20 2020 206d 321 m │ │ │ │ -0000d3d0: 6173 6b2e 5365 744e 756d 4661 6365 5765 ask.SetNumFaceWe │ │ │ │ -0000d3e0: 6967 6874 7328 3029 3b3c 2f64 6976 3e0a ights(0);
. │ │ │ │ -0000d3f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -0000d420: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 322 mask.Set │ │ │ │ -0000d450: 4661 6365 5765 6967 6874 7346 6f72 4661 FaceWeightsForFa │ │ │ │ -0000d460: 6365 4365 6e74 6572 7328 3c73 7061 6e20 ceCenters( │ │ │ │ -0000d480: 6661 6c73 653c 2f73 7061 6e3e 293b 3c2f false);.
3 │ │ │ │ -0000d4e0: 3233 3c2f 7370 616e 3e20 3c2f 6469 763e 23
│ │ │ │ -0000d4f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -0000d520: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 324 mask.Ve │ │ │ │ -0000d550: 7274 6578 5765 6967 6874 2830 2920 3d20 rtexWeight(0) = │ │ │ │ -0000d560: 302e 3566 3b3c 2f64 6976 3e0a 3c64 6976 0.5f;
.
< │ │ │ │ -0000d5a0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000d5b0: 6e6f 223e 2020 3332 353c 2f73 7061 6e3e no"> 325 │ │ │ │ -0000d5c0: 2020 2020 6d61 736b 2e56 6572 7465 7857 mask.VertexW │ │ │ │ -0000d5d0: 6569 6768 7428 3129 203d 2030 2e35 663b eight(1) = 0.5f; │ │ │ │ -0000d5e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000d630: 2033 3236 3c2f 7370 616e 3e7d 3c2f 6469 326}.
327 │ │ │ │ -0000d690: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ -0000d6a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000d6b0: 3e3c 6120 6964 3d22 6c30 3033 3238 2220 > 328templat │ │ │ │ -0000d710: 653c 2f73 7061 6e3e 2026 6c74 3b53 6368 e <Sch │ │ │ │ -0000d720: 656d 6554 7970 6520 5343 4845 4d45 2667 emeType SCHEME&g │ │ │ │ -0000d730: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
329template <typ │ │ │ │ -0000d7d0: 656e 616d 653c 2f73 7061 6e3e 2056 4552 ename VER │ │ │ │ -0000d7e0: 5445 582c 203c 7370 616e 2063 6c61 7373 TEX, typen │ │ │ │ -0000d800: 616d 653c 2f73 7061 6e3e 204d 4153 4b26 ame MASK& │ │ │ │ -0000d810: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
330inline void │ │ │ │ -0000d8b0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000d8d0: 3c61 2069 643d 226c 3030 3333 3122 206e 331 │ │ │ │ -0000d950: 3c2f 613e 3c2f 7370 616e 3e3c 6120 636c Sche │ │ │ │ -0000d9b0: 6d65 266c 743b 5343 4845 4d45 2667 743b me<SCHEME> │ │ │ │ -0000d9c0: 3a3a 6173 7369 676e 436f 726e 6572 4d61 ::assignCornerMa │ │ │ │ -0000d9d0: 736b 466f 7256 6572 7465 783c 2f61 3e28 skForVertex( │ │ │ │ -0000d9e0: 5645 5254 4558 203c 7370 616e 2063 6c61 VERTEX con │ │ │ │ -0000da00: 7374 3c2f 7370 616e 3e26 616d 703b 2c20 st&, │ │ │ │ -0000da10: 4d41 534b 2661 6d70 3b20 6d61 736b 293c MASK& mask)< │ │ │ │ -0000da20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0000da30: 6f72 6422 3e20 636f 6e73 7420 3c2f 7370 ord"> const {
.
332 │ │ │ │ -0000daa0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000daf0: 2033 3333 3c2f 7370 616e 3e20 2020 206d 333 m │ │ │ │ -0000db00: 6173 6b2e 5365 744e 756d 5665 7274 6578 ask.SetNumVertex │ │ │ │ -0000db10: 5765 6967 6874 7328 3129 3b3c 2f64 6976 Weights(1);
.
334< │ │ │ │ -0000db70: 2f73 7061 6e3e 2020 2020 6d61 736b 2e53 /span> mask.S │ │ │ │ -0000db80: 6574 4e75 6d45 6467 6557 6569 6768 7473 etNumEdgeWeights │ │ │ │ -0000db90: 2830 293b 3c2f 6469 763e 0a3c 6469 7620 (0);
.
335 │ │ │ │ -0000dbf0: 2020 206d 6173 6b2e 5365 744e 756d 4661 mask.SetNumFa │ │ │ │ -0000dc00: 6365 5765 6967 6874 7328 3029 3b3c 2f64 ceWeights(0);.
33 │ │ │ │ -0000dc60: 363c 2f73 7061 6e3e 2020 2020 6d61 736b 6 mask │ │ │ │ -0000dc70: 2e53 6574 4661 6365 5765 6967 6874 7346 .SetFaceWeightsF │ │ │ │ -0000dc80: 6f72 4661 6365 4365 6e74 6572 7328 3c73 orFaceCenters(false │ │ │ │ -0000dcb0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
337 .
3 │ │ │ │ -0000dd60: 3338 3c2f 7370 616e 3e20 2020 206d 6173 38 mas │ │ │ │ -0000dd70: 6b2e 5665 7274 6578 5765 6967 6874 2830 k.VertexWeight(0 │ │ │ │ -0000dd80: 2920 3d20 312e 3066 3b3c 2f64 6976 3e0a ) = 1.0f;
. │ │ │ │ -0000dd90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ -0000de20: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000de30: 6e6f 223e 2020 3334 303c 2f73 7061 6e3e no"> 340 │ │ │ │ -0000de40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -0000de90: 2020 3334 313c 2f73 7061 6e3e 203c 2f64 341 .
34 │ │ │ │ -0000def0: 323c 2f73 7061 6e3e 3c73 7061 6e20 636c 2// │ │ │ │ -0000df10: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000df30: 3c61 2069 643d 226c 3030 3334 3322 206e 343// The │ │ │ │ -0000df90: 636f 6d70 7574 6174 696f 6e20 6f66 2061 computation of a │ │ │ │ -0000dfa0: 2066 6163 652d 7665 7274 6578 206d 6173 face-vertex mas │ │ │ │ -0000dfb0: 6b20 6973 2074 7269 7669 616c 2061 6e64 k is trivial and │ │ │ │ -0000dfc0: 2063 6f6e 7369 7374 656e 7420 666f 7220 consistent for │ │ │ │ -0000dfd0: 616c 6c20 7363 6865 6d65 733a 3c2f 7370 all schemes:
.
344//.
34 │ │ │ │ -0000e0b0: 353c 2f73 7061 6e3e 3c73 7061 6e20 636c 5te │ │ │ │ -0000e0d0: 6d70 6c61 7465 3c2f 7370 616e 3e20 266c mplate &l │ │ │ │ -0000e0e0: 743b 5363 6865 6d65 5479 7065 2053 4348 t;SchemeType SCH │ │ │ │ -0000e0f0: 454d 4526 6774 3b3c 2f64 6976 3e0a 3c64 EME>
. │ │ │ │ -0000e110: 3c61 2069 643d 226c 3030 3334 3622 206e 346template │ │ │ │ -0000e170: 3c2f 7370 616e 3e20 266c 743b 3c73 7061 <typename FACE, ty │ │ │ │ -0000e1c0: 7065 6e61 6d65 3c2f 7370 616e 3e20 4d41 pename MA │ │ │ │ -0000e1d0: 534b 2667 743b 3c2f 6469 763e 0a3c 6469 SK>
.< │ │ │ │ -0000e1f0: 6120 6964 3d22 6c30 3033 3437 2220 6e61 a id="l00347" na │ │ │ │ -0000e200: 6d65 3d22 6c30 3033 3437 223e 3c2f 613e me="l00347"> │ │ │ │ -0000e210: 3c73 7061 6e20 636c 6173 733d 226c 696e 347void< │ │ │ │ -0000e250: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -0000e270: 6120 6964 3d22 6c30 3033 3438 2220 6e61 a id="l00348" na │ │ │ │ -0000e280: 6d65 3d22 6c30 3033 3438 223e 3c2f 613e me="l00348"> │ │ │ │ -0000e290: 3c73 7061 6e20 636c 6173 733d 226c 696e 348< │ │ │ │ -0000e2f0: 2f61 3e3c 2f73 7061 6e3e 3c61 2063 6c61 /a>Schem │ │ │ │ -0000e350: 6526 6c74 3b53 4348 454d 4526 6774 3b3a e<SCHEME>: │ │ │ │ -0000e360: 3a43 6f6d 7075 7465 4661 6365 5665 7274 :ComputeFaceVert │ │ │ │ -0000e370: 6578 4d61 736b 3c2f 613e 2846 4143 4520 exMask(FACE │ │ │ │ -0000e380: 3c73 7061 6e20 636c 6173 733d 226b 6579 const& face, MA │ │ │ │ -0000e3b0: 534b 2661 6d70 3b20 6d61 736b 293c 7370 SK& mask) const {
.
349 .
3 │ │ │ │ -0000e490: 3530 3c2f 7370 616e 3e20 2020 203c 7370 50 int vertCount = fa │ │ │ │ -0000e4d0: 6365 2e47 6574 4e75 6d56 6572 7469 6365 ce.GetNumVertice │ │ │ │ -0000e4e0: 7328 293b 3c2f 6469 763e 0a3c 6469 7620 s();
.
351 │ │ │ │ -0000e540: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0000e590: 2033 3532 3c2f 7370 616e 3e20 2020 206d 352 m │ │ │ │ -0000e5a0: 6173 6b2e 5365 744e 756d 5665 7274 6578 ask.SetNumVertex │ │ │ │ -0000e5b0: 5765 6967 6874 7328 7665 7274 436f 756e Weights(vertCoun │ │ │ │ -0000e5c0: 7429 3b3c 2f64 6976 3e0a 3c64 6976 2063 t);
.
353 │ │ │ │ -0000e620: 2020 6d61 736b 2e53 6574 4e75 6d45 6467 mask.SetNumEdg │ │ │ │ -0000e630: 6557 6569 6768 7473 2830 293b 3c2f 6469 eWeights(0);.
354 │ │ │ │ -0000e690: 3c2f 7370 616e 3e20 2020 206d 6173 6b2e mask. │ │ │ │ -0000e6a0: 5365 744e 756d 4661 6365 5765 6967 6874 SetNumFaceWeight │ │ │ │ -0000e6b0: 7328 3029 3b3c 2f64 6976 3e0a 3c64 6976 s(0);
.
< │ │ │ │ -0000e6f0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000e700: 6e6f 223e 2020 3335 353c 2f73 7061 6e3e no"> 355 │ │ │ │ -0000e710: 2020 2020 6d61 736b 2e53 6574 4661 6365 mask.SetFace │ │ │ │ -0000e720: 5765 6967 6874 7346 6f72 4661 6365 4365 WeightsForFaceCe │ │ │ │ -0000e730: 6e74 6572 7328 3c73 7061 6e20 636c 6173 nters(fals │ │ │ │ -0000e750: 653c 2f73 7061 6e3e 293b 3c2f 6469 763e e);
│ │ │ │ -0000e760: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ -0000e7d0: 6120 6964 3d22 6c30 3033 3537 2220 6e61 a id="l00357" na │ │ │ │ -0000e7e0: 6d65 3d22 6c30 3033 3537 223e 3c2f 613e me="l00357"> │ │ │ │ -0000e7f0: 3c73 7061 6e20 636c 6173 733d 226c 696e 357 typen │ │ │ │ -0000e830: 616d 653c 2f73 7061 6e3e 204d 4153 4b3a ame MASK: │ │ │ │ -0000e840: 3a57 6569 6768 7420 7657 6569 6768 7420 :Weight vWeight │ │ │ │ -0000e850: 3d20 312e 3066 202f 2028 3c73 7061 6e20 = 1.0f / ( │ │ │ │ -0000e870: 7479 7065 6e61 6d65 3c2f 7370 616e 3e20 typename │ │ │ │ -0000e880: 4d41 534b 3a3a 5765 6967 6874 2920 7665 MASK::Weight) ve │ │ │ │ -0000e890: 7274 436f 756e 743b 3c2f 6469 763e 0a3c rtCount;
.< │ │ │ │ -0000e8a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000e8b0: 3e3c 6120 6964 3d22 6c30 3033 3538 2220 > 358 for (int i = 0; i < │ │ │ │ -0000e950: 7665 7274 436f 756e 743b 202b 2b69 2920 vertCount; ++i) │ │ │ │ -0000e960: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ │ -0000e9b0: 2020 3335 393c 2f73 7061 6e3e 2020 2020 359 │ │ │ │ -0000e9c0: 2020 2020 6d61 736b 2e56 6572 7465 7857 mask.VertexW │ │ │ │ -0000e9d0: 6569 6768 7428 6929 203d 2076 5765 6967 eight(i) = vWeig │ │ │ │ -0000e9e0: 6874 3b3c 2f64 6976 3e0a 3c64 6976 2063 ht;
.
360 │ │ │ │ -0000ea40: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
361}< │ │ │ │ -0000eaa0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000eaf0: 3336 323c 2f73 7061 6e3e 203c 2f64 6976 362
.
363< │ │ │ │ -0000eb50: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -0000eb70: 3c61 2069 643d 226c 3030 3336 3422 206e 364//
.
│ │ │ │ -0000ec20: 2020 3336 353c 2f73 7061 6e3e 3c73 7061 365// The comput │ │ │ │ -0000ec50: 6174 696f 6e20 6f66 2061 6e20 6564 6765 ation of an edge │ │ │ │ -0000ec60: 2d76 6572 7465 7820 6d61 736b 2072 6571 -vertex mask req │ │ │ │ -0000ec70: 7569 7265 7320 696e 7370 6563 7469 6f6e uires inspection │ │ │ │ -0000ec80: 206f 6620 7368 6172 706e 6573 7320 7661 of sharpness va │ │ │ │ -0000ec90: 6c75 6573 2074 6f3c 2f73 7061 6e3e 3c2f lues to.
3 │ │ │ │ -0000ecf0: 3636 3c2f 7370 616e 3e3c 7370 616e 2063 66/ │ │ │ │ -0000ed10: 2f20 2064 6574 6572 6d69 6e65 2069 6620 / determine if │ │ │ │ -0000ed20: 736d 6f6f 7468 206f 7220 6120 6372 6561 smooth or a crea │ │ │ │ -0000ed30: 7365 2c20 616e 6420 616c 736f 2074 6f20 se, and also to │ │ │ │ -0000ed40: 6465 7465 6374 2061 6e64 2061 7070 6c79 detect and apply │ │ │ │ -0000ed50: 2061 2074 7261 6e73 6974 696f 6e20 6672 a transition fr │ │ │ │ -0000ed60: 6f6d 2061 3c2f 7370 616e 3e3c 2f64 6976 om a
.
367< │ │ │ │ -0000edc0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -0000ede0: 6372 6561 7365 2074 6f20 736d 6f6f 7468 crease to smooth │ │ │ │ -0000edf0: 2e20 2055 7369 6e67 2074 6865 2070 726f . Using the pro │ │ │ │ -0000ee00: 7465 6374 6564 206d 6574 686f 6473 2074 tected methods t │ │ │ │ -0000ee10: 6f20 6173 7369 676e 2074 6865 2073 7065 o assign the spe │ │ │ │ -0000ee20: 6369 6669 6320 6d61 736b 7320 286f 6e6c cific masks (onl │ │ │ │ -0000ee30: 793c 2f73 7061 6e3e 3c2f 6469 763e 0a3c y
.< │ │ │ │ -0000ee40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0000ee50: 3e3c 6120 6964 3d22 6c30 3033 3638 2220 > 368// two │ │ │ │ -0000eeb0: 202d 2d20 736d 6f6f 7468 206f 7220 6372 -- smooth or cr │ │ │ │ -0000eec0: 6561 7365 2920 7468 6973 2069 6d70 6c65 ease) this imple │ │ │ │ -0000eed0: 6d65 6e74 6174 696f 6e20 7368 6f75 6c64 mentation should │ │ │ │ -0000eee0: 2073 6572 7665 2061 6c6c 206e 6f6e 2d6c serve all non-l │ │ │ │ -0000eef0: 696e 6561 7220 7363 6865 6d65 733c 2f73 inear schemes
.
369< │ │ │ │ -0000ef60: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0000ef70: 656e 7422 3e2f 2f20 2028 6375 7272 656e ent">// (curren │ │ │ │ -0000ef80: 746c 7920 4361 746d 6172 6b20 616e 6420 tly Catmark and │ │ │ │ -0000ef90: 4c6f 6f70 2920 616e 6420 6f6e 6c79 206e Loop) and only n │ │ │ │ -0000efa0: 6565 6473 2074 6f20 6265 2073 7065 6369 eeds to be speci │ │ │ │ -0000efb0: 616c 697a 6564 2066 6f72 2042 696c 696e alized for Bilin │ │ │ │ -0000efc0: 6561 7220 746f 3c2f 7370 616e 3e3c 2f64 ear to.
37 │ │ │ │ -0000f020: 303c 2f73 7061 6e3e 3c73 7061 6e20 636c 0// │ │ │ │ -0000f040: 2020 7472 6976 6961 6c69 7a65 2069 7420 trivialize it │ │ │ │ -0000f050: 746f 2074 6865 2063 7265 6173 6520 6361 to the crease ca │ │ │ │ -0000f060: 7365 2e3c 2f73 7061 6e3e 3c2f 6469 763e se.
│ │ │ │ -0000f070: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
372< │ │ │ │ -0000f140: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0000f150: 656e 7422 3e2f 2f20 2054 6865 2069 6d70 ent">// The imp │ │ │ │ -0000f160: 6c65 6d65 6e74 6174 696f 6e20 6865 7265 lementation here │ │ │ │ -0000f170: 2069 7320 736c 6967 6874 6c79 2063 6f6d is slightly com │ │ │ │ -0000f180: 706c 6963 6174 6564 2062 7920 636f 6d62 plicated by comb │ │ │ │ -0000f190: 696e 696e 6720 7477 6f20 7363 656e 6172 ining two scenar │ │ │ │ -0000f1a0: 696f 7320 696e 746f 2061 3c2f 7370 616e ios into a
.
│ │ │ │ -0000f200: 2020 3337 333c 2f73 7061 6e3e 3c73 7061 373// single imp │ │ │ │ -0000f230: 6c65 6d65 6e74 6174 696f 6e20 2d2d 2065 lementation -- e │ │ │ │ -0000f240: 6974 6865 7220 7468 6520 6361 6c6c 6572 ither the caller │ │ │ │ -0000f250: 206b 6e6f 7773 2074 6865 2070 6172 656e knows the paren │ │ │ │ -0000f260: 7420 616e 6420 6368 696c 6420 7275 6c65 t and child rule │ │ │ │ -0000f270: 7320 616e 643c 2f73 7061 6e3e 3c2f 6469 s and.
374 │ │ │ │ -0000f2d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 // │ │ │ │ -0000f2f0: 2070 726f 7669 6465 7320 7468 656d 2c20 provides them, │ │ │ │ -0000f300: 6f72 2074 6865 7920 646f 6e26 2333 393b or they don' │ │ │ │ -0000f310: 7420 616e 6420 7468 6520 5275 6c65 7320 t and the Rules │ │ │ │ -0000f320: 6861 7665 2074 6f20 6265 2064 6574 6572 have to be deter │ │ │ │ -0000f330: 6d69 6e65 6420 6672 6f6d 2073 6861 7270 mined from sharp │ │ │ │ -0000f340: 6e65 7373 3c2f 7370 616e 3e3c 2f64 6976 ness
.
375< │ │ │ │ -0000f3a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -0000f3c0: 7661 6c75 6573 2e20 2042 6f74 6820 6361 values. Both ca │ │ │ │ -0000f3d0: 7365 7320 696e 636c 7564 6520 7175 6963 ses include quic │ │ │ │ -0000f3e0: 6b20 7265 7475 726e 206f 6e63 6520 7468 k return once th │ │ │ │ -0000f3f0: 6520 7061 7265 6e74 2069 7320 6465 7465 e parent is dete │ │ │ │ -0000f400: 726d 696e 6564 2074 6f20 6265 3c2f 7370 rmined to be
.
376// smooth o │ │ │ │ -0000f490: 7220 7468 6520 6368 696c 6420 6120 6372 r the child a cr │ │ │ │ -0000f4a0: 6561 7365 2c20 6c65 6176 696e 6720 7468 ease, leaving th │ │ │ │ -0000f4b0: 6520 7472 616e 7369 7469 6f6e 616c 2063 e transitional c │ │ │ │ -0000f4c0: 6173 6520 7265 6d61 696e 696e 672e 3c2f ase remaining.
.
< │ │ │ │ -0000f510: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0000f520: 6e6f 223e 2020 3337 373c 2f73 7061 6e3e no"> 377 │ │ │ │ -0000f530: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ -0000f550: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0000f5a0: 3337 383c 2f73 7061 6e3e 3c73 7061 6e20 378 │ │ │ │ -0000f5c0: 2f2f 2020 5468 6520 6f76 6572 616c 6c20 // The overall │ │ │ │ -0000f5d0: 7072 6f63 6573 7320 6973 2061 7320 666f process is as fo │ │ │ │ -0000f5e0: 6c6c 6f77 733a 3c2f 7370 616e 3e3c 2f64 llows:.
37 │ │ │ │ -0000f640: 393c 2f73 7061 6e3e 3c73 7061 6e20 636c 9// │ │ │ │ -0000f660: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -0000f680: 3c61 2069 643d 226c 3030 3338 3022 206e 380// │ │ │ │ -0000f6e0: 2d20 7175 6963 6b6c 7920 6465 7465 6374 - quickly detect │ │ │ │ -0000f6f0: 2074 6865 206d 6f73 7420 636f 6d6d 6f6e the most common │ │ │ │ -0000f700: 2073 7065 6369 6669 6564 206f 7220 6465 specified or de │ │ │ │ -0000f710: 7465 6374 6564 2053 6d6f 6f74 6820 6361 tected Smooth ca │ │ │ │ -0000f720: 7365 2061 6e64 2072 6574 7572 6e3c 2f73 se and return
.
381< │ │ │ │ -0000f790: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0000f7a0: 656e 7422 3e2f 2f20 2020 2020 202d 2071 ent">// - q │ │ │ │ -0000f7b0: 7569 636b 6c79 2064 6574 6563 7420 6120 uickly detect a │ │ │ │ -0000f7c0: 6675 6c6c 2043 7265 6173 6520 6279 2063 full Crease by c │ │ │ │ -0000f7d0: 6869 6c64 2052 756c 6520 6173 7369 676e hild Rule assign │ │ │ │ -0000f7e0: 6d65 6e74 2061 6e64 2072 6574 7572 6e3c ment and return< │ │ │ │ -0000f7f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -0000f810: 6120 6964 3d22 6c30 3033 3832 2220 6e61 a id="l00382" na │ │ │ │ -0000f820: 6d65 3d22 6c30 3033 3832 223e 3c2f 613e me="l00382"> │ │ │ │ -0000f830: 3c73 7061 6e20 636c 6173 733d 226c 696e 382// - │ │ │ │ -0000f870: 2064 6574 6572 6d69 6e65 2066 726f 6d20 determine from │ │ │ │ -0000f880: 7368 6172 706e 6573 7320 6966 2075 6e73 sharpness if uns │ │ │ │ -0000f890: 7065 6369 6669 6564 2063 6869 6c64 2069 pecified child i │ │ │ │ -0000f8a0: 7320 6120 6372 6561 7365 202d 2d20 7265 s a crease -- re │ │ │ │ -0000f8b0: 7475 726e 2069 6620 736f 3c2f 7370 616e turn if so
.
│ │ │ │ -0000f910: 2020 3338 333c 2f73 7061 6e3e 3c73 7061 383// - comp │ │ │ │ -0000f940: 7574 6520 736d 6f6f 7468 206d 6173 6b20 ute smooth mask │ │ │ │ -0000f950: 666f 7220 6368 696c 6420 616e 6420 636f for child and co │ │ │ │ -0000f960: 6d62 696e 6520 7769 7468 2063 7265 6173 mbine with creas │ │ │ │ -0000f970: 6520 6672 6f6d 2070 6172 656e 743c 2f73 e from parent
.
384< │ │ │ │ -0000f9e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0000f9f0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
3 │ │ │ │ -0000fa50: 3835 3c2f 7370 616e 3e3c 7370 616e 2063 85/ │ │ │ │ -0000fa70: 2f20 2055 7361 6765 206f 6620 7468 6520 / Usage of the │ │ │ │ -0000fa80: 7061 7265 6e74 2052 756c 6520 6865 7265 parent Rule here │ │ │ │ -0000fa90: 2061 6c6c 6f77 7320 736f 6d65 206d 6973 allows some mis │ │ │ │ -0000faa0: 7573 6520 696e 2074 6861 7420 6f6e 6c79 use in that only │ │ │ │ -0000fab0: 2074 6872 6565 206f 6620 6669 7665 2070 three of five p │ │ │ │ -0000fac0: 6f73 7369 626c 653c 2f73 7061 6e3e 3c2f ossible.
3 │ │ │ │ -0000fb20: 3836 3c2f 7370 616e 3e3c 7370 616e 2063 86/ │ │ │ │ -0000fb40: 2f20 2061 7373 6967 6e6d 656e 7473 2061 / assignments a │ │ │ │ -0000fb50: 7265 206c 6567 6974 696d 6174 6520 666f re legitimate fo │ │ │ │ -0000fb60: 7220 7468 6520 7061 7265 6e74 2061 6e64 r the parent and │ │ │ │ -0000fb70: 2066 6f75 7220 666f 7220 7468 6520 6368 four for the ch │ │ │ │ -0000fb80: 696c 6420 2844 6172 7420 6265 696e 6720 ild (Dart being │ │ │ │ -0000fb90: 6f6e 6c79 3c2f 7370 616e 3e3c 2f64 6976 only
.
387< │ │ │ │ -0000fbf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -0000fc10: 7661 6c69 6420 666f 7220 7468 6520 6368 valid for the ch │ │ │ │ -0000fc20: 696c 6420 616e 6420 436f 726e 6572 2066 ild and Corner f │ │ │ │ -0000fc30: 6f72 206e 6569 7468 6572 292e 2020 5265 or neither). Re │ │ │ │ -0000fc40: 7375 6c74 7320 6172 6520 756e 6465 6669 sults are undefi │ │ │ │ -0000fc50: 6e65 6420 696e 2074 6865 7365 2063 6173 ned in these cas │ │ │ │ -0000fc60: 6573 2e3c 2f73 7061 6e3e 3c2f 6469 763e es.
│ │ │ │ -0000fc70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
389< │ │ │ │ -0000fd40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0000fd50: 6f72 6422 3e74 656d 706c 6174 653c 2f73 ord">template <SchemeT │ │ │ │ -0000fd70: 7970 6520 5343 4845 4d45 2667 743b 3c2f ype SCHEME>.
3 │ │ │ │ -0000fdd0: 3930 3c2f 7370 616e 3e3c 7370 616e 2063 90t │ │ │ │ -0000fdf0: 656d 706c 6174 653c 2f73 7061 6e3e 2026 emplate & │ │ │ │ -0000fe00: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;typenam │ │ │ │ -0000fe20: 653c 2f73 7061 6e3e 2045 4447 452c 203c e EDGE, < │ │ │ │ -0000fe30: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0000fe40: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename MASK>.
39 │ │ │ │ -0000feb0: 313c 2f73 7061 6e3e 3c73 7061 6e20 636c 1void.
392Scheme<SCHE │ │ │ │ -0000ffe0: 4d45 2667 743b 3a3a 436f 6d70 7574 6545 ME>::ComputeE │ │ │ │ -0000fff0: 6467 6556 6572 7465 784d 6173 6b3c 2f61 dgeVertexMask(EDGE con │ │ │ │ -00010020: 7374 3c2f 7370 616e 3e26 616d 703b 2020 st& │ │ │ │ -00010030: 2020 2065 6467 652c 3c2f 6469 763e 0a3c edge,
.< │ │ │ │ -00010040: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00010050: 3e3c 6120 6964 3d22 6c30 3033 3933 2220 > 393 │ │ │ │ -000100a0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000100b0: 2020 2020 2020 2020 2020 2020 4d41 534b MASK │ │ │ │ -000100c0: 2661 6d70 3b20 2020 2020 2020 2020 2020 & │ │ │ │ -000100d0: 6d61 736b 2c3c 2f64 6976 3e0a 3c64 6976 mask,
.
< │ │ │ │ -00010110: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00010120: 6e6f 223e 2020 3339 343c 2f73 7061 6e3e no"> 394 │ │ │ │ -00010130: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00010140: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00010150: 2020 2020 2020 2020 203c 6120 636c 6173 Cre │ │ │ │ -000101b0: 6173 653a 3a52 756c 653c 2f61 3e20 7061 ase::Rule pa │ │ │ │ -000101c0: 7265 6e74 5275 6c65 2c3c 2f64 6976 3e0a rentRule,
. │ │ │ │ -000101d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
│ │ │ │ -00010330: 2020 3339 363c 2f73 7061 6e3e 203c 2f64 396 .
39 │ │ │ │ -00010390: 373c 2f73 7061 6e3e 2020 2020 3c73 7061 7 //
.
398< │ │ │ │ -00010410: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00010430: 2f2f 2020 4966 2074 6865 2070 6172 656e // If the paren │ │ │ │ -00010440: 7420 7761 7320 7370 6563 6966 6965 6420 t was specified │ │ │ │ -00010450: 6f72 2064 6574 6572 6d69 6e65 6420 746f or determined to │ │ │ │ -00010460: 2062 6520 536d 6f6f 7468 2c20 7765 2063 be Smooth, we c │ │ │ │ -00010470: 616e 2071 7569 636b 6c79 2072 6574 7572 an quickly retur │ │ │ │ -00010480: 6e3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c n
.< │ │ │ │ -00010490: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000104a0: 3e3c 6120 6964 3d22 6c30 3033 3939 2220 > 399 // │ │ │ │ -00010500: 2077 6974 6820 6120 536d 6f6f 7468 206d with a Smooth m │ │ │ │ -00010510: 6173 6b2e 2020 4f74 6865 7277 6973 6520 ask. Otherwise │ │ │ │ -00010520: 7468 6520 7061 7265 6e74 2069 7320 6120 the parent is a │ │ │ │ -00010530: 6372 6561 7365 202d 2d20 6966 2074 6865 crease -- if the │ │ │ │ -00010540: 2063 6869 6c64 2077 6173 3c2f 7370 616e child was
.
│ │ │ │ -000105a0: 2020 3430 303c 2f73 7061 6e3e 2020 2020 400 │ │ │ │ -000105b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // also s │ │ │ │ -000105d0: 7065 6369 6669 6564 2074 6f20 6265 2061 pecified to be a │ │ │ │ -000105e0: 2063 7265 6173 652c 2077 6520 6361 6e20 crease, we can │ │ │ │ -000105f0: 7175 6963 6b6c 7920 7265 7475 726e 2077 quickly return w │ │ │ │ -00010600: 6974 6820 6120 4372 6561 7365 206d 6173 ith a Crease mas │ │ │ │ -00010610: 6b2e 3c2f 7370 616e 3e3c 2f64 6976 3e0a k.
. │ │ │ │ -00010620: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
. │ │ │ │ -000106b0: 3c61 2069 643d 226c 3030 3430 3222 206e 402 │ │ │ │ -00010710: 6966 3c2f 7370 616e 3e20 2828 7061 7265 if ((pare │ │ │ │ -00010720: 6e74 5275 6c65 203d 3d20 3c61 2063 6c61 ntRule == Cre │ │ │ │ -000107a0: 6173 653a 3a52 554c 455f 534d 4f4f 5448 ase::RULE_SMOOTH │ │ │ │ -000107b0: 3c2f 613e 2920 7c7c 3c2f 6469 763e 0a3c ) ||
.< │ │ │ │ -000107c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000107d0: 3e3c 6120 6964 3d22 6c30 3034 3033 2220 > 403 ((pare │ │ │ │ -00010820: 6e74 5275 6c65 203d 3d20 3c61 2063 6c61 ntRule == Cre │ │ │ │ -000108a0: 6173 653a 3a52 554c 455f 554e 4b4e 4f57 ase::RULE_UNKNOW │ │ │ │ -000108b0: 4e3c 2f61 3e29 2026 616d 703b 2661 6d70 N) && │ │ │ │ -000108c0: 3b20 2865 6467 652e 4765 7453 6861 7270 ; (edge.GetSharp │ │ │ │ -000108d0: 6e65 7373 2829 2026 6c74 3b3d 2030 2e30 ness() <= 0.0 │ │ │ │ -000108e0: 6629 2929 207b 3c2f 6469 763e 0a3c 6469 f))) {
.< │ │ │ │ -00010900: 6120 6964 3d22 6c30 3034 3034 2220 6e61 a id="l00404" na │ │ │ │ -00010910: 6d65 3d22 6c30 3034 3034 223e 3c2f 613e me="l00404"> │ │ │ │ -00010920: 3c73 7061 6e20 636c 6173 733d 226c 696e 404 assignS │ │ │ │ -00010950: 6d6f 6f74 684d 6173 6b46 6f72 4564 6765 moothMaskForEdge │ │ │ │ -00010960: 2865 6467 652c 206d 6173 6b29 3b3c 2f64 (edge, mask);.
40 │ │ │ │ -000109c0: 353c 2f73 7061 6e3e 2020 2020 2020 2020 5 │ │ │ │ -000109d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ -000109f0: 3c2f 7370 616e 3e3b 3c2f 6469 763e 0a3c ;
.< │ │ │ │ -00010a00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00010a10: 3e3c 6120 6964 3d22 6c30 3034 3036 2220 > 406 }
.< │ │ │ │ -00010a60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00010a70: 3e3c 6120 6964 3d22 6c30 3034 3037 2220 > 407 if (chil │ │ │ │ -00010ae0: 6452 756c 6520 3d3d 203c 6120 636c 6173 dRule == Crea │ │ │ │ -00010b60: 7365 3a3a 5255 4c45 5f43 5245 4153 453c se::RULE_CREASE< │ │ │ │ -00010b70: 2f61 3e29 207b 3c2f 6469 763e 0a3c 6469 /a>) {
.< │ │ │ │ -00010b90: 6120 6964 3d22 6c30 3034 3038 2220 6e61 a id="l00408" na │ │ │ │ -00010ba0: 6d65 3d22 6c30 3034 3038 223e 3c2f 613e me="l00408"> │ │ │ │ -00010bb0: 3c73 7061 6e20 636c 6173 733d 226c 696e 408 assignC │ │ │ │ -00010be0: 7265 6173 654d 6173 6b46 6f72 4564 6765 reaseMaskForEdge │ │ │ │ -00010bf0: 2865 6467 652c 206d 6173 6b29 3b3c 2f64 (edge, mask);.
40 │ │ │ │ -00010c50: 393c 2f73 7061 6e3e 2020 2020 2020 2020 9 │ │ │ │ -00010c60: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ -00010c80: 3c2f 7370 616e 3e3b 3c2f 6469 763e 0a3c ;
.< │ │ │ │ -00010c90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00010ca0: 3e3c 6120 6964 3d22 6c30 3034 3130 2220 > 410 }
.< │ │ │ │ -00010cf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00010d00: 3e3c 6120 6964 3d22 6c30 3034 3131 2220 > 411
.
412 │ │ │ │ -00010da0: 2020 203c 7370 616e 2063 6c61 7373 3d22 //
.
413 │ │ │ │ -00010e20: 203c 7370 616e 2063 6c61 7373 3d22 636f // We ha │ │ │ │ -00010e40: 7665 2061 2043 7265 6173 6520 6f6e 2074 ve a Crease on t │ │ │ │ -00010e50: 6865 2070 6172 656e 7420 616e 6420 7468 he parent and th │ │ │ │ -00010e60: 6520 6368 696c 6420 7761 7320 6569 7468 e child was eith │ │ │ │ -00010e70: 6572 2073 7065 6369 6669 6564 2061 7320 er specified as │ │ │ │ -00010e80: 536d 6f6f 7468 3c2f 7370 616e 3e3c 2f64 Smooth.
41 │ │ │ │ -00010ee0: 343c 2f73 7061 6e3e 2020 2020 3c73 7061 4 // or was not │ │ │ │ -00010f10: 2073 7065 6369 6669 6564 2061 7420 616c specified at al │ │ │ │ -00010f20: 6c20 2d2d 2064 6561 6c20 7769 7468 2074 l -- deal with t │ │ │ │ -00010f30: 6865 2075 6e73 7065 6369 6669 6564 2063 he unspecified c │ │ │ │ -00010f40: 6173 6520 6669 7273 7420 2861 6761 696e ase first (again │ │ │ │ -00010f50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00010f70: 3c61 2069 643d 226c 3030 3431 3522 206e 415
// │ │ │ │ -00010fd0: 7265 7475 726e 696e 6720 6120 4372 6561 returning a Crea │ │ │ │ -00010fe0: 7365 206d 6173 6b20 6966 2074 6865 2063 se mask if the c │ │ │ │ -00010ff0: 6869 6c64 2069 7320 616c 736f 2064 6574 hild is also det │ │ │ │ -00011000: 6572 6d69 6e65 6420 746f 2062 6520 6120 ermined to be a │ │ │ │ -00011010: 4372 6561 7365 2920 616e 643c 2f73 7061 Crease) and
.
416 │ │ │ │ -00011080: 203c 7370 616e 2063 6c61 7373 3d22 636f // conti │ │ │ │ -000110a0: 6e75 6520 6966 2077 6520 6861 7665 2061 nue if we have a │ │ │ │ -000110b0: 2074 7261 6e73 6974 696f 6e20 746f 2053 transition to S │ │ │ │ -000110c0: 6d6f 6f74 682e 3c2f 7370 616e 3e3c 2f64 mooth..
41 │ │ │ │ -00011120: 373c 2f73 7061 6e3e 2020 2020 3c73 7061 7 //
.
418< │ │ │ │ -000111a0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -000111c0: 2f2f 2020 4e6f 7465 2077 6865 6e20 7175 // Note when qu │ │ │ │ -000111d0: 616c 6966 7969 6e67 2074 6865 2063 6869 alifying the chi │ │ │ │ -000111e0: 6c64 2074 6861 7420 6966 2074 6865 2070 ld that if the p │ │ │ │ -000111f0: 6172 656e 7420 7368 6172 706e 6573 7320 arent sharpness │ │ │ │ -00011200: 2667 743b 2031 2e30 2c20 7265 6761 7264 > 1.0, regard │ │ │ │ -00011210: 6c65 7373 3c2f 7370 616e 3e3c 2f64 6976 less
.
419< │ │ │ │ -00011270: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00011290: 2f2f 2020 6f66 2074 6865 2063 7265 6173 // of the creas │ │ │ │ -000112a0: 696e 6720 6d65 7468 6f64 2c20 7768 6574 ing method, whet │ │ │ │ -000112b0: 6865 7220 7468 6520 6368 696c 6420 7368 her the child sh │ │ │ │ -000112c0: 6172 706e 6573 7320 7661 6c75 6573 2064 arpness values d │ │ │ │ -000112d0: 6563 6179 2074 6f20 7a65 726f 2069 733c ecay to zero is< │ │ │ │ -000112e0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -00011300: 6120 6964 3d22 6c30 3034 3230 2220 6e61 a id="l00420" na │ │ │ │ -00011310: 6d65 3d22 6c30 3034 3230 223e 3c2f 613e me="l00420"> │ │ │ │ -00011320: 3c73 7061 6e20 636c 6173 733d 226c 696e 420 // i │ │ │ │ -00011360: 7272 656c 6576 616e 7420 2d2d 2074 6865 rrelevant -- the │ │ │ │ -00011370: 2066 7261 6374 696f 6e61 6c20 7765 6967 fractional weig │ │ │ │ -00011380: 6874 2066 6f72 2073 7563 6820 6120 6361 ht for such a ca │ │ │ │ -00011390: 7365 2028 7468 6520 7661 6c75 6520 6f66 se (the value of │ │ │ │ -000113a0: 2074 6865 2070 6172 656e 743c 2f73 7061 the parent
.
421 │ │ │ │ -00011410: 203c 7370 616e 2063 6c61 7373 3d22 636f // sharp │ │ │ │ -00011430: 6e65 7373 2920 6973 2026 6774 3b20 312e ness) is > 1. │ │ │ │ -00011440: 302c 2061 6e64 2077 6865 6e20 636c 616d 0, and when clam │ │ │ │ -00011450: 7065 6420 746f 2031 2065 6666 6563 7469 ped to 1 effecti │ │ │ │ -00011460: 7665 6c79 2079 6965 6c64 7320 6120 6675 vely yields a fu │ │ │ │ -00011470: 6c6c 2063 7265 6173 652e 3c2f 7370 616e ll crease.
.
│ │ │ │ -000114d0: 2020 3432 323c 2f73 7061 6e3e 2020 2020 422 │ │ │ │ -000114e0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ -00011500: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00011550: 3432 333c 2f73 7061 6e3e 2020 2020 3c73 423 if (childRule == │ │ │ │ -00011590: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Crease::RULE_ │ │ │ │ -00011610: 554e 4b4e 4f57 4e3c 2f61 3e29 207b 3c2f UNKNOWN) {.
4 │ │ │ │ -00011670: 3234 3c2f 7370 616e 3e20 2020 2020 2020 24 │ │ │ │ -00011680: 203c 6120 636c 6173 733d 2263 6f64 6520 Cre │ │ │ │ -000116b0: 6173 653c 2f61 3e20 6372 6561 7365 285f ase crease(_ │ │ │ │ -000116c0: 6f70 7469 6f6e 7329 3b3c 2f64 6976 3e0a options);
. │ │ │ │ -000116d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ -00011760: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00011770: 6e6f 223e 2020 3432 363c 2f73 7061 6e3e no"> 426 │ │ │ │ -00011780: 2020 2020 2020 2020 3c73 7061 6e20 636c bool ch │ │ │ │ -000117b0: 696c 6449 7343 7265 6173 6520 3d20 3c73 ildIsCrease = false │ │ │ │ -000117e0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -00011830: 2020 3432 373c 2f73 7061 6e3e 2020 2020 427 │ │ │ │ -00011840: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ │ -00011860: 3c2f 7370 616e 3e20 2870 6172 656e 7452 (parentR │ │ │ │ -00011870: 756c 6520 3d3d 203c 6120 636c 6173 733d ule == Crease │ │ │ │ -000118f0: 3a3a 5255 4c45 5f43 5245 4153 453c 2f61 ::RULE_CREASE) {
.
428 │ │ │ │ -00011960: 2020 2020 2020 2020 2020 203c 7370 616e // Child unkno │ │ │ │ -00011990: 776e 2061 7320 6465 6661 756c 7420 7661 wn as default va │ │ │ │ -000119a0: 6c75 6520 6275 7420 7061 7265 6e74 2052 lue but parent R │ │ │ │ -000119b0: 756c 6520 7370 6563 6966 6965 6420 6173 ule specified as │ │ │ │ -000119c0: 2043 7265 6173 653c 2f73 7061 6e3e 3c2f Crease.
4 │ │ │ │ -00011a20: 3239 3c2f 7370 616e 3e20 2020 2020 2020 29 │ │ │ │ -00011a30: 2020 2020 2063 6869 6c64 4973 4372 6561 childIsCrea │ │ │ │ -00011a40: 7365 203d 203c 7370 616e 2063 6c61 7373 se = true< │ │ │ │ -00011a60: 2f73 7061 6e3e 3b3c 2f64 6976 3e0a 3c64 /span>;
. │ │ │ │ -00011a80: 3c61 2069 643d 226c 3030 3433 3022 206e 430 } else if (edge.GetS │ │ │ │ -00011b20: 6861 7270 6e65 7373 2829 2026 6774 3b3d harpness() >= │ │ │ │ -00011b30: 2031 2e30 6629 207b 3c2f 6469 763e 0a3c 1.0f) {
.< │ │ │ │ -00011b40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00011b50: 3e3c 6120 6964 3d22 6c30 3034 3331 2220 > 431 < │ │ │ │ -00011ba0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00011bb0: 656e 7422 3e2f 2f20 2053 6861 7270 6e65 ent">// Sharpne │ │ │ │ -00011bc0: 7373 2026 6774 3b3d 2031 2e30 2061 6c77 ss >= 1.0 alw │ │ │ │ -00011bd0: 6179 7320 6120 6372 6561 7365 202d 2d20 ays a crease -- │ │ │ │ -00011be0: 7365 6520 6e6f 7465 2061 626f 7665 3c2f see note above
.
< │ │ │ │ -00011c30: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00011c40: 6e6f 223e 2020 3433 323c 2f73 7061 6e3e no"> 432 │ │ │ │ -00011c50: 2020 2020 2020 2020 2020 2020 6368 696c chil │ │ │ │ -00011c60: 6449 7343 7265 6173 6520 3d20 3c73 7061 dIsCrease = true;.
4 │ │ │ │ -00011ce0: 3333 3c2f 7370 616e 3e20 2020 2020 2020 33 │ │ │ │ -00011cf0: 207d 203c 7370 616e 2063 6c61 7373 3d22 } els │ │ │ │ -00011d10: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e if (cr │ │ │ │ -00011d40: 6561 7365 2e3c 6120 636c 6173 733d 2263 ease.IsUniform< │ │ │ │ -00011da0: 2f61 3e28 2929 207b 3c2f 6469 763e 0a3c /a>()) {
.< │ │ │ │ -00011db0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00011dc0: 3e3c 6120 6964 3d22 6c30 3034 3334 2220 > 434 < │ │ │ │ -00011e10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00011e20: 656e 7422 3e2f 2f20 2053 6861 7270 6e65 ent">// Sharpne │ │ │ │ -00011e30: 7373 2026 6c74 3b20 312e 3020 6973 2067 ss < 1.0 is g │ │ │ │ -00011e40: 7561 7261 6e74 6565 6420 746f 2064 6563 uaranteed to dec │ │ │ │ -00011e50: 6179 2074 6f20 302e 3020 666f 7220 556e ay to 0.0 for Un │ │ │ │ -00011e60: 6966 6f72 6d20 6368 696c 6420 6564 6765 iform child edge │ │ │ │ -00011e70: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a3c s
.< │ │ │ │ -00011e80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00011e90: 3e3c 6120 6964 3d22 6c30 3034 3335 2220 > 435 c │ │ │ │ -00011ee0: 6869 6c64 4973 4372 6561 7365 203d 203c hildIsCrease = < │ │ │ │ -00011ef0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00011f00: 6f72 6422 3e66 616c 7365 3c2f 7370 616e ord">false;
.
436 │ │ │ │ -00011f70: 2020 2020 207d 203c 7370 616e 2063 6c61 } else {.
4 │ │ │ │ -00011ff0: 3337 3c2f 7370 616e 3e20 2020 2020 2020 37 │ │ │ │ -00012000: 2020 2020 203c 7370 616e 2063 6c61 7373 // S │ │ │ │ -00012020: 6861 7270 6e65 7373 2026 6c74 3b3d 2031 harpness <= 1 │ │ │ │ -00012030: 2e30 2064 6f65 7320 6e6f 7420 6e65 6365 .0 does not nece │ │ │ │ -00012040: 7373 6172 696c 7920 6465 6361 7920 746f ssarily decay to │ │ │ │ -00012050: 2030 2e30 2066 6f72 2062 6f74 6820 6368 0.0 for both ch │ │ │ │ -00012060: 696c 6420 6564 6765 732e 2e2e 3c2f 7370 ild edges...
.
438 │ │ │ │ -000120d0: 2020 2020 2020 2020 2020 3c73 7061 6e20 float │ │ │ │ -00012100: 2063 4564 6765 5368 6172 706e 6573 735b cEdgeSharpness[ │ │ │ │ -00012110: 325d 3b3c 2f64 6976 3e0a 3c64 6976 2063 2];
.
439 │ │ │ │ -00012170: 2020 2020 2020 2020 2020 6564 6765 2e47 edge.G │ │ │ │ -00012180: 6574 4368 696c 6453 6861 7270 6e65 7373 etChildSharpness │ │ │ │ -00012190: 6573 2863 7265 6173 652c 2063 4564 6765 es(crease, cEdge │ │ │ │ -000121a0: 5368 6172 706e 6573 7329 3b3c 2f64 6976 Sharpness);
.
440< │ │ │ │ -00012200: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -00012210: 2020 6368 696c 6449 7343 7265 6173 6520 childIsCrease │ │ │ │ -00012220: 3d20 2863 4564 6765 5368 6172 706e 6573 = (cEdgeSharpnes │ │ │ │ -00012230: 735b 305d 2026 6774 3b20 302e 3066 2920 s[0] > 0.0f) │ │ │ │ -00012240: 2661 6d70 3b26 616d 703b 2028 6345 6467 && (cEdg │ │ │ │ -00012250: 6553 6861 7270 6e65 7373 5b31 5d20 2667 eSharpness[1] &g │ │ │ │ -00012260: 743b 2030 2e30 6629 3b3c 2f64 6976 3e0a t; 0.0f);
. │ │ │ │ -00012270: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -000122a0: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 441 }.
44 │ │ │ │ -00012320: 323c 2f73 7061 6e3e 2020 2020 2020 2020 2 │ │ │ │ -00012330: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (childIsCrea │ │ │ │ -00012360: 7365 2920 7b3c 2f64 6976 3e0a 3c64 6976 se) {
.
< │ │ │ │ -000123a0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000123b0: 6e6f 223e 2020 3434 333c 2f73 7061 6e3e no"> 443 │ │ │ │ -000123c0: 2020 2020 2020 2020 2020 2020 6173 7369 assi │ │ │ │ -000123d0: 676e 4372 6561 7365 4d61 736b 466f 7245 gnCreaseMaskForE │ │ │ │ -000123e0: 6467 6528 6564 6765 2c20 6d61 736b 293b dge(edge, mask); │ │ │ │ -000123f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00012440: 2034 3434 3c2f 7370 616e 3e20 2020 2020 444 │ │ │ │ -00012450: 2020 2020 2020 203c 7370 616e 2063 6c61 return;< │ │ │ │ -00012480: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000124d0: 3434 353c 2f73 7061 6e3e 2020 2020 2020 445 │ │ │ │ -000124e0: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
446 │ │ │ │ -00012540: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
447 < │ │ │ │ -000125a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000125f0: 3434 383c 2f73 7061 6e3e 2020 2020 3c73 448 //.
44 │ │ │ │ -00012670: 393c 2f73 7061 6e3e 2020 2020 3c73 7061 9 // We are now │ │ │ │ -000126a0: 206c 6566 7420 7769 7468 2074 6865 2043 left with the C │ │ │ │ -000126b0: 7265 6173 652d 746f 2d53 6d6f 6f74 6820 rease-to-Smooth │ │ │ │ -000126c0: 6361 7365 202d 2d20 636f 6d70 7574 6520 case -- compute │ │ │ │ -000126d0: 7468 6520 536d 6f6f 7468 206d 6173 6b3c the Smooth mask< │ │ │ │ -000126e0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -00012700: 6120 6964 3d22 6c30 3034 3530 2220 6e61 a id="l00450" na │ │ │ │ -00012710: 6d65 3d22 6c30 3034 3530 223e 3c2f 613e me="l00450"> │ │ │ │ -00012720: 3c73 7061 6e20 636c 6173 733d 226c 696e 450 // f │ │ │ │ -00012760: 6f72 2074 6865 2063 6869 6c64 2061 6e64 or the child and │ │ │ │ -00012770: 2061 7567 6d65 6e74 2069 7420 7769 7468 augment it with │ │ │ │ -00012780: 2074 6865 2074 7261 6e73 6974 696f 6e61 the transitiona │ │ │ │ -00012790: 6c20 4372 6561 7365 206f 6620 7468 6520 l Crease of the │ │ │ │ -000127a0: 7061 7265 6e74 2e3c 2f73 7061 6e3e 3c2f parent..
4 │ │ │ │ -00012800: 3531 3c2f 7370 616e 3e20 2020 203c 7370 51 //.
452 │ │ │ │ -00012880: 3c2f 7370 616e 3e20 2020 203c 7370 616e // A general c │ │ │ │ -000128b0: 6f6d 6269 6e61 7469 6f6e 206f 6620 7365 ombination of se │ │ │ │ -000128c0: 7061 7261 7465 6c79 2061 7373 6967 6e65 parately assigne │ │ │ │ -000128d0: 6420 6d61 736b 7320 6865 7265 2028 6173 d masks here (as │ │ │ │ -000128e0: 2064 6f6e 6520 696e 2074 6865 2076 6572 done in the ver │ │ │ │ -000128f0: 7465 782d 3c2f 7370 616e 3e3c 2f64 6976 tex-
.
453< │ │ │ │ -00012950: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00012970: 2f2f 2020 7665 7274 6578 2063 6173 6529 // vertex case) │ │ │ │ -00012980: 2069 7320 6f76 6572 6b69 6c6c 202d 2d20 is overkill -- │ │ │ │ -00012990: 7472 6976 6961 6c6c 7920 636f 6d62 696e trivially combin │ │ │ │ -000129a0: 6520 7468 6520 302e 3566 2076 6572 7465 e the 0.5f verte │ │ │ │ -000129b0: 7820 636f 6566 6669 6369 656e 7420 666f x coefficient fo │ │ │ │ -000129c0: 723c 2f73 7061 6e3e 3c2f 6469 763e 0a3c r
.< │ │ │ │ -000129d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000129e0: 3e3c 6120 6964 3d22 6c30 3034 3534 2220 > 454
// │ │ │ │ -00012a40: 2074 6865 2043 7265 6173 6520 6f66 2074 the Crease of t │ │ │ │ -00012a50: 6865 2070 6172 656e 7420 7769 7468 2074 he parent with t │ │ │ │ -00012a60: 6865 2076 6572 7465 7820 7765 6967 6874 he vertex weight │ │ │ │ -00012a70: 7320 616e 6420 6174 7465 6e75 6174 6520 s and attenuate │ │ │ │ -00012a80: 7468 6520 6661 6365 2077 6569 6768 7473 the face weights │ │ │ │ -00012a90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00012ab0: 3c61 2069 643d 226c 3030 3435 3522 206e 455 // │ │ │ │ -00012b10: 6163 636f 7264 696e 676c 792e 3c2f 7370 accordingly.
.
456 │ │ │ │ -00012b80: 2020 3c73 7061 6e20 636c 6173 733d 2263 //
.
│ │ │ │ -00012bf0: 2020 3435 373c 2f73 7061 6e3e 2020 2020 457 │ │ │ │ -00012c00: 6173 7369 676e 536d 6f6f 7468 4d61 736b assignSmoothMask │ │ │ │ -00012c10: 466f 7245 6467 6528 6564 6765 2c20 6d61 ForEdge(edge, ma │ │ │ │ -00012c20: 736b 293b 3c2f 6469 763e 0a3c 6469 7620 sk);
.
458 │ │ │ │ -00012c80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00012cd0: 2034 3539 3c2f 7370 616e 3e20 2020 203c 459 < │ │ │ │ -00012ce0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00012cf0: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef typena │ │ │ │ -00012d20: 6d65 3c2f 7370 616e 3e20 4d41 534b 3a3a me MASK:: │ │ │ │ -00012d30: 5765 6967 6874 2057 6569 6768 743b 3c2f Weight Weight;.
4 │ │ │ │ -00012d90: 3630 3c2f 7370 616e 3e20 3c2f 6469 763e 60
│ │ │ │ -00012da0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00012dd0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 461 Weight │ │ │ │ -00012e00: 7057 6569 6768 7420 3d20 6564 6765 2e47 pWeight = edge.G │ │ │ │ -00012e10: 6574 5368 6172 706e 6573 7328 293b 3c2f etSharpness();.
4 │ │ │ │ -00012e70: 3632 3c2f 7370 616e 3e20 2020 2057 6569 62 Wei │ │ │ │ -00012e80: 6768 7420 6357 6569 6768 7420 3d20 312e ght cWeight = 1. │ │ │ │ -00012e90: 3066 202d 2070 5765 6967 6874 3b3c 2f64 0f - pWeight;.
46 │ │ │ │ -00012ef0: 333c 2f73 7061 6e3e 203c 2f64 6976 3e0a 3
. │ │ │ │ -00012f00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -00012f30: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 464 mask.Ver │ │ │ │ -00012f60: 7465 7857 6569 6768 7428 3029 203d 2070 texWeight(0) = p │ │ │ │ -00012f70: 5765 6967 6874 202a 2030 2e35 6620 2b20 Weight * 0.5f + │ │ │ │ -00012f80: 6357 6569 6768 7420 2a20 6d61 736b 2e56 cWeight * mask.V │ │ │ │ -00012f90: 6572 7465 7857 6569 6768 7428 3029 3b3c ertexWeight(0);< │ │ │ │ -00012fa0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00012ff0: 3436 353c 2f73 7061 6e3e 2020 2020 6d61 465 ma │ │ │ │ -00013000: 736b 2e56 6572 7465 7857 6569 6768 7428 sk.VertexWeight( │ │ │ │ -00013010: 3129 203d 2070 5765 6967 6874 202a 2030 1) = pWeight * 0 │ │ │ │ -00013020: 2e35 6620 2b20 6357 6569 6768 7420 2a20 .5f + cWeight * │ │ │ │ -00013030: 6d61 736b 2e56 6572 7465 7857 6569 6768 mask.VertexWeigh │ │ │ │ -00013040: 7428 3129 3b3c 2f64 6976 3e0a 3c64 6976 t(1);
.
< │ │ │ │ -00013080: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00013090: 6e6f 223e 2020 3436 363c 2f73 7061 6e3e no"> 466 │ │ │ │ -000130a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -000130f0: 2020 3436 373c 2f73 7061 6e3e 2020 2020 467 │ │ │ │ -00013100: 3c73 7061 6e20 636c 6173 733d 226b 6579 int faceCount = │ │ │ │ -00013130: 206d 6173 6b2e 4765 744e 756d 4661 6365 mask.GetNumFace │ │ │ │ -00013140: 5765 6967 6874 7328 293b 3c2f 6469 763e Weights();
│ │ │ │ -00013150: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00013180: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 468 for (< │ │ │ │ -000131d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000131e0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int i = 0; i < │ │ │ │ -00013200: 3b20 6661 6365 436f 756e 743b 202b 2b69 ; faceCount; ++i │ │ │ │ -00013210: 2920 7b3c 2f64 6976 3e0a 3c64 6976 2063 ) {
.
469 │ │ │ │ -00013270: 2020 2020 2020 6d61 736b 2e46 6163 6557 mask.FaceW │ │ │ │ -00013280: 6569 6768 7428 6929 202a 3d20 6357 6569 eight(i) *= cWei │ │ │ │ -00013290: 6768 743b 3c2f 6469 763e 0a3c 6469 7620 ght;
.
470 │ │ │ │ -000132f0: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
.
471} │ │ │ │ -00013350: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000133a0: 2034 3732 3c2f 7370 616e 3e20 3c2f 6469 472 .
473 │ │ │ │ -00013400: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 //< │ │ │ │ -00013420: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -00013440: 6120 6964 3d22 6c30 3034 3734 2220 6e61 a id="l00474" na │ │ │ │ -00013450: 6d65 3d22 6c30 3034 3734 223e 3c2f 613e me="l00474"> │ │ │ │ -00013460: 3c73 7061 6e20 636c 6173 733d 226c 696e 474// The c │ │ │ │ -000134a0: 6f6d 7075 7461 7469 6f6e 206f 6620 6120 omputation of a │ │ │ │ -000134b0: 7665 7274 6578 2d76 6572 7465 7820 6d61 vertex-vertex ma │ │ │ │ -000134c0: 736b 2072 6571 7569 7265 7320 696e 7370 sk requires insp │ │ │ │ -000134d0: 6563 7469 6f6e 206f 6620 6372 6561 7369 ection of creasi │ │ │ │ -000134e0: 6e67 2073 6861 7270 6e65 7373 2076 616c ng sharpness val │ │ │ │ -000134f0: 7565 733c 2f73 7061 6e3e 3c2f 6469 763e ues
│ │ │ │ -00013500: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00013530: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 475// t │ │ │ │ -00013570: 6f20 6465 7465 726d 696e 6520 7768 6174 o determine what │ │ │ │ -00013580: 2073 7562 6469 7669 7369 6f6e 2052 756c subdivision Rul │ │ │ │ -00013590: 6573 2061 7070 6c79 2074 6f20 7468 6520 es apply to the │ │ │ │ -000135a0: 7061 7265 6e74 2061 6e64 2069 7473 2063 parent and its c │ │ │ │ -000135b0: 6869 6c64 2076 6572 7465 782c 2061 6e64 hild vertex, and │ │ │ │ -000135c0: 2061 6c73 6f20 746f 3c2f 7370 616e 3e3c also to< │ │ │ │ -000135d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00013620: 3437 363c 2f73 7061 6e3e 3c73 7061 6e20 476 │ │ │ │ -00013640: 2f2f 2020 6465 7465 6374 2061 6e64 2061 // detect and a │ │ │ │ -00013650: 7070 6c79 2061 2074 7261 6e73 6974 696f pply a transitio │ │ │ │ -00013660: 6e20 6265 7477 6565 6e20 7477 6f20 6469 n between two di │ │ │ │ -00013670: 6666 6572 696e 6720 5275 6c65 732e 2020 ffering Rules. │ │ │ │ -00013680: 5573 696e 6720 7468 6520 7072 6f74 6563 Using the protec │ │ │ │ -00013690: 7465 6420 6d65 7468 6f64 7320 746f 3c2f ted methods to
.
< │ │ │ │ -000136e0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000136f0: 6e6f 223e 2020 3437 373c 2f73 7061 6e3e no"> 477 │ │ │ │ -00013700: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // assign │ │ │ │ -00013720: 2073 7065 6369 6669 6320 6d61 736b 732c specific masks, │ │ │ │ -00013730: 2074 6869 7320 696d 706c 656d 656e 7461 this implementa │ │ │ │ -00013740: 7469 6f6e 2073 686f 756c 6420 7365 7276 tion should serv │ │ │ │ -00013750: 6520 616c 6c20 6e6f 6e2d 6c69 6e65 6172 e all non-linear │ │ │ │ -00013760: 2073 6368 656d 6573 2028 6375 7272 656e schemes (curren │ │ │ │ -00013770: 746c 793c 2f73 7061 6e3e 3c2f 6469 763e tly
│ │ │ │ -00013780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -000137b0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 478// C │ │ │ │ -000137f0: 6174 6d61 726b 2061 6e64 204c 6f6f 7029 atmark and Loop) │ │ │ │ -00013800: 2061 6e64 206f 6e6c 7920 6e65 6564 7320 and only needs │ │ │ │ -00013810: 746f 2062 6520 7370 6563 6961 6c69 7a65 to be specialize │ │ │ │ -00013820: 6420 666f 7220 4269 6c69 6e65 6172 2074 d for Bilinear t │ │ │ │ -00013830: 6f20 7265 6d6f 7665 2061 6c6c 2075 6e6e o remove all unn │ │ │ │ -00013840: 6563 6573 7361 7279 3c2f 7370 616e 3e3c ecessary< │ │ │ │ -00013850: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000138a0: 3437 393c 2f73 7061 6e3e 3c73 7061 6e20 479 │ │ │ │ -000138c0: 2f2f 2020 636f 6d70 6c65 7869 7479 2072 // complexity r │ │ │ │ -000138d0: 656c 6174 696e 6720 746f 2063 7265 6173 elating to creas │ │ │ │ -000138e0: 696e 672c 2052 756c 6573 2c20 6574 632e ing, Rules, etc. │ │ │ │ -000138f0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00013910: 3c61 2069 643d 226c 3030 3438 3022 206e 480//
.
│ │ │ │ -000139c0: 2020 3438 313c 2f73 7061 6e3e 3c73 7061 481// The implem │ │ │ │ -000139f0: 656e 7461 7469 6f6e 2068 6572 6520 6973 entation here is │ │ │ │ -00013a00: 2073 6c69 6768 746c 7920 636f 6d70 6c69 slightly compli │ │ │ │ -00013a10: 6361 7465 6420 6279 2063 6f6d 6269 6e69 cated by combini │ │ │ │ -00013a20: 6e67 2074 776f 2073 6365 6e61 7269 6f73 ng two scenarios │ │ │ │ -00013a30: 2069 6e74 6f20 6f6e 6520 2d2d 3c2f 7370 into one --
.
482// either t │ │ │ │ -00013ac0: 6865 2063 616c 6c65 7220 6b6e 6f77 7320 he caller knows │ │ │ │ -00013ad0: 7468 6520 7061 7265 6e74 2061 6e64 2063 the parent and c │ │ │ │ -00013ae0: 6869 6c64 2072 756c 6573 2061 6e64 2070 hild rules and p │ │ │ │ -00013af0: 726f 7669 6465 7320 7468 656d 2c20 6f72 rovides them, or │ │ │ │ -00013b00: 2074 6865 7920 646f 6e26 2333 393b 7420 they don't │ │ │ │ -00013b10: 616e 643c 2f73 7061 6e3e 3c2f 6469 763e and
│ │ │ │ -00013b20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00013b50: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 483// t │ │ │ │ -00013b90: 6865 2052 756c 6573 2068 6176 6520 746f he Rules have to │ │ │ │ -00013ba0: 2062 6520 6465 7465 726d 696e 6564 2066 be determined f │ │ │ │ -00013bb0: 726f 6d20 7368 6172 706e 6573 7320 7661 rom sharpness va │ │ │ │ -00013bc0: 6c75 6573 2e20 2045 7665 6e20 7768 656e lues. Even when │ │ │ │ -00013bd0: 2074 6865 2052 756c 6573 2061 7265 206b the Rules are k │ │ │ │ -00013be0: 6e6f 776e 2061 6e64 3c2f 7370 616e 3e3c nown and< │ │ │ │ -00013bf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00013c40: 3438 343c 2f73 7061 6e3e 3c73 7061 6e20 484 │ │ │ │ -00013c60: 2f2f 2020 7072 6f76 6964 6564 2074 686f // provided tho │ │ │ │ -00013c70: 7567 682c 2074 6865 7265 2061 7265 2063 ugh, there are c │ │ │ │ -00013c80: 6173 6573 2077 6865 7265 2074 6865 2070 ases where the p │ │ │ │ -00013c90: 6172 656e 7420 616e 6420 6368 696c 6420 arent and child │ │ │ │ -00013ca0: 7368 6172 706e 6573 7320 7661 6c75 6573 sharpness values │ │ │ │ -00013cb0: 206e 6565 6420 746f 2062 653c 2f73 7061 need to be
.
485// identifie │ │ │ │ -00013d40: 642c 2073 6f20 6163 636f 756e 7469 6e67 d, so accounting │ │ │ │ -00013d50: 2066 6f72 2074 6865 2075 6e6b 6e6f 776e for the unknown │ │ │ │ -00013d60: 2052 756c 6573 2074 6f6f 2069 7320 6e6f Rules too is no │ │ │ │ -00013d70: 7420 6d75 6368 206f 6620 616e 2061 6464 t much of an add │ │ │ │ -00013d80: 6564 2063 6f6d 706c 6963 6174 696f 6e2e ed complication. │ │ │ │ -00013d90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00013db0: 3c61 2069 643d 226c 3030 3438 3622 206e 486//
.
│ │ │ │ -00013e60: 2020 3438 373c 2f73 7061 6e3e 3c73 7061 487// The benefi │ │ │ │ -00013e90: 7420 6f66 2073 7570 706f 7274 696e 6720 t of supporting │ │ │ │ -00013ea0: 7370 6563 6966 6965 6420 5275 6c65 7320 specified Rules │ │ │ │ -00013eb0: 6973 2074 6861 7420 7468 6579 2063 616e is that they can │ │ │ │ -00013ec0: 206f 6674 656e 2062 6520 7472 6976 6961 often be trivia │ │ │ │ -00013ed0: 6c6c 793c 2f73 7061 6e3e 3c2f 6469 763e lly
│ │ │ │ -00013ee0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00013f10: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 488// d │ │ │ │ -00013f50: 6574 6572 6d69 6e65 6420 6672 6f6d 2063 etermined from c │ │ │ │ -00013f60: 6f6e 7465 7874 2028 652e 672e 2061 2076 ontext (e.g. a v │ │ │ │ -00013f70: 6572 7465 7820 6465 7269 7665 6420 6672 ertex derived fr │ │ │ │ -00013f80: 6f6d 2061 2066 6163 6520 6174 2061 2070 om a face at a p │ │ │ │ -00013f90: 7265 7669 6f75 7320 6c65 7665 6c20 7769 revious level wi │ │ │ │ -00013fa0: 6c6c 2061 6c77 6179 733c 2f73 7061 6e3e ll always │ │ │ │ -00013fb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00014000: 2034 3839 3c2f 7370 616e 3e3c 7370 616e 489// be smooth) │ │ │ │ -00014030: 7261 7468 6572 2074 6861 6e20 6d6f 7265 rather than more │ │ │ │ -00014040: 2067 656e 6572 616c 6c79 2c20 616e 6420 generally, and │ │ │ │ -00014050: 6174 2067 7265 6174 6572 2063 6f73 742c at greater cost, │ │ │ │ -00014060: 2069 6e73 7065 6374 696e 6720 6e65 6967 inspecting neig │ │ │ │ -00014070: 6862 6f72 696e 6720 616e 643c 2f73 7061 hboring and
.
490// they are │ │ │ │ -00014100: 6f66 7465 6e20 7468 6520 7361 6d65 2066 often the same f │ │ │ │ -00014110: 6f72 2070 6172 656e 7420 616e 6420 6368 or parent and ch │ │ │ │ -00014120: 696c 642e 3c2f 7370 616e 3e3c 2f64 6976 ild.
.
491< │ │ │ │ -00014180: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>//
.
< │ │ │ │ -000141e0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000141f0: 6e6f 223e 2020 3439 323c 2f73 7061 6e3e no"> 492 │ │ │ │ -00014200: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // The ov │ │ │ │ -00014220: 6572 616c 6c20 7072 6f63 6573 7320 6973 erall process is │ │ │ │ -00014230: 2061 7320 666f 6c6c 6f77 733a 3c2f 7370 as follows:
.
493//.
49 │ │ │ │ -00014310: 343c 2f73 7061 6e3e 3c73 7061 6e20 636c 4// │ │ │ │ -00014330: 2020 2020 2020 2d20 7175 6963 6b6c 7920 - quickly │ │ │ │ -00014340: 6465 7465 6374 2074 6865 206d 6f73 7420 detect the most │ │ │ │ -00014350: 636f 6d6d 6f6e 2053 6d6f 6f74 6820 6361 common Smooth ca │ │ │ │ -00014360: 7365 2077 6865 6e20 7370 6563 6966 6965 se when specifie │ │ │ │ -00014370: 6420 616e 6420 7265 7475 726e 3c2f 7370 d and return
.
495// - de │ │ │ │ -00014400: 7465 726d 696e 6520 6966 2073 6861 7270 termine if sharp │ │ │ │ -00014410: 6e65 7373 2066 6f72 2070 6172 656e 7420 ness for parent │ │ │ │ -00014420: 6973 2072 6571 7569 7265 6420 616e 6420 is required and │ │ │ │ -00014430: 6761 7468 6572 2069 6620 736f 3c2f 7370 gather if so
.
496// - if │ │ │ │ -000144c0: 2075 6e73 7065 6369 6669 6564 2c20 6465 unspecified, de │ │ │ │ -000144d0: 7465 726d 696e 6520 7468 6520 7061 7265 termine the pare │ │ │ │ -000144e0: 6e74 2072 756c 653c 2f73 7061 6e3e 3c2f nt rule.
4 │ │ │ │ -00014540: 3937 3c2f 7370 616e 3e3c 7370 616e 2063 97/ │ │ │ │ -00014560: 2f20 2020 2020 202d 2061 7373 6967 6e20 / - assign │ │ │ │ -00014570: 6d61 736b 2066 6f72 2074 6865 2070 6172 mask for the par │ │ │ │ -00014580: 656e 7420 7275 6c65 202d 2d20 7265 7475 ent rule -- retu │ │ │ │ -00014590: 726e 696e 6720 6966 2053 6d6f 6f74 682f rning if Smooth/ │ │ │ │ -000145a0: 4461 7274 3c2f 7370 616e 3e3c 2f64 6976 Dart
.
498< │ │ │ │ -00014600: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -00014620: 2020 2020 2d20 7265 7475 726e 2069 6620 - return if │ │ │ │ -00014630: 6368 696c 6420 7275 6c65 206d 6174 6368 child rule match │ │ │ │ -00014640: 6573 2070 6172 656e 743c 2f73 7061 6e3e es parent │ │ │ │ -00014650: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000146a0: 2034 3939 3c2f 7370 616e 3e3c 7370 616e 499// - gathe │ │ │ │ -000146d0: 7220 7368 6172 706e 6573 7320 666f 7220 r sharpness for │ │ │ │ -000146e0: 6368 696c 6420 746f 2064 6574 6572 6d69 child to determi │ │ │ │ -000146f0: 6e65 206f 7220 636f 6d62 696e 6520 6368 ne or combine ch │ │ │ │ -00014700: 696c 6420 7275 6c65 3c2f 7370 616e 3e3c ild rule< │ │ │ │ -00014710: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00014760: 3530 303c 2f73 7061 6e3e 3c73 7061 6e20 500 │ │ │ │ -00014780: 2f2f 2020 2020 2020 2d20 6966 2075 6e73 // - if uns │ │ │ │ -00014790: 7065 6369 6669 6564 2c20 6465 7465 726d pecified, determ │ │ │ │ -000147a0: 696e 6520 7468 6520 6368 696c 6420 7275 ine the child ru │ │ │ │ -000147b0: 6c65 2c20 7265 7475 726e 696e 6720 6966 le, returning if │ │ │ │ -000147c0: 2069 7420 6d61 7463 6865 7320 7061 7265 it matches pare │ │ │ │ -000147d0: 6e74 3c2f 7370 616e 3e3c 2f64 6976 3e0a nt
. │ │ │ │ -000147e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
502< │ │ │ │ -000148d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -000148f0: 2020 2020 2d20 636f 6d62 696e 6520 6c6f - combine lo │ │ │ │ -00014900: 6361 6c20 6368 696c 6420 6d61 736b 2077 cal child mask w │ │ │ │ -00014910: 6974 6820 7468 6520 7061 7265 6e74 206d ith the parent m │ │ │ │ -00014920: 6173 6b3c 2f73 7061 6e3e 3c2f 6469 763e ask
│ │ │ │ -00014930: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
504< │ │ │ │ -00014a00: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00014a10: 656e 7422 3e2f 2f20 2052 656d 656d 6265 ent">// Remembe │ │ │ │ -00014a20: 7220 2d2d 2069 6620 7468 6520 7061 7265 r -- if the pare │ │ │ │ -00014a30: 6e74 2072 756c 6520 6973 2073 7065 6369 nt rule is speci │ │ │ │ -00014a40: 6669 6564 2062 7574 2074 6865 2063 6869 fied but the chi │ │ │ │ -00014a50: 6c64 2069 7320 6e6f 742c 2074 6869 7320 ld is not, this │ │ │ │ -00014a60: 696d 706c 6965 7320 6f6e 6c79 206f 6e65 implies only one │ │ │ │ -00014a70: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00014a90: 3c61 2069 643d 226c 3030 3530 3522 206e 505// of t │ │ │ │ -00014af0: 6865 2074 776f 206f 7074 696f 6e61 6c20 he two optional │ │ │ │ -00014b00: 7275 6c65 7320 7761 7320 7370 6563 6966 rules was specif │ │ │ │ -00014b10: 6965 6420 616e 6420 6973 206d 6561 6e74 ied and is meant │ │ │ │ -00014b20: 2074 6f20 696e 6469 6361 7465 2074 6865 to indicate the │ │ │ │ -00014b30: 7265 2069 7320 6e6f 2074 7261 6e73 6974 re is no transit │ │ │ │ -00014b40: 696f 6e2c 3c2f 7370 616e 3e3c 2f64 6976 ion,
.
506< │ │ │ │ -00014ba0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>// │ │ │ │ -00014bc0: 736f 2074 6865 2063 6869 6c64 2072 756c so the child rul │ │ │ │ -00014bd0: 6520 7368 6f75 6c64 2062 6520 6173 7369 e should be assi │ │ │ │ -00014be0: 676e 6564 2074 6f20 6265 2074 6865 2073 gned to be the s │ │ │ │ -00014bf0: 616d 6520 2877 6973 6820 7468 6520 636f ame (wish the co │ │ │ │ -00014c00: 6d70 696c 6572 2077 6f75 6c64 2061 6c6c mpiler would all │ │ │ │ -00014c10: 6f77 2074 6869 733c 2f73 7061 6e3e 3c2f ow this.
5 │ │ │ │ -00014c70: 3037 3c2f 7370 616e 3e3c 7370 616e 2063 07/ │ │ │ │ -00014c90: 2f20 2069 6e20 6465 6661 756c 7420 7661 / in default va │ │ │ │ -00014ca0: 6c75 6520 6173 7369 676e 6d65 6e74 292e lue assignment). │ │ │ │ -00014cb0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00014cd0: 3c61 2069 643d 226c 3030 3530 3822 206e 508//
.
│ │ │ │ -00014d80: 2020 3530 393c 2f73 7061 6e3e 3c73 7061 509.
│ │ │ │ +0000bef0: 2035 3138 3c2f 7370 616e 3e20 2020 2020 518 │ │ │ │ +0000bf00: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000bf10: 2020 2020 2020 6e75 6d50 6174 6368 436f numPatchCo │ │ │ │ +0000bf20: 6f72 6473 2c3c 2f64 6976 3e0a 3c64 6976 ords,
.
< │ │ │ │ +0000bf60: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +0000bf70: 6e6f 223e 2020 3531 393c 2f73 7061 6e3e no"> 519 │ │ │ │ +0000bf80: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000bf90: 2020 2020 2020 2020 2020 2028 3c73 7061 (const < │ │ │ │ +0000bfc0: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +0000bfd0: 5f73 7472 7563 7422 2068 7265 663d 2261 _struct" href="a │ │ │ │ +0000bfe0: 3031 3331 332e 6874 6d6c 223e 5061 7463 01313.html">Patc │ │ │ │ +0000bff0: 6843 6f6f 7264 3c2f 613e 202a 2970 6174 hCoord *)pat │ │ │ │ +0000c000: 6368 436f 6f72 6473 2d26 6774 3b42 696e chCoords->Bin │ │ │ │ +0000c010: 6443 7564 6142 7566 6665 7228 292c 3c2f dCudaBuffer(),.
5 │ │ │ │ +0000c070: 3230 3c2f 7370 616e 3e20 2020 2020 2020 20 │ │ │ │ +0000c080: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000c090: 2020 2020 283c 7370 616e 2063 6c61 7373 (const │ │ │ │ +0000c0b0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 PatchArray< │ │ │ │ +0000c0f0: 2f61 3e20 2a29 7061 7463 6854 6162 6c65 /a> *)patchTable │ │ │ │ +0000c100: 2d26 6774 3b47 6574 5061 7463 6841 7272 ->GetPatchArr │ │ │ │ +0000c110: 6179 4275 6666 6572 2829 2c3c 2f64 6976 ayBuffer(),
.
521< │ │ │ │ +0000c170: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +0000c180: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000c190: 2028 3c73 7061 6e20 636c 6173 733d 226b (const i │ │ │ │ +0000c1d0: 6e74 3c2f 7370 616e 3e20 2a29 7061 7463 nt *)patc │ │ │ │ +0000c1e0: 6854 6162 6c65 2d26 6774 3b47 6574 5061 hTable->GetPa │ │ │ │ +0000c1f0: 7463 6849 6e64 6578 4275 6666 6572 2829 tchIndexBuffer() │ │ │ │ +0000c200: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000c250: 2020 3532 323c 2f73 7061 6e3e 2020 2020 522 │ │ │ │ +0000c260: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000c270: 2020 2020 2020 2028 3c73 7061 6e20 636c (co │ │ │ │ +0000c290: 6e73 743c 2f73 7061 6e3e 203c 6120 636c nst PatchPar │ │ │ │ +0000c2d0: 616d 3c2f 613e 202a 2970 6174 6368 5461 am *)patchTa │ │ │ │ +0000c2e0: 626c 652d 2667 743b 4765 7450 6174 6368 ble->GetPatch │ │ │ │ +0000c2f0: 5061 7261 6d42 7566 6665 7228 2929 3b3c ParamBuffer());< │ │ │ │ +0000c300: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +0000c350: 3532 333c 2f73 7061 6e3e 2020 2020 7d3c 523 }< │ │ │ │ +0000c360: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +0000c3b0: 3532 343c 2f73 7061 6e3e 203c 2f64 6976 524
.
563< │ │ │ │ +0000c410: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ +0000c430: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ +0000c440: 266c 743b 3c73 7061 6e20 636c 6173 733d <typena │ │ │ │ +0000c460: 6d65 3c2f 7370 616e 3e20 5352 435f 4255 me SRC_BU │ │ │ │ +0000c470: 4646 4552 2c20 3c73 7061 6e20 636c 6173 FFER, type │ │ │ │ +0000c490: 6e61 6d65 3c2f 7370 616e 3e20 4453 545f name DST_ │ │ │ │ +0000c4a0: 4255 4646 4552 2c3c 2f64 6976 3e0a 3c64 BUFFER,
. │ │ │ │ +0000c4c0: 3c61 2069 643d 226c 3030 3536 3422 206e 564 │ │ │ │ +0000c510: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename PATCHCOORD │ │ │ │ +0000c540: 5f42 5546 4645 522c 203c 7370 616e 2063 _BUFFER, t │ │ │ │ +0000c560: 7970 656e 616d 653c 2f73 7061 6e3e 2050 ypename P │ │ │ │ +0000c570: 4154 4348 5f54 4142 4c45 2667 743b 3c2f ATCH_TABLE>.
565 stat │ │ │ │ +0000c640: 6963 3c2f 7370 616e 3e20 3c73 7061 6e20 ic bool │ │ │ │ +0000c670: 3c61 2063 6c61 7373 3d22 636f 6465 2068 EvalPatches │ │ │ │ +0000c6d0: 283c 2f64 6976 3e0a 3c64 6976 2063 6c61 (
.
│ │ │ │ +0000c720: 2020 3536 363c 2f73 7061 6e3e 2020 2020 566 │ │ │ │ +0000c730: 2020 2020 5352 435f 4255 4646 4552 202a SRC_BUFFER * │ │ │ │ +0000c740: 7372 6342 7566 6665 722c 203c 6120 636c srcBuffer, BufferDe │ │ │ │ +0000c780: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +0000c7b0: 2661 6d70 3b73 7263 4465 7363 2c3c 2f64 &srcDesc,.
56 │ │ │ │ +0000c810: 373c 2f73 7061 6e3e 2020 2020 2020 2020 7 │ │ │ │ +0000c820: 4453 545f 4255 4646 4552 202a 6473 7442 DST_BUFFER *dstB │ │ │ │ +0000c830: 7566 6665 722c 203c 6120 636c 6173 733d uffer, BufferDescri │ │ │ │ +0000c870: 7074 6f72 3c2f 613e 203c 7370 616e 2063 ptor c │ │ │ │ +0000c890: 6f6e 7374 3c2f 7370 616e 3e20 2661 6d70 onst & │ │ │ │ +0000c8a0: 3b64 7374 4465 7363 2c3c 2f64 6976 3e0a ;dstDesc,
. │ │ │ │ +0000c8b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
569 │ │ │ │ +0000c9f0: 2020 2020 2020 2044 5354 5f42 5546 4645 DST_BUFFE │ │ │ │ +0000ca00: 5220 2a64 7642 7566 6665 722c 2020 3c61 R *dvBuffer, Buffe │ │ │ │ +0000ca40: 7244 6573 6372 6970 746f 723c 2f61 3e20 rDescriptor │ │ │ │ +0000ca50: 3c73 7061 6e20 636c 6173 733d 226b 6579 const &dvDesc,< │ │ │ │ +0000ca80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +0000cad0: 3537 303c 2f73 7061 6e3e 2020 2020 2020 570 │ │ │ │ +0000cae0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +0000cb00: 2f73 7061 6e3e 206e 756d 5061 7463 6843 /span> numPatchC │ │ │ │ +0000cb10: 6f6f 7264 732c 3c2f 6469 763e 0a3c 6469 oords,
.< │ │ │ │ +0000cb30: 6120 6964 3d22 6c30 3035 3731 2220 6e61 a id="l00571" na │ │ │ │ +0000cb40: 6d65 3d22 6c30 3035 3731 223e 3c2f 613e me="l00571"> │ │ │ │ +0000cb50: 3c73 7061 6e20 636c 6173 733d 226c 696e 571 PATCHCO │ │ │ │ +0000cb80: 4f52 445f 4255 4646 4552 202a 7061 7463 ORD_BUFFER *patc │ │ │ │ +0000cb90: 6843 6f6f 7264 732c 3c2f 6469 763e 0a3c hCoords,
.< │ │ │ │ +0000cba0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000cbb0: 3e3c 6120 6964 3d22 6c30 3035 3732 2220 > 572 PATCH │ │ │ │ +0000cc00: 5f54 4142 4c45 202a 7061 7463 6854 6162 _TABLE *patchTab │ │ │ │ +0000cc10: 6c65 2c3c 2f64 6976 3e0a 3c64 6976 2063 le,
..
│ │ │ │ +0000cd30: 2020 3537 343c 2f73 7061 6e3e 2020 2020 574 │ │ │ │ +0000cd40: 2020 2020 3c73 7061 6e20 636c 6173 733d vo │ │ │ │ +0000cd60: 6964 3c2f 7370 616e 3e20 2a20 6465 7669 id * devi │ │ │ │ +0000cd70: 6365 436f 6e74 6578 7420 3d20 4e55 4c4c ceContext = NULL │ │ │ │ +0000cd80: 2920 7b3c 2f64 6976 3e0a 3c64 6976 2063 ) {
.
575 < │ │ │ │ +0000cde0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +0000ce30: 3537 363c 2f73 7061 6e3e 2020 2020 2020 576 │ │ │ │ +0000ce40: 2020 2876 6f69 6429 696e 7374 616e 6365 (void)instance │ │ │ │ +0000ce50: 3b20 2020 2020 2020 3c73 7061 6e20 636c ; // │ │ │ │ +0000ce70: 2075 6e75 7365 643c 2f73 7061 6e3e 3c2f unused.
5 │ │ │ │ +0000ced0: 3737 3c2f 7370 616e 3e20 2020 2020 2020 77 │ │ │ │ +0000cee0: 2028 766f 6964 2964 6576 6963 6543 6f6e (void)deviceCon │ │ │ │ +0000cef0: 7465 7874 3b20 203c 7370 616e 2063 6c61 text; // │ │ │ │ +0000cf10: 756e 7573 6564 3c2f 7370 616e 3e3c 2f64 unused.
57 │ │ │ │ +0000cf70: 383c 2f73 7061 6e3e 203c 2f64 6976 3e0a 8
. │ │ │ │ +0000cf80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +0000cfb0: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 579 return EvalPatches │ │ │ │ +0000d060: 3c2f 613e 2873 7263 4275 6666 6572 2d26 (srcBuffer-& │ │ │ │ +0000d070: 6774 3b42 696e 6443 7564 6142 7566 6665 gt;BindCudaBuffe │ │ │ │ +0000d080: 7228 292c 2073 7263 4465 7363 2c3c 2f64 r(), srcDesc,.
58 │ │ │ │ +0000d0e0: 303c 2f73 7061 6e3e 2020 2020 2020 2020 0 │ │ │ │ +0000d0f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d100: 2020 2064 7374 4275 6666 6572 2d26 6774 dstBuffer-> │ │ │ │ +0000d110: 3b42 696e 6443 7564 6142 7566 6665 7228 ;BindCudaBuffer( │ │ │ │ +0000d120: 292c 2064 7374 4465 7363 2c3c 2f64 6976 ), dstDesc,
.
581< │ │ │ │ +0000d180: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +0000d190: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d1a0: 2064 7542 7566 6665 722d 2667 743b 4269 duBuffer->Bi │ │ │ │ +0000d1b0: 6e64 4375 6461 4275 6666 6572 2829 2c20 ndCudaBuffer(), │ │ │ │ +0000d1c0: 2064 7544 6573 632c 3c2f 6469 763e 0a3c duDesc,
.< │ │ │ │ +0000d1d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000d1e0: 3e3c 6120 6964 3d22 6c30 3035 3832 2220 > 582 │ │ │ │ +0000d230: 2020 2020 2020 2020 2020 2020 2020 6476 dv │ │ │ │ +0000d240: 4275 6666 6572 2d26 6774 3b42 696e 6443 Buffer->BindC │ │ │ │ +0000d250: 7564 6142 7566 6665 7228 292c 2020 6476 udaBuffer(), dv │ │ │ │ +0000d260: 4465 7363 2c3c 2f64 6976 3e0a 3c64 6976 Desc,
.
< │ │ │ │ +0000d2a0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +0000d2b0: 6e6f 223e 2020 3538 333c 2f73 7061 6e3e no"> 583 │ │ │ │ +0000d2c0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d2d0: 2020 2020 2020 2020 2020 206e 756d 5061 numPa │ │ │ │ +0000d2e0: 7463 6843 6f6f 7264 732c 3c2f 6469 763e tchCoords,
│ │ │ │ +0000d2f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000d320: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 584 │ │ │ │ +0000d350: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d360: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (const PatchCoord │ │ │ │ +0000d3c0: 2a29 7061 7463 6843 6f6f 7264 732d 2667 *)patchCoords-&g │ │ │ │ +0000d3d0: 743b 4269 6e64 4375 6461 4275 6666 6572 t;BindCudaBuffer │ │ │ │ +0000d3e0: 2829 2c3c 2f64 6976 3e0a 3c64 6976 2063 (),
.
585 │ │ │ │ +0000d440: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d450: 2020 2020 2020 2020 2028 3c73 7061 6e20 ( │ │ │ │ +0000d470: 636f 6e73 743c 2f73 7061 6e3e 203c 6120 const PatchA │ │ │ │ +0000d4b0: 7272 6179 3c2f 613e 202a 2970 6174 6368 rray *)patch │ │ │ │ +0000d4c0: 5461 626c 652d 2667 743b 4765 7450 6174 Table->GetPat │ │ │ │ +0000d4d0: 6368 4172 7261 7942 7566 6665 7228 292c chArrayBuffer(), │ │ │ │ +0000d4e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +0000d530: 2035 3836 3c2f 7370 616e 3e20 2020 2020 586 │ │ │ │ +0000d540: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000d550: 2020 2020 2020 283c 7370 616e 2063 6c61 (con │ │ │ │ +0000d570: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st int * │ │ │ │ +0000d5a0: 2970 6174 6368 5461 626c 652d 2667 743b )patchTable-> │ │ │ │ +0000d5b0: 4765 7450 6174 6368 496e 6465 7842 7566 GetPatchIndexBuf │ │ │ │ +0000d5c0: 6665 7228 292c 3c2f 6469 763e 0a3c 6469 fer(),
.< │ │ │ │ +0000d5e0: 6120 6964 3d22 6c30 3035 3837 2220 6e61 a id="l00587" na │ │ │ │ +0000d5f0: 6d65 3d22 6c30 3035 3837 223e 3c2f 613e me="l00587"> │ │ │ │ +0000d600: 3c73 7061 6e20 636c 6173 733d 226c 696e 587 │ │ │ │ +0000d630: 2020 2020 2020 2020 2020 2020 283c 7370 (const │ │ │ │ +0000d660: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Pat │ │ │ │ +0000d690: 6368 5061 7261 6d3c 2f61 3e20 2a29 7061 chParam *)pa │ │ │ │ +0000d6a0: 7463 6854 6162 6c65 2d26 6774 3b47 6574 tchTable->Get │ │ │ │ +0000d6b0: 5061 7463 6850 6172 616d 4275 6666 6572 PatchParamBuffer │ │ │ │ +0000d6c0: 2829 293b 3c2f 6469 763e 0a3c 6469 7620 ());
.
588 │ │ │ │ +0000d720: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
.
589 │ │ │ │ +0000d780: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +0000d7d0: 2036 3436 3c2f 7370 616e 3e20 2020 203c 646 < │ │ │ │ +0000d7e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0000d7f0: 6f72 6422 3e74 656d 706c 6174 653c 2f73 ord">template <t │ │ │ │ +0000d820: 7970 656e 616d 653c 2f73 7061 6e3e 2053 ypename S │ │ │ │ +0000d830: 5243 5f42 5546 4645 522c 203c 7370 616e RC_BUFFER, typename │ │ │ │ +0000d860: 2044 5354 5f42 5546 4645 522c 3c2f 6469 DST_BUFFER,.
647 │ │ │ │ +0000d8c0: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +0000d8d0: 2020 2020 203c 7370 616e 2063 6c61 7373 typen │ │ │ │ +0000d8f0: 616d 653c 2f73 7061 6e3e 2050 4154 4348 ame PATCH │ │ │ │ +0000d900: 434f 4f52 445f 4255 4646 4552 2c20 3c73 COORD_BUFFER, typename PATCH_TABLE& │ │ │ │ +0000d940: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
648 │ │ │ │ +0000d9e0: 3c2f 7370 616e 3e20 2020 203c 7370 616e static < │ │ │ │ +0000da10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0000da20: 6f72 6474 7970 6522 3e62 6f6f 6c3c 2f73 ordtype">bool EvalPatche │ │ │ │ +0000da90: 733c 2f61 3e28 3c2f 6469 763e 0a3c 6469 s(
.< │ │ │ │ +0000dab0: 6120 6964 3d22 6c30 3036 3439 2220 6e61 a id="l00649" na │ │ │ │ +0000dac0: 6d65 3d22 6c30 3036 3439 223e 3c2f 613e me="l00649"> │ │ │ │ +0000dad0: 3c73 7061 6e20 636c 6173 733d 226c 696e 649 SRC_BUF │ │ │ │ +0000db00: 4645 5220 2a73 7263 4275 6666 6572 2c20 FER *srcBuffer, │ │ │ │ +0000db10: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Buf │ │ │ │ +0000db40: 6665 7244 6573 6372 6970 746f 723c 2f61 ferDescriptor const
&srcDes │ │ │ │ +0000db80: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
650 │ │ │ │ +0000dbe0: 2020 2020 2044 5354 5f42 5546 4645 5220 DST_BUFFER │ │ │ │ +0000dbf0: 2a64 7374 4275 6666 6572 2c20 3c61 2063 *dstBuffer, BufferD │ │ │ │ +0000dc30: 6573 6372 6970 746f 723c 2f61 3e20 3c73 escriptor const │ │ │ │ +0000dc60: 2026 616d 703b 6473 7444 6573 632c 3c2f &dstDesc,.
6 │ │ │ │ +0000dcc0: 3531 3c2f 7370 616e 3e20 2020 2020 2020 51 │ │ │ │ +0000dcd0: 2044 5354 5f42 5546 4645 5220 2a64 7542 DST_BUFFER *duB │ │ │ │ +0000dce0: 7566 6665 722c 2020 3c61 2063 6c61 7373 uffer, BufferDescr │ │ │ │ +0000dd20: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +0000dd40: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +0000dd50: 703b 6475 4465 7363 2c3c 2f64 6976 3e0a p;duDesc,
. │ │ │ │ +0000dd60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
653 │ │ │ │ +0000dea0: 2020 2020 2020 2044 5354 5f42 5546 4645 DST_BUFFE │ │ │ │ +0000deb0: 5220 2a64 7575 4275 6666 6572 2c20 3c61 R *duuBuffer, Buffe │ │ │ │ +0000def0: 7244 6573 6372 6970 746f 723c 2f61 3e20 rDescriptor │ │ │ │ +0000df00: 3c73 7061 6e20 636c 6173 733d 226b 6579 const &duuDesc, │ │ │ │ +0000df30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +0000df80: 2036 3534 3c2f 7370 616e 3e20 2020 2020 654 │ │ │ │ +0000df90: 2020 2044 5354 5f42 5546 4645 5220 2a64 DST_BUFFER *d │ │ │ │ +0000dfa0: 7576 4275 6666 6572 2c20 3c61 2063 6c61 uvBuffer, BufferDes │ │ │ │ +0000dfe0: 6372 6970 746f 723c 2f61 3e20 3c73 7061 criptor const & │ │ │ │ +0000e010: 616d 703b 6475 7644 6573 632c 3c2f 6469 amp;duvDesc,.
655 │ │ │ │ +0000e070: 3c2f 7370 616e 3e20 2020 2020 2020 2044 D │ │ │ │ +0000e080: 5354 5f42 5546 4645 5220 2a64 7676 4275 ST_BUFFER *dvvBu │ │ │ │ +0000e090: 6666 6572 2c20 3c61 2063 6c61 7373 3d22 ffer, BufferDescrip │ │ │ │ +0000e0d0: 746f 723c 2f61 3e20 3c73 7061 6e20 636c tor co │ │ │ │ +0000e0f0: 6e73 743c 2f73 7061 6e3e 2026 616d 703b nst & │ │ │ │ +0000e100: 6476 7644 6573 632c 3c2f 6469 763e 0a3c dvvDesc,
.< │ │ │ │ +0000e110: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000e120: 3e3c 6120 6964 3d22 6c30 3036 3536 2220 > 656 int │ │ │ │ +0000e190: 6e75 6d50 6174 6368 436f 6f72 6473 2c3c numPatchCoords,< │ │ │ │ +0000e1a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +0000e1f0: 3635 373c 2f73 7061 6e3e 2020 2020 2020 657 │ │ │ │ +0000e200: 2020 5041 5443 4843 4f4f 5244 5f42 5546 PATCHCOORD_BUF │ │ │ │ +0000e210: 4645 5220 2a70 6174 6368 436f 6f72 6473 FER *patchCoords │ │ │ │ +0000e220: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000e270: 2020 3635 383c 2f73 7061 6e3e 2020 2020 658 │ │ │ │ +0000e280: 2020 2020 5041 5443 485f 5441 424c 4520 PATCH_TABLE │ │ │ │ +0000e290: 2a70 6174 6368 5461 626c 652c 3c2f 6469 *patchTable,.
659 │ │ │ │ +0000e2f0: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ +0000e300: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +0000e310: 5f63 6c61 7373 2220 6872 6566 3d22 6130 _class" href="a0 │ │ │ │ +0000e320: 3131 3737 2e68 746d 6c22 3e43 7564 6145 1177.html">CudaE │ │ │ │ +0000e330: 7661 6c75 6174 6f72 3c2f 613e 203c 7370 valuator const │ │ │ │ +0000e360: 2a69 6e73 7461 6e63 652c 3c2f 6469 763e *instance,
│ │ │ │ +0000e370: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000e3a0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 660 void * deviceConte │ │ │ │ +0000e400: 7874 203d 204e 554c 4c29 207b 3c2f 6469 xt = NULL) {.
661 │ │ │ │ +0000e460: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ +0000e470: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000e480: 3e3c 6120 6964 3d22 6c30 3036 3632 2220 > 662
(void │ │ │ │ +0000e4d0: 2969 6e73 7461 6e63 653b 2020 2020 2020 )instance; │ │ │ │ +0000e4e0: 203c 7370 616e 2063 6c61 7373 3d22 636f // unused │ │ │ │ +0000e500: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +0000e520: 3c61 2069 643d 226c 3030 3636 3322 206e 663 (void) │ │ │ │ +0000e570: 6465 7669 6365 436f 6e74 6578 743b 2020 deviceContext; │ │ │ │ +0000e580: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // unused< │ │ │ │ +0000e5a0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ +0000e5c0: 6120 6964 3d22 6c30 3036 3634 2220 6e61 a id="l00664" na │ │ │ │ +0000e5d0: 6d65 3d22 6c30 3036 3634 223e 3c2f 613e me="l00664"> │ │ │ │ +0000e5e0: 3c73 7061 6e20 636c 6173 733d 226c 696e 664
.
665 │ │ │ │ +0000e660: 2020 2020 203c 7370 616e 2063 6c61 7373 r │ │ │ │ +0000e680: 6574 7572 6e3c 2f73 7061 6e3e 203c 6120 eturn Ev │ │ │ │ +0000e6e0: 616c 5061 7463 6865 733c 2f61 3e28 7372 alPatches(sr │ │ │ │ +0000e6f0: 6342 7566 6665 722d 2667 743b 4269 6e64 cBuffer->Bind │ │ │ │ +0000e700: 4375 6461 4275 6666 6572 2829 2c20 7372 CudaBuffer(), sr │ │ │ │ +0000e710: 6344 6573 632c 3c2f 6469 763e 0a3c 6469 cDesc,
.< │ │ │ │ +0000e730: 6120 6964 3d22 6c30 3036 3636 2220 6e61 a id="l00666" na │ │ │ │ +0000e740: 6d65 3d22 6c30 3036 3636 223e 3c2f 613e me="l00666"> │ │ │ │ +0000e750: 3c73 7061 6e20 636c 6173 733d 226c 696e 666 │ │ │ │ +0000e780: 2020 2020 2020 2020 2020 2020 6473 7442 dstB │ │ │ │ +0000e790: 7566 6665 722d 2667 743b 4269 6e64 4375 uffer->BindCu │ │ │ │ +0000e7a0: 6461 4275 6666 6572 2829 2c20 6473 7444 daBuffer(), dstD │ │ │ │ +0000e7b0: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
667 │ │ │ │ +0000e810: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000e820: 2020 2020 2020 2020 2020 6475 4275 6666 duBuff │ │ │ │ +0000e830: 6572 2d26 6774 3b42 696e 6443 7564 6142 er->BindCudaB │ │ │ │ +0000e840: 7566 6665 7228 292c 2020 6475 4465 7363 uffer(), duDesc │ │ │ │ +0000e850: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000e8a0: 2020 3636 383c 2f73 7061 6e3e 2020 2020 668 │ │ │ │ +0000e8b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000e8c0: 2020 2020 2020 2064 7642 7566 6665 722d dvBuffer- │ │ │ │ +0000e8d0: 2667 743b 4269 6e64 4375 6461 4275 6666 >BindCudaBuff │ │ │ │ +0000e8e0: 6572 2829 2c20 2064 7644 6573 632c 3c2f er(), dvDesc,.
6 │ │ │ │ +0000e940: 3639 3c2f 7370 616e 3e20 2020 2020 2020 69 │ │ │ │ +0000e950: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000e960: 2020 2020 6475 7542 7566 6665 722d 2667 duuBuffer-&g │ │ │ │ +0000e970: 743b 4269 6e64 4375 6461 4275 6666 6572 t;BindCudaBuffer │ │ │ │ +0000e980: 2829 2c20 6475 7544 6573 632c 3c2f 6469 (), duuDesc,.
670 │ │ │ │ +0000e9e0: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +0000e9f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000ea00: 2020 6475 7642 7566 6665 722d 2667 743b duvBuffer-> │ │ │ │ +0000ea10: 4269 6e64 4375 6461 4275 6666 6572 2829 BindCudaBuffer() │ │ │ │ +0000ea20: 2c20 6475 7644 6573 632c 3c2f 6469 763e , duvDesc,
│ │ │ │ +0000ea30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000ea60: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 671 │ │ │ │ +0000ea90: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000eaa0: 6476 7642 7566 6665 722d 2667 743b 4269 dvvBuffer->Bi │ │ │ │ +0000eab0: 6e64 4375 6461 4275 6666 6572 2829 2c20 ndCudaBuffer(), │ │ │ │ +0000eac0: 6476 7644 6573 632c 3c2f 6469 763e 0a3c dvvDesc,
.< │ │ │ │ +0000ead0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000eae0: 3e3c 6120 6964 3d22 6c30 3036 3732 2220 > 672 │ │ │ │ +0000eb30: 2020 2020 2020 2020 2020 2020 2020 6e75 nu │ │ │ │ +0000eb40: 6d50 6174 6368 436f 6f72 6473 2c3c 2f64 mPatchCoords,.
67 │ │ │ │ +0000eba0: 333c 2f73 7061 6e3e 2020 2020 2020 2020 3 │ │ │ │ +0000ebb0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000ebc0: 2020 2028 3c73 7061 6e20 636c 6173 733d (const< │ │ │ │ +0000ebe0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> PatchCoord *)patchCoords │ │ │ │ +0000ec30: 2d26 6774 3b42 696e 6443 7564 6142 7566 ->BindCudaBuf │ │ │ │ +0000ec40: 6665 7228 292c 3c2f 6469 763e 0a3c 6469 fer(),
.< │ │ │ │ +0000ec60: 6120 6964 3d22 6c30 3036 3734 2220 6e61 a id="l00674" na │ │ │ │ +0000ec70: 6d65 3d22 6c30 3036 3734 223e 3c2f 613e me="l00674"> │ │ │ │ +0000ec80: 3c73 7061 6e20 636c 6173 733d 226c 696e 674 │ │ │ │ +0000ecb0: 2020 2020 2020 2020 2020 2020 283c 7370 (const │ │ │ │ +0000ece0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Pat │ │ │ │ +0000ed10: 6368 4172 7261 793c 2f61 3e20 2a29 7061 chArray *)pa │ │ │ │ +0000ed20: 7463 6854 6162 6c65 2d26 6774 3b47 6574 tchTable->Get │ │ │ │ +0000ed30: 5061 7463 6841 7272 6179 4275 6666 6572 PatchArrayBuffer │ │ │ │ +0000ed40: 2829 2c3c 2f64 6976 3e0a 3c64 6976 2063 (),
.
675 │ │ │ │ +0000eda0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000edb0: 2020 2020 2020 2020 2028 3c73 7061 6e20 ( │ │ │ │ +0000edd0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const int *)patchTable-& │ │ │ │ +0000ee10: 6774 3b47 6574 5061 7463 6849 6e64 6578 gt;GetPatchIndex │ │ │ │ +0000ee20: 4275 6666 6572 2829 2c3c 2f64 6976 3e0a Buffer(),
. │ │ │ │ +0000ee30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +0000ee60: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 676 │ │ │ │ +0000ee90: 2020 2020 2020 2020 2020 2020 2020 2028 ( │ │ │ │ +0000eea0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const │ │ │ │ +0000eef0: 5061 7463 6850 6172 616d 3c2f 613e 202a PatchParam * │ │ │ │ +0000ef00: 2970 6174 6368 5461 626c 652d 2667 743b )patchTable-> │ │ │ │ +0000ef10: 4765 7450 6174 6368 5061 7261 6d42 7566 GetPatchParamBuf │ │ │ │ +0000ef20: 6665 7228 2929 3b3c 2f64 6976 3e0a 3c64 fer());
. │ │ │ │ +0000ef40: 3c61 2069 643d 226c 3030 3637 3722 206e 677 }
. │ │ │ │ +0000efa0: 3c61 2069 643d 226c 3030 3637 3822 206e 678
.
706 │ │ │ │ +0000f080: 3c2f 7370 616e 3e20 2020 203c 7370 616e static < │ │ │ │ +0000f0b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0000f0c0: 6f72 6474 7970 6522 3e62 6f6f 6c3c 2f73 ordtype">bool EvalPatche │ │ │ │ +0000f130: 733c 2f61 3e28 3c2f 6469 763e 0a3c 6469 s(
.< │ │ │ │ +0000f150: 6120 6964 3d22 6c30 3037 3037 2220 6e61 a id="l00707" na │ │ │ │ +0000f160: 6d65 3d22 6c30 3037 3037 223e 3c2f 613e me="l00707"> │ │ │ │ +0000f170: 3c73 7061 6e20 636c 6173 733d 226c 696e 707 c │ │ │ │ +0000f1b0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst float *src, BufferDesc │ │ │ │ +0000f220: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +0000f250: 6d70 3b73 7263 4465 7363 2c3c 2f64 6976 mp;srcDesc,
.
708< │ │ │ │ +0000f2b0: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> float *dst, │ │ │ │ +0000f2f0: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +0000f320: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &dstDe │ │ │ │ +0000f360: 7363 2c3c 2f64 6976 3e0a 3c64 6976 2063 sc,
.
709 │ │ │ │ +0000f3c0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +0000f3e0: 696e 743c 2f73 7061 6e3e 206e 756d 5061 int numPa │ │ │ │ +0000f3f0: 7463 6843 6f6f 7264 732c 3c2f 6469 763e tchCoords,
│ │ │ │ +0000f400: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +0000f430: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 710 const │ │ │ │ +0000f480: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Pat │ │ │ │ +0000f4b0: 6368 436f 6f72 643c 2f61 3e20 2a70 6174 chCoord *pat │ │ │ │ +0000f4c0: 6368 436f 6f72 6473 2c3c 2f64 6976 3e0a chCoords,
. │ │ │ │ +0000f4d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +0000f5a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0000f5b0: 3e3c 6120 6964 3d22 6c30 3037 3132 2220 > 712 const int *patchIndices │ │ │ │ +0000f650: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000f6a0: 2020 3731 333c 2f73 7061 6e3e 2020 2020 713 │ │ │ │ +0000f6b0: 2020 2020 3c73 7061 6e20 636c 6173 733d const< │ │ │ │ +0000f6d0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> PatchParam *patchParams) │ │ │ │ +0000f720: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ +0000f770: 2020 3731 343c 2f73 7061 6e3e 203c 2f64 714 .
752 stati │ │ │ │ +0000f840: 633c 2f73 7061 6e3e 203c 7370 616e 2063 c bool < │ │ │ │ +0000f870: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +0000f880: 5f66 756e 6374 696f 6e22 2068 7265 663d _function" href= │ │ │ │ +0000f890: 2261 3031 3137 372e 6874 6d6c 2361 3938 "a01177.html#a98 │ │ │ │ +0000f8a0: 3662 3330 3863 3362 3763 6633 6435 3132 6b308c3b7cf3d512 │ │ │ │ +0000f8b0: 3162 3065 3963 6565 6432 6337 3264 223e 1b0e9ceed2c72d"> │ │ │ │ +0000f8c0: 4576 616c 5061 7463 6865 733c 2f61 3e28 EvalPatches( │ │ │ │ +0000f8d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +0000f920: 2037 3533 3c2f 7370 616e 3e20 2020 2020 753 │ │ │ │ +0000f930: 2020 203c 7370 616e 2063 6c61 7373 3d22 const │ │ │ │ +0000f970: 666c 6f61 743c 2f73 7061 6e3e 202a 7372 float *sr │ │ │ │ +0000f980: 632c 203c 6120 636c 6173 733d 2263 6f64 c, │ │ │ │ +0000f9b0: 4275 6666 6572 4465 7363 7269 7074 6f72 BufferDescriptor │ │ │ │ +0000f9c0: 3c2f 613e 203c 7370 616e 2063 6c61 7373 const │ │ │ │ +0000f9e0: 3c2f 7370 616e 3e20 2661 6d70 3b73 7263 &src │ │ │ │ +0000f9f0: 4465 7363 2c3c 2f64 6976 3e0a 3c64 6976 Desc,
.
< │ │ │ │ +0000fa30: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +0000fa40: 6e6f 223e 2020 3735 343c 2f73 7061 6e3e no"> 754 │ │ │ │ +0000fa50: 2020 2020 2020 2020 3c73 7061 6e20 636c float * │ │ │ │ +0000fa80: 6473 742c 2020 2020 2020 203c 6120 636c dst, BufferDe │ │ │ │ +0000fac0: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +0000faf0: 2661 6d70 3b64 7374 4465 7363 2c3c 2f64 &dstDesc,.
75 │ │ │ │ +0000fb50: 353c 2f73 7061 6e3e 2020 2020 2020 2020 5 │ │ │ │ +0000fb60: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ │ +0000fb80: 2f73 7061 6e3e 202a 6475 2c20 2020 2020 /span> *du, │ │ │ │ +0000fb90: 2020 203c 6120 636c 6173 733d 2263 6f64 │ │ │ │ +0000fbc0: 4275 6666 6572 4465 7363 7269 7074 6f72 BufferDescriptor │ │ │ │ +0000fbd0: 3c2f 613e 203c 7370 616e 2063 6c61 7373 const │ │ │ │ +0000fbf0: 3c2f 7370 616e 3e20 2661 6d70 3b64 7544 &duD │ │ │ │ +0000fc00: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
756 │ │ │ │ +0000fc60: 2020 2020 2020 203c 7370 616e 2063 6c61 float *d │ │ │ │ +0000fc90: 762c 2020 2020 2020 2020 3c61 2063 6c61 v, BufferDes │ │ │ │ +0000fcd0: 6372 6970 746f 723c 2f61 3e20 3c73 7061 criptor const & │ │ │ │ +0000fd00: 616d 703b 6476 4465 7363 2c3c 2f64 6976 amp;dvDesc,
.
757< │ │ │ │ +0000fd60: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> int numPatchCoord │ │ │ │ +0000fda0: 732c 3c2f 6469 763e 0a3c 6469 7620 636c s,
.
758 │ │ │ │ +0000fe00: 2020 2020 203c 6120 636c 6173 733d 2263 PatchCoord │ │ │ │ +0000fe40: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const *patchCoords │ │ │ │ +0000fe70: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +0000fec0: 2020 3735 393c 2f73 7061 6e3e 2020 2020 759 │ │ │ │ +0000fed0: 2020 2020 3c61 2063 6c61 7373 3d22 636f PatchArray │ │ │ │ +0000ff10: 3c73 7061 6e20 636c 6173 733d 226b 6579 const *patchArrays, │ │ │ │ +0000ff40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +0000ff90: 2037 3630 3c2f 7370 616e 3e20 2020 2020 760 │ │ │ │ +0000ffa0: 2020 203c 7370 616e 2063 6c61 7373 3d22 const │ │ │ │ +0000ffe0: 696e 743c 2f73 7061 6e3e 202a 7061 7463 int *patc │ │ │ │ +0000fff0: 6849 6e64 6963 6573 2c3c 2f64 6976 3e0a hIndices,
. │ │ │ │ +00010000: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +00010030: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 761 PatchPa │ │ │ │ +00010090: 7261 6d3c 2f61 3e20 3c73 7061 6e20 636c ram co │ │ │ │ +000100b0: 6e73 743c 2f73 7061 6e3e 202a 7061 7463 nst *patc │ │ │ │ +000100c0: 6850 6172 616d 7329 3b3c 2f64 6976 3e0a hParams);
. │ │ │ │ +000100d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
..< │ │ │ │ +00010280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00010290: 3e3c 6120 6964 3d22 6c30 3038 3136 2220 > 816
const float *src, BufferDe │ │ │ │ +00010360: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +00010390: 2661 6d70 3b73 7263 4465 7363 2c3c 2f64 &srcDesc,.
81 │ │ │ │ +000103f0: 373c 2f73 7061 6e3e 2020 2020 2020 2020 7 │ │ │ │ +00010400: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ │ +00010420: 2f73 7061 6e3e 202a 6473 742c 2020 2020 /span> *dst, │ │ │ │ +00010430: 2020 203c 6120 636c 6173 733d 2263 6f64 │ │ │ │ +00010460: 4275 6666 6572 4465 7363 7269 7074 6f72 BufferDescriptor │ │ │ │ +00010470: 3c2f 613e 203c 7370 616e 2063 6c61 7373 const │ │ │ │ +00010490: 3c2f 7370 616e 3e20 2661 6d70 3b64 7374 &dst │ │ │ │ +000104a0: 4465 7363 2c3c 2f64 6976 3e0a 3c64 6976 Desc,
.
< │ │ │ │ +000104e0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +000104f0: 6e6f 223e 2020 3831 383c 2f73 7061 6e3e no"> 818 │ │ │ │ +00010500: 2020 2020 2020 2020 3c73 7061 6e20 636c float * │ │ │ │ +00010530: 6475 2c20 2020 2020 2020 203c 6120 636c du, BufferDe │ │ │ │ +00010570: 7363 7269 7074 6f72 3c2f 613e 203c 7370 scriptor const │ │ │ │ +000105a0: 2661 6d70 3b64 7544 6573 632c 3c2f 6469 &duDesc,.
819 │ │ │ │ +00010600: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ +00010610: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00010620: 6f72 6474 7970 6522 3e66 6c6f 6174 3c2f ordtype">float *dv, │ │ │ │ +00010640: 2020 3c61 2063 6c61 7373 3d22 636f 6465 B │ │ │ │ +00010670: 7566 6665 7244 6573 6372 6970 746f 723c ufferDescriptor< │ │ │ │ +00010680: 2f61 3e20 3c73 7061 6e20 636c 6173 733d /a> const< │ │ │ │ +000106a0: 2f73 7061 6e3e 2026 616d 703b 6476 4465 /span> &dvDe │ │ │ │ +000106b0: 7363 2c3c 2f64 6976 3e0a 3c64 6976 2063 sc,
.
820 │ │ │ │ +00010710: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +00010730: 666c 6f61 743c 2f73 7061 6e3e 202a 6475 float *du │ │ │ │ +00010740: 752c 2020 2020 2020 203c 6120 636c 6173 u, BufferDesc │ │ │ │ +00010780: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +000107b0: 6d70 3b64 7575 4465 7363 2c3c 2f64 6976 mp;duuDesc,
.
821< │ │ │ │ +00010810: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> float *duv, │ │ │ │ +00010850: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +00010880: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &duvDe │ │ │ │ +000108c0: 7363 2c3c 2f64 6976 3e0a 3c64 6976 2063 sc,
.
822 │ │ │ │ +00010920: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +00010940: 666c 6f61 743c 2f73 7061 6e3e 202a 6476 float *dv │ │ │ │ +00010950: 762c 2020 2020 2020 203c 6120 636c 6173 v, BufferDesc │ │ │ │ +00010990: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +000109c0: 6d70 3b64 7676 4465 7363 2c3c 2f64 6976 mp;dvvDesc,
.
823< │ │ │ │ +00010a20: 2f73 7061 6e3e 2020 2020 2020 2020 3c73 /span> int numPatchCoord │ │ │ │ +00010a60: 732c 3c2f 6469 763e 0a3c 6469 7620 636c s,
.
824 │ │ │ │ +00010ac0: 2020 2020 203c 6120 636c 6173 733d 2263 PatchCoord │ │ │ │ +00010b00: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const *patchCoords │ │ │ │ +00010b30: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00010b80: 2020 3832 353c 2f73 7061 6e3e 2020 2020 825 │ │ │ │ +00010b90: 2020 2020 3c61 2063 6c61 7373 3d22 636f PatchArray │ │ │ │ +00010bd0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const *patchArrays, │ │ │ │ +00010c00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00010c50: 2038 3236 3c2f 7370 616e 3e20 2020 2020 826 │ │ │ │ +00010c60: 2020 203c 7370 616e 2063 6c61 7373 3d22 const │ │ │ │ +00010ca0: 696e 743c 2f73 7061 6e3e 202a 7061 7463 int *patc │ │ │ │ +00010cb0: 6849 6e64 6963 6573 2c3c 2f64 6976 3e0a hIndices,
. │ │ │ │ +00010cc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +00010cf0: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 827 PatchPa │ │ │ │ +00010d50: 7261 6d3c 2f61 3e20 3c73 7061 6e20 636c ram co │ │ │ │ +00010d70: 6e73 743c 2f73 7061 6e3e 202a 7061 7463 nst *patc │ │ │ │ +00010d80: 6850 6172 616d 7329 3b3c 2f64 6976 3e0a hParams);
. │ │ │ │ +00010d90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ +00010e20: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00010e30: 6e6f 223e 2020 3835 373c 2f73 7061 6e3e no"> 857 │ │ │ │ +00010e40: 2020 2020 3c73 7061 6e20 636c 6173 733d templa │ │ │ │ +00010e60: 7465 3c2f 7370 616e 3e20 266c 743b 3c73 te <typename SRC_BUFFER, │ │ │ │ +00010ea0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename DST_BUFFER │ │ │ │ +00010ed0: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00010f20: 2020 3835 383c 2f73 7061 6e3e 2020 2020 858 │ │ │ │ +00010f30: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ │ +00010f50: 7479 7065 6e61 6d65 3c2f 7370 616e 3e20 typename │ │ │ │ +00010f60: 5041 5443 4843 4f4f 5244 5f42 5546 4645 PATCHCOORD_BUFFE │ │ │ │ +00010f70: 522c 203c 7370 616e 2063 6c61 7373 3d22 R, typenam │ │ │ │ +00010f90: 653c 2f73 7061 6e3e 2050 4154 4348 5f54 e PATCH_T │ │ │ │ +00010fa0: 4142 4c45 2667 743b 3c2f 6469 763e 0a3c ABLE>
.< │ │ │ │ +00010fb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00010fc0: 3e3c 6120 6964 3d22 6c30 3038 3539 2220 > 85 │ │ │ │ +00011040: 393c 2f61 3e3c 2f73 7061 6e3e 2020 2020 9 │ │ │ │ +00011050: 3c73 7061 6e20 636c 6173 733d 226b 6579 static bo │ │ │ │ +00011090: 6f6c 3c2f 7370 616e 3e20 3c61 2063 6c61 ol EvalP │ │ │ │ +000110f0: 6174 6368 6573 5661 7279 696e 673c 2f61 atchesVarying(
.
860 │ │ │ │ +00011160: 2020 2020 2053 5243 5f42 5546 4645 5220 SRC_BUFFER │ │ │ │ +00011170: 2a73 7263 4275 6666 6572 2c20 3c61 2063 *srcBuffer, BufferD │ │ │ │ +000111b0: 6573 6372 6970 746f 723c 2f61 3e20 3c73 escriptor const │ │ │ │ +000111e0: 2026 616d 703b 7372 6344 6573 632c 3c2f &srcDesc,.
8 │ │ │ │ +00011240: 3631 3c2f 7370 616e 3e20 2020 2020 2020 61 │ │ │ │ +00011250: 2044 5354 5f42 5546 4645 5220 2a64 7374 DST_BUFFER *dst │ │ │ │ +00011260: 4275 6666 6572 2c20 3c61 2063 6c61 7373 Buffer, BufferDescr │ │ │ │ +000112a0: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +000112c0: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +000112d0: 703b 6473 7444 6573 632c 3c2f 6469 763e p;dstDesc,
│ │ │ │ +000112e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00011310: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 862 int numPatchCoords │ │ │ │ +00011370: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +000113c0: 2020 3836 333c 2f73 7061 6e3e 2020 2020 863 │ │ │ │ +000113d0: 2020 2020 5041 5443 4843 4f4f 5244 5f42 PATCHCOORD_B │ │ │ │ +000113e0: 5546 4645 5220 2a70 6174 6368 436f 6f72 UFFER *patchCoor │ │ │ │ +000113f0: 6473 2c3c 2f64 6976 3e0a 3c64 6976 2063 ds,
.
864 │ │ │ │ +00011450: 2020 2020 2020 5041 5443 485f 5441 424c PATCH_TABL │ │ │ │ +00011460: 4520 2a70 6174 6368 5461 626c 652c 3c2f E *patchTable,.
8 │ │ │ │ +000114c0: 3635 3c2f 7370 616e 3e20 2020 2020 2020 65 │ │ │ │ +000114d0: 203c 6120 636c 6173 733d 2263 6f64 6520 Cud │ │ │ │ +00011500: 6145 7661 6c75 6174 6f72 3c2f 613e 203c aEvaluator < │ │ │ │ +00011510: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00011520: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const *instance,.
866 │ │ │ │ +00011590: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ +000115a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000115b0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void * deviceCon │ │ │ │ +000115d0: 7465 7874 203d 204e 554c 4c29 207b 3c2f text = NULL) {.
8 │ │ │ │ +00011630: 3637 3c2f 7370 616e 3e20 3c2f 6469 763e 67
│ │ │ │ +00011640: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00011670: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 868 (vo │ │ │ │ +000116a0: 6964 2969 6e73 7461 6e63 653b 2020 2020 id)instance; │ │ │ │ +000116b0: 2020 203c 7370 616e 2063 6c61 7373 3d22 // unus │ │ │ │ +000116d0: 6564 3c2f 7370 616e 3e3c 2f64 6976 3e0a ed
. │ │ │ │ +000116e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +00011780: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00011790: 3e3c 6120 6964 3d22 6c30 3038 3730 2220 > 870
.
871 │ │ │ │ +00011830: 2020 2020 2020 203c 7370 616e 2063 6c61 return < │ │ │ │ +00011860: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +00011870: 5f66 756e 6374 696f 6e22 2068 7265 663d _function" href= │ │ │ │ +00011880: 2261 3031 3137 372e 6874 6d6c 2361 6433 "a01177.html#ad3 │ │ │ │ +00011890: 3830 3365 3831 3231 6263 3034 3931 6539 803e8121bc0491e9 │ │ │ │ +000118a0: 6639 3739 3030 6563 6435 3030 3232 223e f97900ecd50022"> │ │ │ │ +000118b0: 4576 616c 5061 7463 6865 733c 2f61 3e28 EvalPatches( │ │ │ │ +000118c0: 7372 6342 7566 6665 722d 2667 743b 4269 srcBuffer->Bi │ │ │ │ +000118d0: 6e64 4375 6461 4275 6666 6572 2829 2c20 ndCudaBuffer(), │ │ │ │ +000118e0: 7372 6344 6573 632c 3c2f 6469 763e 0a3c srcDesc,
.< │ │ │ │ +000118f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00011900: 3e3c 6120 6964 3d22 6c30 3038 3732 2220 > 872 │ │ │ │ +00011950: 2020 2020 2020 2020 2020 2020 2020 6473 ds │ │ │ │ +00011960: 7442 7566 6665 722d 2667 743b 4269 6e64 tBuffer->Bind │ │ │ │ +00011970: 4375 6461 4275 6666 6572 2829 2c20 6473 CudaBuffer(), ds │ │ │ │ +00011980: 7444 6573 632c 3c2f 6469 763e 0a3c 6469 tDesc,
.< │ │ │ │ +000119a0: 6120 6964 3d22 6c30 3038 3733 2220 6e61 a id="l00873" na │ │ │ │ +000119b0: 6d65 3d22 6c30 3038 3733 223e 3c2f 613e me="l00873"> │ │ │ │ +000119c0: 3c73 7061 6e20 636c 6173 733d 226c 696e 873 │ │ │ │ +000119f0: 2020 2020 2020 2020 2020 2020 6e75 6d50 numP │ │ │ │ +00011a00: 6174 6368 436f 6f72 6473 2c3c 2f64 6976 atchCoords,
.
874< │ │ │ │ +00011a60: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +00011a70: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00011a80: 2028 3c73 7061 6e20 636c 6173 733d 226b (const PatchCoord │ │ │ │ +00011ae0: 202a 2970 6174 6368 436f 6f72 6473 2d26 *)patchCoords-& │ │ │ │ +00011af0: 6774 3b42 696e 6443 7564 6142 7566 6665 gt;BindCudaBuffe │ │ │ │ +00011b00: 7228 292c 3c2f 6469 763e 0a3c 6469 7620 r(),
.
875 │ │ │ │ +00011b60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00011b70: 2020 2020 2020 2020 2020 283c 7370 616e (const Patch │ │ │ │ +00011bd0: 4172 7261 793c 2f61 3e20 2a29 7061 7463 Array *)patc │ │ │ │ +00011be0: 6854 6162 6c65 2d26 6774 3b47 6574 5661 hTable->GetVa │ │ │ │ +00011bf0: 7279 696e 6750 6174 6368 4172 7261 7942 ryingPatchArrayB │ │ │ │ +00011c00: 7566 6665 7228 292c 3c2f 6469 763e 0a3c uffer(),
.< │ │ │ │ +00011c10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00011c20: 3e3c 6120 6964 3d22 6c30 3038 3736 2220 > 876 │ │ │ │ +00011c70: 2020 2020 2020 2020 2020 2020 2020 283c (< │ │ │ │ +00011c80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00011c90: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const int< │ │ │ │ +00011cc0: 2f73 7061 6e3e 202a 2970 6174 6368 5461 /span> *)patchTa │ │ │ │ +00011cd0: 626c 652d 2667 743b 4765 7456 6172 7969 ble->GetVaryi │ │ │ │ +00011ce0: 6e67 5061 7463 6849 6e64 6578 4275 6666 ngPatchIndexBuff │ │ │ │ +00011cf0: 6572 2829 2c3c 2f64 6976 3e0a 3c64 6976 er(),
.
< │ │ │ │ +00011d30: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00011d40: 6e6f 223e 2020 3837 373c 2f73 7061 6e3e no"> 877 │ │ │ │ +00011d50: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00011d60: 2020 2020 2020 2020 2020 2028 3c73 7061 (const < │ │ │ │ +00011d90: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +00011da0: 5f73 7472 7563 7422 2068 7265 663d 2261 _struct" href="a │ │ │ │ +00011db0: 3031 3332 312e 6874 6d6c 223e 5061 7463 01321.html">Patc │ │ │ │ +00011dc0: 6850 6172 616d 3c2f 613e 202a 2970 6174 hParam *)pat │ │ │ │ +00011dd0: 6368 5461 626c 652d 2667 743b 4765 7450 chTable->GetP │ │ │ │ +00011de0: 6174 6368 5061 7261 6d42 7566 6665 7228 atchParamBuffer( │ │ │ │ +00011df0: 2929 3b3c 2f64 6976 3e0a 3c64 6976 2063 ));
.
878 │ │ │ │ +00011e50: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
879 < │ │ │ │ +00011eb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +00011f00: 3932 303c 2f73 7061 6e3e 2020 2020 3c73 920 template <ty │ │ │ │ +00011f50: 7065 6e61 6d65 3c2f 7370 616e 3e20 5352 pename SR │ │ │ │ +00011f60: 435f 4255 4646 4552 2c20 3c73 7061 6e20 C_BUFFER, │ │ │ │ +00011f80: 7479 7065 6e61 6d65 3c2f 7370 616e 3e20 typename │ │ │ │ +00011f90: 4453 545f 4255 4646 4552 2c3c 2f64 6976 DST_BUFFER,
.
921< │ │ │ │ +00011ff0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ +00012000: 2020 2020 3c73 7061 6e20 636c 6173 733d typena │ │ │ │ +00012020: 6d65 3c2f 7370 616e 3e20 5041 5443 4843 me PATCHC │ │ │ │ +00012030: 4f4f 5244 5f42 5546 4645 522c 203c 7370 OORD_BUFFER, typename PATCH_TABLE&g │ │ │ │ +00012070: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
922< │ │ │ │ +00012110: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ +00012130: 7374 6174 6963 3c2f 7370 616e 3e20 3c73 static bool EvalPatches │ │ │ │ +000121c0: 5661 7279 696e 673c 2f61 3e28 3c2f 6469 Varying(.
923 │ │ │ │ +00012220: 3c2f 7370 616e 3e20 2020 2020 2020 2053 S │ │ │ │ +00012230: 5243 5f42 5546 4645 5220 2a73 7263 4275 RC_BUFFER *srcBu │ │ │ │ +00012240: 6666 6572 2c20 3c61 2063 6c61 7373 3d22 ffer, BufferDescrip │ │ │ │ +00012280: 746f 723c 2f61 3e20 3c73 7061 6e20 636c tor co │ │ │ │ +000122a0: 6e73 743c 2f73 7061 6e3e 2026 616d 703b nst & │ │ │ │ +000122b0: 7372 6344 6573 632c 3c2f 6469 763e 0a3c srcDesc,
.< │ │ │ │ +000122c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000122d0: 3e3c 6120 6964 3d22 6c30 3039 3234 2220 > 924 DST_B │ │ │ │ +00012320: 5546 4645 5220 2a64 7374 4275 6666 6572 UFFER *dstBuffer │ │ │ │ +00012330: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , B │ │ │ │ +00012360: 7566 6665 7244 6573 6372 6970 746f 723c ufferDescriptor< │ │ │ │ +00012370: 2f61 3e20 3c73 7061 6e20 636c 6173 733d /a> const< │ │ │ │ +00012390: 2f73 7061 6e3e 2026 616d 703b 6473 7444 /span> &dstD │ │ │ │ +000123a0: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
925 │ │ │ │ +00012400: 2020 2020 2020 2044 5354 5f42 5546 4645 DST_BUFFE │ │ │ │ +00012410: 5220 2a64 7542 7566 6665 722c 2020 3c61 R *duBuffer, Buffe │ │ │ │ +00012450: 7244 6573 6372 6970 746f 723c 2f61 3e20 rDescriptor │ │ │ │ +00012460: 3c73 7061 6e20 636c 6173 733d 226b 6579 const &duDesc,< │ │ │ │ +00012490: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000124e0: 3932 363c 2f73 7061 6e3e 2020 2020 2020 926 │ │ │ │ +000124f0: 2020 4453 545f 4255 4646 4552 202a 6476 DST_BUFFER *dv │ │ │ │ +00012500: 4275 6666 6572 2c20 203c 6120 636c 6173 Buffer, BufferDesc │ │ │ │ +00012540: 7269 7074 6f72 3c2f 613e 203c 7370 616e riptor const &a │ │ │ │ +00012570: 6d70 3b64 7644 6573 632c 3c2f 6469 763e mp;dvDesc,
│ │ │ │ +00012580: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +000125b0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 927 int numPatchCoords │ │ │ │ +00012610: 2c3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ,
.
│ │ │ │ +00012660: 2020 3932 383c 2f73 7061 6e3e 2020 2020 928 │ │ │ │ +00012670: 2020 2020 5041 5443 4843 4f4f 5244 5f42 PATCHCOORD_B │ │ │ │ +00012680: 5546 4645 5220 2a70 6174 6368 436f 6f72 UFFER *patchCoor │ │ │ │ +00012690: 6473 2c3c 2f64 6976 3e0a 3c64 6976 2063 ds,
.
929 │ │ │ │ +000126f0: 2020 2020 2020 5041 5443 485f 5441 424c PATCH_TABL │ │ │ │ +00012700: 4520 2a70 6174 6368 5461 626c 652c 3c2f E *patchTable,.
9 │ │ │ │ +00012760: 3330 3c2f 7370 616e 3e20 2020 2020 2020 30 │ │ │ │ +00012770: 203c 6120 636c 6173 733d 2263 6f64 6520 Cud │ │ │ │ +000127a0: 6145 7661 6c75 6174 6f72 3c2f 613e 203c aEvaluator < │ │ │ │ +000127b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000127c0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const *instance,.
931 │ │ │ │ +00012830: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ +00012840: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00012850: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void * deviceCon │ │ │ │ +00012870: 7465 7874 203d 204e 554c 4c29 207b 3c2f text = NULL) {.
9 │ │ │ │ +000128d0: 3332 3c2f 7370 616e 3e20 3c2f 6469 763e 32
│ │ │ │ +000128e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00012910: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 933 (vo │ │ │ │ +00012940: 6964 2969 6e73 7461 6e63 653b 2020 2020 id)instance; │ │ │ │ +00012950: 2020 203c 7370 616e 2063 6c61 7373 3d22 // unus │ │ │ │ +00012970: 6564 3c2f 7370 616e 3e3c 2f64 6976 3e0a ed
. │ │ │ │ +00012980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ +00012a20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00012a30: 3e3c 6120 6964 3d22 6c30 3039 3335 2220 > 935
.
936 │ │ │ │ +00012ad0: 2020 2020 2020 203c 7370 616e 2063 6c61 return < │ │ │ │ +00012b00: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ +00012b10: 5f66 756e 6374 696f 6e22 2068 7265 663d _function" href= │ │ │ │ +00012b20: 2261 3031 3137 372e 6874 6d6c 2361 6433 "a01177.html#ad3 │ │ │ │ +00012b30: 3830 3365 3831 3231 6263 3034 3931 6539 803e8121bc0491e9 │ │ │ │ +00012b40: 6639 3739 3030 6563 6435 3030 3232 223e f97900ecd50022"> │ │ │ │ +00012b50: 4576 616c 5061 7463 6865 733c 2f61 3e28 EvalPatches( │ │ │ │ +00012b60: 7372 6342 7566 6665 722d 2667 743b 4269 srcBuffer->Bi │ │ │ │ +00012b70: 6e64 4375 6461 4275 6666 6572 2829 2c20 ndCudaBuffer(), │ │ │ │ +00012b80: 7372 6344 6573 632c 3c2f 6469 763e 0a3c srcDesc,
.< │ │ │ │ +00012b90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00012ba0: 3e3c 6120 6964 3d22 6c30 3039 3337 2220 > 937 │ │ │ │ +00012bf0: 2020 2020 2020 2020 2020 2020 2020 6473 ds │ │ │ │ +00012c00: 7442 7566 6665 722d 2667 743b 4269 6e64 tBuffer->Bind │ │ │ │ +00012c10: 4375 6461 4275 6666 6572 2829 2c20 6473 CudaBuffer(), ds │ │ │ │ +00012c20: 7444 6573 632c 3c2f 6469 763e 0a3c 6469 tDesc,
.< │ │ │ │ +00012c40: 6120 6964 3d22 6c30 3039 3338 2220 6e61 a id="l00938" na │ │ │ │ +00012c50: 6d65 3d22 6c30 3039 3338 223e 3c2f 613e me="l00938"> │ │ │ │ +00012c60: 3c73 7061 6e20 636c 6173 733d 226c 696e 938 │ │ │ │ +00012c90: 2020 2020 2020 2020 2020 2020 6475 4275 duBu │ │ │ │ +00012ca0: 6666 6572 2d26 6774 3b42 696e 6443 7564 ffer->BindCud │ │ │ │ +00012cb0: 6142 7566 6665 7228 292c 2064 7544 6573 aBuffer(), duDes │ │ │ │ +00012cc0: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
939 │ │ │ │ +00012d20: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00012d30: 2020 2020 2020 2020 6476 4275 6666 6572 dvBuffer │ │ │ │ +00012d40: 2d26 6774 3b42 696e 6443 7564 6142 7566 ->BindCudaBuf │ │ │ │ +00012d50: 6665 7228 292c 2064 7644 6573 632c 3c2f fer(), dvDesc,.
9 │ │ │ │ +00012db0: 3430 3c2f 7370 616e 3e20 2020 2020 2020 40 │ │ │ │ +00012dc0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00012dd0: 2020 2020 6e75 6d50 6174 6368 436f 6f72 numPatchCoor │ │ │ │ +00012de0: 6473 2c3c 2f64 6976 3e0a 3c64 6976 2063 ds,
.
941 │ │ │ │ +00012e40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00012e50: 2020 2020 2020 2020 2028 3c73 7061 6e20 ( │ │ │ │ +00012e70: 636f 6e73 743c 2f73 7061 6e3e 203c 6120 const PatchC │ │ │ │ +00012eb0: 6f6f 7264 3c2f 613e 202a 2970 6174 6368 oord *)patch │ │ │ │ +00012ec0: 436f 6f72 6473 2d26 6774 3b42 696e 6443 Coords->BindC │ │ │ │ +00012ed0: 7564 6142 7566 6665 7228 292c 3c2f 6469 udaBuffer(),.
942 │ │ │ │ +00012f30: 3c2f 7370 616e 3e20 2020 2020 2020 2020 │ │ │ │ +00012f40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00012f50: 2020 283c 7370 616e 2063 6c61 7373 3d22 (const PatchArray *)patchTable-& │ │ │ │ +00012fc0: 6774 3b47 6574 5661 7279 696e 6750 6174 gt;GetVaryingPat │ │ │ │ +00012fd0: 6368 4172 7261 7942 7566 6665 7228 292c chArrayBuffer(), │ │ │ │ +00012fe0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00013030: 2039 3433 3c2f 7370 616e 3e20 2020 2020 943 │ │ │ │ +00013040: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00013050: 2020 2020 2020 283c 7370 616e 2063 6c61 (con │ │ │ │ +00013070: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st int * │ │ │ │ +000130a0: 2970 6174 6368 5461 626c 652d 2667 743b )patchTable-> │ │ │ │ +000130b0: 4765 7456 6172 7969 6e67 5061 7463 6849 GetVaryingPatchI │ │ │ │ +000130c0: 6e64 6578 4275 6666 6572 2829 2c3c 2f64 ndexBuffer(),.
94 │ │ │ │ +00013120: 343c 2f73 7061 6e3e 2020 2020 2020 2020 4 │ │ │ │ +00013130: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00013140: 2020 2028 3c73 7061 6e20 636c 6173 733d (const< │ │ │ │ +00013160: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> PatchParam *)patchTable- │ │ │ │ +000131b0: 2667 743b 4765 7450 6174 6368 5061 7261 >GetPatchPara │ │ │ │ +000131c0: 6d42 7566 6665 7228 2929 3b3c 2f64 6976 mBuffer());
.
945< │ │ │ │ +00013220: 2f73 7061 6e3e 2020 2020 7d3c 2f64 6976 /span> }
.
946< │ │ │ │ +00013280: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ +000132a0: 3c61 2069 643d 226c 3031 3030 3522 206e 1005 temp │ │ │ │ +00013300: 6c61 7465 3c2f 7370 616e 3e20 266c 743b late < │ │ │ │ +00013310: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename SRC_BUFFER │ │ │ │ +00013340: 2c20 3c73 7061 6e20 636c 6173 733d 226b , typename │ │ │ │ +00013360: 3c2f 7370 616e 3e20 4453 545f 4255 4646 DST_BUFF │ │ │ │ +00013370: 4552 2c3c 2f64 6976 3e0a 3c64 6976 2063 ER,
.
1006 │ │ │ │ +000133d0: 2020 2020 2020 2020 2020 2020 3c73 7061 typename PATCHCOORD_BUF │ │ │ │ +00013410: 4645 522c 203c 7370 616e 2063 6c61 7373 FER, typen │ │ │ │ +00013430: 616d 653c 2f73 7061 6e3e 2050 4154 4348 ame PATCH │ │ │ │ +00013440: 5f54 4142 4c45 2667 743b 3c2f 6469 763e _TABLE>
│ │ │ │ +00013450: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
1008 │ │ │ │ +00013600: 2020 2020 2020 2053 5243 5f42 5546 4645 SRC_BUFFE │ │ │ │ +00013610: 5220 2a73 7263 4275 6666 6572 2c20 3c61 R *srcBuffer, Buffe │ │ │ │ +00013650: 7244 6573 6372 6970 746f 723c 2f61 3e20 rDescriptor │ │ │ │ +00013660: 3c73 7061 6e20 636c 6173 733d 226b 6579 const &srcDesc, │ │ │ │ +00013690: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +000136e0: 3130 3039 3c2f 7370 616e 3e20 2020 2020 1009 │ │ │ │ +000136f0: 2020 2044 5354 5f42 5546 4645 5220 2a64 DST_BUFFER *d │ │ │ │ +00013700: 7374 4275 6666 6572 2c20 3c61 2063 6c61 stBuffer, BufferDes │ │ │ │ +00013740: 6372 6970 746f 723c 2f61 3e20 3c73 7061 criptor const & │ │ │ │ +00013770: 616d 703b 6473 7444 6573 632c 3c2f 6469 amp;dstDesc,.
1010 │ │ │ │ +000137d0: 3c2f 7370 616e 3e20 2020 2020 2020 2044 D │ │ │ │ +000137e0: 5354 5f42 5546 4645 5220 2a64 7542 7566 ST_BUFFER *duBuf │ │ │ │ +000137f0: 6665 722c 2020 3c61 2063 6c61 7373 3d22 fer, BufferDescrip │ │ │ │ +00013830: 746f 723c 2f61 3e20 3c73 7061 6e20 636c tor co │ │ │ │ +00013850: 6e73 743c 2f73 7061 6e3e 2026 616d 703b nst & │ │ │ │ +00013860: 6475 4465 7363 2c3c 2f64 6976 3e0a 3c64 duDesc,
. │ │ │ │ +00013880: 3c61 2069 643d 226c 3031 3031 3122 206e 1011
DST_BU │ │ │ │ +000138d0: 4646 4552 202a 6476 4275 6666 6572 2c20 FFER *dvBuffer, │ │ │ │ +000138e0: 203c 6120 636c 6173 733d 2263 6f64 6520 Bu │ │ │ │ +00013910: 6666 6572 4465 7363 7269 7074 6f72 3c2f fferDescriptor const &dvDes │ │ │ │ +00013950: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
1012 │ │ │ │ +000139b0: 2020 2020 2044 5354 5f42 5546 4645 5220 DST_BUFFER │ │ │ │ +000139c0: 2a64 7575 4275 6666 6572 2c20 3c61 2063 *duuBuffer, BufferD │ │ │ │ +00013a00: 6573 6372 6970 746f 723c 2f61 3e20 3c73 escriptor const │ │ │ │ +00013a30: 2026 616d 703b 6475 7544 6573 632c 3c2f &duuDesc,.
10 │ │ │ │ +00013a90: 3133 3c2f 7370 616e 3e20 2020 2020 2020 13 │ │ │ │ +00013aa0: 2044 5354 5f42 5546 4645 5220 2a64 7576 DST_BUFFER *duv │ │ │ │ +00013ab0: 4275 6666 6572 2c20 3c61 2063 6c61 7373 Buffer, BufferDescr │ │ │ │ +00013af0: 6970 746f 723c 2f61 3e20 3c73 7061 6e20 iptor │ │ │ │ +00013b10: 636f 6e73 743c 2f73 7061 6e3e 2026 616d const &am │ │ │ │ +00013b20: 703b 6475 7644 6573 632c 3c2f 6469 763e p;duvDesc,
│ │ │ │ +00013b30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00013b60: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 1014 DST │ │ │ │ +00013b90: 5f42 5546 4645 5220 2a64 7676 4275 6666 _BUFFER *dvvBuff │ │ │ │ +00013ba0: 6572 2c20 3c61 2063 6c61 7373 3d22 636f er, BufferDescripto │ │ │ │ +00013be0: 723c 2f61 3e20 3c73 7061 6e20 636c 6173 r cons │ │ │ │ +00013c00: 743c 2f73 7061 6e3e 2026 616d 703b 6476 t &dv │ │ │ │ +00013c10: 7644 6573 632c 3c2f 6469 763e 0a3c 6469 vDesc,
.< │ │ │ │ +00013c30: 6120 6964 3d22 6c30 3130 3135 2220 6e61 a id="l01015" na │ │ │ │ +00013c40: 6d65 3d22 6c30 3130 3135 223e 3c2f 613e me="l01015"> │ │ │ │ +00013c50: 3c73 7061 6e20 636c 6173 733d 226c 696e 1015 int nu │ │ │ │ +00013ca0: 6d50 6174 6368 436f 6f72 6473 2c3c 2f64 mPatchCoords,.
101 │ │ │ │ +00013d00: 363c 2f73 7061 6e3e 2020 2020 2020 2020 6 │ │ │ │ +00013d10: 5041 5443 4843 4f4f 5244 5f42 5546 4645 PATCHCOORD_BUFFE │ │ │ │ +00013d20: 5220 2a70 6174 6368 436f 6f72 6473 2c3c R *patchCoords,< │ │ │ │ +00013d30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
1 │ │ │ │ +00013d80: 3031 373c 2f73 7061 6e3e 2020 2020 2020 017 │ │ │ │ +00013d90: 2020 5041 5443 485f 5441 424c 4520 2a70 PATCH_TABLE *p │ │ │ │ +00013da0: 6174 6368 5461 626c 652c 3c2f 6469 763e atchTable,
│ │ │ │ +00013db0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +00013e80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00013e90: 3e3c 6120 6964 3d22 6c30 3130 3139 2220 > 1019 void │ │ │ │ +00013f00: 202a 2064 6576 6963 6543 6f6e 7465 7874 * deviceContext │ │ │ │ +00013f10: 203d 204e 554c 4c29 207b 3c2f 6469 763e = NULL) {
│ │ │ │ +00013f20: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +00013f90: 6120 6964 3d22 6c30 3130 3231 2220 6e61 a id="l01021" na │ │ │ │ +00013fa0: 6d65 3d22 6c30 3130 3231 223e 3c2f 613e me="l01021"> │ │ │ │ +00013fb0: 3c73 7061 6e20 636c 6173 733d 226c 696e 1021 (void)i │ │ │ │ +00013fe0: 6e73 7461 6e63 653b 2020 2020 2020 203c nstance; < │ │ │ │ +00013ff0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00014000: 656e 7422 3e2f 2f20 756e 7573 6564 3c2f ent">// unused
.
< │ │ │ │ +00014050: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ +00014060: 6e6f 223e 2031 3032 323c 2f73 7061 6e3e no"> 1022 │ │ │ │ +00014070: 2020 2020 2020 2020 2876 6f69 6429 6465 (void)de │ │ │ │ +00014080: 7669 6365 436f 6e74 6578 743b 2020 3c73 viceContext; // unused
.
1023 │ │ │ │ +00014110: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ +00014160: 3130 3234 3c2f 7370 616e 3e20 2020 2020 1024 │ │ │ │ +00014170: 2020 203c 7370 616e 2063 6c61 7373 3d22 ret │ │ │ │ +00014190: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn Eval │ │ │ │ +000141f0: 5061 7463 6865 733c 2f61 3e28 7372 6342 Patches(srcB │ │ │ │ +00014200: 7566 6665 722d 2667 743b 4269 6e64 4375 uffer->BindCu │ │ │ │ +00014210: 6461 4275 6666 6572 2829 2c20 7372 6344 daBuffer(), srcD │ │ │ │ +00014220: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
1025 │ │ │ │ +00014280: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00014290: 2020 2020 2020 2020 2020 6473 7442 7566 dstBuf │ │ │ │ +000142a0: 6665 722d 2667 743b 4269 6e64 4375 6461 fer->BindCuda │ │ │ │ +000142b0: 4275 6666 6572 2829 2c20 6473 7444 6573 Buffer(), dstDes │ │ │ │ +000142c0: 632c 3c2f 6469 763e 0a3c 6469 7620 636c c,
.
1026 │ │ │ │ +00014320: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00014330: 2020 2020 2020 2020 6475 4275 6666 6572 duBuffer │ │ │ │ +00014340: 2d26 6774 3b42 696e 6443 7564 6142 7566 ->BindCudaBuf │ │ │ │ +00014350: 6665 7228 292c 2064 7544 6573 632c 3c2f fer(), duDesc,.
10 │ │ │ │ +000143b0: 3237 3c2f 7370 616e 3e20 2020 2020 2020 27 │ │ │ │ +000143c0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000143d0: 2020 2020 6476 4275 6666 6572 2d26 6774 dvBuffer-> │ │ │ │ +000143e0: 3b42 696e 6443 7564 6142 7566 6665 7228 ;BindCudaBuffer( │ │ │ │ +000143f0: 292c 2064 7644 6573 632c 3c2f 6469 763e ), dvDesc,
│ │ │ │ +00014400: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ +00014430: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 1028 │ │ │ │ +00014460: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00014470: 6475 7542 7566 6665 722d 2667 743b 4269 duuBuffer->Bi │ │ │ │ +00014480: 6e64 4375 6461 4275 6666 6572 2829 2c20 ndCudaBuffer(), │ │ │ │ +00014490: 6475 7544 6573 632c 3c2f 6469 763e 0a3c duuDesc,
.< │ │ │ │ +000144a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000144b0: 3e3c 6120 6964 3d22 6c30 3130 3239 2220 > 1029 │ │ │ │ +00014500: 2020 2020 2020 2020 2020 2020 2020 6475 du │ │ │ │ +00014510: 7642 7566 6665 722d 2667 743b 4269 6e64 vBuffer->Bind │ │ │ │ +00014520: 4375 6461 4275 6666 6572 2829 2c20 6475 CudaBuffer(), du │ │ │ │ +00014530: 7644 6573 632c 3c2f 6469 763e 0a3c 6469 vDesc,
.< │ │ │ │ +00014550: 6120 6964 3d22 6c30 3130 3330 2220 6e61 a id="l01030" na │ │ │ │ +00014560: 6d65 3d22 6c30 3130 3330 223e 3c2f 613e me="l01030"> │ │ │ │ +00014570: 3c73 7061 6e20 636c 6173 733d 226c 696e 1030 │ │ │ │ +000145a0: 2020 2020 2020 2020 2020 2020 6476 7642 dvvB │ │ │ │ +000145b0: 7566 6665 722d 2667 743b 4269 6e64 4375 uffer->BindCu │ │ │ │ +000145c0: 6461 4275 6666 6572 2829 2c20 6476 7644 daBuffer(), dvvD │ │ │ │ +000145d0: 6573 632c 3c2f 6469 763e 0a3c 6469 7620 esc,
.
1031 │ │ │ │ +00014630: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00014640: 2020 2020 2020 2020 2020 6e75 6d50 6174 numPat │ │ │ │ +00014650: 6368 436f 6f72 6473 2c3c 2f64 6976 3e0a chCoords,
. │ │ │ │ +00014660: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +00014690: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 1032 │ │ │ │ +000146c0: 2020 2020 2020 2020 2020 2020 2020 2028 ( │ │ │ │ +000146d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const │ │ │ │ +00014720: 5061 7463 6843 6f6f 7264 3c2f 613e 202a PatchCoord * │ │ │ │ +00014730: 2970 6174 6368 436f 6f72 6473 2d26 6774 )patchCoords-> │ │ │ │ +00014740: 3b42 696e 6443 7564 6142 7566 6665 7228 ;BindCudaBuffer( │ │ │ │ +00014750: 292c 3c2f 6469 763e 0a3c 6469 7620 636c ),
.
1033 │ │ │ │ +000147b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000147c0: 2020 2020 2020 2020 283c 7370 616e 2063 (c │ │ │ │ +000147e0: 6f6e 7374 3c2f 7370 616e 3e20 3c61 2063 onst PatchAr │ │ │ │ +00014820: 7261 793c 2f61 3e20 2a29 7061 7463 6854 ray *)patchT │ │ │ │ +00014830: 6162 6c65 2d26 6774 3b47 6574 5661 7279 able->GetVary │ │ │ │ +00014840: 696e 6750 6174 6368 4172 7261 7942 7566 ingPatchArrayBuf │ │ │ │ +00014850: 6665 7228 292c 3c2f 6469 763e 0a3c 6469 fer(),
.< │ │ │ │ +00014870: 6120 6964 3d22 6c30 3130 3334 2220 6e61 a id="l01034" na │ │ │ │ +00014880: 6d65 3d22 6c30 3130 3334 223e 3c2f 613e me="l01034"> │ │ │ │ +00014890: 3c73 7061 6e20 636c 6173 733d 226c 696e 1034 │ │ │ │ +000148c0: 2020 2020 2020 2020 2020 2020 283c 7370 (const │ │ │ │ +000148f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
*)patchTabl │ │ │ │ +00014920: 652d 2667 743b 4765 7456 6172 7969 6e67 e->GetVarying │ │ │ │ +00014930: 5061 7463 6849 6e64 6578 4275 6666 6572 PatchIndexBuffer │ │ │ │ +00014940: 2829 2c3c 2f64 6976 3e0a 3c64 6976 2063 (),
.
1035 │ │ │ │ +000149a0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000149b0: 2020 2020 2020 2020 2028 3c73 7061 6e20 ( │ │ │ │ +000149d0: 636f 6e73 743c 2f73 7061 6e3e 203c 6120 const PatchP │ │ │ │ +00014a10: 6172 616d 3c2f 613e 202a 2970 6174 6368 aram *)patch │ │ │ │ +00014a20: 5461 626c 652d 2667 743b 4765 7450 6174 Table->GetPat │ │ │ │ +00014a30: 6368 5061 7261 6d42 7566 6665 7228 2929 chParamBuffer()) │ │ │ │ +00014a40: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ +00014a90: 2031 3033 363c 2f73 7061 6e3e 2020 2020 1036 │ │ │ │ +00014aa0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
.
│ │ │ │ +00014af0: 2031 3033 373c 2f73 7061 6e3e 203c 2f64 1037 .
106 │ │ │ │ +00014b50: 383c 2f73 7061 6e3e 2020 2020 3c73 7061 8 template <type │ │ │ │ +00014ba0: 6e61 6d65 3c2f 7370 616e 3e20 5352 435f name SRC_ │ │ │ │ +00014bb0: 4255 4646 4552 2c20 3c73 7061 6e20 636c BUFFER, ty │ │ │ │ +00014bd0: 7065 6e61 6d65 3c2f 7370 616e 3e20 4453 pename DS │ │ │ │ +00014be0: 545f 4255 4646 4552 2c3c 2f64 6976 3e0a T_BUFFER,
. │ │ │ │ +00014bf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ +00014d10: 6120 636c 6173 733d 226c 696e 6522 2068 a class="line" h │ │ │ │ +00014d20: 7265 663d 2261 3031 3137 372e 6874 6d6c ref="a01177.html │ │ │ │ +00014d30: 2361 6635 6433 6339 3437 6462 3135 6663 #af5d3c947db15fc │ │ │ │ +00014d40: 6564 3437 3663 6662 3430 6637 6631 3232 ed476cfb40f7f122 │ │ │ │ +00014d50: 3033 223e 2031 3037 303c 2f61 3e3c 2f73 03"> 1070 st │ │ │ │ +00014d80: 6174 6963 3c2f 7370 616e 3e20 3c73 7061 atic template <SchemeType │ │ │ │ -00014dc0: 2053 4348 454d 4526 6774 3b3c 2f64 6976 SCHEME>
.
510< │ │ │ │ -00014e20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>temp │ │ │ │ -00014e40: 6c61 7465 3c2f 7370 616e 3e20 266c 743b late < │ │ │ │ -00014e50: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename VERTEX, typename MASK>.
511 │ │ │ │ -00014f00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 void..
513< │ │ │ │ -000150e0: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -000150f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00015100: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00015110: 204d 4153 4b26 616d 703b 2020 2020 2020 MASK& │ │ │ │ -00015120: 2020 2020 206d 6173 6b2c 3c2f 6469 763e mask,
│ │ │ │ -00015130: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00015160: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 514 │ │ │ │ -00015190: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000151a0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000151b0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Crease::Rule │ │ │ │ -00015210: 3c2f 613e 2070 5275 6c65 2c3c 2f64 6976 pRule,
.
515< │ │ │ │ -00015270: 2f73 7061 6e3e 2020 2020 2020 2020 2020 /span> │ │ │ │ -00015280: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00015290: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000152a0: 203c 6120 636c 6173 733d 2263 6f64 6520 Crease::Rul │ │ │ │ -00015300: 653c 2f61 3e20 6352 756c 6529 3c73 7061 e cRule) const │ │ │ │ -00015330: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ │ -00015380: 2020 3531 363c 2f73 7061 6e3e 203c 2f64 516 .
51 │ │ │ │ -000153e0: 373c 2f73 7061 6e3e 2020 2020 3c73 7061 7 // Quick assi │ │ │ │ -00015410: 676e 6d65 6e74 2061 6e64 2072 6574 7572 gnment and retur │ │ │ │ -00015420: 6e20 666f 7220 7468 6520 6d6f 7374 2063 n for the most c │ │ │ │ -00015430: 6f6d 6d6f 6e20 6361 7365 3a3c 2f73 7061 ommon case:
.
518 │ │ │ │ -000154a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if ((pRule == │ │ │ │ -000154d0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 Crease::RULE_ │ │ │ │ -00015550: 534d 4f4f 5448 3c2f 613e 2920 7c7c 2028 SMOOTH) || ( │ │ │ │ -00015560: 7052 756c 6520 3d3d 203c 6120 636c 6173 pRule == Crea │ │ │ │ -000155e0: 7365 3a3a 5255 4c45 5f44 4152 543c 2f61 se::RULE_DART)) {
.
< │ │ │ │ -00015630: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00015640: 6e6f 223e 2020 3531 393c 2f73 7061 6e3e no"> 519 │ │ │ │ -00015650: 2020 2020 2020 2020 6173 7369 676e 536d assignSm │ │ │ │ -00015660: 6f6f 7468 4d61 736b 466f 7256 6572 7465 oothMaskForVerte │ │ │ │ -00015670: 7828 7665 7274 6578 2c20 6d61 736b 293b x(vertex, mask); │ │ │ │ -00015680: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000156d0: 2035 3230 3c2f 7370 616e 3e20 2020 2020 520 │ │ │ │ -000156e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ret │ │ │ │ -00015700: 7572 6e3c 2f73 7061 6e3e 3b3c 2f64 6976 urn;
.
521< │ │ │ │ -00015760: 2f73 7061 6e3e 2020 2020 7d3c 2f64 6976 /span> }
.
522< │ │ │ │ -000157c0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -000157e0: 2f2f 2020 4966 2075 6e73 7065 6369 6669 // If unspecifi │ │ │ │ -000157f0: 6564 2c20 6173 7369 676e 2074 6865 2063 ed, assign the c │ │ │ │ -00015800: 6869 6c64 2072 756c 6520 746f 206d 6174 hild rule to mat │ │ │ │ -00015810: 6368 2074 6865 2070 6172 656e 7420 7275 ch the parent ru │ │ │ │ -00015820: 6c65 2069 6620 7370 6563 6966 6965 643a le if specified: │ │ │ │ -00015830: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00015850: 3c61 2069 643d 226c 3030 3532 3322 206e 523 │ │ │ │ -000158b0: 6966 3c2f 7370 616e 3e20 2828 6352 756c if ((cRul │ │ │ │ -000158c0: 6520 3d3d 203c 6120 636c 6173 733d 2263 e == Crease:: │ │ │ │ -00015940: 5255 4c45 5f55 4e4b 4e4f 574e 3c2f 613e RULE_UNKNOWN │ │ │ │ -00015950: 2920 2661 6d70 3b26 616d 703b 2028 7052 ) && (pR │ │ │ │ -00015960: 756c 6520 213d 203c 6120 636c 6173 733d ule != Crease │ │ │ │ -000159e0: 3a3a 5255 4c45 5f55 4e4b 4e4f 574e 3c2f ::RULE_UNKNOWN)) {
.< │ │ │ │ -00015a10: 6120 6964 3d22 6c30 3035 3234 2220 6e61 a id="l00524" na │ │ │ │ -00015a20: 6d65 3d22 6c30 3035 3234 223e 3c2f 613e me="l00524"> │ │ │ │ -00015a30: 3c73 7061 6e20 636c 6173 733d 226c 696e 524 cRule = │ │ │ │ -00015a60: 2070 5275 6c65 3b3c 2f64 6976 3e0a 3c64 pRule;
. │ │ │ │ -00015a80: 3c61 2069 643d 226c 3030 3532 3522 206e 525 }
. │ │ │ │ -00015ae0: 3c61 2069 643d 226c 3030 3532 3622 206e 526 │ │ │ │ -00015b40: 696e 743c 2f73 7061 6e3e 2076 616c 656e int valen │ │ │ │ -00015b50: 6365 203d 2076 6572 7465 782e 4765 744e ce = vertex.GetN │ │ │ │ -00015b60: 756d 4564 6765 7328 293b 3c2f 6469 763e umEdges();
│ │ │ │ -00015b70: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ -00015be0: 6120 6964 3d22 6c30 3035 3238 2220 6e61 a id="l00528" na │ │ │ │ -00015bf0: 6d65 3d22 6c30 3035 3238 223e 3c2f 613e me="l00528"> │ │ │ │ -00015c00: 3c73 7061 6e20 636c 6173 733d 226c 696e 528 //
.
529 │ │ │ │ -00015ca0: 2020 203c 7370 616e 2063 6c61 7373 3d22 // Det │ │ │ │ -00015cc0: 6572 6d69 6e65 2069 6620 7765 206e 6565 ermine if we nee │ │ │ │ -00015cd0: 6420 7468 6520 7061 7265 6e74 2065 6467 d the parent edg │ │ │ │ -00015ce0: 6520 7368 6172 706e 6573 7320 7661 6c75 e sharpness valu │ │ │ │ -00015cf0: 6573 202d 2d20 6964 656e 7469 6679 2f67 es -- identify/g │ │ │ │ -00015d00: 6174 6865 7220 6966 2073 6f3c 2f73 7061 ather if so
.
530 │ │ │ │ -00015d70: 203c 7370 616e 2063 6c61 7373 3d22 636f // and u │ │ │ │ -00015d90: 7365 2069 7420 746f 2063 6f6d 7075 7465 se it to compute │ │ │ │ -00015da0: 2074 6865 2070 6172 656e 7420 7275 6c65 the parent rule │ │ │ │ -00015db0: 2069 6620 756e 7370 6563 6966 6965 643a if unspecified: │ │ │ │ -00015dc0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00015de0: 3c61 2069 643d 226c 3030 3533 3122 206e 531 //
.
< │ │ │ │ -00015e80: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00015e90: 6e6f 223e 2020 3533 323c 2f73 7061 6e3e no"> 532 │ │ │ │ -00015ea0: 2020 2020 3c73 7061 6e20 636c 6173 733d fl │ │ │ │ -00015ec0: 6f61 743c 2f73 7061 6e3e 202a 2070 4564 oat * pEd │ │ │ │ -00015ed0: 6765 5368 6172 706e 6573 7342 7566 6665 geSharpnessBuffe │ │ │ │ -00015ee0: 7220 3d20 283c 7370 616e 2063 6c61 7373 r = (f │ │ │ │ -00015f00: 6c6f 6174 3c2f 7370 616e 3e20 2a29 616c loat *)al │ │ │ │ -00015f10: 6c6f 6361 2876 616c 656e 6365 2a3c 7370 loca(valence*sizeof │ │ │ │ -00015f40: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (float │ │ │ │ -00015f60: 3c2f 7370 616e 3e29 292c 3c2f 6469 763e )),
│ │ │ │ -00015f70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00015fa0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 533 * │ │ │ │ -00015fd0: 2070 4564 6765 5368 6172 706e 6573 7320 pEdgeSharpness │ │ │ │ -00015fe0: 2020 3d20 302c 3c2f 6469 763e 0a3c 6469 = 0,
.< │ │ │ │ -00016000: 6120 6964 3d22 6c30 3035 3334 2220 6e61 a id="l00534" na │ │ │ │ -00016010: 6d65 3d22 6c30 3035 3334 223e 3c2f 613e me="l00534"> │ │ │ │ -00016020: 3c73 7061 6e20 636c 6173 733d 226c 696e 534 pVe │ │ │ │ -00016050: 7274 6578 5368 6172 706e 6573 7320 3d20 rtexSharpness = │ │ │ │ -00016060: 302e 3066 3b3c 2f64 6976 3e0a 3c64 6976 0.0f;
.
< │ │ │ │ -000160a0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000160b0: 6e6f 223e 2020 3533 353c 2f73 7061 6e3e no"> 535 │ │ │ │ -000160c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00016110: 2020 3533 363c 2f73 7061 6e3e 2020 2020 536 │ │ │ │ -00016120: 3c73 7061 6e20 636c 6173 733d 226b 6579 bool requirePar │ │ │ │ -00016150: 656e 7453 6861 7270 6e65 7373 203d 2028 entSharpness = ( │ │ │ │ -00016160: 7052 756c 6520 3d3d 203c 6120 636c 6173 pRule == Crea │ │ │ │ -000161e0: 7365 3a3a 5255 4c45 5f55 4e4b 4e4f 574e se::RULE_UNKNOWN │ │ │ │ -000161f0: 3c2f 613e 2920 7c7c 3c2f 6469 763e 0a3c ) ||
.< │ │ │ │ -00016200: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00016210: 3e3c 6120 6964 3d22 6c30 3035 3337 2220 > 537 │ │ │ │ -00016260: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00016270: 2020 2020 2028 7052 756c 6520 3d3d 203c (pRule == < │ │ │ │ -00016280: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ -00016290: 5f65 6e75 6d76 616c 7565 2220 6872 6566 _enumvalue" href │ │ │ │ -000162a0: 3d22 6130 3133 3235 2e68 746d 6c23 6131 ="a01325.html#a1 │ │ │ │ -000162b0: 3166 6364 3531 6566 3836 3131 3866 3635 1fcd51ef86118f65 │ │ │ │ -000162c0: 6536 3033 6331 3437 3433 3737 6137 3861 e603c1474377a78a │ │ │ │ -000162d0: 3936 3666 6131 6165 3861 6562 3835 3837 966fa1ae8aeb8587 │ │ │ │ -000162e0: 6334 3938 6366 3661 3932 6363 3333 3335 c498cf6a92cc3335 │ │ │ │ -000162f0: 223e 4372 6561 7365 3a3a 5255 4c45 5f43 ">Crease::RULE_C │ │ │ │ -00016300: 5245 4153 453c 2f61 3e29 207c 7c3c 2f64 REASE) ||.
53 │ │ │ │ -00016360: 383c 2f73 7061 6e3e 2020 2020 2020 2020 8 │ │ │ │ -00016370: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00016380: 2020 2020 2020 2020 2020 2870 5275 6c65 (pRule │ │ │ │ -00016390: 2021 3d20 6352 756c 6529 3b3c 2f64 6976 != cRule);
.
539< │ │ │ │ -000163f0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> if (r │ │ │ │ -00016420: 6571 7569 7265 5061 7265 6e74 5368 6172 equireParentShar │ │ │ │ -00016430: 706e 6573 7329 207b 3c2f 6469 763e 0a3c pness) {
.< │ │ │ │ -00016440: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00016450: 3e3c 6120 6964 3d22 6c30 3035 3430 2220 > 540 pVert │ │ │ │ -000164a0: 6578 5368 6172 706e 6573 7320 3d20 7665 exSharpness = ve │ │ │ │ -000164b0: 7274 6578 2e47 6574 5368 6172 706e 6573 rtex.GetSharpnes │ │ │ │ -000164c0: 7328 293b 3c2f 6469 763e 0a3c 6469 7620 s();
.
541 │ │ │ │ -00016520: 2020 2020 2020 2070 4564 6765 5368 6172 pEdgeShar │ │ │ │ -00016530: 706e 6573 7320 2020 3d20 7665 7274 6578 pness = vertex │ │ │ │ -00016540: 2e47 6574 5368 6172 706e 6573 7350 6572 .GetSharpnessPer │ │ │ │ -00016550: 4564 6765 2870 4564 6765 5368 6172 706e Edge(pEdgeSharpn │ │ │ │ -00016560: 6573 7342 7566 6665 7229 3b3c 2f64 6976 essBuffer);
.
542< │ │ │ │ -000165c0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -000165e0: 3c61 2069 643d 226c 3030 3534 3322 206e 543 if (p │ │ │ │ -00016650: 5275 6c65 203d 3d20 3c61 2063 6c61 7373 Rule == Creas │ │ │ │ -000166d0: 653a 3a52 554c 455f 554e 4b4e 4f57 4e3c e::RULE_UNKNOWN< │ │ │ │ -000166e0: 2f61 3e29 207b 3c2f 6469 763e 0a3c 6469 /a>) {
.< │ │ │ │ -00016700: 6120 6964 3d22 6c30 3035 3434 2220 6e61 a id="l00544" na │ │ │ │ -00016710: 6d65 3d22 6c30 3035 3434 223e 3c2f 613e me="l00544"> │ │ │ │ -00016720: 3c73 7061 6e20 636c 6173 733d 226c 696e 544 pRu │ │ │ │ -00016750: 6c65 203d 203c 6120 636c 6173 733d 2263 le = Crease(_opt │ │ │ │ -00016790: 696f 6e73 292e 3c61 2063 6c61 7373 3d22 ions).Determine │ │ │ │ -000167f0: 5665 7274 6578 5665 7274 6578 5275 6c65 VertexVertexRule │ │ │ │ -00016800: 3c2f 613e 2870 5665 7274 6578 5368 6172 (pVertexShar │ │ │ │ -00016810: 706e 6573 732c 2076 616c 656e 6365 2c20 pness, valence, │ │ │ │ -00016820: 7045 6467 6553 6861 7270 6e65 7373 293b pEdgeSharpness); │ │ │ │ -00016830: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00016880: 2035 3435 3c2f 7370 616e 3e20 2020 2020 545 │ │ │ │ -00016890: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
.
546 │ │ │ │ -000168f0: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
.
547 │ │ │ │ -00016950: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ │ -00016970: 2f73 7061 6e3e 2028 2870 5275 6c65 203d /span> ((pRule = │ │ │ │ -00016980: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = Crease::RUL │ │ │ │ -00016a00: 455f 534d 4f4f 5448 3c2f 613e 2920 7c7c E_SMOOTH) || │ │ │ │ -00016a10: 2028 7052 756c 6520 3d3d 203c 6120 636c (pRule == Cr │ │ │ │ -00016a90: 6561 7365 3a3a 5255 4c45 5f44 4152 543c ease::RULE_DART< │ │ │ │ -00016aa0: 2f61 3e29 2920 7b3c 2f64 6976 3e0a 3c64 /a>)) {
. │ │ │ │ -00016ac0: 3c61 2069 643d 226c 3030 3534 3822 206e 548 assign │ │ │ │ -00016b10: 536d 6f6f 7468 4d61 736b 466f 7256 6572 SmoothMaskForVer │ │ │ │ -00016b20: 7465 7828 7665 7274 6578 2c20 6d61 736b tex(vertex, mask │ │ │ │ -00016b30: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
549 │ │ │ │ -00016b90: 2020 2020 203c 7370 616e 2063 6c61 7373 r │ │ │ │ -00016bb0: 6574 7572 6e3c 2f73 7061 6e3e 3b20 203c eturn; < │ │ │ │ -00016bc0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00016bd0: 656e 7422 3e2f 2f20 2041 7320 646f 6e65 ent">// As done │ │ │ │ -00016be0: 206f 6e20 656e 7472 792c 2077 6520 6361 on entry, we ca │ │ │ │ -00016bf0: 6e20 7265 7475 726e 2069 6d6d 6564 6961 n return immedia │ │ │ │ -00016c00: 7465 6c79 2069 6620 7061 7265 6e74 2069 tely if parent i │ │ │ │ -00016c10: 7320 536d 6f6f 7468 2f44 6172 743c 2f73 s Smooth/Dart
.
550 │ │ │ │ -00016c80: 2020 207d 203c 7370 616e 2063 6c61 7373 } e │ │ │ │ -00016ca0: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ │ -00016cd0: 7052 756c 6520 3d3d 203c 6120 636c 6173 pRule == Crea │ │ │ │ -00016d50: 7365 3a3a 5255 4c45 5f43 5245 4153 453c se::RULE_CREASE< │ │ │ │ -00016d60: 2f61 3e29 207b 3c2f 6469 763e 0a3c 6469 /a>) {
.< │ │ │ │ -00016d80: 6120 6964 3d22 6c30 3035 3531 2220 6e61 a id="l00551" na │ │ │ │ -00016d90: 6d65 3d22 6c30 3035 3531 223e 3c2f 613e me="l00551"> │ │ │ │ -00016da0: 3c73 7061 6e20 636c 6173 733d 226c 696e 551 int cr │ │ │ │ -00016df0: 6561 7365 456e 6473 5b32 5d3b 3c2f 6469 easeEnds[2];.
552 │ │ │ │ -00016e50: 3c2f 7370 616e 3e20 2020 2020 2020 203c < │ │ │ │ -00016e60: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ -00016e70: 5f63 6c61 7373 2220 6872 6566 3d22 6130 _class" href="a0 │ │ │ │ -00016e80: 3133 3235 2e68 746d 6c22 3e43 7265 6173 1325.html">Creas │ │ │ │ -00016e90: 653c 2f61 3e28 5f6f 7074 696f 6e73 292e e(_options). │ │ │ │ -00016ea0: 3c61 2063 6c61 7373 3d22 636f 6465 2068 GetSharpEdgePai │ │ │ │ -00016f00: 724f 6643 7265 6173 653c 2f61 3e28 7045 rOfCrease(pE │ │ │ │ -00016f10: 6467 6553 6861 7270 6e65 7373 2c20 7661 dgeSharpness, va │ │ │ │ -00016f20: 6c65 6e63 652c 2063 7265 6173 6545 6e64 lence, creaseEnd │ │ │ │ -00016f30: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
553 < │ │ │ │ -00016f90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00016fe0: 3535 343c 2f73 7061 6e3e 2020 2020 2020 554 │ │ │ │ -00016ff0: 2020 6173 7369 676e 4372 6561 7365 4d61 assignCreaseMa │ │ │ │ -00017000: 736b 466f 7256 6572 7465 7828 7665 7274 skForVertex(vert │ │ │ │ -00017010: 6578 2c20 6d61 736b 2c20 6372 6561 7365 ex, mask, crease │ │ │ │ -00017020: 456e 6473 293b 3c2f 6469 763e 0a3c 6469 Ends);
.< │ │ │ │ -00017040: 6120 6964 3d22 6c30 3035 3535 2220 6e61 a id="l00555" na │ │ │ │ -00017050: 6d65 3d22 6c30 3035 3535 223e 3c2f 613e me="l00555"> │ │ │ │ -00017060: 3c73 7061 6e20 636c 6173 733d 226c 696e 555 } else {.
5 │ │ │ │ -00017100: 3536 3c2f 7370 616e 3e20 2020 2020 2020 56 │ │ │ │ -00017110: 2061 7373 6967 6e43 6f72 6e65 724d 6173 assignCornerMas │ │ │ │ -00017120: 6b46 6f72 5665 7274 6578 2876 6572 7465 kForVertex(verte │ │ │ │ -00017130: 782c 206d 6173 6b29 3b3c 2f64 6976 3e0a x, mask);
. │ │ │ │ -00017140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
. │ │ │ │ -000171a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ -00017290: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000172a0: 6e6f 223e 2020 3535 393c 2f73 7061 6e3e no"> 559 │ │ │ │ -000172b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00017300: 2020 3536 303c 2f73 7061 6e3e 2020 2020 560 │ │ │ │ -00017310: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ -00017330: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00017380: 3536 313c 2f73 7061 6e3e 2020 2020 3c73 561 // Identify │ │ │ │ -000173b0: 2f67 6174 6865 7220 6368 696c 6420 7368 /gather child sh │ │ │ │ -000173c0: 6172 706e 6573 7320 746f 2063 6f6d 6269 arpness to combi │ │ │ │ -000173d0: 6e65 206d 6173 6b73 2066 6f72 2074 6865 ne masks for the │ │ │ │ -000173e0: 2074 776f 2064 6966 6665 7269 6e67 2052 two differing R │ │ │ │ -000173f0: 756c 6573 3a3c 2f73 7061 6e3e 3c2f 6469 ules:.
562 │ │ │ │ -00017450: 3c2f 7370 616e 3e20 2020 203c 7370 616e //
│ │ │ │ -00017480: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -000174b0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 563 Crease │ │ │ │ -00017510: 6372 6561 7365 285f 6f70 7469 6f6e 7329 crease(_options) │ │ │ │ -00017520: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -00017570: 2020 3536 343c 2f73 7061 6e3e 203c 2f64 564 .
56 │ │ │ │ -000175d0: 353c 2f73 7061 6e3e 2020 2020 3c73 7061 5 float * cEdgeSharpn │ │ │ │ -00017610: 6573 7342 7566 6665 7220 3d20 283c 7370 essBuffer = (float *)alloca(val │ │ │ │ -00017650: 656e 6365 2a3c 7370 616e 2063 6c61 7373 ence*sizeo │ │ │ │ -00017670: 663c 2f73 7061 6e3e 283c 7370 616e 2063 f(float) │ │ │ │ -000176a0: 292c 3c2f 6469 763e 0a3c 6469 7620 636c ),
.
566 │ │ │ │ -00017700: 2020 2020 2020 202a 2063 4564 6765 5368 * cEdgeSh │ │ │ │ -00017710: 6172 706e 6573 7320 3d20 7665 7274 6578 arpness = vertex │ │ │ │ -00017720: 2e47 6574 4368 696c 6453 6861 7270 6e65 .GetChildSharpne │ │ │ │ -00017730: 7373 5065 7245 6467 6528 6372 6561 7365 ssPerEdge(crease │ │ │ │ -00017740: 2c20 6345 6467 6553 6861 7270 6e65 7373 , cEdgeSharpness │ │ │ │ -00017750: 4275 6666 6572 292c 3c2f 6469 763e 0a3c Buffer),
.< │ │ │ │ -00017760: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00017770: 3e3c 6120 6964 3d22 6c30 3035 3637 2220 > 567 c │ │ │ │ -000177c0: 5665 7274 6578 5368 6172 706e 6573 7320 VertexSharpness │ │ │ │ -000177d0: 3d20 7665 7274 6578 2e47 6574 4368 696c = vertex.GetChil │ │ │ │ -000177e0: 6453 6861 7270 6e65 7373 2863 7265 6173 dSharpness(creas │ │ │ │ -000177f0: 6529 3b3c 2f64 6976 3e0a 3c64 6976 2063 e);
.
568 < │ │ │ │ -00017850: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>. │ │ │ │ -00017970: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -000179a0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 570 cRu │ │ │ │ -000179d0: 6c65 203d 2063 7265 6173 652e 3c61 2063 le = crease.Det │ │ │ │ -00017a30: 6572 6d69 6e65 5665 7274 6578 5665 7274 ermineVertexVert │ │ │ │ -00017a40: 6578 5275 6c65 3c2f 613e 2863 5665 7274 exRule(cVert │ │ │ │ -00017a50: 6578 5368 6172 706e 6573 732c 2076 616c exSharpness, val │ │ │ │ -00017a60: 656e 6365 2c20 6345 6467 6553 6861 7270 ence, cEdgeSharp │ │ │ │ -00017a70: 6e65 7373 293b 3c2f 6469 763e 0a3c 6469 ness);
.< │ │ │ │ -00017a90: 6120 6964 3d22 6c30 3035 3731 2220 6e61 a id="l00571" na │ │ │ │ -00017aa0: 6d65 3d22 6c30 3035 3731 223e 3c2f 613e me="l00571"> │ │ │ │ -00017ab0: 3c73 7061 6e20 636c 6173 733d 226c 696e 571 if (cR │ │ │ │ -00017b00: 756c 6520 3d3d 2070 5275 6c65 2920 3c73 ule == pRule) return;
.< │ │ │ │ -00017b50: 6120 6964 3d22 6c30 3035 3732 2220 6e61 a id="l00572" na │ │ │ │ -00017b60: 6d65 3d22 6c30 3035 3732 223e 3c2f 613e me="l00572"> │ │ │ │ -00017b70: 3c73 7061 6e20 636c 6173 733d 226c 696e 572 }
.< │ │ │ │ -00017bb0: 6120 6964 3d22 6c30 3035 3733 2220 6e61 a id="l00573" na │ │ │ │ -00017bc0: 6d65 3d22 6c30 3035 3733 223e 3c2f 613e me="l00573"> │ │ │ │ -00017bd0: 3c73 7061 6e20 636c 6173 733d 226c 696e 573
.
574 │ │ │ │ -00017c50: 203c 7370 616e 2063 6c61 7373 3d22 636f // │ │ │ │ -00017c70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00017cc0: 2035 3735 3c2f 7370 616e 3e20 2020 203c 575 < │ │ │ │ -00017cd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00017ce0: 656e 7422 3e2f 2f20 2049 6e69 7469 616c ent">// Initial │ │ │ │ -00017cf0: 697a 6520 6120 6c6f 6361 6c20 6368 696c ize a local chil │ │ │ │ -00017d00: 6420 6d61 736b 2c20 636f 6d70 7574 6520 d mask, compute │ │ │ │ -00017d10: 7468 6520 6672 6163 7469 6f6e 616c 2077 the fractional w │ │ │ │ -00017d20: 6569 6768 7420 6672 6f6d 2070 6172 656e eight from paren │ │ │ │ -00017d30: 7420 616e 6420 6368 696c 643c 2f73 7061 t and child
.
576 │ │ │ │ -00017da0: 203c 7370 616e 2063 6c61 7373 3d22 636f // sharp │ │ │ │ -00017dc0: 6e65 7373 2076 616c 7565 7320 616e 6420 ness values and │ │ │ │ -00017dd0: 636f 6d62 696e 6520 7468 6520 7477 6f20 combine the two │ │ │ │ -00017de0: 6d61 736b 733a 3c2f 7370 616e 3e3c 2f64 masks:.
57 │ │ │ │ -00017e40: 373c 2f73 7061 6e3e 2020 2020 3c73 7061 7 //
.
578< │ │ │ │ -00017ec0: 2f73 7061 6e3e 2020 2020 3c73 7061 6e20 /span> │ │ │ │ -00017ee0: 7479 7065 6465 663c 2f73 7061 6e3e 203c typedef < │ │ │ │ -00017ef0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00017f00: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename MASK::Weigh │ │ │ │ -00017f20: 7420 5765 6967 6874 3b3c 2f64 6976 3e0a t Weight;
. │ │ │ │ -00017f30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
< │ │ │ │ -00017fc0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00017fd0: 6e6f 223e 2020 3538 303c 2f73 7061 6e3e no"> 580 │ │ │ │ -00017fe0: 2020 2020 5765 6967 6874 202a 2063 4d61 Weight * cMa │ │ │ │ -00017ff0: 736b 5765 6967 6874 7320 3d20 2857 6569 skWeights = (Wei │ │ │ │ -00018000: 6768 7420 2a29 616c 6c6f 6361 2828 3120 ght *)alloca((1 │ │ │ │ -00018010: 2b20 3220 2a20 7661 6c65 6e63 6529 2a3c + 2 * valence)*< │ │ │ │ -00018020: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00018030: 6f72 6422 3e73 697a 656f 663c 2f73 7061 ord">sizeof(Weight));..
< │ │ │ │ -00018170: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -00018180: 6e6f 223e 2020 3538 323c 2f73 7061 6e3e no"> 582 │ │ │ │ -00018190: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -000181e0: 2020 3538 333c 2f73 7061 6e3e 2020 2020 583 │ │ │ │ -000181f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if ((cRule == < │ │ │ │ -00018220: 6120 636c 6173 733d 2263 6f64 6520 686c a class="code hl │ │ │ │ -00018230: 5f65 6e75 6d76 616c 7565 2220 6872 6566 _enumvalue" href │ │ │ │ -00018240: 3d22 6130 3133 3235 2e68 746d 6c23 6131 ="a01325.html#a1 │ │ │ │ -00018250: 3166 6364 3531 6566 3836 3131 3866 3635 1fcd51ef86118f65 │ │ │ │ -00018260: 6536 3033 6331 3437 3433 3737 6137 3861 e603c1474377a78a │ │ │ │ -00018270: 3631 6431 3337 6638 3636 3939 3765 6433 61d137f866997ed3 │ │ │ │ -00018280: 3639 3365 3366 6361 6437 3664 6566 3566 693e3fcad76def5f │ │ │ │ -00018290: 223e 4372 6561 7365 3a3a 5255 4c45 5f53 ">Crease::RULE_S │ │ │ │ -000182a0: 4d4f 4f54 483c 2f61 3e29 207c 7c20 2863 MOOTH) || (c │ │ │ │ -000182b0: 5275 6c65 203d 3d20 3c61 2063 6c61 7373 Rule == Creas │ │ │ │ -00018330: 653a 3a52 554c 455f 4441 5254 3c2f 613e e::RULE_DART │ │ │ │ -00018340: 2929 207b 3c2f 6469 763e 0a3c 6469 7620 )) {
.
584 │ │ │ │ -000183a0: 2020 2020 2020 2061 7373 6967 6e53 6d6f assignSmo │ │ │ │ -000183b0: 6f74 684d 6173 6b46 6f72 5665 7274 6578 othMaskForVertex │ │ │ │ -000183c0: 2876 6572 7465 782c 2063 4d61 736b 293b (vertex, cMask); │ │ │ │ -000183d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -00018420: 2035 3835 3c2f 7370 616e 3e20 2020 207d 585 } │ │ │ │ -00018430: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ │ -00018450: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> if (cRul │ │ │ │ -00018480: 6520 3d3d 203c 6120 636c 6173 733d 2263 e == Crease:: │ │ │ │ -00018500: 5255 4c45 5f43 5245 4153 453c 2f61 3e29 RULE_CREASE) │ │ │ │ -00018510: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
586 │ │ │ │ -00018570: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ -00018590: 6e74 3c2f 7370 616e 3e20 6372 6561 7365 nt crease │ │ │ │ -000185a0: 456e 6473 5b32 5d3b 3c2f 6469 763e 0a3c Ends[2];
.< │ │ │ │ -000185b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000185c0: 3e3c 6120 6964 3d22 6c30 3035 3837 2220 > 587 Crease(_options).Get │ │ │ │ -000186a0: 5368 6172 7045 6467 6550 6169 724f 6643 SharpEdgePairOfC │ │ │ │ -000186b0: 7265 6173 653c 2f61 3e28 6345 6467 6553 rease(cEdgeS │ │ │ │ -000186c0: 6861 7270 6e65 7373 2c20 7661 6c65 6e63 harpness, valenc │ │ │ │ -000186d0: 652c 2063 7265 6173 6545 6e64 7329 3b3c e, creaseEnds);< │ │ │ │ -000186e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00018730: 3538 383c 2f73 7061 6e3e 203c 2f64 6976 588
.
589< │ │ │ │ -00018790: 2f73 7061 6e3e 2020 2020 2020 2020 6173 /span> as │ │ │ │ -000187a0: 7369 676e 4372 6561 7365 4d61 736b 466f signCreaseMaskFo │ │ │ │ -000187b0: 7256 6572 7465 7828 7665 7274 6578 2c20 rVertex(vertex, │ │ │ │ -000187c0: 634d 6173 6b2c 2063 7265 6173 6545 6e64 cMask, creaseEnd │ │ │ │ -000187d0: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
590 │ │ │ │ -00018830: 2020 7d20 3c73 7061 6e20 636c 6173 733d } el │ │ │ │ -00018850: 7365 3c2f 7370 616e 3e20 7b3c 2f64 6976 se {
.
591< │ │ │ │ -000188b0: 2f73 7061 6e3e 2020 2020 2020 2020 6173 /span> as │ │ │ │ -000188c0: 7369 676e 436f 726e 6572 4d61 736b 466f signCornerMaskFo │ │ │ │ -000188d0: 7256 6572 7465 7828 7665 7274 6578 2c20 rVertex(vertex, │ │ │ │ -000188e0: 634d 6173 6b29 3b3c 2f64 6976 3e0a 3c64 cMask);
. │ │ │ │ -00018900: 3c61 2069 643d 226c 3030 3539 3222 206e 592 }
. │ │ │ │ -00018960: 3c61 2069 643d 226c 3030 3539 3322 206e 593
.
594 │ │ │ │ -00018a00: 2020 5765 6967 6874 2070 5765 6967 6874 Weight pWeight │ │ │ │ -00018a10: 203d 2063 7265 6173 652e 3c61 2063 6c61 = crease.Compu │ │ │ │ -00018a70: 7465 4672 6163 7469 6f6e 616c 5765 6967 teFractionalWeig │ │ │ │ -00018a80: 6874 4174 5665 7274 6578 3c2f 613e 2870 htAtVertex(p │ │ │ │ -00018a90: 5665 7274 6578 5368 6172 706e 6573 732c VertexSharpness, │ │ │ │ -00018aa0: 2063 5665 7274 6578 5368 6172 706e 6573 cVertexSharpnes │ │ │ │ -00018ab0: 732c 3c2f 6469 763e 0a3c 6469 7620 636c s,
.
595 │ │ │ │ -00018b10: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00018b20: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00018b30: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00018b40: 7661 6c65 6e63 652c 2070 4564 6765 5368 valence, pEdgeSh │ │ │ │ -00018b50: 6172 706e 6573 732c 2063 4564 6765 5368 arpness, cEdgeSh │ │ │ │ -00018b60: 6172 706e 6573 7329 3b3c 2f64 6976 3e0a arpness);
. │ │ │ │ -00018b70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.< │ │ │ │ -00018bf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00018c00: 3e3c 6120 6964 3d22 6c30 3035 3937 2220 > 597
.
598 │ │ │ │ -00018ca0: 2020 2063 4d61 736b 2e3c 6120 636c 6173 cMask.Combin │ │ │ │ -00018d00: 6556 6572 7465 7856 6572 7465 784d 6173 eVertexVertexMas │ │ │ │ -00018d10: 6b73 3c2f 613e 2863 5765 6967 6874 2c20 ks(cWeight, │ │ │ │ -00018d20: 7057 6569 6768 742c 206d 6173 6b29 3b3c pWeight, mask);< │ │ │ │ -00018d30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00018d80: 3539 393c 2f73 7061 6e3e 7d3c 2f64 6976 599}
.
600< │ │ │ │ -00018de0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -00018e00: 3c61 2069 643d 226c 3030 3630 3122 206e 601//
.
│ │ │ │ -00018eb0: 2020 3630 323c 2f73 7061 6e3e 3c73 7061 602// The comput │ │ │ │ -00018ee0: 6174 696f 6e20 6f66 206c 696d 6974 206d ation of limit m │ │ │ │ -00018ef0: 6173 6b73 2066 6f72 2076 6572 7469 6365 asks for vertice │ │ │ │ -00018f00: 733a 3c2f 7370 616e 3e3c 2f64 6976 3e0a s:
. │ │ │ │ -00018f10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
604template <SchemeTy │ │ │ │ -00019010: 7065 2053 4348 454d 4526 6774 3b3c 2f64 pe SCHEME>.
60 │ │ │ │ -00019070: 353c 2f73 7061 6e3e 3c73 7061 6e20 636c 5te │ │ │ │ -00019090: 6d70 6c61 7465 3c2f 7370 616e 3e20 266c mplate &l │ │ │ │ -000190a0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;typename │ │ │ │ -000190c0: 3c2f 7370 616e 3e20 5645 5254 4558 2c20 VERTEX, │ │ │ │ -000190d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typename MASK>.
6 │ │ │ │ -00019150: 3036 3c2f 7370 616e 3e3c 7370 616e 2063 06void. │ │ │ │ -000192e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00019310: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 608 │ │ │ │ -00019340: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00019350: 2020 2020 2020 2020 2020 2020 4d41 534b MASK │ │ │ │ -00019360: 2661 6d70 3b20 2020 2020 2020 2020 6d61 & ma │ │ │ │ -00019370: 736b 2c3c 2f64 6976 3e0a 3c64 6976 2063 sk,
.
609 │ │ │ │ -000193d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000193e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000193f0: 2020 2020 203c 6120 636c 6173 733d 2263 Crease: │ │ │ │ -00019450: 3a52 756c 653c 2f61 3e20 2072 756c 6529 :Rule rule) │ │ │ │ -00019460: 3c73 7061 6e20 636c 6173 733d 226b 6579 const {
.
< │ │ │ │ -000194c0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -000194d0: 6e6f 223e 2020 3631 303c 2f73 7061 6e3e no"> 610 │ │ │ │ -000194e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00019530: 2020 3631 313c 2f73 7061 6e3e 2020 2020 611 │ │ │ │ -00019540: 3c73 7061 6e20 636c 6173 733d 226b 6579 if ((rule == Crease::RULE_SM │ │ │ │ -000195f0: 4f4f 5448 3c2f 613e 2920 7c7c 2028 7275 OOTH) || (ru │ │ │ │ -00019600: 6c65 203d 3d20 3c61 2063 6c61 7373 3d22 le == Crease: │ │ │ │ -00019680: 3a52 554c 455f 4441 5254 3c2f 613e 2929 :RULE_DART)) │ │ │ │ -00019690: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
612 │ │ │ │ -000196f0: 2020 2020 2061 7373 6967 6e53 6d6f 6f74 assignSmoot │ │ │ │ -00019700: 684c 696d 6974 4d61 736b 2876 6572 7465 hLimitMask(verte │ │ │ │ -00019710: 782c 206d 6173 6b29 3b3c 2f64 6976 3e0a x, mask);
. │ │ │ │ -00019720: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ │ -00019860: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -00019890: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 614 float * edgeSharpn │ │ │ │ -000198f0: 6573 7320 3d20 283c 7370 616e 2063 6c61 ess = (float *) │ │ │ │ -00019920: 616c 6c6f 6361 2876 6572 7465 782e 4765 alloca(vertex.Ge │ │ │ │ -00019930: 744e 756d 4564 6765 7328 2920 2a20 3c73 tNumEdges() * sizeof(float));
│ │ │ │ -00019970: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -000199a0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 615 ver │ │ │ │ -000199d0: 7465 782e 4765 7453 6861 7270 6e65 7373 tex.GetSharpness │ │ │ │ -000199e0: 5065 7245 6467 6528 6564 6765 5368 6172 PerEdge(edgeShar │ │ │ │ -000199f0: 706e 6573 7329 3b3c 2f64 6976 3e0a 3c64 pness);
. │ │ │ │ -00019a10: 3c61 2069 643d 226c 3030 3631 3622 206e 616
.
617 │ │ │ │ -00019ab0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ -00019ad0: 696e 743c 2f73 7061 6e3e 2063 7265 6173 int creas │ │ │ │ -00019ae0: 6545 6e64 735b 325d 3b3c 2f64 6976 3e0a eEnds[2];
. │ │ │ │ -00019af0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -00019b20: 2f61 3e3c 7370 616e 2063 6c61 7373 3d22 /a> 618 Crease(_options).Ge │ │ │ │ -00019be0: 7453 6861 7270 4564 6765 5061 6972 4f66 tSharpEdgePairOf │ │ │ │ -00019bf0: 4372 6561 7365 3c2f 613e 2865 6467 6553 Crease(edgeS │ │ │ │ -00019c00: 6861 7270 6e65 7373 2c20 7665 7274 6578 harpness, vertex │ │ │ │ -00019c10: 2e47 6574 4e75 6d45 6467 6573 2829 2c20 .GetNumEdges(), │ │ │ │ -00019c20: 6372 6561 7365 456e 6473 293b 3c2f 6469 creaseEnds);.
619 │ │ │ │ -00019c80: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ │ -00019c90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00019ca0: 3e3c 6120 6964 3d22 6c30 3036 3230 2220 > 620 assig │ │ │ │ -00019cf0: 6e43 7265 6173 654c 696d 6974 4d61 736b nCreaseLimitMask │ │ │ │ -00019d00: 2876 6572 7465 782c 206d 6173 6b2c 2063 (vertex, mask, c │ │ │ │ -00019d10: 7265 6173 6545 6e64 7329 3b3c 2f64 6976 reaseEnds);
.
621< │ │ │ │ -00019d70: 2f73 7061 6e3e 2020 2020 7d20 3c73 7061 /span> } else {
.
622 │ │ │ │ -00019e00: 2020 2020 2020 6173 7369 676e 436f 726e assignCorn │ │ │ │ -00019e10: 6572 4c69 6d69 744d 6173 6b28 7665 7274 erLimitMask(vert │ │ │ │ -00019e20: 6578 2c20 6d61 736b 293b 3c2f 6469 763e ex, mask);
│ │ │ │ -00019e30: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -00019e90: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ -00019f00: 6120 6964 3d22 6c30 3036 3235 2220 6e61 a id="l00625" na │ │ │ │ -00019f10: 6d65 3d22 6c30 3036 3235 223e 3c2f 613e me="l00625"> │ │ │ │ -00019f20: 3c73 7061 6e20 636c 6173 733d 226c 696e 625
.
626template <SchemeTyp │ │ │ │ -00019fd0: 6520 5343 4845 4d45 2667 743b 3c2f 6469 e SCHEME>.
627 │ │ │ │ -0001a030: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 tem │ │ │ │ -0001a050: 706c 6174 653c 2f73 7061 6e3e 2026 6c74 plate < │ │ │ │ -0001a060: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;typename< │ │ │ │ -0001a080: 2f73 7061 6e3e 2056 4552 5445 582c 203c /span> VERTEX, < │ │ │ │ -0001a090: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0001a0a0: 6f72 6422 3e74 7970 656e 616d 653c 2f73 ord">typename MASK>.
62 │ │ │ │ -0001a110: 383c 2f73 7061 6e3e 3c73 7061 6e20 636c 8void.. │ │ │ │ -0001a2a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
< │ │ │ │ -0001a370: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0001a380: 6e6f 223e 2020 3633 313c 2f73 7061 6e3e no"> 631 │ │ │ │ -0001a390: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a3a0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a3b0: 2020 2020 2020 204d 4153 4b26 616d 703b MASK& │ │ │ │ -0001a3c0: 2020 2020 2020 2020 2074 616e 314d 6173 tan1Mas │ │ │ │ -0001a3d0: 6b2c 3c2f 6469 763e 0a3c 6469 7620 636c k,
.
632 │ │ │ │ -0001a430: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a440: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a450: 2020 2020 4d41 534b 2661 6d70 3b20 2020 MASK& │ │ │ │ -0001a460: 2020 2020 2020 7461 6e32 4d61 736b 2c3c tan2Mask,< │ │ │ │ -0001a470: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0001a4c0: 3633 333c 2f73 7061 6e3e 2020 2020 2020 633 │ │ │ │ -0001a4d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a4e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001a4f0: 203c 6120 636c 6173 733d 2263 6f64 6520 Crease::Rul │ │ │ │ -0001a550: 653c 2f61 3e20 2072 756c 6529 3c73 7061 e rule) const │ │ │ │ -0001a580: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ │ -0001a5d0: 2020 3633 343c 2f73 7061 6e3e 203c 2f64 634 .
63 │ │ │ │ -0001a630: 353c 2f73 7061 6e3e 2020 2020 3c73 7061 5 if │ │ │ │ -0001a660: 2828 7275 6c65 203d 3d20 3c61 2063 6c61 ((rule == Cre │ │ │ │ -0001a6e0: 6173 653a 3a52 554c 455f 534d 4f4f 5448 ase::RULE_SMOOTH │ │ │ │ -0001a6f0: 3c2f 613e 2920 7c7c 2028 7275 6c65 203d ) || (rule = │ │ │ │ -0001a700: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = Crease::RUL │ │ │ │ -0001a780: 455f 4441 5254 3c2f 613e 2929 207b 3c2f E_DART)) {.
6 │ │ │ │ -0001a7e0: 3336 3c2f 7370 616e 3e20 2020 2020 2020 36 │ │ │ │ -0001a7f0: 2061 7373 6967 6e53 6d6f 6f74 684c 696d assignSmoothLim │ │ │ │ -0001a800: 6974 4d61 736b 2876 6572 7465 782c 2070 itMask(vertex, p │ │ │ │ -0001a810: 6f73 4d61 736b 293b 3c2f 6469 763e 0a3c osMask);
.< │ │ │ │ -0001a820: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0001a830: 3e3c 6120 6964 3d22 6c30 3036 3337 2220 > 637 assig │ │ │ │ -0001a880: 6e53 6d6f 6f74 684c 696d 6974 5461 6e67 nSmoothLimitTang │ │ │ │ -0001a890: 656e 744d 6173 6b73 2876 6572 7465 782c entMasks(vertex, │ │ │ │ -0001a8a0: 2074 616e 314d 6173 6b2c 2074 616e 324d tan1Mask, tan2M │ │ │ │ -0001a8b0: 6173 6b29 3b3c 2f64 6976 3e0a 3c64 6976 ask);
.
< │ │ │ │ -0001a8f0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0001a900: 6e6f 223e 2020 3633 383c 2f73 7061 6e3e no"> 638 │ │ │ │ -0001a910: 2020 2020 7d20 3c73 7061 6e20 636c 6173 } │ │ │ │ -0001a930: 656c 7365 3c2f 7370 616e 3e20 3c73 7061 else if │ │ │ │ -0001a960: 2872 756c 6520 3d3d 203c 6120 636c 6173 (rule == Crea │ │ │ │ -0001a9e0: 7365 3a3a 5255 4c45 5f43 5245 4153 453c se::RULE_CREASE< │ │ │ │ -0001a9f0: 2f61 3e29 207b 3c2f 6469 763e 0a3c 6469 /a>) {
.< │ │ │ │ -0001aa10: 6120 6964 3d22 6c30 3036 3339 2220 6e61 a id="l00639" na │ │ │ │ -0001aa20: 6d65 3d22 6c30 3036 3339 223e 3c2f 613e me="l00639"> │ │ │ │ -0001aa30: 3c73 7061 6e20 636c 6173 733d 226c 696e 639 float │ │ │ │ -0001aa80: 2a20 6564 6765 5368 6172 706e 6573 7320 * edgeSharpness │ │ │ │ -0001aa90: 3d20 283c 7370 616e 2063 6c61 7373 3d22 = (flo │ │ │ │ -0001aab0: 6174 3c2f 7370 616e 3e20 2a29 616c 6c6f at *)allo │ │ │ │ -0001aac0: 6361 2876 6572 7465 782e 4765 744e 756d ca(vertex.GetNum │ │ │ │ -0001aad0: 4564 6765 7328 2920 2a20 3c73 7061 6e20 Edges() * │ │ │ │ -0001aaf0: 7369 7a65 6f66 3c2f 7370 616e 3e28 666c sizeof(fl │ │ │ │ -0001ab00: 6f61 7429 293b 3c2f 6469 763e 0a3c 6469 oat));
.< │ │ │ │ -0001ab20: 6120 6964 3d22 6c30 3036 3430 2220 6e61 a id="l00640" na │ │ │ │ -0001ab30: 6d65 3d22 6c30 3036 3430 223e 3c2f 613e me="l00640"> │ │ │ │ -0001ab40: 3c73 7061 6e20 636c 6173 733d 226c 696e 640 vertex. │ │ │ │ -0001ab70: 4765 7453 6861 7270 6e65 7373 5065 7245 GetSharpnessPerE │ │ │ │ -0001ab80: 6467 6528 6564 6765 5368 6172 706e 6573 dge(edgeSharpnes │ │ │ │ -0001ab90: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
641 < │ │ │ │ -0001abf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0001ac40: 3634 323c 2f73 7061 6e3e 2020 2020 2020 642 │ │ │ │ -0001ac50: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ -0001ac70: 2f73 7061 6e3e 2063 7265 6173 6545 6e64 /span> creaseEnd │ │ │ │ -0001ac80: 735b 325d 3b3c 2f64 6976 3e0a 3c64 6976 s[2];
.
< │ │ │ │ -0001acc0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0001acd0: 6e6f 223e 2020 3634 333c 2f73 7061 6e3e no"> 643 │ │ │ │ -0001ace0: 2020 2020 2020 2020 3c61 2063 6c61 7373 Crease(_ │ │ │ │ -0001ad20: 6f70 7469 6f6e 7329 2e3c 6120 636c 6173 options).GetSha │ │ │ │ -0001ad80: 7270 4564 6765 5061 6972 4f66 4372 6561 rpEdgePairOfCrea │ │ │ │ -0001ad90: 7365 3c2f 613e 2865 6467 6553 6861 7270 se(edgeSharp │ │ │ │ -0001ada0: 6e65 7373 2c20 7665 7274 6578 2e47 6574 ness, vertex.Get │ │ │ │ -0001adb0: 4e75 6d45 6467 6573 2829 2c20 6372 6561 NumEdges(), crea │ │ │ │ -0001adc0: 7365 456e 6473 293b 3c2f 6469 763e 0a3c seEnds);
.< │ │ │ │ -0001add0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0001ade0: 3e3c 6120 6964 3d22 6c30 3036 3434 2220 > 644
.
645 │ │ │ │ -0001ae80: 2020 2020 2020 2061 7373 6967 6e43 7265 assignCre │ │ │ │ -0001ae90: 6173 654c 696d 6974 4d61 736b 2876 6572 aseLimitMask(ver │ │ │ │ -0001aea0: 7465 782c 2070 6f73 4d61 736b 2c20 6372 tex, posMask, cr │ │ │ │ -0001aeb0: 6561 7365 456e 6473 293b 3c2f 6469 763e easeEnds);
│ │ │ │ -0001aec0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
│ │ │ │ -0001aef0: 3c2f 613e 3c73 7061 6e20 636c 6173 733d 646 ass │ │ │ │ -0001af20: 6967 6e43 7265 6173 654c 696d 6974 5461 ignCreaseLimitTa │ │ │ │ -0001af30: 6e67 656e 744d 6173 6b73 2876 6572 7465 ngentMasks(verte │ │ │ │ -0001af40: 782c 2074 616e 314d 6173 6b2c 2074 616e x, tan1Mask, tan │ │ │ │ -0001af50: 324d 6173 6b2c 2063 7265 6173 6545 6e64 2Mask, creaseEnd │ │ │ │ -0001af60: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
647 │ │ │ │ -0001afc0: 2020 7d20 3c73 7061 6e20 636c 6173 733d } el │ │ │ │ -0001afe0: 7365 3c2f 7370 616e 3e20 7b3c 2f64 6976 se {
.
648< │ │ │ │ -0001b040: 2f73 7061 6e3e 2020 2020 2020 2020 6173 /span> as │ │ │ │ -0001b050: 7369 676e 436f 726e 6572 4c69 6d69 744d signCornerLimitM │ │ │ │ -0001b060: 6173 6b28 7665 7274 6578 2c20 706f 734d ask(vertex, posM │ │ │ │ -0001b070: 6173 6b29 3b3c 2f64 6976 3e0a 3c64 6976 ask);
.
< │ │ │ │ -0001b0b0: 7370 616e 2063 6c61 7373 3d22 6c69 6e65 span class="line │ │ │ │ -0001b0c0: 6e6f 223e 2020 3634 393c 2f73 7061 6e3e no"> 649 │ │ │ │ -0001b0d0: 2020 2020 2020 2020 6173 7369 676e 436f assignCo │ │ │ │ -0001b0e0: 726e 6572 4c69 6d69 7454 616e 6765 6e74 rnerLimitTangent │ │ │ │ -0001b0f0: 4d61 736b 7328 7665 7274 6578 2c20 7461 Masks(vertex, ta │ │ │ │ -0001b100: 6e31 4d61 736b 2c20 7461 6e32 4d61 736b n1Mask, tan2Mask │ │ │ │ -0001b110: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
650 │ │ │ │ -0001b170: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
.
651}.
6 │ │ │ │ -0001b220: 3532 3c2f 7370 616e 3e20 3c2f 6469 763e 52
│ │ │ │ -0001b230: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ -0001b2a0: 6120 6964 3d22 6c30 3036 3534 2220 6e61 a id="l00654" na │ │ │ │ -0001b2b0: 6d65 3d22 6c30 3036 3534 223e 3c2f 613e me="l00654"> │ │ │ │ -0001b2c0: 3c73 7061 6e20 636c 6173 733d 226c 696e 654} // end │ │ │ │ -0001b300: 6e61 6d65 7370 6163 6520 7364 633c 2f73 namespace sdc
.
655 │ │ │ │ -0001b370: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0001b3c0: 2036 3536 3c2f 7370 616e 3e7d 203c 7370 656} // end namesp │ │ │ │ -0001b3f0: 6163 6520 4f50 454e 5355 4244 4956 5f56 ace OPENSUBDIV_V │ │ │ │ -0001b400: 4552 5349 4f4e 3c2f 7370 616e 3e3c 2f64 ERSION.
65 │ │ │ │ -0001b460: 373c 2f73 7061 6e3e 3c73 7061 6e20 636c 7us │ │ │ │ -0001b480: 696e 6720 6e61 6d65 7370 6163 6520 3c2f ing namespace OPENSUBDIV_ │ │ │ │ -0001b4a0: 5645 5253 494f 4e3b 3c2f 6469 763e 0a3c VERSION;
.< │ │ │ │ -0001b4b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0001b4c0: 3e3c 6120 6964 3d22 6c30 3036 3538 2220 > 658
} // en │ │ │ │ -0001b520: 6420 6e61 6d65 7370 6163 6520 4f70 656e d namespace Open │ │ │ │ -0001b530: 5375 6264 6976 3c2f 7370 616e 3e3c 2f64 Subdiv.
65 │ │ │ │ -0001b590: 393c 2f73 7061 6e3e 203c 2f64 6976 3e0a 9
. │ │ │ │ -0001b5a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ │ -0001b680: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
E │ │ │ │ -0001b840: 6e75 6d65 7261 7465 6420 7479 7065 2066 numerated type f │ │ │ │ -0001b850: 6f72 2061 6c6c 2066 6163 6520 7370 6c69 or all face spli │ │ │ │ -0001b860: 7474 696e 6720 7363 6865 6d65 732e 3c2f tting schemes.
Defini │ │ │ │ -0001b890: 7469 6f6e 3a3c 2f62 3e20 3c61 2068 7265 tion: ty │ │ │ │ -0001b8c0: 7065 732e 683a 3437 3c2f 613e 3c2f 6469 pes.h:47
.
Ty │ │ │ │ -0001b970: 7065 732c 2063 6f6e 7374 616e 7473 2061 pes, constants a │ │ │ │ -0001b980: 6e64 2075 7469 6c69 7469 6573 2072 656c nd utilities rel │ │ │ │ -0001b990: 6174 6564 2074 6f20 7365 6d69 2d73 6861 ated to semi-sha │ │ │ │ -0001b9a0: 7270 2063 7265 6173 696e 6720 e280 9320 rp creasing ... │ │ │ │ -0001b9b0: 7768 6f73 6520 696d 706c 656d 656e 7461 whose implementa │ │ │ │ -0001b9c0: 7469 6f6e 2069 7320 696e 6465 7065 6e64 tion is independ │ │ │ │ -0001b9d0: 656e 7420 6f2e 2e2e 3c2f 6469 763e 3c64 ent o...
Definition:< │ │ │ │ -0001ba00: 2f62 3e20 3c61 2068 7265 663d 2261 3030 /b> crease.h │ │ │ │ -0001ba30: 3a36 323c 2f61 3e3c 2f64 6976 3e3c 2f64 :62
....
│ │ │ │ -0001c010: 3c64 6976 2063 6c61 7373 3d22 7474 6465 < │ │ │ │ -0001c070: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0001c1a0: 4020 5255 4c45 5f55 4e4b 4e4f 574e 3c2f @ RULE_UNKNOWN
Defini │ │ │ │ -0001c1d0: 7469 6f6e 3a3c 2f62 3e20 3c61 2068 7265 tion: cr │ │ │ │ -0001c200: 6561 7365 2e68 3a38 333c 2f61 3e3c 2f64 ease.h:83
.
vo │ │ │ │ -0001c310: 6964 2047 6574 5368 6172 7045 6467 6550 id GetSharpEdgeP │ │ │ │ -0001c320: 6169 724f 6643 7265 6173 6528 666c 6f61 airOfCrease(floa │ │ │ │ -0001c330: 7420 636f 6e73 7420 2a69 6e63 6964 656e t const *inciden │ │ │ │ -0001c340: 7445 6467 6553 6861 7270 6e65 7373 2c20 tEdgeSharpness, │ │ │ │ -0001c350: 696e 7420 696e 6369 6465 6e74 4564 6765 int incidentEdge │ │ │ │ -0001c360: 436f 756e 742c 2069 6e74 2073 6861 7270 Count, int sharp │ │ │ │ -0001c370: 4564 6765 5061 6972 5b32 5d29 2063 6f6e EdgePair[2]) con │ │ │ │ -0001c380: 7374 3c2f 6469 763e 3c64 6976 2063 6c61 st
De │ │ │ │ -0001c3a0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 3c61 finition: crease.h:228
.< │ │ │ │ -0001c3f0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0001c400: 6964 3d22 6161 3031 3332 355f 6874 6d6c id="aa01325_html │ │ │ │ -0001c410: 5f61 3431 6562 6237 3564 3238 6335 3937 _a41ebb75d28c597 │ │ │ │ -0001c420: 3333 3238 6530 6533 3838 3334 3935 6165 3328e0e3883495ae │ │ │ │ -0001c430: 6261 223e 3c64 6976 2063 6c61 7373 3d22 ba"> │ │ │ │ -0001c4d0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Rule Determi │ │ │ │ -0001c4f0: 6e65 5665 7274 6578 5665 7274 6578 5275 neVertexVertexRu │ │ │ │ -0001c500: 6c65 2866 6c6f 6174 2076 6572 7465 7853 le(float vertexS │ │ │ │ -0001c510: 6861 7270 6e65 7373 2c20 696e 7420 696e harpness, int in │ │ │ │ -0001c520: 6369 6465 6e74 4564 6765 436f 756e 742c cidentEdgeCount, │ │ │ │ -0001c530: 2066 6c6f 6174 2063 6f6e 7374 202a 696e float const *in │ │ │ │ -0001c540: 6369 6465 6e74 4564 6765 5368 6172 706e cidentEdgeSharpn │ │ │ │ -0001c550: 6573 7329 2063 6f6e 7374 3c2f 6469 763e ess) const
│ │ │ │ -0001c560: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
..
O │ │ │ │ -0001c760: 7065 6e53 7562 6469 763a 3a4f 5045 4e53 penSubdiv::OPENS │ │ │ │ -0001c770: 5542 4449 565f 5645 5253 494f 4e3a 3a53 UBDIV_VERSION::S │ │ │ │ -0001c780: 6463 3a3a 4372 6561 7365 3a3a 436f 6d70 dc::Crease::Comp │ │ │ │ -0001c790: 7574 6546 7261 6374 696f 6e61 6c57 6569 uteFractionalWei │ │ │ │ -0001c7a0: 6768 7441 7456 6572 7465 783c 2f61 3e3c ghtAtVertex< │ │ │ │ -0001c7b0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
float C │ │ │ │ -0001c7d0: 6f6d 7075 7465 4672 6163 7469 6f6e 616c omputeFractional │ │ │ │ -0001c7e0: 5765 6967 6874 4174 5665 7274 6578 2866 WeightAtVertex(f │ │ │ │ -0001c7f0: 6c6f 6174 2076 6572 7465 7853 6861 7270 loat vertexSharp │ │ │ │ -0001c800: 6e65 7373 2c20 666c 6f61 7420 6368 696c ness, float chil │ │ │ │ -0001c810: 6456 6572 7465 7853 6861 7270 6e65 7373 dVertexSharpness │ │ │ │ -0001c820: 2c20 696e 7420 696e 6369 6465 6e74 4564 , int incidentEd │ │ │ │ -0001c830: 6765 436f 756e 742c 2066 6c6f 6174 2063 geCount, float c │ │ │ │ -0001c840: 6f6e 7374 202a 696e 6369 6465 6e74 4564 onst *incidentEd │ │ │ │ -0001c850: 6765 5368 6172 706e 6573 732c 2066 6c6f geSharpness, flo │ │ │ │ -0001c860: 6174 2063 6f6e 7374 202a 6368 696c 6445 at const *childE │ │ │ │ -0001c870: 6467 6573 5368 6172 706e 6573 7329 2063 dgesSharpness) c │ │ │ │ -0001c880: 6f6e 7374 3c2f 6469 763e 3c64 6976 2063 onst
Tra │ │ │ │ -0001c8a0: 6e73 6974 696f 6e61 6c20 7765 6967 6874 nsitional weight │ │ │ │ -0001c8b0: 696e 673a 2057 6865 6e20 7468 6520 7275 ing: When the ru │ │ │ │ -0001c8c0: 6c65 7320 6170 706c 6963 6162 6c65 2074 les applicable t │ │ │ │ -0001c8d0: 6f20 6120 7061 7265 6e74 2076 6572 7465 o a parent verte │ │ │ │ -0001c8e0: 7820 616e 6420 6974 7320 6368 696c 6420 x and its child │ │ │ │ -0001c8f0: 6469 6666 6572 2c2e 2e2e 3c2f 6469 763e differ,...
│ │ │ │ -0001c900: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
All │ │ │ │ -0001c9a0: 2073 7570 706f 7274 6564 206f 7074 696f supported optio │ │ │ │ -0001c9b0: 6e73 2061 7070 6c79 696e 6720 746f 2073 ns applying to s │ │ │ │ -0001c9c0: 7562 6469 7669 7369 6f6e 2073 6368 656d ubdivision schem │ │ │ │ -0001c9d0: 652e 3c2f 6469 763e 3c64 6976 2063 6c61 e.
De │ │ │ │ -0001c9f0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 3c61 finition: options.h:51
.< │ │ │ │ -0001ca40: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0001ca50: 6964 3d22 6161 3031 3333 335f 6874 6d6c id="aa01333_html │ │ │ │ -0001ca60: 223e 3c64 6976 2063 6c61 7373 3d22 7474 ">
Scheme is a │ │ │ │ -0001cae0: 636c 6173 7320 7465 6d70 6c61 7465 2077 class template w │ │ │ │ -0001caf0: 6869 6368 2070 726f 7669 6465 7320 616c hich provides al │ │ │ │ -0001cb00: 6c20 696d 706c 656d 656e 7461 7469 6f6e l implementation │ │ │ │ -0001cb10: 2066 6f72 2074 6865 2073 7562 6469 7669 for the subdivi │ │ │ │ -0001cb20: 7369 6f6e 2073 6368 656d 6573 2073 7570 sion schemes sup │ │ │ │ -0001cb30: 706f 7274 6564 2062 792e 2e2e 3c2f 6469 ported by...
Definiti │ │ │ │ -0001cb60: 6f6e 3a3c 2f62 3e20 3c61 2068 7265 663d on: sche │ │ │ │ -0001cb90: 6d65 2e68 3a36 363c 2f61 3e3c 2f64 6976 me.h:66
.
void │ │ │ │ -0001cca0: 6173 7369 676e 536d 6f6f 7468 4d61 736b assignSmoothMask │ │ │ │ -0001ccb0: 466f 7245 6467 6528 4544 4745 2063 6f6e ForEdge(EDGE con │ │ │ │ -0001ccc0: 7374 2026 616d 703b 6564 6765 2c20 4d41 st &edge, MA │ │ │ │ -0001ccd0: 534b 2026 616d 703b 6d61 736b 2920 636f SK &mask) co │ │ │ │ -0001cce0: 6e73 743c 2f64 6976 3e3c 2f64 6976 3e0a nst
. │ │ │ │ -0001ccf0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
< │ │ │ │ -0001cdd0: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -0001cde0: 6922 3e73 7461 7469 6320 5370 6c69 7420 i">static Split │ │ │ │ -0001cdf0: 4765 7454 6f70 6f6c 6f67 6963 616c 5370 GetTopologicalSp │ │ │ │ -0001ce00: 6c69 7454 7970 6528 293c 2f64 6976 3e3c litType()
< │ │ │ │ -0001ce10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ │ -0001ce70: 6120 6872 6566 3d22 6130 3133 3333 2e68 a href="a01333.h │ │ │ │ -0001ce80: 746d 6c23 6132 3433 3965 3738 3337 3364 tml#a2439e78373d │ │ │ │ -0001ce90: 3964 6664 3661 6433 6162 3337 3363 3763 9dfd6ad3ab373c7c │ │ │ │ -0001cea0: 3332 6463 6322 3e4f 7065 6e53 7562 6469 32dcc">OpenSubdi │ │ │ │ -0001ceb0: 763a 3a4f 5045 4e53 5542 4449 565f 5645 v::OPENSUBDIV_VE │ │ │ │ -0001cec0: 5253 494f 4e3a 3a53 6463 3a3a 5363 6865 RSION::Sdc::Sche │ │ │ │ -0001ced0: 6d65 3a3a 6173 7369 676e 4372 6561 7365 me::assignCrease │ │ │ │ -0001cee0: 4d61 736b 466f 7256 6572 7465 783c 2f61 MaskForVertex
void │ │ │ │ -0001cf10: 6173 7369 676e 4372 6561 7365 4d61 736b assignCreaseMask │ │ │ │ -0001cf20: 466f 7256 6572 7465 7828 5645 5254 4558 ForVertex(VERTEX │ │ │ │ -0001cf30: 2063 6f6e 7374 2026 616d 703b 6564 6765 const &edge │ │ │ │ -0001cf40: 2c20 4d41 534b 2026 616d 703b 6d61 736b , MASK &mask │ │ │ │ -0001cf50: 2c20 696e 7420 636f 6e73 7420 6372 6561 , int const crea │ │ │ │ -0001cf60: 7365 456e 6473 5b32 5d29 2063 6f6e 7374 seEnds[2]) const │ │ │ │ -0001cf70: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.
│ │ │ │ -0001d070: 766f 6964 2043 6f6d 7075 7465 5665 7274 void ComputeVert │ │ │ │ -0001d080: 6578 5665 7274 6578 4d61 736b 2856 4552 exVertexMask(VER │ │ │ │ -0001d090: 5445 5820 636f 6e73 7420 2661 6d70 3b76 TEX const &v │ │ │ │ -0001d0a0: 6572 7465 784e 6569 6768 626f 7268 6f6f ertexNeighborhoo │ │ │ │ -0001d0b0: 642c 204d 4153 4b20 2661 6d70 3b76 6572 d, MASK &ver │ │ │ │ -0001d0c0: 7465 7856 6572 7465 784d 6173 6b2c 2043 texVertexMask, C │ │ │ │ -0001d0d0: 7265 6173 653a 3a52 756c 6520 7061 7265 rease::Rule pare │ │ │ │ -0001d0e0: 6e74 5275 6c65 3d43 7265 6173 653a 3a52 ntRule=Crease::R │ │ │ │ -0001d0f0: 554c 455f 554e 4b4e 4f57 4e2c 2043 7265 ULE_UNKNOWN, Cre │ │ │ │ -0001d100: 6173 653a 3a52 756c 6520 6368 696c 6452 ase::Rule childR │ │ │ │ -0001d110: 756c 653d 4372 6561 7365 3a3a 5255 4c45 ule=Crease::RULE │ │ │ │ -0001d120: 5f55 4e4b 4e4f 574e 2920 636f 6e73 743c _UNKNOWN) const< │ │ │ │ -0001d130: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Vertex-v │ │ │ │ -0001d150: 6572 7465 7820 6d61 736b 7320 4966 206b ertex masks If k │ │ │ │ -0001d160: 6e6f 776e 2c20 6120 7369 6e67 6c65 2052 nown, a single R │ │ │ │ -0001d170: 756c 6520 6f72 2070 6169 7220 6f66 2052 ule or pair of R │ │ │ │ -0001d180: 756c 6573 2063 616e 2062 6520 7370 6563 ules can be spec │ │ │ │ -0001d190: 6966 6965 6420 2869 6e64 6963 6174 696e ified (indicatin │ │ │ │ -0001d1a0: 6720 6120 6372 6561 7365 2074 722e 2e2e g a crease tr... │ │ │ │ -0001d1b0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ │ -0001d1d0: 6e69 7469 6f6e 3a3c 2f62 3e20 3c61 2068 nition: │ │ │ │ -0001d200: 7363 6865 6d65 2e68 3a35 3132 3c2f 613e scheme.h:512 │ │ │ │ -0001d210: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.
v │ │ │ │ -0001d310: 6f69 6420 436f 6d70 7574 6556 6572 7465 oid ComputeVerte │ │ │ │ -0001d320: 784c 696d 6974 4d61 736b 2856 4552 5445 xLimitMask(VERTE │ │ │ │ -0001d330: 5820 636f 6e73 7420 2661 6d70 3b76 6572 X const &ver │ │ │ │ -0001d340: 7465 784e 6569 6768 626f 7268 6f6f 642c texNeighborhood, │ │ │ │ -0001d350: 204d 4153 4b20 2661 6d70 3b70 6f73 6974 MASK &posit │ │ │ │ -0001d360: 696f 6e4d 6173 6b2c 2043 7265 6173 653a ionMask, Crease: │ │ │ │ -0001d370: 3a52 756c 6520 7665 7274 6578 5275 6c65 :Rule vertexRule │ │ │ │ -0001d380: 2920 636f 6e73 743c 2f64 6976 3e3c 6469 ) const
│ │ │ │ -0001d3a0: 4c69 6d69 7420 6d61 736b 7320 666f 7220 Limit masks for │ │ │ │ -0001d3b0: 7665 7274 6963 6573 20e2 8093 2070 6f73 vertices ... pos │ │ │ │ -0001d3c0: 6974 696f 6e20 616e 6420 7461 6e67 656e ition and tangen │ │ │ │ -0001d3d0: 7473 2054 6865 7365 2070 7265 7375 6d65 ts These presume │ │ │ │ -0001d3e0: 2074 6861 7420 6120 7665 7274 6578 2069 that a vertex i │ │ │ │ -0001d3f0: 7320 7375 6974 6162 6c79 2069 736f 6c61 s suitably isola │ │ │ │ -0001d400: 7465 6420 666f 722e 2e2e 3c2f 6469 763e ted for...
│ │ │ │ -0001d410: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -0001d430: 3a3c 2f62 3e20 3c61 2068 7265 663d 2261 : scheme │ │ │ │ -0001d460: 2e68 3a36 3037 3c2f 613e 3c2f 6469 763e .h:607
│ │ │ │ -0001d470: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0001d570: 766f 6964 2061 7373 6967 6e43 7265 6173 void assignCreas │ │ │ │ -0001d580: 654c 696d 6974 5461 6e67 656e 744d 6173 eLimitTangentMas │ │ │ │ -0001d590: 6b73 2856 4552 5445 5820 636f 6e73 7420 ks(VERTEX const │ │ │ │ -0001d5a0: 2661 6d70 3b76 6572 7465 782c 204d 4153 &vertex, MAS │ │ │ │ -0001d5b0: 4b20 2661 6d70 3b74 616e 312c 204d 4153 K &tan1, MAS │ │ │ │ -0001d5c0: 4b20 2661 6d70 3b74 616e 322c 2069 6e74 K &tan2, int │ │ │ │ -0001d5d0: 2063 6f6e 7374 2063 7265 6173 6545 6e64 const creaseEnd │ │ │ │ -0001d5e0: 735b 325d 2920 636f 6e73 743c 2f64 6976 s[2]) const
..
void assign │ │ │ │ -0001d810: 4372 6561 7365 4d61 736b 466f 7245 6467 CreaseMaskForEdg │ │ │ │ -0001d820: 6528 4544 4745 2063 6f6e 7374 2026 616d e(EDGE const &am │ │ │ │ -0001d830: 703b 6564 6765 2c20 4d41 534b 2026 616d p;edge, MASK &am │ │ │ │ -0001d840: 703b 6d61 736b 2920 636f 6e73 743c 2f64 p;mask) const
Definit │ │ │ │ -0001d870: 696f 6e3a 3c2f 623e 203c 6120 6872 6566 ion: sch │ │ │ │ -0001d8a0: 656d 652e 683a 3331 373c 2f61 3e3c 2f64 eme.h:317
.
void │ │ │ │ -0001d9b0: 436f 6d70 7574 6545 6467 6556 6572 7465 ComputeEdgeVerte │ │ │ │ -0001d9c0: 784d 6173 6b28 4544 4745 2063 6f6e 7374 xMask(EDGE const │ │ │ │ -0001d9d0: 2026 616d 703b 6564 6765 4e65 6967 6862 &edgeNeighb │ │ │ │ -0001d9e0: 6f72 686f 6f64 2c20 4d41 534b 2026 616d orhood, MASK &am │ │ │ │ -0001d9f0: 703b 6564 6765 5665 7274 6578 4d61 736b p;edgeVertexMask │ │ │ │ -0001da00: 2c20 4372 6561 7365 3a3a 5275 6c65 2070 , Crease::Rule p │ │ │ │ -0001da10: 6172 656e 7452 756c 653d 4372 6561 7365 arentRule=Crease │ │ │ │ -0001da20: 3a3a 5255 4c45 5f55 4e4b 4e4f 574e 2c20 ::RULE_UNKNOWN, │ │ │ │ -0001da30: 4372 6561 7365 3a3a 5275 6c65 2063 6869 Crease::Rule chi │ │ │ │ -0001da40: 6c64 5275 6c65 3d43 7265 6173 653a 3a52 ldRule=Crease::R │ │ │ │ -0001da50: 554c 455f 554e 4b4e 4f57 4e29 2063 6f6e ULE_UNKNOWN) con │ │ │ │ -0001da60: 7374 3c2f 6469 763e 3c64 6976 2063 6c61 st
Edge- │ │ │ │ -0001da80: 7665 7274 6578 206d 6173 6b73 2049 6620 vertex masks If │ │ │ │ -0001da90: 6b6e 6f77 6e2c 2074 6865 2052 756c 6520 known, the Rule │ │ │ │ -0001daa0: 666f 7220 7468 6520 6564 6765 2061 6e64 for the edge and │ │ │ │ -0001dab0: 2f6f 7220 7468 6520 6465 7269 7665 6420 /or the derived │ │ │ │ -0001dac0: 7665 7274 6578 2063 616e 2062 6520 7370 vertex can be sp │ │ │ │ -0001dad0: 6563 6966 6965 6420 746f 2061 6363 656c ecified to accel │ │ │ │ -0001dae0: 2e2e 2e3c 2f64 6976 3e3c 6469 7620 636c ...
D │ │ │ │ -0001db00: 6566 696e 6974 696f 6e3a 3c2f 623e 203c efinition: < │ │ │ │ -0001db10: 6120 6872 6566 3d22 6130 3037 3733 5f73 a href="a00773_s │ │ │ │ -0001db20: 6f75 7263 652e 6874 6d6c 236c 3030 3339 ource.html#l0039 │ │ │ │ -0001db30: 3222 3e73 6368 656d 652e 683a 3339 323c 2">scheme.h:392< │ │ │ │ -0001db40: 2f61 3e3c 2f64 6976 3e3c 2f64 6976 3e0a /a>
. │ │ │ │ -0001db50: 3c64 6976 2063 6c61 7373 3d22 7474 6322 │ │ │ │ -0001dc40: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -0001dc60: 3a3c 2f62 3e20 3c61 2068 7265 663d 2261 : scheme │ │ │ │ -0001dc90: 2e68 3a37 303c 2f61 3e3c 2f64 6976 3e3c .h:70
< │ │ │ │ -0001dca0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ │ -0001dd00: 6120 6872 6566 3d22 6130 3133 3333 2e68 a href="a01333.h │ │ │ │ -0001dd10: 746d 6c23 6137 3336 6331 3039 3434 6362 tml#a736c10944cb │ │ │ │ -0001dd20: 3932 3162 3333 3466 6264 3862 3831 3836 921b334fbd8b8186 │ │ │ │ -0001dd30: 3664 3539 6622 3e4f 7065 6e53 7562 6469 6d59f">OpenSubdi │ │ │ │ -0001dd40: 763a 3a4f 5045 4e53 5542 4449 565f 5645 v::OPENSUBDIV_VE │ │ │ │ -0001dd50: 5253 494f 4e3a 3a53 6463 3a3a 5363 6865 RSION::Sdc::Sche │ │ │ │ -0001dd60: 6d65 3a3a 6173 7369 676e 536d 6f6f 7468 me::assignSmooth │ │ │ │ -0001dd70: 4c69 6d69 744d 6173 6b3c 2f61 3e3c 2f64 LimitMask
void assi │ │ │ │ -0001dda0: 676e 536d 6f6f 7468 4c69 6d69 744d 6173 gnSmoothLimitMas │ │ │ │ -0001ddb0: 6b28 5645 5254 4558 2063 6f6e 7374 2026 k(VERTEX const & │ │ │ │ -0001ddc0: 616d 703b 7665 7274 6578 2c20 4d41 534b amp;vertex, MASK │ │ │ │ -0001ddd0: 2026 616d 703b 706f 7329 2063 6f6e 7374 &pos) const │ │ │ │ -0001dde0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.static int GetL │ │ │ │ -0001def0: 6f63 616c 4e65 6967 6862 6f72 686f 6f64 ocalNeighborhood │ │ │ │ -0001df00: 5369 7a65 2829 3c2f 6469 763e 3c2f 6469 Size()
.
OpenSubdiv:: │ │ │ │ -0001dfb0: 4f50 454e 5355 4244 4956 5f56 4552 5349 OPENSUBDIV_VERSI │ │ │ │ -0001dfc0: 4f4e 3a3a 5364 633a 3a53 6368 656d 653a ON::Sdc::Scheme: │ │ │ │ -0001dfd0: 3a61 7373 6967 6e43 6f72 6e65 724d 6173 :assignCornerMas │ │ │ │ -0001dfe0: 6b46 6f72 5665 7274 6578 3c2f 613e 3c2f kForVertex
void ass │ │ │ │ -0001e010: 6967 6e43 6f72 6e65 724d 6173 6b46 6f72 ignCornerMaskFor │ │ │ │ -0001e020: 5665 7274 6578 2856 4552 5445 5820 636f Vertex(VERTEX co │ │ │ │ -0001e030: 6e73 7420 2661 6d70 3b65 6467 652c 204d nst &edge, M │ │ │ │ -0001e040: 4153 4b20 2661 6d70 3b6d 6173 6b29 2063 ASK &mask) c │ │ │ │ -0001e050: 6f6e 7374 3c2f 6469 763e 3c64 6976 2063 onst
│ │ │ │ -0001e070: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -0001e080: 3c61 2068 7265 663d 2261 3030 3737 335f scheme.h:331 │ │ │ │ -0001e0b0: 3c2f 613e 3c2f 6469 763e 3c2f 6469 763e
│ │ │ │ -0001e0c0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
void assignCre │ │ │ │ -0001e1c0: 6173 654c 696d 6974 4d61 736b 2856 4552 aseLimitMask(VER │ │ │ │ -0001e1d0: 5445 5820 636f 6e73 7420 2661 6d70 3b76 TEX const &v │ │ │ │ -0001e1e0: 6572 7465 782c 204d 4153 4b20 2661 6d70 ertex, MASK & │ │ │ │ -0001e1f0: 3b70 6f73 2c20 696e 7420 636f 6e73 7420 ;pos, int const │ │ │ │ -0001e200: 6372 6561 7365 456e 6473 5b32 5d29 2063 creaseEnds[2]) c │ │ │ │ -0001e210: 6f6e 7374 3c2f 6469 763e 3c2f 6469 763e onst
│ │ │ │ -0001e220: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
OpenSubdiv::OP │ │ │ │ -0001e2c0: 454e 5355 4244 4956 5f56 4552 5349 4f4e ENSUBDIV_VERSION │ │ │ │ -0001e2d0: 3a3a 5364 633a 3a53 6368 656d 653a 3a61 ::Sdc::Scheme::a │ │ │ │ -0001e2e0: 7373 6967 6e53 6d6f 6f74 684d 6173 6b46 ssignSmoothMaskF │ │ │ │ -0001e2f0: 6f72 5665 7274 6578 3c2f 613e 3c2f 6469 orVertex
void assig │ │ │ │ -0001e320: 6e53 6d6f 6f74 684d 6173 6b46 6f72 5665 nSmoothMaskForVe │ │ │ │ -0001e330: 7274 6578 2856 4552 5445 5820 636f 6e73 rtex(VERTEX cons │ │ │ │ -0001e340: 7420 2661 6d70 3b65 6467 652c 204d 4153 t &edge, MAS │ │ │ │ -0001e350: 4b20 2661 6d70 3b6d 6173 6b29 2063 6f6e K &mask) con │ │ │ │ -0001e360: 7374 3c2f 6469 763e 3c2f 6469 763e 0a3c st
.< │ │ │ │ -0001e370: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0001e380: 6964 3d22 6161 3031 3333 335f 6874 6d6c id="aa01333_html │ │ │ │ -0001e390: 5f61 3866 3765 3938 3362 3231 3935 6163 _a8f7e983b2195ac │ │ │ │ -0001e3a0: 3662 3338 3863 3761 3664 6231 3766 3863 6b388c7a6db17f8c │ │ │ │ -0001e3b0: 6230 223e 3c64 6976 2063 6c61 7373 3d22 b0">static int Get │ │ │ │ -0001e470: 5265 6775 6c61 7256 6572 7465 7856 616c RegularVertexVal │ │ │ │ -0001e480: 656e 6365 2829 3c2f 6469 763e 3c2f 6469 ence()
.
OpenSubdiv:: │ │ │ │ -0001e530: 4f50 454e 5355 4244 4956 5f56 4552 5349 OPENSUBDIV_VERSI │ │ │ │ -0001e540: 4f4e 3a3a 5364 633a 3a53 6368 656d 653a ON::Sdc::Scheme: │ │ │ │ -0001e550: 3a47 6574 4f70 7469 6f6e 733c 2f61 3e3c :GetOptions< │ │ │ │ -0001e560: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Options │ │ │ │ -0001e580: 2047 6574 4f70 7469 6f6e 7328 2920 636f GetOptions() co │ │ │ │ -0001e590: 6e73 743c 2f64 6976 3e3c 6469 7620 636c nst
D │ │ │ │ -0001e5b0: 6566 696e 6974 696f 6e3a 3c2f 623e 203c efinition: < │ │ │ │ -0001e5c0: 6120 6872 6566 3d22 6130 3037 3733 5f73 a href="a00773_s │ │ │ │ -0001e5d0: 6f75 7263 652e 6874 6d6c 236c 3030 3037 ource.html#l0007 │ │ │ │ -0001e5e0: 3422 3e73 6368 656d 652e 683a 3734 3c2f 4">scheme.h:74
.< │ │ │ │ -0001e600: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0001e610: 6964 3d22 6161 3031 3333 335f 6874 6d6c id="aa01333_html │ │ │ │ -0001e620: 5f61 3965 6535 6531 3934 6130 3038 3332 _a9ee5e194a00832 │ │ │ │ -0001e630: 6135 6266 6137 3663 6635 3864 6630 6263 a5bfa76cf58df0bc │ │ │ │ -0001e640: 3462 223e 3c64 6976 2063 6c61 7373 3d22 4b">
│ │ │ │ -0001e690: 4f70 656e 5375 6264 6976 3a3a 4f50 454e OpenSubdiv::OPEN │ │ │ │ -0001e6a0: 5355 4244 4956 5f56 4552 5349 4f4e 3a3a SUBDIV_VERSION:: │ │ │ │ -0001e6b0: 5364 633a 3a53 6368 656d 653a 3a61 7373 Sdc::Scheme::ass │ │ │ │ -0001e6c0: 6967 6e53 6d6f 6f74 684c 696d 6974 5461 ignSmoothLimitTa │ │ │ │ -0001e6d0: 6e67 656e 744d 6173 6b73 3c2f 613e 3c2f ngentMasks
void ass │ │ │ │ -0001e700: 6967 6e53 6d6f 6f74 684c 696d 6974 5461 ignSmoothLimitTa │ │ │ │ -0001e710: 6e67 656e 744d 6173 6b73 2856 4552 5445 ngentMasks(VERTE │ │ │ │ -0001e720: 5820 636f 6e73 7420 2661 6d70 3b76 6572 X const &ver │ │ │ │ -0001e730: 7465 782c 204d 4153 4b20 2661 6d70 3b74 tex, MASK &t │ │ │ │ -0001e740: 616e 312c 204d 4153 4b20 2661 6d70 3b74 an1, MASK &t │ │ │ │ -0001e750: 616e 3229 2063 6f6e 7374 3c2f 6469 763e an2) const
│ │ │ │ -0001e760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0001e7c0: 3c61 2068 7265 663d 2261 3031 3333 332e OpenSubd │ │ │ │ -0001e800: 6976 3a3a 4f50 454e 5355 4244 4956 5f56 iv::OPENSUBDIV_V │ │ │ │ -0001e810: 4552 5349 4f4e 3a3a 5364 633a 3a53 6368 ERSION::Sdc::Sch │ │ │ │ -0001e820: 656d 653a 3a61 7373 6967 6e43 6f72 6e65 eme::assignCorne │ │ │ │ -0001e830: 724c 696d 6974 4d61 736b 3c2f 613e 3c2f rLimitMask
void ass │ │ │ │ -0001e860: 6967 6e43 6f72 6e65 724c 696d 6974 4d61 ignCornerLimitMa │ │ │ │ -0001e870: 736b 2856 4552 5445 5820 636f 6e73 7420 sk(VERTEX const │ │ │ │ -0001e880: 2661 6d70 3b76 6572 7465 782c 204d 4153 &vertex, MAS │ │ │ │ -0001e890: 4b20 2661 6d70 3b70 6f73 2920 636f 6e73 K &pos) cons │ │ │ │ -0001e8a0: 743c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 t
.
│ │ │ │ -0001e990: 5363 6865 6d65 284f 7074 696f 6e73 2063 Scheme(Options c │ │ │ │ -0001e9a0: 6f6e 7374 2026 616d 703b 6f70 7469 6f6e onst &option │ │ │ │ -0001e9b0: 7329 3c2f 6469 763e 3c64 6976 2063 6c61 s)
De │ │ │ │ -0001e9d0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 3c61 finition: scheme.h:72
.
v │ │ │ │ -0001eb10: 6f69 6420 436f 6d70 7574 6546 6163 6556 oid ComputeFaceV │ │ │ │ -0001eb20: 6572 7465 784d 6173 6b28 4641 4345 2063 ertexMask(FACE c │ │ │ │ -0001eb30: 6f6e 7374 2026 616d 703b 6661 6365 4e65 onst &faceNe │ │ │ │ -0001eb40: 6967 6862 6f72 686f 6f64 2c20 4d41 534b ighborhood, MASK │ │ │ │ -0001eb50: 2026 616d 703b 6661 6365 5665 7274 6578 &faceVertex │ │ │ │ -0001eb60: 4d61 736b 2920 636f 6e73 743c 2f64 6976 Mask) const
Face-vertex │ │ │ │ -0001eb90: 6d61 736b 7320 2d20 7472 6976 6961 6c20 masks - trivial │ │ │ │ -0001eba0: 666f 7220 616c 6c20 6375 7272 656e 7420 for all current │ │ │ │ -0001ebb0: 7363 6865 6d65 732e 3c2f 6469 763e 3c64 schemes.
Definition:< │ │ │ │ -0001ebe0: 2f62 3e20 3c61 2068 7265 663d 2261 3030 /b> scheme.h │ │ │ │ -0001ec10: 3a33 3438 3c2f 613e 3c2f 6469 763e 3c2f :348
.
vo │ │ │ │ -0001ed20: 6964 2061 7373 6967 6e43 6f72 6e65 724c id assignCornerL │ │ │ │ -0001ed30: 696d 6974 5461 6e67 656e 744d 6173 6b73 imitTangentMasks │ │ │ │ -0001ed40: 2856 4552 5445 5820 636f 6e73 7420 2661 (VERTEX const &a │ │ │ │ -0001ed50: 6d70 3b76 6572 7465 782c 204d 4153 4b20 mp;vertex, MASK │ │ │ │ -0001ed60: 2661 6d70 3b74 616e 312c 204d 4153 4b20 &tan1, MASK │ │ │ │ -0001ed70: 2661 6d70 3b74 616e 3229 2063 6f6e 7374 &tan2) const │ │ │ │ -0001ed80: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.< │ │ │ │ -0001ee60: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -0001ee70: 6922 3e76 6f69 6420 5365 744f 7074 696f i">void SetOptio │ │ │ │ -0001ee80: 6e73 2863 6f6e 7374 204f 7074 696f 6e73 ns(const Options │ │ │ │ -0001ee90: 2026 616d 703b 6e65 774f 7074 696f 6e73 &newOptions │ │ │ │ -0001eea0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Def │ │ │ │ -0001eec0: 696e 6974 696f 6e3a 3c2f 623e 203c 6120 inition: scheme.h:75 │ │ │ │ -0001ef00: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
. │ │ │ │ -0001ef30: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
│ │ │ │ -0001efb0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -0001efc0: 3c61 2068 7265 663d 2261 3030 3737 335f scheme.h:209 │ │ │ │ -0001eff0: 3c2f 613e 3c2f 6469 763e 3c2f 6469 763e
│ │ │ │ -0001f000: 0a3c 6469 7620 636c 6173 733d 2274 7463 ..
bool │ │ │ │ -0001f270: 4172 6546 6163 6557 6569 6768 7473 466f AreFaceWeightsFo │ │ │ │ -0001f280: 7246 6163 6543 656e 7465 7273 2829 2063 rFaceCenters() c │ │ │ │ -0001f290: 6f6e 7374 3c2f 6469 763e 3c64 6976 2063 onst
│ │ │ │ -0001f2b0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -0001f2c0: 3c61 2068 7265 663d 2261 3030 3737 335f scheme.h:239 │ │ │ │ -0001f2f0: 3c2f 613e 3c2f 6469 763e 3c2f 6469 763e
│ │ │ │ -0001f300: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
OpenSubdiv::OP │ │ │ │ -0001f3a0: 454e 5355 4244 4956 5f56 4552 5349 4f4e ENSUBDIV_VERSION │ │ │ │ -0001f3b0: 3a3a 5364 633a 3a53 6368 656d 653a 3a4c ::Sdc::Scheme::L │ │ │ │ -0001f3c0: 6f63 616c 4d61 736b 3a3a 5365 744e 756d ocalMask::SetNum │ │ │ │ -0001f3d0: 4564 6765 5765 6967 6874 733c 2f61 3e3c EdgeWeights< │ │ │ │ -0001f3e0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
void Se │ │ │ │ -0001f400: 744e 756d 4564 6765 5765 6967 6874 7328 tNumEdgeWeights( │ │ │ │ -0001f410: 696e 7420 636f 756e 7429 3c2f 6469 763e int count)
│ │ │ │ -0001f420: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -0001f440: 3a3c 2f62 3e20 3c61 2068 7265 663d 2261 : scheme │ │ │ │ -0001f470: 2e68 3a32 3238 3c2f 613e 3c2f 6469 763e .h:228
│ │ │ │ -0001f480: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0001f4e0: 3c61 2068 7265 663d 2261 3031 3333 372e OpenSubd │ │ │ │ -0001f520: 6976 3a3a 4f50 454e 5355 4244 4956 5f56 iv::OPENSUBDIV_V │ │ │ │ -0001f530: 4552 5349 4f4e 3a3a 5364 633a 3a53 6368 ERSION::Sdc::Sch │ │ │ │ -0001f540: 656d 653a 3a4c 6f63 616c 4d61 736b 3a3a eme::LocalMask:: │ │ │ │ -0001f550: 4564 6765 5765 6967 6874 3c2f 613e 3c2f EdgeWeight
Weight c │ │ │ │ -0001f580: 6f6e 7374 2026 616d 703b 2045 6467 6557 onst & EdgeW │ │ │ │ -0001f590: 6569 6768 7428 696e 7420 696e 6465 7829 eight(int index) │ │ │ │ -0001f5a0: 2063 6f6e 7374 3c2f 6469 763e 3c64 6976 const
< │ │ │ │ -0001f5c0: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: scheme.h:2 │ │ │ │ -0001f600: 3332 3c2f 613e 3c2f 6469 763e 3c2f 6469 32
.
│ │ │ │ -0001f6f0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Weight & │ │ │ │ -0001f710: 2045 6467 6557 6569 6768 7428 696e 7420 EdgeWeight(int │ │ │ │ -0001f720: 696e 6465 7829 3c2f 6469 763e 3c64 6976 index)
< │ │ │ │ -0001f740: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: scheme.h:2 │ │ │ │ -0001f780: 3336 3c2f 613e 3c2f 6469 763e 3c2f 6469 36
.
void CombineVe │ │ │ │ -0001f8a0: 7274 6578 5665 7274 6578 4d61 736b 7328 rtexVertexMasks( │ │ │ │ -0001f8b0: 5765 6967 6874 2074 6869 7343 6f65 6666 Weight thisCoeff │ │ │ │ -0001f8c0: 2c20 5765 6967 6874 2064 7374 436f 6566 , Weight dstCoef │ │ │ │ -0001f8d0: 662c 2055 5345 525f 4d41 534b 2026 616d f, USER_MASK &am │ │ │ │ -0001f8e0: 703b 6473 7429 2063 6f6e 7374 3c2f 6469 p;dst) const
Definiti │ │ │ │ -0001f910: 6f6e 3a3c 2f62 3e20 3c61 2068 7265 663d on: sche │ │ │ │ -0001f940: 6d65 2e68 3a32 3439 3c2f 613e 3c2f 6469 me.h:249
.< │ │ │ │ -0001fa40: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -0001fa50: 6922 3e69 6e74 2047 6574 4e75 6d56 6572 i">int GetNumVer │ │ │ │ -0001fa60: 7465 7857 6569 6768 7473 2829 2063 6f6e texWeights() con │ │ │ │ -0001fa70: 7374 3c2f 6469 763e 3c64 6976 2063 6c61 st
De │ │ │ │ -0001fa90: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 3c61 finition: scheme.h:223
.< │ │ │ │ -0001fae0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0001faf0: 6964 3d22 6161 3031 3333 375f 6874 6d6c id="aa01337_html │ │ │ │ -0001fb00: 5f61 3631 6539 3333 6639 6131 3238 6362 _a61e933f9a128cb │ │ │ │ -0001fb10: 3136 6433 3136 3131 6664 3936 6563 6431 16d31611fd96ecd1 │ │ │ │ -0001fb20: 3533 223e 3c64 6976 2063 6c61 7373 3d22 53">.
OpenSubdiv │ │ │ │ -0001fd00: 3a3a 4f50 454e 5355 4244 4956 5f56 4552 ::OPENSUBDIV_VER │ │ │ │ -0001fd10: 5349 4f4e 3a3a 5364 633a 3a53 6368 656d SION::Sdc::Schem │ │ │ │ -0001fd20: 653a 3a4c 6f63 616c 4d61 736b 3a3a 4661 e::LocalMask::Fa │ │ │ │ -0001fd30: 6365 5765 6967 6874 3c2f 613e 3c2f 6469 ceWeight
Weight con │ │ │ │ -0001fd60: 7374 2026 616d 703b 2046 6163 6557 6569 st & FaceWei │ │ │ │ -0001fd70: 6768 7428 696e 7420 696e 6465 7829 2063 ght(int index) c │ │ │ │ -0001fd80: 6f6e 7374 3c2f 6469 763e 3c64 6976 2063 onst
│ │ │ │ -0001fda0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -0001fdb0: 3c61 2068 7265 663d 2261 3030 3737 335f scheme.h:233 │ │ │ │ -0001fde0: 3c2f 613e 3c2f 6469 763e 3c2f 6469 763e
│ │ │ │ -0001fdf0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
OpenSubdiv::OP │ │ │ │ -0001fe90: 454e 5355 4244 4956 5f56 4552 5349 4f4e ENSUBDIV_VERSION │ │ │ │ -0001fea0: 3a3a 5364 633a 3a53 6368 656d 653a 3a4c ::Sdc::Scheme::L │ │ │ │ -0001feb0: 6f63 616c 4d61 736b 3a3a 4765 744e 756d ocalMask::GetNum │ │ │ │ -0001fec0: 4564 6765 5765 6967 6874 733c 2f61 3e3c EdgeWeights< │ │ │ │ -0001fed0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
int Get │ │ │ │ -0001fef0: 4e75 6d45 6467 6557 6569 6768 7473 2829 NumEdgeWeights() │ │ │ │ -0001ff00: 2063 6f6e 7374 3c2f 6469 763e 3c64 6976 const
< │ │ │ │ -0001ff20: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: scheme.h:2 │ │ │ │ -0001ff60: 3234 3c2f 613e 3c2f 6469 763e 3c2f 6469 24
.
OpenSubdiv:: │ │ │ │ -00020010: 4f50 454e 5355 4244 4956 5f56 4552 5349 OPENSUBDIV_VERSI │ │ │ │ -00020020: 4f4e 3a3a 5364 633a 3a53 6368 656d 653a ON::Sdc::Scheme: │ │ │ │ -00020030: 3a4c 6f63 616c 4d61 736b 3a3a 5665 7274 :LocalMask::Vert │ │ │ │ -00020040: 6578 5765 6967 6874 3c2f 613e 3c2f 6469 exWeight
Weight &am │ │ │ │ -00020070: 703b 2056 6572 7465 7857 6569 6768 7428 p; VertexWeight( │ │ │ │ -00020080: 696e 7420 696e 6465 7829 3c2f 6469 763e int index)
│ │ │ │ -00020090: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -000200b0: 3a3c 2f62 3e20 3c61 2068 7265 663d 2261 : scheme │ │ │ │ -000200e0: 2e68 3a32 3335 3c2f 613e 3c2f 6469 763e .h:235
│ │ │ │ -000200f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
i │ │ │ │ -000201f0: 6e74 2047 6574 4e75 6d46 6163 6557 6569 nt GetNumFaceWei │ │ │ │ -00020200: 6768 7473 2829 2063 6f6e 7374 3c2f 6469 ghts() const
Definiti │ │ │ │ -00020230: 6f6e 3a3c 2f62 3e20 3c61 2068 7265 663d on: sche │ │ │ │ -00020260: 6d65 2e68 3a32 3235 3c2f 613e 3c2f 6469 me.h:225
... │ │ │ │ -000206d0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: scheme.h: │ │ │ │ -00020710: 3231 353c 2f61 3e3c 2f64 6976 3e3c 2f64 215
.
OpenSubdiv: │ │ │ │ -000207c0: 3a4f 5045 4e53 5542 4449 565f 5645 5253 :OPENSUBDIV_VERS │ │ │ │ -000207d0: 494f 4e3a 3a53 6463 3a3a 5363 6865 6d65 ION::Sdc::Scheme │ │ │ │ -000207e0: 3a3a 4c6f 6361 6c4d 6173 6b3a 3a56 6572 ::LocalMask::Ver │ │ │ │ -000207f0: 7465 7857 6569 6768 743c 2f61 3e3c 2f64 texWeight
Weight co │ │ │ │ -00020820: 6e73 7420 2661 6d70 3b20 5665 7274 6578 nst & Vertex │ │ │ │ -00020830: 5765 6967 6874 2869 6e74 2069 6e64 6578 Weight(int index │ │ │ │ -00020840: 2920 636f 6e73 743c 2f64 6976 3e3c 6469 ) const
│ │ │ │ -00020860: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: scheme.h: │ │ │ │ -000208a0: 3233 313c 2f61 3e3c 2f64 6976 3e3c 2f64 231
...
..
│ │ │ │ +0001ef40: 3c21 2d2d 2063 6f6e 7465 6e74 7320 2d2d ..
. .
.< │ │ │ │ +0001f1e0: 2f62 6f64 793e 0a3c 2f68 746d 6c3e 0a /body>.. │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -scheme.h │ │ │ │ │ +cudaEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,851 +29,741 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_SCHEME_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_SCHEME_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29#include "../sdc/types.h" │ │ │ │ │ - 30#include "../sdc/options.h" │ │ │ │ │ - 31#include "../sdc/crease.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33#include │ │ │ │ │ - 34#include │ │ │ │ │ - 35#include │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 32#include "../osd/types.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ - 37namespace OpenSubdiv { │ │ │ │ │ - 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 39 │ │ │ │ │ - 40namespace Sdc { │ │ │ │ │ - 41 │ │ │ │ │ - 65template │ │ │ │ │ -66class Scheme { │ │ │ │ │ - 67 │ │ │ │ │ - 68public: │ │ │ │ │ - 69 │ │ │ │ │ -70 Scheme() : _options() { } │ │ │ │ │ - 71 │ │ │ │ │ -72 Scheme(Options const& options) : _options(options) { } │ │ │ │ │ - 73 │ │ │ │ │ -74 Options GetOptions() const { return _options; } │ │ │ │ │ -75 void SetOptions(const Options& newOptions) { _options = newOptions; } │ │ │ │ │ - 76 │ │ │ │ │ - 80 template │ │ │ │ │ - 81 void ComputeFaceVertexMask(FACE const& faceNeighborhood, MASK& │ │ │ │ │ -faceVertexMask) const; │ │ │ │ │ - 82 │ │ │ │ │ - 98 template │ │ │ │ │ - 99 void ComputeEdgeVertexMask(EDGE const& edgeNeighborhood, MASK& │ │ │ │ │ -edgeVertexMask, │ │ │ │ │ - 100 Crease::Rule parentRule = Crease::RULE_UNKNOWN, │ │ │ │ │ - 101 Crease::Rule childRule = Crease::RULE_UNKNOWN) const; │ │ │ │ │ - 102 │ │ │ │ │ - 112 template │ │ │ │ │ - 113 void ComputeVertexVertexMask(VERTEX const& vertexNeighborhood, MASK& │ │ │ │ │ -vertexVertexMask, │ │ │ │ │ - 114 Crease::Rule parentRule = Crease::RULE_UNKNOWN, │ │ │ │ │ - 115 Crease::Rule childRule = Crease::RULE_UNKNOWN) const; │ │ │ │ │ - 116 │ │ │ │ │ - 141 template │ │ │ │ │ - 142 void ComputeVertexLimitMask(VERTEX const& vertexNeighborhood, MASK& │ │ │ │ │ -positionMask, │ │ │ │ │ - 143 Crease::Rule vertexRule) const; │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 class PatchTable; │ │ │ │ │ + 39 class StencilTable; │ │ │ │ │ + 40 class LimitStencilTable; │ │ │ │ │ + 41} │ │ │ │ │ + 42 │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ + 44 │ │ │ │ │ +52class CudaStencilTable { │ │ │ │ │ + 53public: │ │ │ │ │ +54 static CudaStencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ + 55 void *deviceContext = NULL) { │ │ │ │ │ + 56 (void)deviceContext; // unused │ │ │ │ │ + 57 return new CudaStencilTable(stencilTable); │ │ │ │ │ + 58 } │ │ │ │ │ +59 static CudaStencilTable *Create(Far::LimitStencilTable const │ │ │ │ │ +*limitStencilTable, │ │ │ │ │ + 60 void *deviceContext = NULL) { │ │ │ │ │ + 61 (void)deviceContext; // unused │ │ │ │ │ + 62 return new CudaStencilTable(limitStencilTable); │ │ │ │ │ + 63 } │ │ │ │ │ + 64 │ │ │ │ │ +65 explicit CudaStencilTable(Far::StencilTable const *stencilTable); │ │ │ │ │ +66 explicit CudaStencilTable(Far::LimitStencilTable const *limitStencilTable); │ │ │ │ │ +67 ~CudaStencilTable(); │ │ │ │ │ + 68 │ │ │ │ │ + 69 // interfaces needed for CudaCompute │ │ │ │ │ +70 void *GetSizesBuffer() const { return _sizes; } │ │ │ │ │ +71 void *GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ +72 void *GetIndicesBuffer() const { return _indices; } │ │ │ │ │ +73 void *GetWeightsBuffer() const { return _weights; } │ │ │ │ │ +74 void *GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ +75 void *GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ +76 void *GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ +77 void *GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ +78 void *GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ +79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 80 │ │ │ │ │ + 81private: │ │ │ │ │ + 82 void * _sizes, │ │ │ │ │ + 83 * _offsets, │ │ │ │ │ + 84 * _indices, │ │ │ │ │ + 85 * _weights, │ │ │ │ │ + 86 * _duWeights, │ │ │ │ │ + 87 * _dvWeights, │ │ │ │ │ + 88 * _duuWeights, │ │ │ │ │ + 89 * _duvWeights, │ │ │ │ │ + 90 * _dvvWeights; │ │ │ │ │ + 91 int _numStencils; │ │ │ │ │ + 92}; │ │ │ │ │ + 93 │ │ │ │ │ +94class CudaEvaluator { │ │ │ │ │ + 95public: │ │ │ │ │ + 101 │ │ │ │ │ + 125 template │ │ │ │ │ +126 static bool EvalStencils( │ │ │ │ │ + 127 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 128 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 129 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 130 const void *instance = NULL, │ │ │ │ │ + 131 void * deviceContext = NULL) { │ │ │ │ │ + 132 │ │ │ │ │ + 133 (void)instance; // unused │ │ │ │ │ + 134 (void)deviceContext; // unused │ │ │ │ │ + 135 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 136 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 137 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ + 138 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 139 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 140 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 141 /*start = */ 0, │ │ │ │ │ + 142 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 143 } │ │ │ │ │ 144 │ │ │ │ │ - 145 template │ │ │ │ │ - 146 void ComputeVertexLimitMask(VERTEX const& vertexNeighborhood, MASK& │ │ │ │ │ -positionMask, │ │ │ │ │ - 147 MASK& tangent1Mask, MASK& tangent2Mask, │ │ │ │ │ - 148 Crease::Rule vertexRule) const; │ │ │ │ │ - 149 │ │ │ │ │ - 150 // │ │ │ │ │ - 151 // Static methods defining traits/properties of the scheme: │ │ │ │ │ - 152 // │ │ │ │ │ -153 static Split GetTopologicalSplitType(); │ │ │ │ │ -154 static int GetRegularFaceSize(); │ │ │ │ │ -155 static int GetRegularVertexValence(); │ │ │ │ │ -156 static int GetLocalNeighborhoodSize(); │ │ │ │ │ - 157 │ │ │ │ │ - 158protected: │ │ │ │ │ - 159 │ │ │ │ │ - 160 // │ │ │ │ │ - 161 // Supporting internal methods -- optionally implemented, depending on │ │ │ │ │ -specialization: │ │ │ │ │ - 162 // │ │ │ │ │ - 163 │ │ │ │ │ - 164 // Subdivision/refinement masks -- two for edge-vertices and three for │ │ │ │ │ -vertex-vertices: │ │ │ │ │ - 165 // │ │ │ │ │ - 166 template │ │ │ │ │ - 167 void assignCreaseMaskForEdge(EDGE const& edge, MASK& mask) const; │ │ │ │ │ - 168 template │ │ │ │ │ -169 void assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const; │ │ │ │ │ - 170 │ │ │ │ │ - 171 template │ │ │ │ │ - 172 void assignCornerMaskForVertex(VERTEX const& edge, MASK& mask) const; │ │ │ │ │ - 173 template │ │ │ │ │ -174 void assignCreaseMaskForVertex(VERTEX const& edge, MASK& mask, int const │ │ │ │ │ -creaseEnds[2]) const; │ │ │ │ │ - 175 template │ │ │ │ │ -176 void assignSmoothMaskForVertex(VERTEX const& edge, MASK& mask) const; │ │ │ │ │ - 177 │ │ │ │ │ - 178 // │ │ │ │ │ - 179 // Limit masks for position and tangents at vertices -- three cases for │ │ │ │ │ -each: │ │ │ │ │ - 180 // │ │ │ │ │ - 181 template │ │ │ │ │ -182 void assignCornerLimitMask(VERTEX const& vertex, MASK& pos) const; │ │ │ │ │ - 183 template │ │ │ │ │ -184 void assignCreaseLimitMask(VERTEX const& vertex, MASK& pos, int const │ │ │ │ │ -creaseEnds[2]) const; │ │ │ │ │ - 185 template │ │ │ │ │ -186 void assignSmoothLimitMask(VERTEX const& vertex, MASK& pos) const; │ │ │ │ │ - 187 │ │ │ │ │ - 188 template │ │ │ │ │ -189 void assignCornerLimitTangentMasks(VERTEX const& vertex, MASK& tan1, MASK& │ │ │ │ │ -tan2) const; │ │ │ │ │ - 190 template │ │ │ │ │ -191 void assignCreaseLimitTangentMasks(VERTEX const& vertex, MASK& tan1, MASK& │ │ │ │ │ -tan2, int const creaseEnds[2]) const; │ │ │ │ │ - 192 template │ │ │ │ │ -193 void assignSmoothLimitTangentMasks(VERTEX const& vertex, MASK& tan1, MASK& │ │ │ │ │ -tan2) const; │ │ │ │ │ - 194 │ │ │ │ │ - 195private: │ │ │ │ │ - 196 Options _options; │ │ │ │ │ - 197 │ │ │ │ │ - 198protected: │ │ │ │ │ - 199 │ │ │ │ │ - 200 // │ │ │ │ │ - 201 // Internal implementation support: │ │ │ │ │ - 202 // │ │ │ │ │ - 203 // We need a local "mask" class to be declared locally within the vertex- │ │ │ │ │ -vertex mask query │ │ │ │ │ - 204 // to hold one of the two possible masks required and to combine the local │ │ │ │ │ -mask with the mask │ │ │ │ │ - 205 // the caller provides. It has been parameterized by so that a │ │ │ │ │ -version compatible │ │ │ │ │ - 206 // with the caller's mask class is created. │ │ │ │ │ - 207 // │ │ │ │ │ - 208 template │ │ │ │ │ -209 class LocalMask { │ │ │ │ │ - 210 │ │ │ │ │ - 211 public: │ │ │ │ │ -212 typedef WEIGHT Weight; │ │ │ │ │ - 213 │ │ │ │ │ - 214 public: │ │ │ │ │ -215 LocalMask(Weight* v, Weight* e, Weight* f) : _vWeights(v), _eWeights(e), │ │ │ │ │ -_fWeights(f) { } │ │ │ │ │ -216 ~LocalMask() { } │ │ │ │ │ - 217 │ │ │ │ │ - 218 public: │ │ │ │ │ - 219 │ │ │ │ │ - 220 // │ │ │ │ │ - 221 // Methods required for general mask assignments and queries: │ │ │ │ │ - 222 // │ │ │ │ │ -223 int GetNumVertexWeights() const { return _vCount; } │ │ │ │ │ -224 int GetNumEdgeWeights() const { return _eCount; } │ │ │ │ │ -225 int GetNumFaceWeights() const { return _fCount; } │ │ │ │ │ +171 static bool EvalStencils( │ │ │ │ │ + 172 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 173 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 174 const int * sizes, │ │ │ │ │ + 175 const int * offsets, │ │ │ │ │ + 176 const int * indices, │ │ │ │ │ + 177 const float * weights, │ │ │ │ │ + 178 int start, int end); │ │ │ │ │ + 179 │ │ │ │ │ + 217 template │ │ │ │ │ +218 static bool EvalStencils( │ │ │ │ │ + 219 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 220 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 221 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 222 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 223 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 224 const CudaEvaluator *instance = NULL, │ │ │ │ │ + 225 void * deviceContext = NULL) { │ │ │ │ │ 226 │ │ │ │ │ -227 void SetNumVertexWeights(int count) { _vCount = count; } │ │ │ │ │ -228 void SetNumEdgeWeights( int count) { _eCount = count; } │ │ │ │ │ -229 void SetNumFaceWeights( int count) { _fCount = count; } │ │ │ │ │ - 230 │ │ │ │ │ -231 Weight const& VertexWeight(int index) const { return _vWeights[index]; } │ │ │ │ │ -232 Weight const& EdgeWeight( int index) const { return _eWeights[index]; } │ │ │ │ │ -233 Weight const& FaceWeight( int index) const { return _fWeights[index]; } │ │ │ │ │ - 234 │ │ │ │ │ -235 Weight& VertexWeight(int index) { return _vWeights[index]; } │ │ │ │ │ -236 Weight& EdgeWeight( int index) { return _eWeights[index]; } │ │ │ │ │ -237 Weight& FaceWeight( int index) { return _fWeights[index]; } │ │ │ │ │ - 238 │ │ │ │ │ -239 bool AreFaceWeightsForFaceCenters() const { return _fWeightsForCenters; } │ │ │ │ │ -240 void SetFaceWeightsForFaceCenters(bool on) { _fWeightsForCenters = on; } │ │ │ │ │ - 241 │ │ │ │ │ - 242 public: │ │ │ │ │ + 227 (void)instance; // unused │ │ │ │ │ + 228 (void)deviceContext; // unused │ │ │ │ │ + 229 │ │ │ │ │ + 230 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 231 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 232 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 233 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 234 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ + 235 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 236 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 237 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 238 (float const *)stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 239 (float const *)stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 240 /*start = */ 0, │ │ │ │ │ + 241 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 242 } │ │ │ │ │ 243 │ │ │ │ │ - 244 // │ │ │ │ │ - 245 // Additional methods -- mainly the blending method for vertex-vertex │ │ │ │ │ -masks: │ │ │ │ │ - 246 // │ │ │ │ │ - 247 template │ │ │ │ │ - 248 inline void │ │ │ │ │ -249 CombineVertexVertexMasks(Weight thisCoeff, Weight dstCoeff, USER_MASK& dst) │ │ │ │ │ -const { │ │ │ │ │ - 250 │ │ │ │ │ - 251 // │ │ │ │ │ - 252 // This implementation is convoluted by the potential sparsity of each │ │ │ │ │ -mask. Since │ │ │ │ │ - 253 // it is specific to a vertex-vertex mask, we are guaranteed to have │ │ │ │ │ -exactly one │ │ │ │ │ - 254 // vertex-weight for both masks, but the edge- and face-weights are │ │ │ │ │ -optional. The │ │ │ │ │ - 255 // child mask (the "source") should have a superset of the weights of the │ │ │ │ │ -parent │ │ │ │ │ - 256 // (the "destination") given its reduced sharpness, so we fortunately │ │ │ │ │ -don't need to │ │ │ │ │ - 257 // test all permutations. │ │ │ │ │ - 258 // │ │ │ │ │ - 259 dst.VertexWeight(0) = dstCoeff * dst.VertexWeight(0) + thisCoeff * this- │ │ │ │ │ ->VertexWeight(0); │ │ │ │ │ - 260 │ │ │ │ │ - 261 int edgeWeightCount = this->GetNumEdgeWeights(); │ │ │ │ │ - 262 if (edgeWeightCount) { │ │ │ │ │ - 263 if (dst.GetNumEdgeWeights() == 0) { │ │ │ │ │ - 264 dst.SetNumEdgeWeights(edgeWeightCount); │ │ │ │ │ - 265 for (int i = 0; i < edgeWeightCount; ++i) { │ │ │ │ │ - 266 dst.EdgeWeight(i) = thisCoeff * this->EdgeWeight(i); │ │ │ │ │ - 267 } │ │ │ │ │ - 268 } else { │ │ │ │ │ - 269 for (int i = 0; i < edgeWeightCount; ++i) { │ │ │ │ │ - 270 dst.EdgeWeight(i) = dstCoeff * dst.EdgeWeight(i) + thisCoeff * this- │ │ │ │ │ ->EdgeWeight(i); │ │ │ │ │ - 271 } │ │ │ │ │ - 272 } │ │ │ │ │ - 273 } │ │ │ │ │ - 274 │ │ │ │ │ - 275 int faceWeightCount = this->GetNumFaceWeights(); │ │ │ │ │ - 276 if (faceWeightCount) { │ │ │ │ │ - 277 // │ │ │ │ │ - 278 // If combining face weights, be sure their interpretation (i.e. face- │ │ │ │ │ -centers │ │ │ │ │ - 279 // or opposite vertices) is properly set in the destination mask: │ │ │ │ │ - 280 // │ │ │ │ │ - 281 if (dst.GetNumFaceWeights() == 0) { │ │ │ │ │ - 282 dst.SetNumFaceWeights(faceWeightCount); │ │ │ │ │ - 283 dst.SetFaceWeightsForFaceCenters(this->AreFaceWeightsForFaceCenters()); │ │ │ │ │ - 284 │ │ │ │ │ - 285 for (int i = 0; i < faceWeightCount; ++i) { │ │ │ │ │ - 286 dst.FaceWeight(i) = thisCoeff * this->FaceWeight(i); │ │ │ │ │ - 287 } │ │ │ │ │ - 288 } else { │ │ │ │ │ - 289 assert(this->AreFaceWeightsForFaceCenters() == │ │ │ │ │ -dst.AreFaceWeightsForFaceCenters()); │ │ │ │ │ - 290 │ │ │ │ │ - 291 for (int i = 0; i < faceWeightCount; ++i) { │ │ │ │ │ - 292 dst.FaceWeight(i) = dstCoeff * dst.FaceWeight(i) + thisCoeff * this- │ │ │ │ │ ->FaceWeight(i); │ │ │ │ │ - 293 } │ │ │ │ │ - 294 } │ │ │ │ │ - 295 } │ │ │ │ │ - 296 } │ │ │ │ │ - 297 │ │ │ │ │ - 298 private: │ │ │ │ │ - 299 Weight* _vWeights; │ │ │ │ │ - 300 Weight* _eWeights; │ │ │ │ │ - 301 Weight* _fWeights; │ │ │ │ │ - 302 int _vCount; │ │ │ │ │ - 303 int _eCount; │ │ │ │ │ - 304 int _fCount; │ │ │ │ │ - 305 bool _fWeightsForCenters; │ │ │ │ │ - 306 }; │ │ │ │ │ - 307}; │ │ │ │ │ - 308 │ │ │ │ │ - 309 │ │ │ │ │ - 310// │ │ │ │ │ - 311// Crease and corner masks are common to most schemes -- the rest need to │ │ │ │ │ -be provided │ │ │ │ │ - 312// for each Scheme specialization. │ │ │ │ │ - 313// │ │ │ │ │ - 314template │ │ │ │ │ - 315template │ │ │ │ │ - 316inline void │ │ │ │ │ -317Scheme::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const { │ │ │ │ │ - 318 │ │ │ │ │ - 319 mask.SetNumVertexWeights(2); │ │ │ │ │ - 320 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 321 mask.SetNumFaceWeights(0); │ │ │ │ │ - 322 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 323 │ │ │ │ │ - 324 mask.VertexWeight(0) = 0.5f; │ │ │ │ │ - 325 mask.VertexWeight(1) = 0.5f; │ │ │ │ │ - 326} │ │ │ │ │ - 327 │ │ │ │ │ - 328template │ │ │ │ │ - 329template │ │ │ │ │ - 330inline void │ │ │ │ │ -331Scheme::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const { │ │ │ │ │ - 332 │ │ │ │ │ - 333 mask.SetNumVertexWeights(1); │ │ │ │ │ - 334 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 335 mask.SetNumFaceWeights(0); │ │ │ │ │ - 336 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 337 │ │ │ │ │ - 338 mask.VertexWeight(0) = 1.0f; │ │ │ │ │ - 339} │ │ │ │ │ - 340 │ │ │ │ │ - 341 │ │ │ │ │ - 342// │ │ │ │ │ - 343// The computation of a face-vertex mask is trivial and consistent for all │ │ │ │ │ -schemes: │ │ │ │ │ - 344// │ │ │ │ │ - 345template │ │ │ │ │ - 346template │ │ │ │ │ - 347void │ │ │ │ │ -348Scheme::ComputeFaceVertexMask(FACE const& face, MASK& mask) const { │ │ │ │ │ - 349 │ │ │ │ │ - 350 int vertCount = face.GetNumVertices(); │ │ │ │ │ - 351 │ │ │ │ │ - 352 mask.SetNumVertexWeights(vertCount); │ │ │ │ │ - 353 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 354 mask.SetNumFaceWeights(0); │ │ │ │ │ - 355 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 356 │ │ │ │ │ - 357 typename MASK::Weight vWeight = 1.0f / (typename MASK::Weight) vertCount; │ │ │ │ │ - 358 for (int i = 0; i < vertCount; ++i) { │ │ │ │ │ - 359 mask.VertexWeight(i) = vWeight; │ │ │ │ │ - 360 } │ │ │ │ │ - 361} │ │ │ │ │ - 362 │ │ │ │ │ - 363 │ │ │ │ │ - 364// │ │ │ │ │ - 365// The computation of an edge-vertex mask requires inspection of sharpness │ │ │ │ │ -values to │ │ │ │ │ - 366// determine if smooth or a crease, and also to detect and apply a │ │ │ │ │ -transition from a │ │ │ │ │ - 367// crease to smooth. Using the protected methods to assign the specific │ │ │ │ │ -masks (only │ │ │ │ │ - 368// two -- smooth or crease) this implementation should serve all non-linear │ │ │ │ │ -schemes │ │ │ │ │ - 369// (currently Catmark and Loop) and only needs to be specialized for │ │ │ │ │ -Bilinear to │ │ │ │ │ - 370// trivialize it to the crease case. │ │ │ │ │ - 371// │ │ │ │ │ - 372// The implementation here is slightly complicated by combining two │ │ │ │ │ -scenarios into a │ │ │ │ │ - 373// single implementation -- either the caller knows the parent and child │ │ │ │ │ -rules and │ │ │ │ │ - 374// provides them, or they don't and the Rules have to be determined from │ │ │ │ │ -sharpness │ │ │ │ │ - 375// values. Both cases include quick return once the parent is determined to │ │ │ │ │ -be │ │ │ │ │ - 376// smooth or the child a crease, leaving the transitional case remaining. │ │ │ │ │ - 377// │ │ │ │ │ - 378// The overall process is as follows: │ │ │ │ │ - 379// │ │ │ │ │ - 380// - quickly detect the most common specified or detected Smooth case and │ │ │ │ │ -return │ │ │ │ │ - 381// - quickly detect a full Crease by child Rule assignment and return │ │ │ │ │ - 382// - determine from sharpness if unspecified child is a crease -- return if │ │ │ │ │ -so │ │ │ │ │ - 383// - compute smooth mask for child and combine with crease from parent │ │ │ │ │ - 384// │ │ │ │ │ - 385// Usage of the parent Rule here allows some misuse in that only three of │ │ │ │ │ -five possible │ │ │ │ │ - 386// assignments are legitimate for the parent and four for the child (Dart │ │ │ │ │ -being only │ │ │ │ │ - 387// valid for the child and Corner for neither). Results are undefined in │ │ │ │ │ -these cases. │ │ │ │ │ - 388// │ │ │ │ │ - 389template │ │ │ │ │ - 390template │ │ │ │ │ - 391void │ │ │ │ │ -392Scheme::ComputeEdgeVertexMask(EDGE const& edge, │ │ │ │ │ - 393 MASK& mask, │ │ │ │ │ - 394 Crease::Rule parentRule, │ │ │ │ │ - 395 Crease::Rule childRule) const { │ │ │ │ │ - 396 │ │ │ │ │ - 397 // │ │ │ │ │ - 398 // If the parent was specified or determined to be Smooth, we can quickly │ │ │ │ │ -return │ │ │ │ │ - 399 // with a Smooth mask. Otherwise the parent is a crease -- if the child │ │ │ │ │ -was │ │ │ │ │ - 400 // also specified to be a crease, we can quickly return with a Crease │ │ │ │ │ -mask. │ │ │ │ │ - 401 // │ │ │ │ │ - 402 if ((parentRule == Crease::RULE_SMOOTH) || │ │ │ │ │ - 403 ((parentRule == Crease::RULE_UNKNOWN) && (edge.GetSharpness() <= 0.0f))) { │ │ │ │ │ - 404 assignSmoothMaskForEdge(edge, mask); │ │ │ │ │ - 405 return; │ │ │ │ │ - 406 } │ │ │ │ │ - 407 if (childRule == Crease::RULE_CREASE) { │ │ │ │ │ - 408 assignCreaseMaskForEdge(edge, mask); │ │ │ │ │ - 409 return; │ │ │ │ │ - 410 } │ │ │ │ │ - 411 │ │ │ │ │ - 412 // │ │ │ │ │ - 413 // We have a Crease on the parent and the child was either specified as │ │ │ │ │ -Smooth │ │ │ │ │ - 414 // or was not specified at all -- deal with the unspecified case first │ │ │ │ │ -(again │ │ │ │ │ - 415 // returning a Crease mask if the child is also determined to be a Crease) │ │ │ │ │ -and │ │ │ │ │ - 416 // continue if we have a transition to Smooth. │ │ │ │ │ - 417 // │ │ │ │ │ - 418 // Note when qualifying the child that if the parent sharpness > 1.0, │ │ │ │ │ -regardless │ │ │ │ │ - 419 // of the creasing method, whether the child sharpness values decay to │ │ │ │ │ -zero is │ │ │ │ │ - 420 // irrelevant -- the fractional weight for such a case (the value of the │ │ │ │ │ -parent │ │ │ │ │ - 421 // sharpness) is > 1.0, and when clamped to 1 effectively yields a full │ │ │ │ │ -crease. │ │ │ │ │ - 422 // │ │ │ │ │ - 423 if (childRule == Crease::RULE_UNKNOWN) { │ │ │ │ │ - 424 Crease crease(_options); │ │ │ │ │ - 425 │ │ │ │ │ - 426 bool childIsCrease = false; │ │ │ │ │ - 427 if (parentRule == Crease::RULE_CREASE) { │ │ │ │ │ - 428 // Child unknown as default value but parent Rule specified as Crease │ │ │ │ │ - 429 childIsCrease = true; │ │ │ │ │ - 430 } else if (edge.GetSharpness() >= 1.0f) { │ │ │ │ │ - 431 // Sharpness >= 1.0 always a crease -- see note above │ │ │ │ │ - 432 childIsCrease = true; │ │ │ │ │ - 433 } else if (crease.IsUniform()) { │ │ │ │ │ - 434 // Sharpness < 1.0 is guaranteed to decay to 0.0 for Uniform child edges │ │ │ │ │ - 435 childIsCrease = false; │ │ │ │ │ - 436 } else { │ │ │ │ │ - 437 // Sharpness <= 1.0 does not necessarily decay to 0.0 for both child │ │ │ │ │ -edges... │ │ │ │ │ - 438 float cEdgeSharpness[2]; │ │ │ │ │ - 439 edge.GetChildSharpnesses(crease, cEdgeSharpness); │ │ │ │ │ - 440 childIsCrease = (cEdgeSharpness[0] > 0.0f) && (cEdgeSharpness[1] > 0.0f); │ │ │ │ │ - 441 } │ │ │ │ │ - 442 if (childIsCrease) { │ │ │ │ │ - 443 assignCreaseMaskForEdge(edge, mask); │ │ │ │ │ - 444 return; │ │ │ │ │ - 445 } │ │ │ │ │ - 446 } │ │ │ │ │ - 447 │ │ │ │ │ - 448 // │ │ │ │ │ - 449 // We are now left with the Crease-to-Smooth case -- compute the Smooth │ │ │ │ │ -mask │ │ │ │ │ - 450 // for the child and augment it with the transitional Crease of the │ │ │ │ │ -parent. │ │ │ │ │ - 451 // │ │ │ │ │ - 452 // A general combination of separately assigned masks here (as done in the │ │ │ │ │ -vertex- │ │ │ │ │ - 453 // vertex case) is overkill -- trivially combine the 0.5f vertex │ │ │ │ │ -coefficient for │ │ │ │ │ - 454 // the Crease of the parent with the vertex weights and attenuate the face │ │ │ │ │ -weights │ │ │ │ │ - 455 // accordingly. │ │ │ │ │ - 456 // │ │ │ │ │ - 457 assignSmoothMaskForEdge(edge, mask); │ │ │ │ │ - 458 │ │ │ │ │ - 459 typedef typename MASK::Weight Weight; │ │ │ │ │ - 460 │ │ │ │ │ - 461 Weight pWeight = edge.GetSharpness(); │ │ │ │ │ - 462 Weight cWeight = 1.0f - pWeight; │ │ │ │ │ - 463 │ │ │ │ │ - 464 mask.VertexWeight(0) = pWeight * 0.5f + cWeight * mask.VertexWeight(0); │ │ │ │ │ - 465 mask.VertexWeight(1) = pWeight * 0.5f + cWeight * mask.VertexWeight(1); │ │ │ │ │ - 466 │ │ │ │ │ - 467 int faceCount = mask.GetNumFaceWeights(); │ │ │ │ │ - 468 for (int i = 0; i < faceCount; ++i) { │ │ │ │ │ - 469 mask.FaceWeight(i) *= cWeight; │ │ │ │ │ - 470 } │ │ │ │ │ - 471} │ │ │ │ │ - 472 │ │ │ │ │ - 473// │ │ │ │ │ - 474// The computation of a vertex-vertex mask requires inspection of creasing │ │ │ │ │ -sharpness values │ │ │ │ │ - 475// to determine what subdivision Rules apply to the parent and its child │ │ │ │ │ -vertex, and also to │ │ │ │ │ - 476// detect and apply a transition between two differing Rules. Using the │ │ │ │ │ -protected methods to │ │ │ │ │ - 477// assign specific masks, this implementation should serve all non-linear │ │ │ │ │ -schemes (currently │ │ │ │ │ - 478// Catmark and Loop) and only needs to be specialized for Bilinear to │ │ │ │ │ -remove all unnecessary │ │ │ │ │ - 479// complexity relating to creasing, Rules, etc. │ │ │ │ │ - 480// │ │ │ │ │ - 481// The implementation here is slightly complicated by combining two │ │ │ │ │ -scenarios into one -- │ │ │ │ │ - 482// either the caller knows the parent and child rules and provides them, or │ │ │ │ │ -they don't and │ │ │ │ │ - 483// the Rules have to be determined from sharpness values. Even when the │ │ │ │ │ -Rules are known and │ │ │ │ │ - 484// provided though, there are cases where the parent and child sharpness │ │ │ │ │ -values need to be │ │ │ │ │ - 485// identified, so accounting for the unknown Rules too is not much of an │ │ │ │ │ -added complication. │ │ │ │ │ - 486// │ │ │ │ │ - 487// The benefit of supporting specified Rules is that they can often be │ │ │ │ │ -trivially │ │ │ │ │ - 488// determined from context (e.g. a vertex derived from a face at a previous │ │ │ │ │ -level will always │ │ │ │ │ - 489// be smooth) rather than more generally, and at greater cost, inspecting │ │ │ │ │ -neighboring and │ │ │ │ │ - 490// they are often the same for parent and child. │ │ │ │ │ - 491// │ │ │ │ │ - 492// The overall process is as follows: │ │ │ │ │ - 493// │ │ │ │ │ - 494// - quickly detect the most common Smooth case when specified and return │ │ │ │ │ - 495// - determine if sharpness for parent is required and gather if so │ │ │ │ │ - 496// - if unspecified, determine the parent rule │ │ │ │ │ - 497// - assign mask for the parent rule -- returning if Smooth/Dart │ │ │ │ │ - 498// - return if child rule matches parent │ │ │ │ │ - 499// - gather sharpness for child to determine or combine child rule │ │ │ │ │ - 500// - if unspecified, determine the child rule, returning if it matches │ │ │ │ │ -parent │ │ │ │ │ - 501// - assign local mask for child rule │ │ │ │ │ - 502// - combine local child mask with the parent mask │ │ │ │ │ - 503// │ │ │ │ │ - 504// Remember -- if the parent rule is specified but the child is not, this │ │ │ │ │ -implies only one │ │ │ │ │ - 505// of the two optional rules was specified and is meant to indicate there │ │ │ │ │ -is no transition, │ │ │ │ │ - 506// so the child rule should be assigned to be the same (wish the compiler │ │ │ │ │ -would allow this │ │ │ │ │ - 507// in default value assignment). │ │ │ │ │ - 508// │ │ │ │ │ - 509template │ │ │ │ │ - 510template │ │ │ │ │ - 511void │ │ │ │ │ -512Scheme::ComputeVertexVertexMask(VERTEX const& vertex, │ │ │ │ │ - 513 MASK& mask, │ │ │ │ │ - 514 Crease::Rule pRule, │ │ │ │ │ - 515 Crease::Rule cRule) const { │ │ │ │ │ - 516 │ │ │ │ │ - 517 // Quick assignment and return for the most common case: │ │ │ │ │ - 518 if ((pRule == Crease::RULE_SMOOTH) || (pRule == Crease::RULE_DART)) { │ │ │ │ │ - 519 assignSmoothMaskForVertex(vertex, mask); │ │ │ │ │ - 520 return; │ │ │ │ │ - 521 } │ │ │ │ │ - 522 // If unspecified, assign the child rule to match the parent rule if │ │ │ │ │ -specified: │ │ │ │ │ - 523 if ((cRule == Crease::RULE_UNKNOWN) && (pRule != Crease::RULE_UNKNOWN)) { │ │ │ │ │ - 524 cRule = pRule; │ │ │ │ │ - 525 } │ │ │ │ │ - 526 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 527 │ │ │ │ │ - 528 // │ │ │ │ │ - 529 // Determine if we need the parent edge sharpness values -- identify/ │ │ │ │ │ -gather if so │ │ │ │ │ - 530 // and use it to compute the parent rule if unspecified: │ │ │ │ │ - 531 // │ │ │ │ │ - 532 float * pEdgeSharpnessBuffer = (float *)alloca(valence*sizeof(float)), │ │ │ │ │ - 533 * pEdgeSharpness = 0, │ │ │ │ │ - 534 pVertexSharpness = 0.0f; │ │ │ │ │ - 535 │ │ │ │ │ - 536 bool requireParentSharpness = (pRule == Crease::RULE_UNKNOWN) || │ │ │ │ │ - 537 (pRule == Crease::RULE_CREASE) || │ │ │ │ │ - 538 (pRule != cRule); │ │ │ │ │ - 539 if (requireParentSharpness) { │ │ │ │ │ - 540 pVertexSharpness = vertex.GetSharpness(); │ │ │ │ │ - 541 pEdgeSharpness = vertex.GetSharpnessPerEdge(pEdgeSharpnessBuffer); │ │ │ │ │ - 542 │ │ │ │ │ - 543 if (pRule == Crease::RULE_UNKNOWN) { │ │ │ │ │ - 544 pRule = Crease(_options).DetermineVertexVertexRule(pVertexSharpness, │ │ │ │ │ -valence, pEdgeSharpness); │ │ │ │ │ - 545 } │ │ │ │ │ - 546 } │ │ │ │ │ - 547 if ((pRule == Crease::RULE_SMOOTH) || (pRule == Crease::RULE_DART)) { │ │ │ │ │ - 548 assignSmoothMaskForVertex(vertex, mask); │ │ │ │ │ - 549 return; // As done on entry, we can return immediately if parent is │ │ │ │ │ -Smooth/Dart │ │ │ │ │ - 550 } else if (pRule == Crease::RULE_CREASE) { │ │ │ │ │ - 551 int creaseEnds[2]; │ │ │ │ │ - 552 Crease(_options).GetSharpEdgePairOfCrease(pEdgeSharpness, valence, │ │ │ │ │ -creaseEnds); │ │ │ │ │ - 553 │ │ │ │ │ - 554 assignCreaseMaskForVertex(vertex, mask, creaseEnds); │ │ │ │ │ - 555 } else { │ │ │ │ │ - 556 assignCornerMaskForVertex(vertex, mask); │ │ │ │ │ - 557 } │ │ │ │ │ - 558 if (cRule == pRule) return; │ │ │ │ │ - 559 │ │ │ │ │ - 560 // │ │ │ │ │ - 561 // Identify/gather child sharpness to combine masks for the two differing │ │ │ │ │ -Rules: │ │ │ │ │ - 562 // │ │ │ │ │ - 563 Crease crease(_options); │ │ │ │ │ - 564 │ │ │ │ │ - 565 float * cEdgeSharpnessBuffer = (float *)alloca(valence*sizeof(float)), │ │ │ │ │ - 566 * cEdgeSharpness = vertex.GetChildSharpnessPerEdge(crease, │ │ │ │ │ -cEdgeSharpnessBuffer), │ │ │ │ │ - 567 cVertexSharpness = vertex.GetChildSharpness(crease); │ │ │ │ │ - 568 │ │ │ │ │ - 569 if (cRule == Crease::RULE_UNKNOWN) { │ │ │ │ │ - 570 cRule = crease.DetermineVertexVertexRule(cVertexSharpness, valence, │ │ │ │ │ -cEdgeSharpness); │ │ │ │ │ - 571 if (cRule == pRule) return; │ │ │ │ │ - 572 } │ │ │ │ │ - 573 │ │ │ │ │ - 574 // │ │ │ │ │ - 575 // Initialize a local child mask, compute the fractional weight from │ │ │ │ │ -parent and child │ │ │ │ │ - 576 // sharpness values and combine the two masks: │ │ │ │ │ - 577 // │ │ │ │ │ - 578 typedef typename MASK::Weight Weight; │ │ │ │ │ - 579 │ │ │ │ │ - 580 Weight * cMaskWeights = (Weight *)alloca((1 + 2 * valence)*sizeof │ │ │ │ │ -(Weight)); │ │ │ │ │ - 581 LocalMask cMask(cMaskWeights, cMaskWeights + 1, cMaskWeights + 1 + │ │ │ │ │ -valence); │ │ │ │ │ - 582 │ │ │ │ │ - 583 if ((cRule == Crease::RULE_SMOOTH) || (cRule == Crease::RULE_DART)) { │ │ │ │ │ - 584 assignSmoothMaskForVertex(vertex, cMask); │ │ │ │ │ - 585 } else if (cRule == Crease::RULE_CREASE) { │ │ │ │ │ - 586 int creaseEnds[2]; │ │ │ │ │ - 587 Crease(_options).GetSharpEdgePairOfCrease(cEdgeSharpness, valence, │ │ │ │ │ -creaseEnds); │ │ │ │ │ - 588 │ │ │ │ │ - 589 assignCreaseMaskForVertex(vertex, cMask, creaseEnds); │ │ │ │ │ - 590 } else { │ │ │ │ │ - 591 assignCornerMaskForVertex(vertex, cMask); │ │ │ │ │ - 592 } │ │ │ │ │ - 593 │ │ │ │ │ - 594 Weight pWeight = crease.ComputeFractionalWeightAtVertex(pVertexSharpness, │ │ │ │ │ -cVertexSharpness, │ │ │ │ │ - 595 valence, pEdgeSharpness, cEdgeSharpness); │ │ │ │ │ - 596 Weight cWeight = 1.0f - pWeight; │ │ │ │ │ - 597 │ │ │ │ │ - 598 cMask.CombineVertexVertexMasks(cWeight, pWeight, mask); │ │ │ │ │ - 599} │ │ │ │ │ - 600 │ │ │ │ │ - 601// │ │ │ │ │ - 602// The computation of limit masks for vertices: │ │ │ │ │ - 603// │ │ │ │ │ - 604template │ │ │ │ │ - 605template │ │ │ │ │ - 606void │ │ │ │ │ -607Scheme::ComputeVertexLimitMask(VERTEX const& vertex, │ │ │ │ │ - 608 MASK& mask, │ │ │ │ │ - 609 Crease::Rule rule) const { │ │ │ │ │ - 610 │ │ │ │ │ - 611 if ((rule == Crease::RULE_SMOOTH) || (rule == Crease::RULE_DART)) { │ │ │ │ │ - 612 assignSmoothLimitMask(vertex, mask); │ │ │ │ │ - 613 } else if (rule == Crease::RULE_CREASE) { │ │ │ │ │ - 614 float * edgeSharpness = (float *)alloca(vertex.GetNumEdges() * sizeof │ │ │ │ │ -(float)); │ │ │ │ │ - 615 vertex.GetSharpnessPerEdge(edgeSharpness); │ │ │ │ │ - 616 │ │ │ │ │ - 617 int creaseEnds[2]; │ │ │ │ │ - 618 Crease(_options).GetSharpEdgePairOfCrease(edgeSharpness, │ │ │ │ │ -vertex.GetNumEdges(), creaseEnds); │ │ │ │ │ - 619 │ │ │ │ │ - 620 assignCreaseLimitMask(vertex, mask, creaseEnds); │ │ │ │ │ - 621 } else { │ │ │ │ │ - 622 assignCornerLimitMask(vertex, mask); │ │ │ │ │ - 623 } │ │ │ │ │ - 624} │ │ │ │ │ - 625 │ │ │ │ │ - 626template │ │ │ │ │ - 627template │ │ │ │ │ - 628void │ │ │ │ │ -629Scheme::ComputeVertexLimitMask(VERTEX const& vertex, │ │ │ │ │ - 630 MASK& posMask, │ │ │ │ │ - 631 MASK& tan1Mask, │ │ │ │ │ - 632 MASK& tan2Mask, │ │ │ │ │ - 633 Crease::Rule rule) const { │ │ │ │ │ - 634 │ │ │ │ │ - 635 if ((rule == Crease::RULE_SMOOTH) || (rule == Crease::RULE_DART)) { │ │ │ │ │ - 636 assignSmoothLimitMask(vertex, posMask); │ │ │ │ │ - 637 assignSmoothLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ - 638 } else if (rule == Crease::RULE_CREASE) { │ │ │ │ │ - 639 float * edgeSharpness = (float *)alloca(vertex.GetNumEdges() * sizeof │ │ │ │ │ -(float)); │ │ │ │ │ - 640 vertex.GetSharpnessPerEdge(edgeSharpness); │ │ │ │ │ - 641 │ │ │ │ │ - 642 int creaseEnds[2]; │ │ │ │ │ - 643 Crease(_options).GetSharpEdgePairOfCrease(edgeSharpness, │ │ │ │ │ -vertex.GetNumEdges(), creaseEnds); │ │ │ │ │ - 644 │ │ │ │ │ - 645 assignCreaseLimitMask(vertex, posMask, creaseEnds); │ │ │ │ │ - 646 assignCreaseLimitTangentMasks(vertex, tan1Mask, tan2Mask, creaseEnds); │ │ │ │ │ - 647 } else { │ │ │ │ │ - 648 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ - 649 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ - 650 } │ │ │ │ │ - 651} │ │ │ │ │ - 652 │ │ │ │ │ - 653 │ │ │ │ │ - 654} // end namespace sdc │ │ │ │ │ - 655 │ │ │ │ │ - 656} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 657using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 658} // end namespace OpenSubdiv │ │ │ │ │ - 659 │ │ │ │ │ - 660#endif /* OPENSUBDIV3_SDC_SCHEME_H */ │ │ │ │ │ +284 static bool EvalStencils( │ │ │ │ │ + 285 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 286 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 287 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 288 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 289 const int * sizes, │ │ │ │ │ + 290 const int * offsets, │ │ │ │ │ + 291 const int * indices, │ │ │ │ │ + 292 const float * weights, │ │ │ │ │ + 293 const float * duWeights, │ │ │ │ │ + 294 const float * dvWeights, │ │ │ │ │ + 295 int start, int end); │ │ │ │ │ + 296 │ │ │ │ │ + 352 template │ │ │ │ │ +353 static bool EvalStencils( │ │ │ │ │ + 354 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 355 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 356 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 357 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 358 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 359 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 360 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 361 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 362 const CudaEvaluator *instance = NULL, │ │ │ │ │ + 363 void * deviceContext = NULL) { │ │ │ │ │ + 364 │ │ │ │ │ + 365 (void)instance; // unused │ │ │ │ │ + 366 (void)deviceContext; // unused │ │ │ │ │ + 367 │ │ │ │ │ + 368 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 369 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 370 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 371 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 372 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ + 373 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ + 374 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ + 375 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ + 376 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 377 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 378 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 379 (float const *)stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 380 (float const *)stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 381 (float const *)stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ + 382 (float const *)stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ + 383 (float const *)stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ + 384 /*start = */ 0, │ │ │ │ │ + 385 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 386 } │ │ │ │ │ + 387 │ │ │ │ │ +449 static bool EvalStencils( │ │ │ │ │ + 450 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 451 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 452 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 453 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 454 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 455 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 456 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 457 const int * sizes, │ │ │ │ │ + 458 const int * offsets, │ │ │ │ │ + 459 const int * indices, │ │ │ │ │ + 460 const float * weights, │ │ │ │ │ + 461 const float * duWeights, │ │ │ │ │ + 462 const float * dvWeights, │ │ │ │ │ + 463 const float * duuWeights, │ │ │ │ │ + 464 const float * duvWeights, │ │ │ │ │ + 465 const float * dvvWeights, │ │ │ │ │ + 466 int start, int end); │ │ │ │ │ + 467 │ │ │ │ │ + 473 │ │ │ │ │ + 502 template │ │ │ │ │ +504 static bool EvalPatches( │ │ │ │ │ + 505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 507 int numPatchCoords, │ │ │ │ │ + 508 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 509 PATCH_TABLE *patchTable, │ │ │ │ │ + 510 CudaEvaluator const *instance, │ │ │ │ │ + 511 void * deviceContext = NULL) { │ │ │ │ │ + 512 │ │ │ │ │ + 513 (void)instance; // unused │ │ │ │ │ + 514 (void)deviceContext; // unused │ │ │ │ │ + 515 │ │ │ │ │ + 516 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 517 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 518 numPatchCoords, │ │ │ │ │ + 519 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 520 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 521 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 522 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 523 } │ │ │ │ │ + 524 │ │ │ │ │ + 563 template │ │ │ │ │ +565 static bool EvalPatches( │ │ │ │ │ + 566 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 567 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 568 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 569 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 570 int numPatchCoords, │ │ │ │ │ + 571 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 572 PATCH_TABLE *patchTable, │ │ │ │ │ + 573 CudaEvaluator const *instance, │ │ │ │ │ + 574 void * deviceContext = NULL) { │ │ │ │ │ + 575 │ │ │ │ │ + 576 (void)instance; // unused │ │ │ │ │ + 577 (void)deviceContext; // unused │ │ │ │ │ + 578 │ │ │ │ │ + 579 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 580 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 581 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 582 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 583 numPatchCoords, │ │ │ │ │ + 584 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 585 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 586 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 587 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 588 } │ │ │ │ │ + 589 │ │ │ │ │ + 646 template │ │ │ │ │ +648 static bool EvalPatches( │ │ │ │ │ + 649 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 650 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 651 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 652 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 653 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 654 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 655 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 656 int numPatchCoords, │ │ │ │ │ + 657 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 658 PATCH_TABLE *patchTable, │ │ │ │ │ + 659 CudaEvaluator const *instance, │ │ │ │ │ + 660 void * deviceContext = NULL) { │ │ │ │ │ + 661 │ │ │ │ │ + 662 (void)instance; // unused │ │ │ │ │ + 663 (void)deviceContext; // unused │ │ │ │ │ + 664 │ │ │ │ │ + 665 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 666 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 667 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 668 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 669 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ + 670 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ + 671 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ + 672 numPatchCoords, │ │ │ │ │ + 673 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 674 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 675 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 676 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 677 } │ │ │ │ │ + 678 │ │ │ │ │ +706 static bool EvalPatches( │ │ │ │ │ + 707 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 708 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 709 int numPatchCoords, │ │ │ │ │ + 710 const PatchCoord *patchCoords, │ │ │ │ │ + 711 const PatchArray *patchArrays, │ │ │ │ │ + 712 const int *patchIndices, │ │ │ │ │ + 713 const PatchParam *patchParams); │ │ │ │ │ + 714 │ │ │ │ │ +752 static bool EvalPatches( │ │ │ │ │ + 753 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 754 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 755 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 756 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 757 int numPatchCoords, │ │ │ │ │ + 758 PatchCoord const *patchCoords, │ │ │ │ │ + 759 PatchArray const *patchArrays, │ │ │ │ │ + 760 const int *patchIndices, │ │ │ │ │ + 761 PatchParam const *patchParams); │ │ │ │ │ + 762 │ │ │ │ │ +815 static bool EvalPatches( │ │ │ │ │ + 816 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 817 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 818 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 819 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 820 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 821 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 822 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 823 int numPatchCoords, │ │ │ │ │ + 824 PatchCoord const *patchCoords, │ │ │ │ │ + 825 PatchArray const *patchArrays, │ │ │ │ │ + 826 const int *patchIndices, │ │ │ │ │ + 827 PatchParam const *patchParams); │ │ │ │ │ + 828 │ │ │ │ │ + 857 template │ │ │ │ │ +859 static bool EvalPatchesVarying( │ │ │ │ │ + 860 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 861 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 862 int numPatchCoords, │ │ │ │ │ + 863 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 864 PATCH_TABLE *patchTable, │ │ │ │ │ + 865 CudaEvaluator const *instance, │ │ │ │ │ + 866 void * deviceContext = NULL) { │ │ │ │ │ + 867 │ │ │ │ │ + 868 (void)instance; // unused │ │ │ │ │ + 869 (void)deviceContext; // unused │ │ │ │ │ + 870 │ │ │ │ │ + 871 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 872 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 873 numPatchCoords, │ │ │ │ │ + 874 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 875 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 876 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 877 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 878 } │ │ │ │ │ + 879 │ │ │ │ │ + 920 template │ │ │ │ │ +922 static bool EvalPatchesVarying( │ │ │ │ │ + 923 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 924 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 925 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 926 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 927 int numPatchCoords, │ │ │ │ │ + 928 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 929 PATCH_TABLE *patchTable, │ │ │ │ │ + 930 CudaEvaluator const *instance, │ │ │ │ │ + 931 void * deviceContext = NULL) { │ │ │ │ │ + 932 │ │ │ │ │ + 933 (void)instance; // unused │ │ │ │ │ + 934 (void)deviceContext; // unused │ │ │ │ │ + 935 │ │ │ │ │ + 936 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 937 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 938 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 939 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 940 numPatchCoords, │ │ │ │ │ + 941 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 942 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 943 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 944 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 945 } │ │ │ │ │ + 946 │ │ │ │ │ + 1005 template │ │ │ │ │ +1007 static bool EvalPatchesVarying( │ │ │ │ │ + 1008 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1009 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1010 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1011 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1012 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1013 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1014 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1015 int numPatchCoords, │ │ │ │ │ + 1016 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1017 PATCH_TABLE *patchTable, │ │ │ │ │ + 1018 CudaEvaluator const *instance, │ │ │ │ │ + 1019 void * deviceContext = NULL) { │ │ │ │ │ + 1020 │ │ │ │ │ + 1021 (void)instance; // unused │ │ │ │ │ + 1022 (void)deviceContext; // unused │ │ │ │ │ + 1023 │ │ │ │ │ + 1024 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 1025 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 1026 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 1027 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 1028 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ + 1029 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ + 1030 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ + 1031 numPatchCoords, │ │ │ │ │ + 1032 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 1033 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 1034 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1035 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1036 } │ │ │ │ │ + 1037 │ │ │ │ │ + 1068 template │ │ │ │ │ +1070 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1073 int numPatchCoords, │ │ │ │ │ + 1074 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1075 PATCH_TABLE *patchTable, │ │ │ │ │ + 1076 int fvarChannel, │ │ │ │ │ + 1077 CudaEvaluator const *instance, │ │ │ │ │ + 1078 void * deviceContext = NULL) { │ │ │ │ │ + 1079 │ │ │ │ │ + 1080 (void)instance; // unused │ │ │ │ │ + 1081 (void)deviceContext; // unused │ │ │ │ │ + 1082 │ │ │ │ │ + 1083 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 1084 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 1085 numPatchCoords, │ │ │ │ │ + 1086 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 1087 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1088 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1089 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1090 } │ │ │ │ │ + 1091 │ │ │ │ │ + 1134 template │ │ │ │ │ +1136 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1137 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1138 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1139 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1140 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1141 int numPatchCoords, │ │ │ │ │ + 1142 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1143 PATCH_TABLE *patchTable, │ │ │ │ │ + 1144 int fvarChannel, │ │ │ │ │ + 1145 CudaEvaluator const *instance, │ │ │ │ │ + 1146 void * deviceContext = NULL) { │ │ │ │ │ + 1147 │ │ │ │ │ + 1148 (void)instance; // unused │ │ │ │ │ + 1149 (void)deviceContext; // unused │ │ │ │ │ + 1150 │ │ │ │ │ + 1151 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 1152 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 1153 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 1154 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 1155 numPatchCoords, │ │ │ │ │ + 1156 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 1157 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1158 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1159 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1160 } │ │ │ │ │ + 1161 │ │ │ │ │ + 1222 template │ │ │ │ │ +1224 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1225 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1226 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1227 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1228 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1229 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1230 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1231 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1232 int numPatchCoords, │ │ │ │ │ + 1233 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1234 PATCH_TABLE *patchTable, │ │ │ │ │ + 1235 int fvarChannel, │ │ │ │ │ + 1236 CudaEvaluator const *instance, │ │ │ │ │ + 1237 void * deviceContext = NULL) { │ │ │ │ │ + 1238 │ │ │ │ │ + 1239 (void)instance; // unused │ │ │ │ │ + 1240 (void)deviceContext; // unused │ │ │ │ │ + 1241 │ │ │ │ │ + 1242 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ + 1243 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ + 1244 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ + 1245 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ + 1246 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ + 1247 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ + 1248 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ + 1249 numPatchCoords, │ │ │ │ │ + 1250 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ + 1251 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1252 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1253 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1254 } │ │ │ │ │ + 1255 │ │ │ │ │ +1261 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ + 1262}; │ │ │ │ │ + 1263 │ │ │ │ │ + 1264 │ │ │ │ │ + 1265} // end namespace Osd │ │ │ │ │ + 1266 │ │ │ │ │ + 1267} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 1268using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 1269 │ │ │ │ │ + 1270} // end namespace OpenSubdiv │ │ │ │ │ + 1271 │ │ │ │ │ + 1272 │ │ │ │ │ + 1273#endif // OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ -Split │ │ │ │ │ -Enumerated type for all face splitting schemes. │ │ │ │ │ -Definition: types.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease │ │ │ │ │ -Types, constants and utilities related to semi-sharp creasing – whose │ │ │ │ │ -implementation is independent o... │ │ │ │ │ -Definition: crease.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule │ │ │ │ │ -Rule │ │ │ │ │ -Definition: crease.h:82 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_DART │ │ │ │ │ -@ RULE_DART │ │ │ │ │ -Definition: crease.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_SMOOTH │ │ │ │ │ -@ RULE_SMOOTH │ │ │ │ │ -Definition: crease.h:84 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_CREASE │ │ │ │ │ -@ RULE_CREASE │ │ │ │ │ -Definition: crease.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_UNKNOWN │ │ │ │ │ -@ RULE_UNKNOWN │ │ │ │ │ -Definition: crease.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::GetSharpEdgePairOfCrease │ │ │ │ │ -void GetSharpEdgePairOfCrease(float const *incidentEdgeSharpness, int │ │ │ │ │ -incidentEdgeCount, int sharpEdgePair[2]) const │ │ │ │ │ -Definition: crease.h:228 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::DetermineVertexVertexRule │ │ │ │ │ -Rule DetermineVertexVertexRule(float vertexSharpness, int incidentEdgeCount, │ │ │ │ │ -float const *incidentEdgeSharpness) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsUniform │ │ │ │ │ -bool IsUniform() const │ │ │ │ │ -Definition: crease.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::ComputeFractionalWeightAtVertex │ │ │ │ │ -float ComputeFractionalWeightAtVertex(float vertexSharpness, float │ │ │ │ │ -childVertexSharpness, int incidentEdgeCount, float const │ │ │ │ │ -*incidentEdgeSharpness, float const *childEdgesSharpness) const │ │ │ │ │ -Transitional weighting: When the rules applicable to a parent vertex and its │ │ │ │ │ -child differ,... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ -All supported options applying to subdivision scheme. │ │ │ │ │ -Definition: options.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme │ │ │ │ │ -Scheme is a class template which provides all implementation for the │ │ │ │ │ -subdivision schemes supported by... │ │ │ │ │ -Definition: scheme.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForEdge │ │ │ │ │ -void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ -static Split GetTopologicalSplitType() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForVertex │ │ │ │ │ -void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeVertexVertexMask │ │ │ │ │ -void ComputeVertexVertexMask(VERTEX const &vertexNeighborhood, MASK │ │ │ │ │ -&vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule │ │ │ │ │ -childRule=Crease::RULE_UNKNOWN) const │ │ │ │ │ -Vertex-vertex masks If known, a single Rule or pair of Rules can be specified │ │ │ │ │ -(indicating a crease tr... │ │ │ │ │ -Definition: scheme.h:512 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeVertexLimitMask │ │ │ │ │ -void ComputeVertexLimitMask(VERTEX const &vertexNeighborhood, MASK │ │ │ │ │ -&positionMask, Crease::Rule vertexRule) const │ │ │ │ │ -Limit masks for vertices – position and tangents These presume that a vertex is │ │ │ │ │ -suitably isolated for... │ │ │ │ │ -Definition: scheme.h:607 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ -void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2, int const creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ -static int GetRegularFaceSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForEdge │ │ │ │ │ -void assignCreaseMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ -Definition: scheme.h:317 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeEdgeVertexMask │ │ │ │ │ -void ComputeEdgeVertexMask(EDGE const &edgeNeighborhood, MASK &edgeVertexMask, │ │ │ │ │ -Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease:: │ │ │ │ │ -RULE_UNKNOWN) const │ │ │ │ │ -Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can │ │ │ │ │ -be specified to accel... │ │ │ │ │ -Definition: scheme.h:392 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::Scheme │ │ │ │ │ -Scheme() │ │ │ │ │ -Definition: scheme.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ -void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ -static int GetLocalNeighborhoodSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerMaskForVertex │ │ │ │ │ -void assignCornerMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ -Definition: scheme.h:331 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ -void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForVertex │ │ │ │ │ -void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ -static int GetRegularVertexValence() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetOptions │ │ │ │ │ -Options GetOptions() const │ │ │ │ │ -Definition: scheme.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ -void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ -void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::Scheme │ │ │ │ │ -Scheme(Options const &options) │ │ │ │ │ -Definition: scheme.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeFaceVertexMask │ │ │ │ │ -void ComputeFaceVertexMask(FACE const &faceNeighborhood, MASK &faceVertexMask) │ │ │ │ │ -const │ │ │ │ │ -Face-vertex masks - trivial for all current schemes. │ │ │ │ │ -Definition: scheme.h:348 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ -void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::SetOptions │ │ │ │ │ -void SetOptions(const Options &newOptions) │ │ │ │ │ -Definition: scheme.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask │ │ │ │ │ -Definition: scheme.h:209 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::Weight │ │ │ │ │ -WEIGHT Weight │ │ │ │ │ -Definition: scheme.h:212 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask:: │ │ │ │ │ -AreFaceWeightsForFaceCenters │ │ │ │ │ -bool AreFaceWeightsForFaceCenters() const │ │ │ │ │ -Definition: scheme.h:239 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::SetNumEdgeWeights │ │ │ │ │ -void SetNumEdgeWeights(int count) │ │ │ │ │ -Definition: scheme.h:228 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::EdgeWeight │ │ │ │ │ -Weight const & EdgeWeight(int index) const │ │ │ │ │ -Definition: scheme.h:232 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::EdgeWeight │ │ │ │ │ -Weight & EdgeWeight(int index) │ │ │ │ │ -Definition: scheme.h:236 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask:: │ │ │ │ │ -CombineVertexVertexMasks │ │ │ │ │ -void CombineVertexVertexMasks(Weight thisCoeff, Weight dstCoeff, USER_MASK │ │ │ │ │ -&dst) const │ │ │ │ │ -Definition: scheme.h:249 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::GetNumVertexWeights │ │ │ │ │ -int GetNumVertexWeights() const │ │ │ │ │ -Definition: scheme.h:223 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::SetNumFaceWeights │ │ │ │ │ -void SetNumFaceWeights(int count) │ │ │ │ │ -Definition: scheme.h:229 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::FaceWeight │ │ │ │ │ -Weight const & FaceWeight(int index) const │ │ │ │ │ -Definition: scheme.h:233 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::GetNumEdgeWeights │ │ │ │ │ -int GetNumEdgeWeights() const │ │ │ │ │ -Definition: scheme.h:224 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::VertexWeight │ │ │ │ │ -Weight & VertexWeight(int index) │ │ │ │ │ -Definition: scheme.h:235 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::GetNumFaceWeights │ │ │ │ │ -int GetNumFaceWeights() const │ │ │ │ │ -Definition: scheme.h:225 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask:: │ │ │ │ │ -SetFaceWeightsForFaceCenters │ │ │ │ │ -void SetFaceWeightsForFaceCenters(bool on) │ │ │ │ │ -Definition: scheme.h:240 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::SetNumVertexWeights │ │ │ │ │ -void SetNumVertexWeights(int count) │ │ │ │ │ -Definition: scheme.h:227 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::LocalMask │ │ │ │ │ -LocalMask(Weight *v, Weight *e, Weight *f) │ │ │ │ │ -Definition: scheme.h:215 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::VertexWeight │ │ │ │ │ -Weight const & VertexWeight(int index) const │ │ │ │ │ -Definition: scheme.h:231 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::FaceWeight │ │ │ │ │ -Weight & FaceWeight(int index) │ │ │ │ │ -Definition: scheme.h:237 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::LocalMask::~LocalMask │ │ │ │ │ -~LocalMask() │ │ │ │ │ -Definition: scheme.h:216 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ +Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:583 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable │ │ │ │ │ +CUDA stencil table. │ │ │ │ │ +Definition: cudaEvaluator.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuvWeightsBuffer │ │ │ │ │ +void * GetDuvWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::~CudaStencilTable │ │ │ │ │ +~CudaStencilTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuWeightsBuffer │ │ │ │ │ +void * GetDuWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDvvWeightsBuffer │ │ │ │ │ +void * GetDvvWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetOffsetsBuffer │ │ │ │ │ +void * GetOffsetsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::CudaStencilTable │ │ │ │ │ +CudaStencilTable(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDvWeightsBuffer │ │ │ │ │ +void * GetDvWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Definition: cudaEvaluator.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuuWeightsBuffer │ │ │ │ │ +void * GetDuuWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetWeightsBuffer │ │ │ │ │ +void * GetWeightsBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::Create │ │ │ │ │ +static CudaStencilTable * Create(Far::LimitStencilTable const │ │ │ │ │ +*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ +Definition: cudaEvaluator.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetSizesBuffer │ │ │ │ │ +void * GetSizesBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetIndicesBuffer │ │ │ │ │ +void * GetIndicesBuffer() const │ │ │ │ │ +Definition: cudaEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::CudaStencilTable │ │ │ │ │ +CudaStencilTable(Far::StencilTable const *stencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::Create │ │ │ │ │ +static CudaStencilTable * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Definition: cudaEvaluator.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator │ │ │ │ │ +Definition: cudaEvaluator.h:94 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ +PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ +*patchIndices, const PatchParam *patchParams) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:922 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: cudaEvaluator.h:648 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +const CudaEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: cudaEvaluator.h:353 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ +Static eval stencils function which takes raw cuda buffers for input and │ │ │ │ │ +output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:859 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ +CudaEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: cudaEvaluator.h:218 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ +const *patchCoords, PatchArray const *patchArrays, const int *patchIndices, │ │ │ │ │ +PatchParam const *patchParams) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CudaEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:1136 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, const void *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static compute function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: cudaEvaluator.h:126 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw cuda pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ +float *dvvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw cuda pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ +PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ +*patchIndices, PatchParam const *patchParams) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:1007 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:504 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:1224 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: cudaEvaluator.h:565 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cudaEvaluator.h:1070 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ +Coordinates set on a patch table. │ │ │ │ │ +Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ +Definition: types.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ +Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * scheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * cudaEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00776.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/crease.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/opencl.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,44 +80,24 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -
crease.h File Reference
│ │ │ │ +
opencl.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include "../version.h"
│ │ │ │ -#include "../sdc/options.h"
│ │ │ │ +
#include <CL/opencl.h>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Crease
 Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme. More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,28 +4,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -crease.h File Reference │ │ │ │ │ -#include "../version.h" │ │ │ │ │ -#include "../sdc/options.h" │ │ │ │ │ +opencl.h File Reference │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  Crease │ │ │ │ │ -  Types, constants and utilities related to semi-sharp creasing – whose │ │ │ │ │ - implementation is independent of the subdivision scheme. More... │ │ │ │ │ -  │ │ │ │ │ - Namespaces │ │ │ │ │ -namespace  OpenSubdiv │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ -  │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * crease.h │ │ │ │ │ + * osd │ │ │ │ │ + * opencl.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00776_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/crease.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/opencl.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
crease.h
│ │ │ │ +
opencl.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2014 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,205 +106,33 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_SDC_CREASE_H
│ │ │ │ -
25#define OPENSUBDIV3_SDC_CREASE_H
│ │ │ │ -
26
│ │ │ │ -
27#include "../version.h"
│ │ │ │ -
28
│ │ │ │ -
29#include "../sdc/options.h"
│ │ │ │ -
30
│ │ │ │ -
31namespace OpenSubdiv {
│ │ │ │ -
32namespace OPENSUBDIV_VERSION {
│ │ │ │ -
33
│ │ │ │ -
34namespace Sdc {
│ │ │ │ -
35
│ │ │ │ -
61
│ │ │ │ -
62class Crease {
│ │ │ │ -
63public:
│ │ │ │ -
65
│ │ │ │ -
67 static float const SHARPNESS_SMOOTH; // = 0.0f, do we really need this?
│ │ │ │ -
68 static float const SHARPNESS_INFINITE; // = 10.0f;
│ │ │ │ -
69
│ │ │ │ -
70 static bool IsSmooth(float sharpness) { return sharpness <= SHARPNESS_SMOOTH; }
│ │ │ │ -
71 static bool IsSharp(float sharpness) { return sharpness > SHARPNESS_SMOOTH; }
│ │ │ │ -
72 static bool IsInfinite(float sharpness) { return sharpness >= SHARPNESS_INFINITE; }
│ │ │ │ -
73 static bool IsSemiSharp(float sharpness) { return (SHARPNESS_SMOOTH < sharpness) && (sharpness < SHARPNESS_INFINITE); }
│ │ │ │ -
75
│ │ │ │ -
82 enum Rule {
│ │ │ │ - │ │ │ │ -
84 RULE_SMOOTH = (1 << 0),
│ │ │ │ -
85 RULE_DART = (1 << 1),
│ │ │ │ -
86 RULE_CREASE = (1 << 2),
│ │ │ │ -
87 RULE_CORNER = (1 << 3)
│ │ │ │ -
88 };
│ │ │ │ -
89
│ │ │ │ -
90public:
│ │ │ │ -
91 Crease() : _options() { }
│ │ │ │ -
92 Crease(Options const& options) : _options(options) { }
│ │ │ │ -
93 ~Crease() { }
│ │ │ │ -
94
│ │ │ │ -
95 bool IsUniform() const { return _options.GetCreasingMethod() == Options::CREASE_UNIFORM; }
│ │ │ │ -
96
│ │ │ │ -
98
│ │ │ │ -
104 float SharpenBoundaryEdge(float edgeSharpness) const;
│ │ │ │ -
105 float SharpenBoundaryVertex(float edgeSharpness) const;
│ │ │ │ -
106
│ │ │ │ -
107 // For future consideration
│ │ │ │ -
108 //float SharpenNonManifoldEdge(float edgeSharpness) const;
│ │ │ │ -
109 //float SharpenNonManifoldVertex(float edgeSharpness) const;
│ │ │ │ -
111
│ │ │ │ -
113
│ │ │ │ -
124 float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const;
│ │ │ │ -
125
│ │ │ │ -
126 float SubdivideVertexSharpness(float vertexSharpness) const;
│ │ │ │ -
127
│ │ │ │ -
128 float SubdivideEdgeSharpnessAtVertex(float edgeSharpness,
│ │ │ │ -
129 int incidentEdgeCountAtEndVertex,
│ │ │ │ -
130 float const* edgeSharpnessAroundEndVertex) const;
│ │ │ │ -
131
│ │ │ │ -
132 void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex,
│ │ │ │ -
133 float const* incidentEdgeSharpnessAroundVertex,
│ │ │ │ -
134 float* childEdgesSharpnessAroundVertex) const;
│ │ │ │ -
136
│ │ │ │ -
138
│ │ │ │ -
144 Rule DetermineVertexVertexRule(float vertexSharpness,
│ │ │ │ -
145 int incidentEdgeCount,
│ │ │ │ -
146 float const* incidentEdgeSharpness) const;
│ │ │ │ -
147 Rule DetermineVertexVertexRule(float vertexSharpness,
│ │ │ │ -
148 int sharpEdgeCount) const;
│ │ │ │ -
150
│ │ │ │ -
162 float ComputeFractionalWeightAtVertex(float vertexSharpness,
│ │ │ │ -
163 float childVertexSharpness,
│ │ │ │ -
164 int incidentEdgeCount,
│ │ │ │ -
165 float const* incidentEdgeSharpness,
│ │ │ │ -
166 float const* childEdgesSharpness) const;
│ │ │ │ -
167
│ │ │ │ -
168 void GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness,
│ │ │ │ -
169 int incidentEdgeCount,
│ │ │ │ -
170 int sharpEdgePair[2]) const;
│ │ │ │ -
171
│ │ │ │ -
172 // Would these really help? Maybe only need Rules for the vertex-vertex case...
│ │ │ │ -
173 //
│ │ │ │ -
174 // Rule DetermineEdgeVertexRule(float parentEdgeSharpness) const;
│ │ │ │ -
175 // Rule DetermineEdgeVertexRule(float childEdge1Sharpness, float childEdge2Sharpness) const;
│ │ │ │ -
176
│ │ │ │ -
177protected:
│ │ │ │ -
178 float decrementSharpness(float sharpness) const;
│ │ │ │ -
179
│ │ │ │ -
180private:
│ │ │ │ -
181 Options _options;
│ │ │ │ -
182};
│ │ │ │ -
183
│ │ │ │ -
184
│ │ │ │ -
185//
│ │ │ │ -
186// Inline declarations:
│ │ │ │ -
187//
│ │ │ │ -
188inline float
│ │ │ │ -
189Crease::SharpenBoundaryEdge(float /* edgeSharpness */) const {
│ │ │ │ -
190
│ │ │ │ -
191 //
│ │ │ │ -
192 // Despite the presence of the BOUNDARY_NONE option, boundary edges are always sharpened.
│ │ │ │ -
193 // Much of the code relies on sharpness to indicate boundaries to avoid the more complex
│ │ │ │ -
194 // topological inspection
│ │ │ │ -
195 //
│ │ │ │ -
196 return SHARPNESS_INFINITE;
│ │ │ │ -
197}
│ │ │ │ -
198
│ │ │ │ -
199inline float
│ │ │ │ -
200Crease::SharpenBoundaryVertex(float vertexSharpness) const {
│ │ │ │ -
201
│ │ │ │ - │ │ │ │ -
203 SHARPNESS_INFINITE : vertexSharpness;
│ │ │ │ -
204}
│ │ │ │ -
205
│ │ │ │ -
206inline float
│ │ │ │ -
207Crease::decrementSharpness(float sharpness) const {
│ │ │ │ -
208
│ │ │ │ -
209 if (IsSmooth(sharpness)) return Crease::SHARPNESS_SMOOTH; // redundant but most common
│ │ │ │ -
210 if (IsInfinite(sharpness)) return Crease::SHARPNESS_INFINITE;
│ │ │ │ -
211 if (sharpness > 1.0f) return (sharpness - 1.0f);
│ │ │ │ - │ │ │ │ -
213}
│ │ │ │ -
214
│ │ │ │ -
215inline float
│ │ │ │ -
216Crease::SubdivideUniformSharpness(float vertexOrEdgeSharpness) const {
│ │ │ │ -
217
│ │ │ │ -
218 return decrementSharpness(vertexOrEdgeSharpness);
│ │ │ │ -
219}
│ │ │ │ -
220
│ │ │ │ -
221inline float
│ │ │ │ -
222Crease::SubdivideVertexSharpness(float vertexSharpness) const {
│ │ │ │ -
223
│ │ │ │ -
224 return decrementSharpness(vertexSharpness);
│ │ │ │ -
225}
│ │ │ │ -
226
│ │ │ │ -
227inline void
│ │ │ │ -
228Crease::GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, int incidentEdgeCount,
│ │ │ │ -
229 int sharpEdgePair[2]) const {
│ │ │ │ -
230
│ │ │ │ -
231 // Only to be called when a crease is present at a vertex -- exactly two sharp
│ │ │ │ -
232 // edges are expected here:
│ │ │ │ -
233 //
│ │ │ │ -
234 sharpEdgePair[0] = 0;
│ │ │ │ -
235 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[0]])) ++ sharpEdgePair[0];
│ │ │ │ -
236
│ │ │ │ -
237 sharpEdgePair[1] = incidentEdgeCount - 1;
│ │ │ │ -
238 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[1]])) -- sharpEdgePair[1];
│ │ │ │ -
239}
│ │ │ │ -
240
│ │ │ │ -
241} // end namespace sdc
│ │ │ │ -
242
│ │ │ │ -
243} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
244using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
245} // end namespace OpenSubdiv
│ │ │ │ -
246
│ │ │ │ -
247#endif /* OPENSUBDIV3_SDC_CREASE_H */
│ │ │ │ - │ │ │ │ -
Types, constants and utilities related to semi-sharp creasing – whose implementation is independent o...
Definition: crease.h:62
│ │ │ │ -
float SubdivideVertexSharpness(float vertexSharpness) const
Definition: crease.h:222
│ │ │ │ -
static bool IsInfinite(float sharpness)
Definition: crease.h:72
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
float SharpenBoundaryVertex(float edgeSharpness) const
Definition: crease.h:200
│ │ │ │ - │ │ │ │ -
void GetSharpEdgePairOfCrease(float const *incidentEdgeSharpness, int incidentEdgeCount, int sharpEdgePair[2]) const
Definition: crease.h:228
│ │ │ │ - │ │ │ │ -
Rule DetermineVertexVertexRule(float vertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness) const
│ │ │ │ -
float decrementSharpness(float sharpness) const
Definition: crease.h:207
│ │ │ │ -
static bool IsSmooth(float sharpness)
Definition: crease.h:70
│ │ │ │ -
Rule DetermineVertexVertexRule(float vertexSharpness, int sharpEdgeCount) const
│ │ │ │ - │ │ │ │ -
static bool IsSemiSharp(float sharpness)
Definition: crease.h:73
│ │ │ │ -
Crease(Options const &options)
Definition: crease.h:92
│ │ │ │ -
void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, float const *incidentEdgeSharpnessAroundVertex, float *childEdgesSharpnessAroundVertex) const
│ │ │ │ -
float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const
Definition: crease.h:216
│ │ │ │ - │ │ │ │ -
float SharpenBoundaryEdge(float edgeSharpness) const
Definition: crease.h:189
│ │ │ │ -
float ComputeFractionalWeightAtVertex(float vertexSharpness, float childVertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness, float const *childEdgesSharpness) const
Transitional weighting: When the rules applicable to a parent vertex and its child differ,...
│ │ │ │ -
float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, int incidentEdgeCountAtEndVertex, float const *edgeSharpnessAroundEndVertex) const
│ │ │ │ -
static bool IsSharp(float sharpness)
Definition: crease.h:71
│ │ │ │ - │ │ │ │ -
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ - │ │ │ │ -
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:101
│ │ │ │ -
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:89
│ │ │ │ - │ │ │ │ +
24
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_OPENCL_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_OPENCL_H
│ │ │ │ +
27
│ │ │ │ +
28#if defined(OPENSUBDIV_HAS_CLEW)
│ │ │ │ +
29# include <clew.h>
│ │ │ │ +
30#else
│ │ │ │ +
31# if defined(__APPLE__)
│ │ │ │ +
32# include <OpenCL/opencl.h>
│ │ │ │ +
33# else
│ │ │ │ +
34# include <CL/opencl.h>
│ │ │ │ +
35# endif
│ │ │ │ +
36#endif
│ │ │ │ +
37
│ │ │ │ +
38#endif // OPENSUBDIV3_OSD_CL_UTIL_H
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -utf-8 │ │ │ │ │ +us-ascii │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -crease.h │ │ │ │ │ +opencl.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2014 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,289 +29,26 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_CREASE_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_CREASE_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29#include "../sdc/options.h" │ │ │ │ │ - 30 │ │ │ │ │ - 31namespace OpenSubdiv { │ │ │ │ │ - 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace Sdc { │ │ │ │ │ - 35 │ │ │ │ │ - 61 │ │ │ │ │ -62class Crease { │ │ │ │ │ - 63public: │ │ │ │ │ - 65 │ │ │ │ │ -67 static float const SHARPNESS_SMOOTH; // = 0.0f, do we really need this? │ │ │ │ │ -68 static float const SHARPNESS_INFINITE; // = 10.0f; │ │ │ │ │ - 69 │ │ │ │ │ -70 static bool IsSmooth(float sharpness) { return sharpness <= │ │ │ │ │ -SHARPNESS_SMOOTH; } │ │ │ │ │ -71 static bool IsSharp(float sharpness) { return sharpness > SHARPNESS_SMOOTH; │ │ │ │ │ -} │ │ │ │ │ -72 static bool IsInfinite(float sharpness) { return sharpness >= │ │ │ │ │ -SHARPNESS_INFINITE; } │ │ │ │ │ -73 static bool IsSemiSharp(float sharpness) { return (SHARPNESS_SMOOTH < │ │ │ │ │ -sharpness) && (sharpness < SHARPNESS_INFINITE); } │ │ │ │ │ - 75 │ │ │ │ │ -82 enum Rule { │ │ │ │ │ -83 RULE_UNKNOWN = 0, │ │ │ │ │ -84 RULE_SMOOTH = (1 << 0), │ │ │ │ │ -85 RULE_DART = (1 << 1), │ │ │ │ │ -86 RULE_CREASE = (1 << 2), │ │ │ │ │ - 87 RULE_CORNER = (1 << 3) │ │ │ │ │ -88 }; │ │ │ │ │ - 89 │ │ │ │ │ - 90public: │ │ │ │ │ -91 Crease() : _options() { } │ │ │ │ │ -92 Crease(Options const& options) : _options(options) { } │ │ │ │ │ -93 ~Crease() { } │ │ │ │ │ - 94 │ │ │ │ │ -95 bool IsUniform() const { return _options.GetCreasingMethod() == Options:: │ │ │ │ │ -CREASE_UNIFORM; } │ │ │ │ │ - 96 │ │ │ │ │ - 98 │ │ │ │ │ - 104 float SharpenBoundaryEdge(float edgeSharpness) const; │ │ │ │ │ - 105 float SharpenBoundaryVertex(float edgeSharpness) const; │ │ │ │ │ - 106 │ │ │ │ │ - 107 // For future consideration │ │ │ │ │ - 108 //float SharpenNonManifoldEdge(float edgeSharpness) const; │ │ │ │ │ - 109 //float SharpenNonManifoldVertex(float edgeSharpness) const; │ │ │ │ │ - 111 │ │ │ │ │ - 113 │ │ │ │ │ - 124 float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const; │ │ │ │ │ - 125 │ │ │ │ │ - 126 float SubdivideVertexSharpness(float vertexSharpness) const; │ │ │ │ │ - 127 │ │ │ │ │ -128 float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, │ │ │ │ │ - 129 int incidentEdgeCountAtEndVertex, │ │ │ │ │ - 130 float const* edgeSharpnessAroundEndVertex) const; │ │ │ │ │ - 131 │ │ │ │ │ -132 void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, │ │ │ │ │ - 133 float const* incidentEdgeSharpnessAroundVertex, │ │ │ │ │ - 134 float* childEdgesSharpnessAroundVertex) const; │ │ │ │ │ - 136 │ │ │ │ │ - 138 │ │ │ │ │ -144 Rule DetermineVertexVertexRule(float vertexSharpness, │ │ │ │ │ - 145 int incidentEdgeCount, │ │ │ │ │ - 146 float const* incidentEdgeSharpness) const; │ │ │ │ │ -147 Rule DetermineVertexVertexRule(float vertexSharpness, │ │ │ │ │ - 148 int sharpEdgeCount) const; │ │ │ │ │ - 150 │ │ │ │ │ -162 float ComputeFractionalWeightAtVertex(float vertexSharpness, │ │ │ │ │ - 163 float childVertexSharpness, │ │ │ │ │ - 164 int incidentEdgeCount, │ │ │ │ │ - 165 float const* incidentEdgeSharpness, │ │ │ │ │ - 166 float const* childEdgesSharpness) const; │ │ │ │ │ - 167 │ │ │ │ │ - 168 void GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, │ │ │ │ │ - 169 int incidentEdgeCount, │ │ │ │ │ - 170 int sharpEdgePair[2]) const; │ │ │ │ │ - 171 │ │ │ │ │ - 172 // Would these really help? Maybe only need Rules for the vertex-vertex │ │ │ │ │ -case... │ │ │ │ │ - 173 // │ │ │ │ │ - 174 // Rule DetermineEdgeVertexRule(float parentEdgeSharpness) const; │ │ │ │ │ - 175 // Rule DetermineEdgeVertexRule(float childEdge1Sharpness, float │ │ │ │ │ -childEdge2Sharpness) const; │ │ │ │ │ - 176 │ │ │ │ │ - 177protected: │ │ │ │ │ - 178 float decrementSharpness(float sharpness) const; │ │ │ │ │ - 179 │ │ │ │ │ - 180private: │ │ │ │ │ - 181 Options _options; │ │ │ │ │ - 182}; │ │ │ │ │ - 183 │ │ │ │ │ - 184 │ │ │ │ │ - 185// │ │ │ │ │ - 186// Inline declarations: │ │ │ │ │ - 187// │ │ │ │ │ - 188inline float │ │ │ │ │ -189Crease::SharpenBoundaryEdge(float /* edgeSharpness */) const { │ │ │ │ │ - 190 │ │ │ │ │ - 191 // │ │ │ │ │ - 192 // Despite the presence of the BOUNDARY_NONE option, boundary edges are │ │ │ │ │ -always sharpened. │ │ │ │ │ - 193 // Much of the code relies on sharpness to indicate boundaries to avoid │ │ │ │ │ -the more complex │ │ │ │ │ - 194 // topological inspection │ │ │ │ │ - 195 // │ │ │ │ │ - 196 return SHARPNESS_INFINITE; │ │ │ │ │ - 197} │ │ │ │ │ - 198 │ │ │ │ │ - 199inline float │ │ │ │ │ -200Crease::SharpenBoundaryVertex(float vertexSharpness) const { │ │ │ │ │ - 201 │ │ │ │ │ - 202 return (_options.GetVtxBoundaryInterpolation() == Options:: │ │ │ │ │ -VTX_BOUNDARY_EDGE_AND_CORNER) ? │ │ │ │ │ - 203 SHARPNESS_INFINITE : vertexSharpness; │ │ │ │ │ - 204} │ │ │ │ │ - 205 │ │ │ │ │ - 206inline float │ │ │ │ │ -207Crease::decrementSharpness(float sharpness) const { │ │ │ │ │ - 208 │ │ │ │ │ - 209 if (IsSmooth(sharpness)) return Crease::SHARPNESS_SMOOTH; // redundant but │ │ │ │ │ -most common │ │ │ │ │ - 210 if (IsInfinite(sharpness)) return Crease::SHARPNESS_INFINITE; │ │ │ │ │ - 211 if (sharpness > 1.0f) return (sharpness - 1.0f); │ │ │ │ │ - 212 return Crease::SHARPNESS_SMOOTH; │ │ │ │ │ - 213} │ │ │ │ │ - 214 │ │ │ │ │ - 215inline float │ │ │ │ │ -216Crease::SubdivideUniformSharpness(float vertexOrEdgeSharpness) const { │ │ │ │ │ - 217 │ │ │ │ │ - 218 return decrementSharpness(vertexOrEdgeSharpness); │ │ │ │ │ - 219} │ │ │ │ │ - 220 │ │ │ │ │ - 221inline float │ │ │ │ │ -222Crease::SubdivideVertexSharpness(float vertexSharpness) const { │ │ │ │ │ - 223 │ │ │ │ │ - 224 return decrementSharpness(vertexSharpness); │ │ │ │ │ - 225} │ │ │ │ │ - 226 │ │ │ │ │ - 227inline void │ │ │ │ │ -228Crease::GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, int │ │ │ │ │ -incidentEdgeCount, │ │ │ │ │ - 229 int sharpEdgePair[2]) const { │ │ │ │ │ - 230 │ │ │ │ │ - 231 // Only to be called when a crease is present at a vertex -- exactly two │ │ │ │ │ -sharp │ │ │ │ │ - 232 // edges are expected here: │ │ │ │ │ - 233 // │ │ │ │ │ - 234 sharpEdgePair[0] = 0; │ │ │ │ │ - 235 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[0]])) ++ sharpEdgePair │ │ │ │ │ -[0]; │ │ │ │ │ - 236 │ │ │ │ │ - 237 sharpEdgePair[1] = incidentEdgeCount - 1; │ │ │ │ │ - 238 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[1]])) -- sharpEdgePair │ │ │ │ │ -[1]; │ │ │ │ │ - 239} │ │ │ │ │ - 240 │ │ │ │ │ - 241} // end namespace sdc │ │ │ │ │ - 242 │ │ │ │ │ - 243} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 244using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 245} // end namespace OpenSubdiv │ │ │ │ │ - 246 │ │ │ │ │ - 247#endif /* OPENSUBDIV3_SDC_CREASE_H */ │ │ │ │ │ -OpenSubdiv │ │ │ │ │ -Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease │ │ │ │ │ -Types, constants and utilities related to semi-sharp creasing – whose │ │ │ │ │ -implementation is independent o... │ │ │ │ │ -Definition: crease.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideVertexSharpness │ │ │ │ │ -float SubdivideVertexSharpness(float vertexSharpness) const │ │ │ │ │ -Definition: crease.h:222 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsInfinite │ │ │ │ │ -static bool IsInfinite(float sharpness) │ │ │ │ │ -Definition: crease.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule │ │ │ │ │ -Rule │ │ │ │ │ -Definition: crease.h:82 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_CORNER │ │ │ │ │ -@ RULE_CORNER │ │ │ │ │ -Definition: crease.h:87 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_DART │ │ │ │ │ -@ RULE_DART │ │ │ │ │ -Definition: crease.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_SMOOTH │ │ │ │ │ -@ RULE_SMOOTH │ │ │ │ │ -Definition: crease.h:84 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_CREASE │ │ │ │ │ -@ RULE_CREASE │ │ │ │ │ -Definition: crease.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_UNKNOWN │ │ │ │ │ -@ RULE_UNKNOWN │ │ │ │ │ -Definition: crease.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SharpenBoundaryVertex │ │ │ │ │ -float SharpenBoundaryVertex(float edgeSharpness) const │ │ │ │ │ -Definition: crease.h:200 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SHARPNESS_SMOOTH │ │ │ │ │ -static float const SHARPNESS_SMOOTH │ │ │ │ │ -Definition: crease.h:67 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::GetSharpEdgePairOfCrease │ │ │ │ │ -void GetSharpEdgePairOfCrease(float const *incidentEdgeSharpness, int │ │ │ │ │ -incidentEdgeCount, int sharpEdgePair[2]) const │ │ │ │ │ -Definition: crease.h:228 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SHARPNESS_INFINITE │ │ │ │ │ -static float const SHARPNESS_INFINITE │ │ │ │ │ -Definition: crease.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::DetermineVertexVertexRule │ │ │ │ │ -Rule DetermineVertexVertexRule(float vertexSharpness, int incidentEdgeCount, │ │ │ │ │ -float const *incidentEdgeSharpness) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::decrementSharpness │ │ │ │ │ -float decrementSharpness(float sharpness) const │ │ │ │ │ -Definition: crease.h:207 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSmooth │ │ │ │ │ -static bool IsSmooth(float sharpness) │ │ │ │ │ -Definition: crease.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::DetermineVertexVertexRule │ │ │ │ │ -Rule DetermineVertexVertexRule(float vertexSharpness, int sharpEdgeCount) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsUniform │ │ │ │ │ -bool IsUniform() const │ │ │ │ │ -Definition: crease.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSemiSharp │ │ │ │ │ -static bool IsSemiSharp(float sharpness) │ │ │ │ │ -Definition: crease.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Crease │ │ │ │ │ -Crease(Options const &options) │ │ │ │ │ -Definition: crease.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease:: │ │ │ │ │ -SubdivideEdgeSharpnessesAroundVertex │ │ │ │ │ -void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, float │ │ │ │ │ -const *incidentEdgeSharpnessAroundVertex, float │ │ │ │ │ -*childEdgesSharpnessAroundVertex) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideUniformSharpness │ │ │ │ │ -float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const │ │ │ │ │ -Definition: crease.h:216 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Crease │ │ │ │ │ -Crease() │ │ │ │ │ -Definition: crease.h:91 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SharpenBoundaryEdge │ │ │ │ │ -float SharpenBoundaryEdge(float edgeSharpness) const │ │ │ │ │ -Definition: crease.h:189 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::ComputeFractionalWeightAtVertex │ │ │ │ │ -float ComputeFractionalWeightAtVertex(float vertexSharpness, float │ │ │ │ │ -childVertexSharpness, int incidentEdgeCount, float const │ │ │ │ │ -*incidentEdgeSharpness, float const *childEdgesSharpness) const │ │ │ │ │ -Transitional weighting: When the rules applicable to a parent vertex and its │ │ │ │ │ -child differ,... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideEdgeSharpnessAtVertex │ │ │ │ │ -float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, int │ │ │ │ │ -incidentEdgeCountAtEndVertex, float const *edgeSharpnessAroundEndVertex) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSharp │ │ │ │ │ -static bool IsSharp(float sharpness) │ │ │ │ │ -Definition: crease.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::~Crease │ │ │ │ │ -~Crease() │ │ │ │ │ -Definition: crease.h:93 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ -All supported options applying to subdivision scheme. │ │ │ │ │ -Definition: options.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM │ │ │ │ │ -@ CREASE_UNIFORM │ │ │ │ │ -Catmark rule. │ │ │ │ │ -Definition: options.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod │ │ │ │ │ -CreasingMethod GetCreasingMethod() const │ │ │ │ │ -Get edge crease rule. │ │ │ │ │ -Definition: options.h:101 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation │ │ │ │ │ -VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const │ │ │ │ │ -Get vertex boundary interpolation rule. │ │ │ │ │ -Definition: options.h:89 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ -@ VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ -Definition: options.h:57 │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_OPENCL_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_OPENCL_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#if defined(OPENSUBDIV_HAS_CLEW) │ │ │ │ │ + 29# include │ │ │ │ │ + 30#else │ │ │ │ │ + 31# if defined(__APPLE__) │ │ │ │ │ + 32# include │ │ │ │ │ + 33# else │ │ │ │ │ + 34# include │ │ │ │ │ + 35# endif │ │ │ │ │ + 36#endif │ │ │ │ │ + 37 │ │ │ │ │ + 38#endif // OPENSUBDIV3_OSD_CL_UTIL_H │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * crease.h │ │ │ │ │ + * osd │ │ │ │ │ + * opencl.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00779.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/loopScheme.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/clVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,38 +81,43 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces
│ │ │ │ -
loopScheme.h File Reference
│ │ │ │ +
clVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../sdc/scheme.h"
│ │ │ │ -#include <cassert>
│ │ │ │ -#include <cmath>
│ │ │ │ +#include "../osd/opencl.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CLVertexBuffer
 Concrete vertex buffer class for OpenCL subdivision. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,25 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces │ │ │ │ │ -loopScheme.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +clVertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../sdc/scheme.h" │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include "../osd/opencl.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CLVertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for OpenCL subdivision. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * loopScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00779_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/loopScheme.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/clVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
loopScheme.h
│ │ │ │ +
clVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,596 +106,90 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_SDC_LOOP_SCHEME_H
│ │ │ │ -
25#define OPENSUBDIV3_SDC_LOOP_SCHEME_H
│ │ │ │ -
26
│ │ │ │ -
27#include "../version.h"
│ │ │ │ -
28
│ │ │ │ -
29#include "../sdc/scheme.h"
│ │ │ │ +
24
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ +
27
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29#include "../osd/opencl.h"
│ │ │ │
30
│ │ │ │ -
31#include <cassert>
│ │ │ │ -
32#include <cmath>
│ │ │ │ +
31namespace OpenSubdiv {
│ │ │ │ +
32namespace OPENSUBDIV_VERSION {
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36namespace Sdc {
│ │ │ │ -
37
│ │ │ │ -
38
│ │ │ │ -
39//
│ │ │ │ -
40// Specializations for Sdc::Scheme<SCHEME_LOOP>:
│ │ │ │ -
41//
│ │ │ │ -
42//
│ │ │ │ +
34namespace Osd {
│ │ │ │ +
35
│ │ │ │ + │ │ │ │
43
│ │ │ │ -
44//
│ │ │ │ -
45// Loop traits:
│ │ │ │ -
46//
│ │ │ │ -
47template <>
│ │ │ │ - │ │ │ │ -
49
│ │ │ │ -
50template <>
│ │ │ │ - │ │ │ │ -
52
│ │ │ │ -
53template <>
│ │ │ │ - │ │ │ │ -
55
│ │ │ │ -
56template <>
│ │ │ │ - │ │ │ │ -
58
│ │ │ │ -
59
│ │ │ │ -
60//
│ │ │ │ -
61// Protected methods to assign the two types of masks for an edge-vertex --
│ │ │ │ -
62// Crease and Smooth.
│ │ │ │ -
63//
│ │ │ │ -
64// The Crease case does not really need to be specialized, though it may be
│ │ │ │ -
65// preferable to define all explicitly here.
│ │ │ │ -
66//
│ │ │ │ -
67template <>
│ │ │ │ -
68template <typename EDGE, typename MASK>
│ │ │ │ -
69inline void
│ │ │ │ - │ │ │ │ -
71{
│ │ │ │ -
72 mask.SetNumVertexWeights(2);
│ │ │ │ -
73 mask.SetNumEdgeWeights(0);
│ │ │ │ -
74 mask.SetNumFaceWeights(0);
│ │ │ │ -
75 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
76
│ │ │ │ -
77 mask.VertexWeight(0) = 0.5f;
│ │ │ │ -
78 mask.VertexWeight(1) = 0.5f;
│ │ │ │ -
79}
│ │ │ │ -
80
│ │ │ │ -
81template <>
│ │ │ │ -
82template <typename EDGE, typename MASK>
│ │ │ │ -
83inline void
│ │ │ │ -
84Scheme<SCHEME_LOOP>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const
│ │ │ │ -
85{
│ │ │ │ -
86 int faceCount = edge.GetNumFaces();
│ │ │ │ -
87
│ │ │ │ -
88 mask.SetNumVertexWeights(2);
│ │ │ │ -
89 mask.SetNumEdgeWeights(0);
│ │ │ │ -
90 mask.SetNumFaceWeights(faceCount);
│ │ │ │ -
91 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
92
│ │ │ │ -
93 //
│ │ │ │ -
94 // This is where we run into the issue of "face weights" -- we want to weight the
│ │ │ │ -
95 // face-centers for Catmark, but face-centers are not generated for Loop. So do
│ │ │ │ -
96 // we make assumptions on how the mask is used, assign some property to the mask
│ │ │ │ -
97 // to indicate how they were assigned, or take input from the mask itself?
│ │ │ │ -
98 //
│ │ │ │ -
99 // Regardless, we have two choices:
│ │ │ │ -
100 // - face-weights are for the vertices opposite the edge (as in Hbr):
│ │ │ │ -
101 // vertex weights = 0.375f;
│ │ │ │ -
102 // face weights = 0.125f;
│ │ │ │ -
103 //
│ │ │ │ -
104 // - face-weights are for the face centers:
│ │ │ │ -
105 // vertex weights = 0.125f;
│ │ │ │ -
106 // face weights = 0.375f;
│ │ │ │ -
107 //
│ │ │ │ -
108 // Coincidentally the coefficients are the same but reversed.
│ │ │ │ -
109 //
│ │ │ │ -
110 typedef typename MASK::Weight Weight;
│ │ │ │ -
111
│ │ │ │ -
112 Weight vWeight = mask.AreFaceWeightsForFaceCenters() ? 0.125f : 0.375f;
│ │ │ │ -
113 Weight fWeight = mask.AreFaceWeightsForFaceCenters() ? 0.375f : 0.125f;
│ │ │ │ -
114
│ │ │ │ -
115 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
116 mask.VertexWeight(1) = vWeight;
│ │ │ │ -
117
│ │ │ │ -
118 if (faceCount == 2) {
│ │ │ │ -
119 mask.FaceWeight(0) = fWeight;
│ │ │ │ -
120 mask.FaceWeight(1) = fWeight;
│ │ │ │ -
121 } else {
│ │ │ │ -
122 // The non-manifold case is not clearly defined -- we adjust the above
│ │ │ │ -
123 // face-weight to preserve the ratio of edge-center and face-centers:
│ │ │ │ -
124 fWeight *= 2.0f / (Weight) faceCount;
│ │ │ │ -
125 for (int i = 0; i < faceCount; ++i) {
│ │ │ │ -
126 mask.FaceWeight(i) = fWeight;
│ │ │ │ -
127 }
│ │ │ │ -
128 }
│ │ │ │ -
129}
│ │ │ │ -
130
│ │ │ │ -
131
│ │ │ │ -
132//
│ │ │ │ -
133// Protected methods to assign the three types of masks for a vertex-vertex --
│ │ │ │ -
134// Corner, Crease and Smooth (Dart is the same as Smooth).
│ │ │ │ -
135//
│ │ │ │ -
136// Corner and Crease do not really need to be specialized, though it may be
│ │ │ │ -
137// preferable to define all explicitly here.
│ │ │ │ -
138//
│ │ │ │ -
139template <>
│ │ │ │ -
140template <typename VERTEX, typename MASK>
│ │ │ │ -
141inline void
│ │ │ │ - │ │ │ │ -
143{
│ │ │ │ -
144 mask.SetNumVertexWeights(1);
│ │ │ │ -
145 mask.SetNumEdgeWeights(0);
│ │ │ │ -
146 mask.SetNumFaceWeights(0);
│ │ │ │ -
147 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
148
│ │ │ │ -
149 mask.VertexWeight(0) = 1.0f;
│ │ │ │ -
150}
│ │ │ │ -
151
│ │ │ │ -
152template <>
│ │ │ │ -
153template <typename VERTEX, typename MASK>
│ │ │ │ -
154inline void
│ │ │ │ -
155Scheme<SCHEME_LOOP>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask,
│ │ │ │ -
156 int const creaseEnds[2]) const {
│ │ │ │ -
157 typedef typename MASK::Weight Weight;
│ │ │ │ -
158
│ │ │ │ -
159 int valence = vertex.GetNumEdges();
│ │ │ │ -
160
│ │ │ │ -
161 mask.SetNumVertexWeights(1);
│ │ │ │ -
162 mask.SetNumEdgeWeights(valence);
│ │ │ │ -
163 mask.SetNumFaceWeights(0);
│ │ │ │ -
164 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
165
│ │ │ │ -
166 Weight vWeight = 0.75f;
│ │ │ │ -
167 Weight eWeight = 0.125f;
│ │ │ │ -
168
│ │ │ │ -
169 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
170 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
171 mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
172 }
│ │ │ │ -
173 mask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ -
174 mask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ -
175}
│ │ │ │ -
176
│ │ │ │ -
177template <>
│ │ │ │ -
178template <typename VERTEX, typename MASK>
│ │ │ │ -
179inline void
│ │ │ │ -
180Scheme<SCHEME_LOOP>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const
│ │ │ │ -
181{
│ │ │ │ -
182 typedef typename MASK::Weight Weight;
│ │ │ │ -
183
│ │ │ │ -
184 int valence = vertex.GetNumFaces();
│ │ │ │ -
185
│ │ │ │ -
186 mask.SetNumVertexWeights(1);
│ │ │ │ -
187 mask.SetNumEdgeWeights(valence);
│ │ │ │ -
188 mask.SetNumFaceWeights(0);
│ │ │ │ -
189 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
190
│ │ │ │ -
191 // Specialize for the regular case: 1/16 per edge-vert, 5/8 for the vert itself:
│ │ │ │ -
192 Weight eWeight = (Weight) 0.0625f;
│ │ │ │ -
193 Weight vWeight = (Weight) 0.625f;
│ │ │ │ -
194
│ │ │ │ -
195 if (valence != 6) {
│ │ │ │ -
196 // From HbrLoopSubdivision<T>::Subdivide(mesh, vertex):
│ │ │ │ -
197 // - could use some lookup tables here for common irregular valence (5, 7, 8)
│ │ │ │ -
198 // or all of these cosine calls will be adding up...
│ │ │ │ -
199
│ │ │ │ -
200 double dValence = (double) valence;
│ │ │ │ -
201 double invValence = 1.0f / dValence;
│ │ │ │ -
202 double cosTheta = std::cos(M_PI * 2.0f * invValence);
│ │ │ │ -
203
│ │ │ │ -
204 double beta = 0.25f * cosTheta + 0.375f;
│ │ │ │ -
205
│ │ │ │ -
206 eWeight = (Weight) ((0.625f - (beta * beta)) * invValence);
│ │ │ │ -
207 vWeight = (Weight) (1.0f - (eWeight * dValence));
│ │ │ │ -
208 }
│ │ │ │ -
209
│ │ │ │ -
210 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
211 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
212 mask.EdgeWeight(i) = eWeight;
│ │ │ │ -
213 }
│ │ │ │ -
214}
│ │ │ │ -
215
│ │ │ │ -
216
│ │ │ │ -
217//
│ │ │ │ -
218// Limit masks for position:
│ │ │ │ -
219//
│ │ │ │ -
220template <>
│ │ │ │ -
221template <typename VERTEX, typename MASK>
│ │ │ │ -
222inline void
│ │ │ │ -
223Scheme<SCHEME_LOOP>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ -
224
│ │ │ │ -
225 posMask.SetNumVertexWeights(1);
│ │ │ │ -
226 posMask.SetNumEdgeWeights(0);
│ │ │ │ -
227 posMask.SetNumFaceWeights(0);
│ │ │ │ -
228 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
229
│ │ │ │ -
230 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ -
231}
│ │ │ │ -
232
│ │ │ │ -
233template <>
│ │ │ │ -
234template <typename VERTEX, typename MASK>
│ │ │ │ -
235inline void
│ │ │ │ -
236Scheme<SCHEME_LOOP>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ -
237 int const creaseEnds[2]) const {
│ │ │ │ -
238
│ │ │ │ -
239 typedef typename MASK::Weight Weight;
│ │ │ │ -
240
│ │ │ │ -
241 int valence = vertex.GetNumEdges();
│ │ │ │ -
242
│ │ │ │ -
243 posMask.SetNumVertexWeights(1);
│ │ │ │ -
244 posMask.SetNumEdgeWeights(valence);
│ │ │ │ -
245 posMask.SetNumFaceWeights(0);
│ │ │ │ -
246 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
247
│ │ │ │ -
248 //
│ │ │ │ -
249 // The refinement mask for a crease vertex is (1/8, 3/4, 1/8) and for a crease
│ │ │ │ -
250 // edge is (1/2, 1/2) -- producing a uniform B-spline curve along the crease
│ │ │ │ -
251 // (boundary) whether the vertex or its crease is regular or not. The limit
│ │ │ │ -
252 // mask is therefore (1/6, 2/3, 1/6) for ALL cases.
│ │ │ │ -
253 //
│ │ │ │ -
254 // An alternative limit mask (1/5, 3/5, 1/5) is often published for use either
│ │ │ │ -
255 // for irregular crease vertices or for all crease/boundary vertices, but this
│ │ │ │ -
256 // is based on an alternate refinement mask for the edge -- (3/8, 5/8) versus
│ │ │ │ -
257 // the usual (1/2, 1/2) -- and will not produce the B-spline curve desired.
│ │ │ │ -
258 //
│ │ │ │ -
259 Weight vWeight = (Weight) (4.0 / 6.0);
│ │ │ │ -
260 Weight eWeight = (Weight) (1.0 / 6.0);
│ │ │ │ -
261
│ │ │ │ -
262 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
263 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
264 posMask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
265 }
│ │ │ │ -
266 posMask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ -
267 posMask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ -
268}
│ │ │ │ -
269
│ │ │ │ -
270template <>
│ │ │ │ -
271template <typename VERTEX, typename MASK>
│ │ │ │ -
272inline void
│ │ │ │ -
273Scheme<SCHEME_LOOP>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ -
274
│ │ │ │ -
275 typedef typename MASK::Weight Weight;
│ │ │ │ -
276
│ │ │ │ -
277 int valence = vertex.GetNumFaces();
│ │ │ │ -
278
│ │ │ │ -
279 posMask.SetNumVertexWeights(1);
│ │ │ │ -
280 posMask.SetNumEdgeWeights(valence);
│ │ │ │ -
281 posMask.SetNumFaceWeights(0);
│ │ │ │ -
282 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
283
│ │ │ │ -
284 // Specialize for the regular case: 1/12 per edge-vert, 1/2 for the vert itself:
│ │ │ │ -
285 if (valence == 6) {
│ │ │ │ -
286 Weight eWeight = (Weight) (1.0 / 12.0);
│ │ │ │ -
287 Weight vWeight = 0.5f;
│ │ │ │ -
288
│ │ │ │ -
289 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
290
│ │ │ │ -
291 posMask.EdgeWeight(0) = eWeight;
│ │ │ │ -
292 posMask.EdgeWeight(1) = eWeight;
│ │ │ │ -
293 posMask.EdgeWeight(2) = eWeight;
│ │ │ │ -
294 posMask.EdgeWeight(3) = eWeight;
│ │ │ │ -
295 posMask.EdgeWeight(4) = eWeight;
│ │ │ │ -
296 posMask.EdgeWeight(5) = eWeight;
│ │ │ │ -
297
│ │ │ │ -
298 } else {
│ │ │ │ -
299 double dValence = (double) valence;
│ │ │ │ -
300 double invValence = 1.0f / dValence;
│ │ │ │ -
301 double cosTheta = std::cos(M_PI * 2.0f * invValence);
│ │ │ │ -
302
│ │ │ │ -
303 double beta = 0.25f * cosTheta + 0.375f;
│ │ │ │ -
304 double gamma = (0.625f - (beta * beta)) * invValence;
│ │ │ │ -
305
│ │ │ │ -
306 Weight eWeight = (Weight) (1.0f / (dValence + 3.0f / (8.0f * gamma)));
│ │ │ │ -
307 Weight vWeight = (Weight) (1.0f - (eWeight * dValence));
│ │ │ │ -
308
│ │ │ │ -
309 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
310 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
311 posMask.EdgeWeight(i) = eWeight;
│ │ │ │ -
312 }
│ │ │ │ -
313 }
│ │ │ │ -
314}
│ │ │ │ -
315
│ │ │ │ -
316/*
│ │ │ │ -
317// Limit masks for tangents:
│ │ │ │ -
318//
│ │ │ │ -
319// A note on tangent magnitudes:
│ │ │ │ -
320//
│ │ │ │ -
321// Several formulae exist for limit tangents at a vertex to accommodate the
│ │ │ │ -
322// different topological configurations around the vertex. While these produce
│ │ │ │ -
323// the desired direction, there is inconsistency in the resulting magnitudes.
│ │ │ │ -
324// Ideally a regular mesh of uniformly shaped triangles with similar edge lengths
│ │ │ │ -
325// should produce tangents of similar magnitudes throughout -- including corners
│ │ │ │ -
326// and boundaries. So some of the common formulae for these are adjusted with
│ │ │ │ -
327// scale factors.
│ │ │ │ -
328//
│ │ │ │ -
329// For uses where magnitude does not matter, this scaling should be irrelevant.
│ │ │ │ -
330// But just as with patches, where the magnitudes of partial derivatives are
│ │ │ │ -
331// consistent between similar patches, the magnitudes of limit tangents should
│ │ │ │ -
332// also be similar.
│ │ │ │ -
333//
│ │ │ │ -
334// The reference tangents, in terms of magnitudes, are those produced by the
│ │ │ │ -
335// limit tangent mask for smooth interior vertices, for which well established
│ │ │ │ -
336// sin/cos formulae apply -- these remain unscaled. Formulae for the other
│ │ │ │ -
337// crease/boundary, corner tangents and irregular cases are scaled to be more
│ │ │ │ -
338// consistent with these.
│ │ │ │ -
339//
│ │ │ │ -
340// The crease/boundary tangents for the regular case can be viewed as derived
│ │ │ │ -
341// from the smooth interior masks with two "phantom" points extrapolated across
│ │ │ │ -
342// the regular boundary:
│ │ │ │ -
343//
│ │ │ │ -
344// v3 v2
│ │ │ │ -
345// X - - - - - X
│ │ │ │ -
346// / \ / \
│ │ │ │ -
347// / \ / \
│ │ │ │ -
348// v4 X - - - - - X - - - - - X v1
│ │ │ │ -
349// . . 0 . .
│ │ │ │ -
350// . . . .
│ │ │ │ -
351// . . . .
│ │ │ │ -
352// (v5) (v6)
│ │ │ │ -
353//
│ │ │ │ -
354// where v5 = v0 + (v4 - v3) and v6 = v0 + v1 - v2.
│ │ │ │ -
355//
│ │ │ │ -
356// When the standard limit tangent mask is applied, the cosines of increments
│ │ │ │ -
357// of pi/3 give us coefficients that are multiples of 1/2, leading to the first
│ │ │ │ -
358// tangent T1 = 3/2 * (v1 - v4), rather than the widely used T1 = v1 - v4. So
│ │ │ │ -
359// this scale factor of 3/2 is applied to ensure tangents along the boundaries
│ │ │ │ -
360// are of similar magnitude as tangents in the immediate interior (which may be
│ │ │ │ -
361// parallel).
│ │ │ │ -
362//
│ │ │ │ -
363// Tangents at corners are essentially a form of boundary tangent, and so its
│ │ │ │ -
364// simple difference formula is scaled to be consistent with adjoining boundary
│ │ │ │ -
365// tangents -- not just with the 3/2 factor from above, but with an additional
│ │ │ │ -
366// 2.0 to compensate for the fact that the difference of only side of the vertex
│ │ │ │ -
367// is considered here. The resulting scale factor of 3.0 for the regular corner
│ │ │ │ -
368// is what similarly arises by extrapolating an interior region around the
│ │ │ │ -
369// vertex and using the interior mask for the first tangent.
│ │ │ │ -
370//
│ │ │ │ -
371// The cross-tangent formula for the regular crease/boundary is similarly found
│ │ │ │ -
372// from the above construction of the boundary, but the commonly used weights of
│ │ │ │ -
373// +/- 1 and 2 result from omitting the common factor of sqrt(3)/2 (arising from
│ │ │ │ -
374// the sines of increments of pi/3). With that scale factor close to one, it has
│ │ │ │ -
375// less impact than the irregular cases, which are analogous to corner tangents
│ │ │ │ -
376// in that differences on only one side of the vertex are considered. While a
│ │ │ │ -
377// scaling of 3.0 is similarly understandable for the valence 2 and 3 cases, it is
│ │ │ │ -
378// less obvious in the irregular formula for valence > 4, but similarly effective.
│ │ │ │ -
379//
│ │ │ │ -
380// The end result of these adjustments should be a set of limit tangents that are
│ │ │ │ -
381// of similar magnitude over a regular mesh including boundaries and corners.
│ │ │ │ -
382*/
│ │ │ │ -
383template <>
│ │ │ │ -
384template <typename VERTEX, typename MASK>
│ │ │ │ -
385inline void
│ │ │ │ - │ │ │ │ -
387 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
388
│ │ │ │ -
389 int valence = vertex.GetNumEdges();
│ │ │ │ -
390
│ │ │ │ -
391 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
392 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
393 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ -
394 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
395
│ │ │ │ -
396 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
397 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
398 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ -
399 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
400
│ │ │ │ -
401 // See note above regarding scale factor of 3.0:
│ │ │ │ -
402 tan1Mask.VertexWeight(0) = -3.0f;
│ │ │ │ -
403 tan1Mask.EdgeWeight(0) = 3.0f;
│ │ │ │ -
404 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ -
405
│ │ │ │ -
406 tan2Mask.VertexWeight(0) = -3.0f;
│ │ │ │ -
407 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ -
408 tan2Mask.EdgeWeight(1) = 3.0f;
│ │ │ │ -
409
│ │ │ │ -
410 // Should be at least 2 edges -- be sure to clear weights for any more:
│ │ │ │ -
411 for (int i = 2; i < valence; ++i) {
│ │ │ │ -
412 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
413 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
414 }
│ │ │ │ -
415}
│ │ │ │ -
416
│ │ │ │ -
417template <>
│ │ │ │ -
418template <typename VERTEX, typename MASK>
│ │ │ │ -
419inline void
│ │ │ │ - │ │ │ │ -
421 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const {
│ │ │ │ -
422
│ │ │ │ -
423 typedef typename MASK::Weight Weight;
│ │ │ │ -
424
│ │ │ │ -
425 //
│ │ │ │ -
426 // First, the tangent along the crease:
│ │ │ │ -
427 // The first crease edge is considered the "leading" edge of the span
│ │ │ │ -
428 // of surface for which we are evaluating tangents and the second edge the
│ │ │ │ -
429 // "trailing edge". By convention, the tangent along the crease is oriented
│ │ │ │ -
430 // in the direction of the leading edge.
│ │ │ │ -
431 //
│ │ │ │ -
432 int valence = vertex.GetNumEdges();
│ │ │ │ -
433
│ │ │ │ -
434 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
435 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
436 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ -
437 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
438
│ │ │ │ -
439 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
440 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
441 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
442 }
│ │ │ │ -
443
│ │ │ │ -
444 // See the note above regarding scale factor of 1.5:
│ │ │ │ -
445 tan1Mask.EdgeWeight(creaseEnds[0]) = 1.5f;
│ │ │ │ -
446 tan1Mask.EdgeWeight(creaseEnds[1]) = -1.5f;
│ │ │ │ -
447
│ │ │ │ -
448 //
│ │ │ │ -
449 // Second, the tangent across the interior faces:
│ │ │ │ -
450 // Note this is ambiguous for an interior vertex. We currently return
│ │ │ │ -
451 // the tangent for the surface in the counter-clockwise span between the
│ │ │ │ -
452 // leading and trailing edges that form the crease. Given the expected
│ │ │ │ -
453 // computation of a surface normal as Tan1 X Tan2, this tangent should be
│ │ │ │ -
454 // oriented "inward" from the crease/boundary -- across the surface rather
│ │ │ │ -
455 // than outward and away from it.
│ │ │ │ -
456 //
│ │ │ │ -
457 // There is inconsistency in the orientation of this tangent in commonly
│ │ │ │ -
458 // published results: the general formula provided for arbitrary valence
│ │ │ │ -
459 // has the tangent pointing across the crease and "outward" from the surface,
│ │ │ │ -
460 // while the special cases for regular valence and lower have the tangent
│ │ │ │ -
461 // pointing across the surface and "inward" from the crease. So if we are
│ │ │ │ -
462 // to consistently orient the first tangent along the crease, regardless of
│ │ │ │ -
463 // the interior topology, we have to correct this. With the first tangent
│ │ │ │ -
464 // following the direction of the leading crease edge, we want the second
│ │ │ │ -
465 // tangent pointing inward/across the surface -- so we flip the result of
│ │ │ │ -
466 // the general formula.
│ │ │ │ -
467 //
│ │ │ │ -
468 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
469 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
470 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ -
471 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
472
│ │ │ │ -
473 for (int i = 0; i < creaseEnds[0]; ++i) {
│ │ │ │ -
474 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
475 }
│ │ │ │ -
476 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1;
│ │ │ │ -
477 if (interiorEdgeCount == 2) {
│ │ │ │ -
478 // See note above regarding scale factor of (sin(60 degs) == sqrt(3)/2:
│ │ │ │ -
479
│ │ │ │ -
480 static Weight const Root3 = (Weight) 1.73205080756887729352;
│ │ │ │ -
481 static Weight const Root3by2 = (Weight) (Root3 * 0.5);
│ │ │ │ -
482
│ │ │ │ -
483 tan2Mask.VertexWeight(0) = -Root3;
│ │ │ │ -
484
│ │ │ │ -
485 tan2Mask.EdgeWeight(creaseEnds[0]) = -Root3by2;
│ │ │ │ -
486 tan2Mask.EdgeWeight(creaseEnds[1]) = -Root3by2;
│ │ │ │ -
487
│ │ │ │ -
488 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = Root3;
│ │ │ │ -
489 tan2Mask.EdgeWeight(creaseEnds[0] + 2) = Root3;
│ │ │ │ -
490 } else if (interiorEdgeCount > 2) {
│ │ │ │ -
491 // See notes above regarding scale factor of -3.0 (-1 for orientation,
│ │ │ │ -
492 // 2.0 for considering the region as a half-disk, and 1.5 in keeping
│ │ │ │ -
493 // with the crease tangent):
│ │ │ │ -
494
│ │ │ │ -
495 double theta = M_PI / (interiorEdgeCount + 1);
│ │ │ │ -
496
│ │ │ │ -
497 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
498
│ │ │ │ -
499 Weight cWeight = (Weight) (-3.0f * std::sin(theta));
│ │ │ │ -
500 tan2Mask.EdgeWeight(creaseEnds[0]) = cWeight;
│ │ │ │ -
501 tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight;
│ │ │ │ -
502
│ │ │ │ -
503 double eCoeff = -3.0f * 2.0f * (std::cos(theta) - 1.0f);
│ │ │ │ -
504 for (int i = 1; i <= interiorEdgeCount; ++i) {
│ │ │ │ -
505 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) (eCoeff * std::sin(i * theta));
│ │ │ │ -
506 }
│ │ │ │ -
507 } else if (interiorEdgeCount == 1) {
│ │ │ │ -
508 // See notes above regarding scale factor of 3.0:
│ │ │ │ -
509
│ │ │ │ -
510 tan2Mask.VertexWeight(0) = -3.0f;
│ │ │ │ -
511
│ │ │ │ -
512 tan2Mask.EdgeWeight(creaseEnds[0]) = 0.0f;
│ │ │ │ -
513 tan2Mask.EdgeWeight(creaseEnds[1]) = 0.0f;
│ │ │ │ -
514
│ │ │ │ -
515 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = 3.0f;
│ │ │ │ -
516 } else {
│ │ │ │ -
517 // See notes above regarding scale factor of 3.0:
│ │ │ │ -
518
│ │ │ │ -
519 tan2Mask.VertexWeight(0) = -6.0f;
│ │ │ │ -
520
│ │ │ │ -
521 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f;
│ │ │ │ -
522 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f;
│ │ │ │ -
523 }
│ │ │ │ -
524 for (int i = creaseEnds[1] + 1; i < valence; ++i) {
│ │ │ │ -
525 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
526 }
│ │ │ │ -
527}
│ │ │ │ -
528
│ │ │ │ -
529template <>
│ │ │ │ -
530template <typename VERTEX, typename MASK>
│ │ │ │ -
531inline void
│ │ │ │ - │ │ │ │ -
533 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
534
│ │ │ │ -
535 typedef typename MASK::Weight Weight;
│ │ │ │ -
536
│ │ │ │ -
537 int valence = vertex.GetNumFaces();
│ │ │ │ -
538
│ │ │ │ -
539 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
540 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
541 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ -
542 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
543
│ │ │ │ -
544 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
545 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
546 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ -
547 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
548
│ │ │ │ -
549 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
550 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
551
│ │ │ │ -
552 if (valence == 6) {
│ │ │ │ -
553 static Weight const Root3by2 = (Weight)(0.5 * 1.73205080756887729352);
│ │ │ │ -
554
│ │ │ │ -
555 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ -
556 tan1Mask.EdgeWeight(1) = 0.5f;
│ │ │ │ -
557 tan1Mask.EdgeWeight(2) = -0.5f;
│ │ │ │ -
558 tan1Mask.EdgeWeight(3) = -1.0f;
│ │ │ │ -
559 tan1Mask.EdgeWeight(4) = -0.5f;
│ │ │ │ -
560 tan1Mask.EdgeWeight(5) = 0.5f;
│ │ │ │ -
561
│ │ │ │ -
562 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ -
563 tan2Mask.EdgeWeight(1) = Root3by2;
│ │ │ │ -
564 tan2Mask.EdgeWeight(2) = Root3by2;
│ │ │ │ -
565 tan2Mask.EdgeWeight(3) = 0.0f;
│ │ │ │ -
566 tan2Mask.EdgeWeight(4) = -Root3by2;
│ │ │ │ -
567 tan2Mask.EdgeWeight(5) = -Root3by2;
│ │ │ │ -
568 } else {
│ │ │ │ -
569 double alpha = 2.0f * M_PI / valence;
│ │ │ │ -
570 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
571 double alphaI = alpha * i;
│ │ │ │ -
572 tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI);
│ │ │ │ -
573 tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI);
│ │ │ │ -
574 }
│ │ │ │ -
575 }
│ │ │ │ -
576}
│ │ │ │ -
577
│ │ │ │ -
578} // end namespace Sdc
│ │ │ │ -
579} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
580using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
581} // end namespace OpenSubdiv
│ │ │ │ -
582
│ │ │ │ -
583#endif /* OPENSUBDIV3_SDC_LOOP_SCHEME_H */
│ │ │ │ +
44public:
│ │ │ │ +
46 static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext);
│ │ │ │ +
47
│ │ │ │ +
48 template <typename DEVICE_CONTEXT>
│ │ │ │ +
49 static CLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
50 DEVICE_CONTEXT context) {
│ │ │ │ +
51 return Create(numElements, numVertices, context->GetContext());
│ │ │ │ +
52 }
│ │ │ │ +
53
│ │ │ │ + │ │ │ │ +
56
│ │ │ │ +
59 void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue,
│ │ │ │ +
60 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* endEvent = NULL);
│ │ │ │ +
61
│ │ │ │ +
62 template<typename DEVICE_CONTEXT>
│ │ │ │ +
63 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
64 DEVICE_CONTEXT context,
│ │ │ │ +
65 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* endEvent = NULL) {
│ │ │ │ +
66 UpdateData(src, startVertex, numVertices, context->GetCommandQueue(), startEvents, numStartEvents, endEvent);
│ │ │ │ +
67 }
│ │ │ │ +
68
│ │ │ │ +
70 int GetNumElements() const;
│ │ │ │ +
71
│ │ │ │ +
73 int GetNumVertices() const;
│ │ │ │ +
74
│ │ │ │ +
76 cl_mem BindCLBuffer(cl_command_queue queue);
│ │ │ │ +
77
│ │ │ │ +
78protected:
│ │ │ │ +
80 CLVertexBuffer(int numElements, int numVertices, cl_context clContext);
│ │ │ │ +
81
│ │ │ │ +
84 bool allocate(cl_context clContext);
│ │ │ │ +
85
│ │ │ │ +
86private:
│ │ │ │ +
87 int _numElements;
│ │ │ │ +
88 int _numVertices;
│ │ │ │ +
89 cl_mem _clMemory;
│ │ │ │ +
90};
│ │ │ │ +
91
│ │ │ │ +
92} // end namespace Osd
│ │ │ │ +
93
│ │ │ │ +
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
96
│ │ │ │ +
97} // end namespace OpenSubdiv
│ │ │ │ +
98
│ │ │ │ +
99#endif // OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ -
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ -
@ SPLIT_TO_TRIS
Used by Loop.
Definition: types.h:49
│ │ │ │ -
void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const
│ │ │ │ - │ │ │ │ -
void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const creaseEnds[2]) const
│ │ │ │ -
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ - │ │ │ │ -
void assignCreaseMaskForEdge(EDGE const &edge, MASK &mask) const
Definition: scheme.h:317
│ │ │ │ -
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ - │ │ │ │ -
void assignCornerMaskForVertex(VERTEX const &edge, MASK &mask) const
Definition: scheme.h:331
│ │ │ │ -
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ -
void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const
│ │ │ │ - │ │ │ │ -
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ -
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ -
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
Concrete vertex buffer class for OpenCL subdivision.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
│ │ │ │ + │ │ │ │ +
CLVertexBuffer(int numElements, int numVertices, cl_context clContext)
Constructor.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
│ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ + │ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext)
Creator. Returns NULL if error.
│ │ │ │ +
static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT context)
│ │ │ │ +
cl_mem BindCLBuffer(cl_command_queue queue)
Returns the CL memory object.
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -loopScheme.h │ │ │ │ │ +clVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,677 +29,115 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_LOOP_SCHEME_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_LOOP_SCHEME_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29#include "../sdc/scheme.h" │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29#include "../osd/opencl.h" │ │ │ │ │ 30 │ │ │ │ │ - 31#include │ │ │ │ │ - 32#include │ │ │ │ │ + 31namespace OpenSubdiv { │ │ │ │ │ + 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36namespace Sdc { │ │ │ │ │ - 37 │ │ │ │ │ - 38 │ │ │ │ │ - 39// │ │ │ │ │ - 40// Specializations for Sdc::Scheme: │ │ │ │ │ - 41// │ │ │ │ │ - 42// │ │ │ │ │ + 34namespace Osd { │ │ │ │ │ + 35 │ │ │ │ │ +42class CLVertexBuffer { │ │ │ │ │ 43 │ │ │ │ │ - 44// │ │ │ │ │ - 45// Loop traits: │ │ │ │ │ - 46// │ │ │ │ │ - 47template <> │ │ │ │ │ -48inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ -SPLIT_TO_TRIS; } │ │ │ │ │ - 49 │ │ │ │ │ - 50template <> │ │ │ │ │ -51inline int Scheme::GetRegularFaceSize() { return 3; } │ │ │ │ │ - 52 │ │ │ │ │ - 53template <> │ │ │ │ │ -54inline int Scheme::GetRegularVertexValence() { return 6; } │ │ │ │ │ - 55 │ │ │ │ │ - 56template <> │ │ │ │ │ -57inline int Scheme::GetLocalNeighborhoodSize() { return 1; } │ │ │ │ │ - 58 │ │ │ │ │ - 59 │ │ │ │ │ - 60// │ │ │ │ │ - 61// Protected methods to assign the two types of masks for an edge-vertex -- │ │ │ │ │ - 62// Crease and Smooth. │ │ │ │ │ - 63// │ │ │ │ │ - 64// The Crease case does not really need to be specialized, though it may be │ │ │ │ │ - 65// preferable to define all explicitly here. │ │ │ │ │ - 66// │ │ │ │ │ - 67template <> │ │ │ │ │ - 68template │ │ │ │ │ - 69inline void │ │ │ │ │ -70Scheme::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const │ │ │ │ │ - 71{ │ │ │ │ │ - 72 mask.SetNumVertexWeights(2); │ │ │ │ │ - 73 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 74 mask.SetNumFaceWeights(0); │ │ │ │ │ - 75 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 76 │ │ │ │ │ - 77 mask.VertexWeight(0) = 0.5f; │ │ │ │ │ - 78 mask.VertexWeight(1) = 0.5f; │ │ │ │ │ - 79} │ │ │ │ │ - 80 │ │ │ │ │ - 81template <> │ │ │ │ │ - 82template │ │ │ │ │ - 83inline void │ │ │ │ │ -84Scheme::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) │ │ │ │ │ -const │ │ │ │ │ - 85{ │ │ │ │ │ - 86 int faceCount = edge.GetNumFaces(); │ │ │ │ │ - 87 │ │ │ │ │ - 88 mask.SetNumVertexWeights(2); │ │ │ │ │ - 89 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 90 mask.SetNumFaceWeights(faceCount); │ │ │ │ │ - 91 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 92 │ │ │ │ │ - 93 // │ │ │ │ │ - 94 // This is where we run into the issue of "face weights" -- we want to │ │ │ │ │ -weight the │ │ │ │ │ - 95 // face-centers for Catmark, but face-centers are not generated for Loop. │ │ │ │ │ -So do │ │ │ │ │ - 96 // we make assumptions on how the mask is used, assign some property to the │ │ │ │ │ -mask │ │ │ │ │ - 97 // to indicate how they were assigned, or take input from the mask itself? │ │ │ │ │ - 98 // │ │ │ │ │ - 99 // Regardless, we have two choices: │ │ │ │ │ - 100 // - face-weights are for the vertices opposite the edge (as in Hbr): │ │ │ │ │ - 101 // vertex weights = 0.375f; │ │ │ │ │ - 102 // face weights = 0.125f; │ │ │ │ │ - 103 // │ │ │ │ │ - 104 // - face-weights are for the face centers: │ │ │ │ │ - 105 // vertex weights = 0.125f; │ │ │ │ │ - 106 // face weights = 0.375f; │ │ │ │ │ - 107 // │ │ │ │ │ - 108 // Coincidentally the coefficients are the same but reversed. │ │ │ │ │ - 109 // │ │ │ │ │ - 110 typedef typename MASK::Weight Weight; │ │ │ │ │ - 111 │ │ │ │ │ - 112 Weight vWeight = mask.AreFaceWeightsForFaceCenters() ? 0.125f : 0.375f; │ │ │ │ │ - 113 Weight fWeight = mask.AreFaceWeightsForFaceCenters() ? 0.375f : 0.125f; │ │ │ │ │ - 114 │ │ │ │ │ - 115 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 116 mask.VertexWeight(1) = vWeight; │ │ │ │ │ - 117 │ │ │ │ │ - 118 if (faceCount == 2) { │ │ │ │ │ - 119 mask.FaceWeight(0) = fWeight; │ │ │ │ │ - 120 mask.FaceWeight(1) = fWeight; │ │ │ │ │ - 121 } else { │ │ │ │ │ - 122 // The non-manifold case is not clearly defined -- we adjust the above │ │ │ │ │ - 123 // face-weight to preserve the ratio of edge-center and face-centers: │ │ │ │ │ - 124 fWeight *= 2.0f / (Weight) faceCount; │ │ │ │ │ - 125 for (int i = 0; i < faceCount; ++i) { │ │ │ │ │ - 126 mask.FaceWeight(i) = fWeight; │ │ │ │ │ - 127 } │ │ │ │ │ - 128 } │ │ │ │ │ - 129} │ │ │ │ │ - 130 │ │ │ │ │ - 131 │ │ │ │ │ - 132// │ │ │ │ │ - 133// Protected methods to assign the three types of masks for a vertex-vertex │ │ │ │ │ --- │ │ │ │ │ - 134// Corner, Crease and Smooth (Dart is the same as Smooth). │ │ │ │ │ - 135// │ │ │ │ │ - 136// Corner and Crease do not really need to be specialized, though it may be │ │ │ │ │ - 137// preferable to define all explicitly here. │ │ │ │ │ - 138// │ │ │ │ │ - 139template <> │ │ │ │ │ - 140template │ │ │ │ │ - 141inline void │ │ │ │ │ -142Scheme::assignCornerMaskForVertex(VERTEX const&, MASK& mask) │ │ │ │ │ -const │ │ │ │ │ - 143{ │ │ │ │ │ - 144 mask.SetNumVertexWeights(1); │ │ │ │ │ - 145 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 146 mask.SetNumFaceWeights(0); │ │ │ │ │ - 147 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 148 │ │ │ │ │ - 149 mask.VertexWeight(0) = 1.0f; │ │ │ │ │ - 150} │ │ │ │ │ - 151 │ │ │ │ │ - 152template <> │ │ │ │ │ - 153template │ │ │ │ │ - 154inline void │ │ │ │ │ -155Scheme::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& │ │ │ │ │ -mask, │ │ │ │ │ - 156 int const creaseEnds[2]) const { │ │ │ │ │ - 157 typedef typename MASK::Weight Weight; │ │ │ │ │ - 158 │ │ │ │ │ - 159 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 160 │ │ │ │ │ - 161 mask.SetNumVertexWeights(1); │ │ │ │ │ - 162 mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 163 mask.SetNumFaceWeights(0); │ │ │ │ │ - 164 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 165 │ │ │ │ │ - 166 Weight vWeight = 0.75f; │ │ │ │ │ - 167 Weight eWeight = 0.125f; │ │ │ │ │ - 168 │ │ │ │ │ - 169 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 170 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 171 mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 172 } │ │ │ │ │ - 173 mask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ - 174 mask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ - 175} │ │ │ │ │ - 176 │ │ │ │ │ - 177template <> │ │ │ │ │ - 178template │ │ │ │ │ - 179inline void │ │ │ │ │ -180Scheme::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& │ │ │ │ │ -mask) const │ │ │ │ │ - 181{ │ │ │ │ │ - 182 typedef typename MASK::Weight Weight; │ │ │ │ │ - 183 │ │ │ │ │ - 184 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 185 │ │ │ │ │ - 186 mask.SetNumVertexWeights(1); │ │ │ │ │ - 187 mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 188 mask.SetNumFaceWeights(0); │ │ │ │ │ - 189 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 190 │ │ │ │ │ - 191 // Specialize for the regular case: 1/16 per edge-vert, 5/8 for the vert │ │ │ │ │ -itself: │ │ │ │ │ - 192 Weight eWeight = (Weight) 0.0625f; │ │ │ │ │ - 193 Weight vWeight = (Weight) 0.625f; │ │ │ │ │ - 194 │ │ │ │ │ - 195 if (valence != 6) { │ │ │ │ │ - 196 // From HbrLoopSubdivision::Subdivide(mesh, vertex): │ │ │ │ │ - 197 // - could use some lookup tables here for common irregular valence (5, 7, │ │ │ │ │ -8) │ │ │ │ │ - 198 // or all of these cosine calls will be adding up... │ │ │ │ │ - 199 │ │ │ │ │ - 200 double dValence = (double) valence; │ │ │ │ │ - 201 double invValence = 1.0f / dValence; │ │ │ │ │ - 202 double cosTheta = std::cos(M_PI * 2.0f * invValence); │ │ │ │ │ - 203 │ │ │ │ │ - 204 double beta = 0.25f * cosTheta + 0.375f; │ │ │ │ │ - 205 │ │ │ │ │ - 206 eWeight = (Weight) ((0.625f - (beta * beta)) * invValence); │ │ │ │ │ - 207 vWeight = (Weight) (1.0f - (eWeight * dValence)); │ │ │ │ │ - 208 } │ │ │ │ │ - 209 │ │ │ │ │ - 210 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 211 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 212 mask.EdgeWeight(i) = eWeight; │ │ │ │ │ - 213 } │ │ │ │ │ - 214} │ │ │ │ │ - 215 │ │ │ │ │ - 216 │ │ │ │ │ - 217// │ │ │ │ │ - 218// Limit masks for position: │ │ │ │ │ - 219// │ │ │ │ │ - 220template <> │ │ │ │ │ - 221template │ │ │ │ │ - 222inline void │ │ │ │ │ -223Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& │ │ │ │ │ -posMask) const { │ │ │ │ │ - 224 │ │ │ │ │ - 225 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 226 posMask.SetNumEdgeWeights(0); │ │ │ │ │ - 227 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 228 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 229 │ │ │ │ │ - 230 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ - 231} │ │ │ │ │ - 232 │ │ │ │ │ - 233template <> │ │ │ │ │ - 234template │ │ │ │ │ - 235inline void │ │ │ │ │ -236Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask, │ │ │ │ │ - 237 int const creaseEnds[2]) const { │ │ │ │ │ - 238 │ │ │ │ │ - 239 typedef typename MASK::Weight Weight; │ │ │ │ │ - 240 │ │ │ │ │ - 241 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 242 │ │ │ │ │ - 243 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 244 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ - 245 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 246 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 247 │ │ │ │ │ - 248 // │ │ │ │ │ - 249 // The refinement mask for a crease vertex is (1/8, 3/4, 1/8) and for a │ │ │ │ │ -crease │ │ │ │ │ - 250 // edge is (1/2, 1/2) -- producing a uniform B-spline curve along the │ │ │ │ │ -crease │ │ │ │ │ - 251 // (boundary) whether the vertex or its crease is regular or not. The │ │ │ │ │ -limit │ │ │ │ │ - 252 // mask is therefore (1/6, 2/3, 1/6) for ALL cases. │ │ │ │ │ - 253 // │ │ │ │ │ - 254 // An alternative limit mask (1/5, 3/5, 1/5) is often published for use │ │ │ │ │ -either │ │ │ │ │ - 255 // for irregular crease vertices or for all crease/boundary vertices, but │ │ │ │ │ -this │ │ │ │ │ - 256 // is based on an alternate refinement mask for the edge -- (3/8, 5/8) │ │ │ │ │ -versus │ │ │ │ │ - 257 // the usual (1/2, 1/2) -- and will not produce the B-spline curve │ │ │ │ │ -desired. │ │ │ │ │ - 258 // │ │ │ │ │ - 259 Weight vWeight = (Weight) (4.0 / 6.0); │ │ │ │ │ - 260 Weight eWeight = (Weight) (1.0 / 6.0); │ │ │ │ │ - 261 │ │ │ │ │ - 262 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 263 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 264 posMask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 265 } │ │ │ │ │ - 266 posMask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ - 267 posMask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ - 268} │ │ │ │ │ - 269 │ │ │ │ │ - 270template <> │ │ │ │ │ - 271template │ │ │ │ │ - 272inline void │ │ │ │ │ -273Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask) const { │ │ │ │ │ - 274 │ │ │ │ │ - 275 typedef typename MASK::Weight Weight; │ │ │ │ │ - 276 │ │ │ │ │ - 277 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 278 │ │ │ │ │ - 279 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 280 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ - 281 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 282 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 283 │ │ │ │ │ - 284 // Specialize for the regular case: 1/12 per edge-vert, 1/2 for the vert │ │ │ │ │ -itself: │ │ │ │ │ - 285 if (valence == 6) { │ │ │ │ │ - 286 Weight eWeight = (Weight) (1.0 / 12.0); │ │ │ │ │ - 287 Weight vWeight = 0.5f; │ │ │ │ │ - 288 │ │ │ │ │ - 289 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 290 │ │ │ │ │ - 291 posMask.EdgeWeight(0) = eWeight; │ │ │ │ │ - 292 posMask.EdgeWeight(1) = eWeight; │ │ │ │ │ - 293 posMask.EdgeWeight(2) = eWeight; │ │ │ │ │ - 294 posMask.EdgeWeight(3) = eWeight; │ │ │ │ │ - 295 posMask.EdgeWeight(4) = eWeight; │ │ │ │ │ - 296 posMask.EdgeWeight(5) = eWeight; │ │ │ │ │ - 297 │ │ │ │ │ - 298 } else { │ │ │ │ │ - 299 double dValence = (double) valence; │ │ │ │ │ - 300 double invValence = 1.0f / dValence; │ │ │ │ │ - 301 double cosTheta = std::cos(M_PI * 2.0f * invValence); │ │ │ │ │ - 302 │ │ │ │ │ - 303 double beta = 0.25f * cosTheta + 0.375f; │ │ │ │ │ - 304 double gamma = (0.625f - (beta * beta)) * invValence; │ │ │ │ │ - 305 │ │ │ │ │ - 306 Weight eWeight = (Weight) (1.0f / (dValence + 3.0f / (8.0f * gamma))); │ │ │ │ │ - 307 Weight vWeight = (Weight) (1.0f - (eWeight * dValence)); │ │ │ │ │ - 308 │ │ │ │ │ - 309 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 310 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 311 posMask.EdgeWeight(i) = eWeight; │ │ │ │ │ - 312 } │ │ │ │ │ - 313 } │ │ │ │ │ - 314} │ │ │ │ │ - 315 │ │ │ │ │ - 316/* │ │ │ │ │ - 317// Limit masks for tangents: │ │ │ │ │ - 318// │ │ │ │ │ - 319// A note on tangent magnitudes: │ │ │ │ │ - 320// │ │ │ │ │ - 321// Several formulae exist for limit tangents at a vertex to accommodate the │ │ │ │ │ - 322// different topological configurations around the vertex. While these │ │ │ │ │ -produce │ │ │ │ │ - 323// the desired direction, there is inconsistency in the resulting │ │ │ │ │ -magnitudes. │ │ │ │ │ - 324// Ideally a regular mesh of uniformly shaped triangles with similar edge │ │ │ │ │ -lengths │ │ │ │ │ - 325// should produce tangents of similar magnitudes throughout -- including │ │ │ │ │ -corners │ │ │ │ │ - 326// and boundaries. So some of the common formulae for these are adjusted │ │ │ │ │ -with │ │ │ │ │ - 327// scale factors. │ │ │ │ │ - 328// │ │ │ │ │ - 329// For uses where magnitude does not matter, this scaling should be │ │ │ │ │ -irrelevant. │ │ │ │ │ - 330// But just as with patches, where the magnitudes of partial derivatives │ │ │ │ │ -are │ │ │ │ │ - 331// consistent between similar patches, the magnitudes of limit tangents │ │ │ │ │ -should │ │ │ │ │ - 332// also be similar. │ │ │ │ │ - 333// │ │ │ │ │ - 334// The reference tangents, in terms of magnitudes, are those produced by │ │ │ │ │ -the │ │ │ │ │ - 335// limit tangent mask for smooth interior vertices, for which well │ │ │ │ │ -established │ │ │ │ │ - 336// sin/cos formulae apply -- these remain unscaled. Formulae for the other │ │ │ │ │ - 337// crease/boundary, corner tangents and irregular cases are scaled to be │ │ │ │ │ -more │ │ │ │ │ - 338// consistent with these. │ │ │ │ │ - 339// │ │ │ │ │ - 340// The crease/boundary tangents for the regular case can be viewed as │ │ │ │ │ -derived │ │ │ │ │ - 341// from the smooth interior masks with two "phantom" points extrapolated │ │ │ │ │ -across │ │ │ │ │ - 342// the regular boundary: │ │ │ │ │ - 343// │ │ │ │ │ - 344// v3 v2 │ │ │ │ │ - 345// X - - - - - X │ │ │ │ │ - 346// / \ / \ │ │ │ │ │ - 347// / \ / \ │ │ │ │ │ - 348// v4 X - - - - - X - - - - - X v1 │ │ │ │ │ - 349// . . 0 . . │ │ │ │ │ - 350// . . . . │ │ │ │ │ - 351// . . . . │ │ │ │ │ - 352// (v5) (v6) │ │ │ │ │ - 353// │ │ │ │ │ - 354// where v5 = v0 + (v4 - v3) and v6 = v0 + v1 - v2. │ │ │ │ │ - 355// │ │ │ │ │ - 356// When the standard limit tangent mask is applied, the cosines of │ │ │ │ │ -increments │ │ │ │ │ - 357// of pi/3 give us coefficients that are multiples of 1/2, leading to the │ │ │ │ │ -first │ │ │ │ │ - 358// tangent T1 = 3/2 * (v1 - v4), rather than the widely used T1 = v1 - v4. │ │ │ │ │ -So │ │ │ │ │ - 359// this scale factor of 3/2 is applied to ensure tangents along the │ │ │ │ │ -boundaries │ │ │ │ │ - 360// are of similar magnitude as tangents in the immediate interior (which │ │ │ │ │ -may be │ │ │ │ │ - 361// parallel). │ │ │ │ │ - 362// │ │ │ │ │ - 363// Tangents at corners are essentially a form of boundary tangent, and so │ │ │ │ │ -its │ │ │ │ │ - 364// simple difference formula is scaled to be consistent with adjoining │ │ │ │ │ -boundary │ │ │ │ │ - 365// tangents -- not just with the 3/2 factor from above, but with an │ │ │ │ │ -additional │ │ │ │ │ - 366// 2.0 to compensate for the fact that the difference of only side of the │ │ │ │ │ -vertex │ │ │ │ │ - 367// is considered here. The resulting scale factor of 3.0 for the regular │ │ │ │ │ -corner │ │ │ │ │ - 368// is what similarly arises by extrapolating an interior region around the │ │ │ │ │ - 369// vertex and using the interior mask for the first tangent. │ │ │ │ │ - 370// │ │ │ │ │ - 371// The cross-tangent formula for the regular crease/boundary is similarly │ │ │ │ │ -found │ │ │ │ │ - 372// from the above construction of the boundary, but the commonly used │ │ │ │ │ -weights of │ │ │ │ │ - 373// +/- 1 and 2 result from omitting the common factor of sqrt(3)/2 (arising │ │ │ │ │ -from │ │ │ │ │ - 374// the sines of increments of pi/3). With that scale factor close to one, │ │ │ │ │ -it has │ │ │ │ │ - 375// less impact than the irregular cases, which are analogous to corner │ │ │ │ │ -tangents │ │ │ │ │ - 376// in that differences on only one side of the vertex are considered. While │ │ │ │ │ -a │ │ │ │ │ - 377// scaling of 3.0 is similarly understandable for the valence 2 and 3 │ │ │ │ │ -cases, it is │ │ │ │ │ - 378// less obvious in the irregular formula for valence > 4, but similarly │ │ │ │ │ -effective. │ │ │ │ │ - 379// │ │ │ │ │ - 380// The end result of these adjustments should be a set of limit tangents │ │ │ │ │ -that are │ │ │ │ │ - 381// of similar magnitude over a regular mesh including boundaries and │ │ │ │ │ -corners. │ │ │ │ │ - 382*/ │ │ │ │ │ - 383template <> │ │ │ │ │ - 384template │ │ │ │ │ - 385inline void │ │ │ │ │ -386Scheme::assignCornerLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 387 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 388 │ │ │ │ │ - 389 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 390 │ │ │ │ │ - 391 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 392 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 393 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ - 394 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 395 │ │ │ │ │ - 396 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 397 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 398 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ - 399 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 400 │ │ │ │ │ - 401 // See note above regarding scale factor of 3.0: │ │ │ │ │ - 402 tan1Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ - 403 tan1Mask.EdgeWeight(0) = 3.0f; │ │ │ │ │ - 404 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ - 405 │ │ │ │ │ - 406 tan2Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ - 407 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ - 408 tan2Mask.EdgeWeight(1) = 3.0f; │ │ │ │ │ - 409 │ │ │ │ │ - 410 // Should be at least 2 edges -- be sure to clear weights for any more: │ │ │ │ │ - 411 for (int i = 2; i < valence; ++i) { │ │ │ │ │ - 412 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 413 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 414 } │ │ │ │ │ - 415} │ │ │ │ │ - 416 │ │ │ │ │ - 417template <> │ │ │ │ │ - 418template │ │ │ │ │ - 419inline void │ │ │ │ │ -420Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 421 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const { │ │ │ │ │ - 422 │ │ │ │ │ - 423 typedef typename MASK::Weight Weight; │ │ │ │ │ - 424 │ │ │ │ │ - 425 // │ │ │ │ │ - 426 // First, the tangent along the crease: │ │ │ │ │ - 427 // The first crease edge is considered the "leading" edge of the span │ │ │ │ │ - 428 // of surface for which we are evaluating tangents and the second edge the │ │ │ │ │ - 429 // "trailing edge". By convention, the tangent along the crease is │ │ │ │ │ -oriented │ │ │ │ │ - 430 // in the direction of the leading edge. │ │ │ │ │ - 431 // │ │ │ │ │ - 432 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 433 │ │ │ │ │ - 434 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 435 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 436 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ - 437 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 438 │ │ │ │ │ - 439 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 440 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 441 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 442 } │ │ │ │ │ - 443 │ │ │ │ │ - 444 // See the note above regarding scale factor of 1.5: │ │ │ │ │ - 445 tan1Mask.EdgeWeight(creaseEnds[0]) = 1.5f; │ │ │ │ │ - 446 tan1Mask.EdgeWeight(creaseEnds[1]) = -1.5f; │ │ │ │ │ - 447 │ │ │ │ │ - 448 // │ │ │ │ │ - 449 // Second, the tangent across the interior faces: │ │ │ │ │ - 450 // Note this is ambiguous for an interior vertex. We currently return │ │ │ │ │ - 451 // the tangent for the surface in the counter-clockwise span between the │ │ │ │ │ - 452 // leading and trailing edges that form the crease. Given the expected │ │ │ │ │ - 453 // computation of a surface normal as Tan1 X Tan2, this tangent should be │ │ │ │ │ - 454 // oriented "inward" from the crease/boundary -- across the surface rather │ │ │ │ │ - 455 // than outward and away from it. │ │ │ │ │ - 456 // │ │ │ │ │ - 457 // There is inconsistency in the orientation of this tangent in commonly │ │ │ │ │ - 458 // published results: the general formula provided for arbitrary valence │ │ │ │ │ - 459 // has the tangent pointing across the crease and "outward" from the │ │ │ │ │ -surface, │ │ │ │ │ - 460 // while the special cases for regular valence and lower have the tangent │ │ │ │ │ - 461 // pointing across the surface and "inward" from the crease. So if we are │ │ │ │ │ - 462 // to consistently orient the first tangent along the crease, regardless │ │ │ │ │ -of │ │ │ │ │ - 463 // the interior topology, we have to correct this. With the first tangent │ │ │ │ │ - 464 // following the direction of the leading crease edge, we want the second │ │ │ │ │ - 465 // tangent pointing inward/across the surface -- so we flip the result of │ │ │ │ │ - 466 // the general formula. │ │ │ │ │ - 467 // │ │ │ │ │ - 468 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 469 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 470 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ - 471 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 472 │ │ │ │ │ - 473 for (int i = 0; i < creaseEnds[0]; ++i) { │ │ │ │ │ - 474 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 475 } │ │ │ │ │ - 476 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1; │ │ │ │ │ - 477 if (interiorEdgeCount == 2) { │ │ │ │ │ - 478 // See note above regarding scale factor of (sin(60 degs) == sqrt(3)/2: │ │ │ │ │ - 479 │ │ │ │ │ - 480 static Weight const Root3 = (Weight) 1.73205080756887729352; │ │ │ │ │ - 481 static Weight const Root3by2 = (Weight) (Root3 * 0.5); │ │ │ │ │ - 482 │ │ │ │ │ - 483 tan2Mask.VertexWeight(0) = -Root3; │ │ │ │ │ - 484 │ │ │ │ │ - 485 tan2Mask.EdgeWeight(creaseEnds[0]) = -Root3by2; │ │ │ │ │ - 486 tan2Mask.EdgeWeight(creaseEnds[1]) = -Root3by2; │ │ │ │ │ - 487 │ │ │ │ │ - 488 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = Root3; │ │ │ │ │ - 489 tan2Mask.EdgeWeight(creaseEnds[0] + 2) = Root3; │ │ │ │ │ - 490 } else if (interiorEdgeCount > 2) { │ │ │ │ │ - 491 // See notes above regarding scale factor of -3.0 (-1 for orientation, │ │ │ │ │ - 492 // 2.0 for considering the region as a half-disk, and 1.5 in keeping │ │ │ │ │ - 493 // with the crease tangent): │ │ │ │ │ - 494 │ │ │ │ │ - 495 double theta = M_PI / (interiorEdgeCount + 1); │ │ │ │ │ - 496 │ │ │ │ │ - 497 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 498 │ │ │ │ │ - 499 Weight cWeight = (Weight) (-3.0f * std::sin(theta)); │ │ │ │ │ - 500 tan2Mask.EdgeWeight(creaseEnds[0]) = cWeight; │ │ │ │ │ - 501 tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight; │ │ │ │ │ - 502 │ │ │ │ │ - 503 double eCoeff = -3.0f * 2.0f * (std::cos(theta) - 1.0f); │ │ │ │ │ - 504 for (int i = 1; i <= interiorEdgeCount; ++i) { │ │ │ │ │ - 505 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) (eCoeff * std::sin(i * │ │ │ │ │ -theta)); │ │ │ │ │ - 506 } │ │ │ │ │ - 507 } else if (interiorEdgeCount == 1) { │ │ │ │ │ - 508 // See notes above regarding scale factor of 3.0: │ │ │ │ │ - 509 │ │ │ │ │ - 510 tan2Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ - 511 │ │ │ │ │ - 512 tan2Mask.EdgeWeight(creaseEnds[0]) = 0.0f; │ │ │ │ │ - 513 tan2Mask.EdgeWeight(creaseEnds[1]) = 0.0f; │ │ │ │ │ - 514 │ │ │ │ │ - 515 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = 3.0f; │ │ │ │ │ - 516 } else { │ │ │ │ │ - 517 // See notes above regarding scale factor of 3.0: │ │ │ │ │ - 518 │ │ │ │ │ - 519 tan2Mask.VertexWeight(0) = -6.0f; │ │ │ │ │ - 520 │ │ │ │ │ - 521 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f; │ │ │ │ │ - 522 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f; │ │ │ │ │ - 523 } │ │ │ │ │ - 524 for (int i = creaseEnds[1] + 1; i < valence; ++i) { │ │ │ │ │ - 525 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 526 } │ │ │ │ │ - 527} │ │ │ │ │ - 528 │ │ │ │ │ - 529template <> │ │ │ │ │ - 530template │ │ │ │ │ - 531inline void │ │ │ │ │ -532Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 533 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 534 │ │ │ │ │ - 535 typedef typename MASK::Weight Weight; │ │ │ │ │ - 536 │ │ │ │ │ - 537 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 538 │ │ │ │ │ - 539 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 540 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 541 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ - 542 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 543 │ │ │ │ │ - 544 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 545 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 546 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ - 547 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 548 │ │ │ │ │ - 549 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 550 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 551 │ │ │ │ │ - 552 if (valence == 6) { │ │ │ │ │ - 553 static Weight const Root3by2 = (Weight)(0.5 * 1.73205080756887729352); │ │ │ │ │ - 554 │ │ │ │ │ - 555 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ - 556 tan1Mask.EdgeWeight(1) = 0.5f; │ │ │ │ │ - 557 tan1Mask.EdgeWeight(2) = -0.5f; │ │ │ │ │ - 558 tan1Mask.EdgeWeight(3) = -1.0f; │ │ │ │ │ - 559 tan1Mask.EdgeWeight(4) = -0.5f; │ │ │ │ │ - 560 tan1Mask.EdgeWeight(5) = 0.5f; │ │ │ │ │ - 561 │ │ │ │ │ - 562 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ - 563 tan2Mask.EdgeWeight(1) = Root3by2; │ │ │ │ │ - 564 tan2Mask.EdgeWeight(2) = Root3by2; │ │ │ │ │ - 565 tan2Mask.EdgeWeight(3) = 0.0f; │ │ │ │ │ - 566 tan2Mask.EdgeWeight(4) = -Root3by2; │ │ │ │ │ - 567 tan2Mask.EdgeWeight(5) = -Root3by2; │ │ │ │ │ - 568 } else { │ │ │ │ │ - 569 double alpha = 2.0f * M_PI / valence; │ │ │ │ │ - 570 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 571 double alphaI = alpha * i; │ │ │ │ │ - 572 tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI); │ │ │ │ │ - 573 tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI); │ │ │ │ │ - 574 } │ │ │ │ │ - 575 } │ │ │ │ │ - 576} │ │ │ │ │ - 577 │ │ │ │ │ - 578} // end namespace Sdc │ │ │ │ │ - 579} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 580using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 581} // end namespace OpenSubdiv │ │ │ │ │ - 582 │ │ │ │ │ - 583#endif /* OPENSUBDIV3_SDC_LOOP_SCHEME_H */ │ │ │ │ │ + 44public: │ │ │ │ │ +46 static CLVertexBuffer * Create(int numElements, int numVertices, cl_context │ │ │ │ │ +clContext); │ │ │ │ │ + 47 │ │ │ │ │ + 48 template │ │ │ │ │ +49 static CLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 50 DEVICE_CONTEXT context) { │ │ │ │ │ + 51 return Create(numElements, numVertices, context->GetContext()); │ │ │ │ │ + 52 } │ │ │ │ │ + 53 │ │ │ │ │ +55 ~CLVertexBuffer(); │ │ │ │ │ + 56 │ │ │ │ │ +59 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ +cl_command_queue clQueue, │ │ │ │ │ + 60 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* │ │ │ │ │ +endEvent = NULL); │ │ │ │ │ + 61 │ │ │ │ │ + 62 template │ │ │ │ │ +63 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 64 DEVICE_CONTEXT context, │ │ │ │ │ + 65 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* │ │ │ │ │ +endEvent = NULL) { │ │ │ │ │ + 66 UpdateData(src, startVertex, numVertices, context->GetCommandQueue(), │ │ │ │ │ +startEvents, numStartEvents, endEvent); │ │ │ │ │ + 67 } │ │ │ │ │ + 68 │ │ │ │ │ +70 int GetNumElements() const; │ │ │ │ │ + 71 │ │ │ │ │ +73 int GetNumVertices() const; │ │ │ │ │ + 74 │ │ │ │ │ +76 cl_mem BindCLBuffer(cl_command_queue queue); │ │ │ │ │ + 77 │ │ │ │ │ + 78protected: │ │ │ │ │ +80 CLVertexBuffer(int numElements, int numVertices, cl_context clContext); │ │ │ │ │ + 81 │ │ │ │ │ +84 bool allocate(cl_context clContext); │ │ │ │ │ + 85 │ │ │ │ │ + 86private: │ │ │ │ │ + 87 int _numElements; │ │ │ │ │ + 88 int _numVertices; │ │ │ │ │ + 89 cl_mem _clMemory; │ │ │ │ │ + 90}; │ │ │ │ │ + 91 │ │ │ │ │ + 92} // end namespace Osd │ │ │ │ │ + 93 │ │ │ │ │ + 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 96 │ │ │ │ │ + 97} // end namespace OpenSubdiv │ │ │ │ │ + 98 │ │ │ │ │ + 99#endif // OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ -Split │ │ │ │ │ -Enumerated type for all face splitting schemes. │ │ │ │ │ -Definition: types.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_TRIS │ │ │ │ │ -@ SPLIT_TO_TRIS │ │ │ │ │ -Used by Loop. │ │ │ │ │ -Definition: types.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForEdge │ │ │ │ │ -void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ -static Split GetTopologicalSplitType() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForVertex │ │ │ │ │ -void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ -void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2, int const creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ -static int GetRegularFaceSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForEdge │ │ │ │ │ -void assignCreaseMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ -Definition: scheme.h:317 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ -void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ -static int GetLocalNeighborhoodSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerMaskForVertex │ │ │ │ │ -void assignCornerMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ -Definition: scheme.h:331 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ -void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForVertex │ │ │ │ │ -void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ -static int GetRegularVertexValence() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ -void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ -void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ -void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer │ │ │ │ │ +Concrete vertex buffer class for OpenCL subdivision. │ │ │ │ │ +Definition: clVertexBuffer.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ +DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int │ │ │ │ │ +numStartEvents=0, cl_event *endEvent=NULL) │ │ │ │ │ +Definition: clVertexBuffer.h:63 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::~CLVertexBuffer │ │ │ │ │ +~CLVertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::CLVertexBuffer │ │ │ │ │ +CLVertexBuffer(int numElements, int numVertices, cl_context clContext) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ +cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int │ │ │ │ │ +numStartEvents=0, cl_event *endEvent=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::allocate │ │ │ │ │ +bool allocate(cl_context clContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::Create │ │ │ │ │ +static CLVertexBuffer * Create(int numElements, int numVertices, cl_context │ │ │ │ │ +clContext) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::Create │ │ │ │ │ +static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT │ │ │ │ │ +context) │ │ │ │ │ +Definition: clVertexBuffer.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::BindCLBuffer │ │ │ │ │ +cl_mem BindCLBuffer(cl_command_queue queue) │ │ │ │ │ +Returns the CL memory object. │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * loopScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00782.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/catmarkScheme.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/clPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,38 +81,48 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces
│ │ │ │ -
catmarkScheme.h File Reference
│ │ │ │ +
clPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../sdc/scheme.h"
│ │ │ │ -#include <cassert>
│ │ │ │ -#include <cmath>
│ │ │ │ +#include "../osd/opencl.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CLPatchTable
 CL patch table. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,25 +4,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces │ │ │ │ │ -catmarkScheme.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +clPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../sdc/scheme.h" │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include "../osd/opencl.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CLPatchTable │ │ │ │ │ +  CL patch table. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * catmarkScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00782_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/catmarkScheme.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/clPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
catmarkScheme.h
│ │ │ │ +
clPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,548 +106,121 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_SDC_CATMARK_SCHEME_H
│ │ │ │ -
25#define OPENSUBDIV3_SDC_CATMARK_SCHEME_H
│ │ │ │ -
26
│ │ │ │ -
27#include "../version.h"
│ │ │ │ -
28
│ │ │ │ -
29#include "../sdc/scheme.h"
│ │ │ │ -
30
│ │ │ │ -
31#include <cassert>
│ │ │ │ -
32#include <cmath>
│ │ │ │ +
24
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ +
27
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/opencl.h"
│ │ │ │ +
31#include "../osd/nonCopyable.h"
│ │ │ │ +
32#include "../osd/types.h"
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Sdc {
│ │ │ │ +
34#include <vector>
│ │ │ │ +
35
│ │ │ │ +
36namespace OpenSubdiv {
│ │ │ │ +
37namespace OPENSUBDIV_VERSION {
│ │ │ │
38
│ │ │ │ -
39//
│ │ │ │ -
40// Specializations for Scheme<SCHEME_CATMARK>:
│ │ │ │ -
41//
│ │ │ │ +
39namespace Far{
│ │ │ │ +
40 class PatchTable;
│ │ │ │ +
41};
│ │ │ │
42
│ │ │ │ -
43//
│ │ │ │ -
44// Catmark traits:
│ │ │ │ -
45//
│ │ │ │ -
46template <>
│ │ │ │ - │ │ │ │ -
48
│ │ │ │ -
49template <>
│ │ │ │ - │ │ │ │ -
51
│ │ │ │ -
52template <>
│ │ │ │ - │ │ │ │ -
54
│ │ │ │ -
55template <>
│ │ │ │ - │ │ │ │ +
43namespace Osd {
│ │ │ │ +
44
│ │ │ │ +
52class CLPatchTable : private NonCopyable<CLPatchTable> {
│ │ │ │ +
53public:
│ │ │ │ +
55 static CLPatchTable *Create(Far::PatchTable const *patchTable,
│ │ │ │ +
56 cl_context clContext);
│ │ │ │
57
│ │ │ │ -
58
│ │ │ │ -
59//
│ │ │ │ -
60// Masks for edge-vertices: the hard Crease mask does not need to be specialized
│ │ │ │ -
61// (simply the midpoint), so all that is left is the Smooth case:
│ │ │ │ -
62//
│ │ │ │ -
63// The Smooth mask is complicated by the need to support the "triangle subdivision"
│ │ │ │ -
64// option, which applies different weighting in the presence of triangles. It is
│ │ │ │ -
65// up for debate as to whether this is useful or not -- we may be able to deprecate
│ │ │ │ -
66// this option.
│ │ │ │ -
67//
│ │ │ │ -
68template <>
│ │ │ │ -
69template <typename EDGE, typename MASK>
│ │ │ │ -
70inline void
│ │ │ │ -
71Scheme<SCHEME_CATMARK>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const {
│ │ │ │ +
58 template <typename DEVICE_CONTEXT>
│ │ │ │ +
59 static CLPatchTable * Create(Far::PatchTable const *patchTable,
│ │ │ │ +
60 DEVICE_CONTEXT context) {
│ │ │ │ +
61 return Create(patchTable, context->GetContext());
│ │ │ │ +
62 }
│ │ │ │ +
63
│ │ │ │ + │ │ │ │ +
66
│ │ │ │ +
68 cl_mem GetPatchArrayBuffer() const { return _patchArrays; }
│ │ │ │ +
69
│ │ │ │ +
71 cl_mem GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │
72
│ │ │ │ -
73 typedef typename MASK::Weight Weight;
│ │ │ │ -
74
│ │ │ │ -
75 int faceCount = edge.GetNumFaces();
│ │ │ │ -
76
│ │ │ │ -
77 mask.SetNumVertexWeights(2);
│ │ │ │ -
78 mask.SetNumEdgeWeights(0);
│ │ │ │ -
79 mask.SetNumFaceWeights(faceCount);
│ │ │ │ -
80 mask.SetFaceWeightsForFaceCenters(true);
│ │ │ │ +
74 cl_mem GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ +
75
│ │ │ │ + │ │ │ │ +
78
│ │ │ │ + │ │ │ │
81
│ │ │ │ -
82 //
│ │ │ │ -
83 // Determine if we need to inspect incident faces and apply alternate weighting for
│ │ │ │ -
84 // triangles -- and if so, determine which of the two are triangles.
│ │ │ │ -
85 //
│ │ │ │ -
86 bool face0IsTri = false;
│ │ │ │ -
87 bool face1IsTri = false;
│ │ │ │ -
88 bool useTriangleOption = (_options.GetTriangleSubdivision() == Options::TRI_SUB_SMOOTH);
│ │ │ │ -
89 if (useTriangleOption) {
│ │ │ │ -
90 if (faceCount == 2) {
│ │ │ │ -
91 //
│ │ │ │ -
92 // Ideally we want to avoid this inspection when we have already subdivided at
│ │ │ │ -
93 // least once -- need something in the Edge interface to help avoid this, e.g.
│ │ │ │ -
94 // an IsRegular() query, the subdivision level...
│ │ │ │ -
95 //
│ │ │ │ -
96 int vertsPerFace[2];
│ │ │ │ -
97 edge.GetNumVerticesPerFace(vertsPerFace);
│ │ │ │ +
83 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ +
84
│ │ │ │ +
86 cl_mem GetFVarPatchArrayBuffer(int fvarChannel = 0) const { return _fvarPatchArrays[fvarChannel]; }
│ │ │ │ +
87
│ │ │ │ +
89 cl_mem GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return _fvarIndexBuffers[fvarChannel]; }
│ │ │ │ +
90
│ │ │ │ +
92 cl_mem GetFVarPatchParamBuffer(int fvarChannel = 0) const { return _fvarParamBuffers[fvarChannel]; }
│ │ │ │ +
93
│ │ │ │ +
94protected:
│ │ │ │ + │ │ │ │ +
96
│ │ │ │ +
97 bool allocate(Far::PatchTable const *patchTable, cl_context clContext);
│ │ │ │
98
│ │ │ │ -
99 face0IsTri = (vertsPerFace[0] == 3);
│ │ │ │ -
100 face1IsTri = (vertsPerFace[1] == 3);
│ │ │ │ -
101 useTriangleOption = face0IsTri || face1IsTri;
│ │ │ │ -
102 } else {
│ │ │ │ -
103 useTriangleOption = false;
│ │ │ │ -
104 }
│ │ │ │ -
105 }
│ │ │ │ -
106
│ │ │ │ -
107 if (! useTriangleOption) {
│ │ │ │ -
108 mask.VertexWeight(0) = 0.25f;
│ │ │ │ -
109 mask.VertexWeight(1) = 0.25f;
│ │ │ │ -
110
│ │ │ │ -
111 if (faceCount == 2) {
│ │ │ │ -
112 mask.FaceWeight(0) = 0.25f;
│ │ │ │ -
113 mask.FaceWeight(1) = 0.25f;
│ │ │ │ -
114 } else {
│ │ │ │ -
115 Weight fWeight = 0.5f / (Weight)faceCount;
│ │ │ │ -
116 for (int i = 0; i < faceCount; ++i) {
│ │ │ │ -
117 mask.FaceWeight(i) = fWeight;
│ │ │ │ -
118 }
│ │ │ │ -
119 }
│ │ │ │ -
120 } else {
│ │ │ │ -
121 //
│ │ │ │ -
122 // This mimics the implementation in Hbr in terms of order of operations.
│ │ │ │ -
123 //
│ │ │ │ -
124 const Weight CATMARK_SMOOTH_TRI_EDGE_WEIGHT = (Weight) 0.470;
│ │ │ │ -
125
│ │ │ │ -
126 Weight f0Weight = face0IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f;
│ │ │ │ -
127 Weight f1Weight = face1IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f;
│ │ │ │ -
128
│ │ │ │ -
129 Weight fWeight = 0.5f * (f0Weight + f1Weight);
│ │ │ │ -
130 Weight vWeight = 0.5f * (1.0f - 2.0f * fWeight);
│ │ │ │ -
131
│ │ │ │ -
132 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
133 mask.VertexWeight(1) = vWeight;
│ │ │ │ -
134
│ │ │ │ -
135 mask.FaceWeight(0) = fWeight;
│ │ │ │ -
136 mask.FaceWeight(1) = fWeight;
│ │ │ │ -
137 }
│ │ │ │ -
138}
│ │ │ │ -
139
│ │ │ │ -
140
│ │ │ │ -
141//
│ │ │ │ -
142// Masks for vertex-vertices: the hard Corner mask does not need to be specialized
│ │ │ │ -
143// (simply the vertex itself), leaving the Crease and Smooth cases (Dart is smooth):
│ │ │ │ -
144//
│ │ │ │ -
145template <>
│ │ │ │ -
146template <typename VERTEX, typename MASK>
│ │ │ │ -
147inline void
│ │ │ │ - │ │ │ │ -
149 int const creaseEnds[2]) const {
│ │ │ │ -
150 typedef typename MASK::Weight Weight;
│ │ │ │ -
151
│ │ │ │ -
152 int valence = vertex.GetNumEdges();
│ │ │ │ -
153
│ │ │ │ -
154 mask.SetNumVertexWeights(1);
│ │ │ │ -
155 mask.SetNumEdgeWeights(valence);
│ │ │ │ -
156 mask.SetNumFaceWeights(0);
│ │ │ │ -
157 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
158
│ │ │ │ -
159 Weight vWeight = 0.75f;
│ │ │ │ -
160 Weight eWeight = 0.125f;
│ │ │ │ -
161
│ │ │ │ -
162 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
163 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
164 mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
165 }
│ │ │ │ -
166 mask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ -
167 mask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ -
168}
│ │ │ │ -
169
│ │ │ │ -
170template <>
│ │ │ │ -
171template <typename VERTEX, typename MASK>
│ │ │ │ -
172inline void
│ │ │ │ -
173Scheme<SCHEME_CATMARK>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const {
│ │ │ │ -
174
│ │ │ │ -
175 typedef typename MASK::Weight Weight;
│ │ │ │ -
176
│ │ │ │ -
177 //
│ │ │ │ -
178 // A Smooth vertex must be manifold and interior -- manifold boundary vertices will be
│ │ │ │ -
179 // Creases and non-manifold vertices of any kind will be Corners or Creases. If smooth
│ │ │ │ -
180 // rules for non-manifold vertices are ever defined, this will need adjusting:
│ │ │ │ -
181 //
│ │ │ │ -
182 assert(vertex.GetNumFaces() == vertex.GetNumEdges());
│ │ │ │ -
183
│ │ │ │ -
184 int valence = vertex.GetNumFaces();
│ │ │ │ -
185
│ │ │ │ -
186 mask.SetNumVertexWeights(1);
│ │ │ │ -
187 mask.SetNumEdgeWeights(valence);
│ │ │ │ -
188 mask.SetNumFaceWeights(valence);
│ │ │ │ -
189 mask.SetFaceWeightsForFaceCenters(true);
│ │ │ │ -
190
│ │ │ │ -
191 Weight vWeight = (Weight)(valence - 2) / (Weight)valence;
│ │ │ │ -
192 Weight fWeight = 1.0f / (Weight)(valence * valence);
│ │ │ │ -
193 Weight eWeight = fWeight;
│ │ │ │ -
194
│ │ │ │ -
195 mask.VertexWeight(0) = vWeight;
│ │ │ │ -
196 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
197 mask.EdgeWeight(i) = eWeight;
│ │ │ │ -
198 mask.FaceWeight(i) = fWeight;
│ │ │ │ -
199 }
│ │ │ │ -
200}
│ │ │ │ -
201
│ │ │ │ -
202//
│ │ │ │ -
203// Limit masks for position:
│ │ │ │ -
204//
│ │ │ │ -
205template <>
│ │ │ │ -
206template <typename VERTEX, typename MASK>
│ │ │ │ -
207inline void
│ │ │ │ -
208Scheme<SCHEME_CATMARK>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ -
209
│ │ │ │ -
210 posMask.SetNumVertexWeights(1);
│ │ │ │ -
211 posMask.SetNumEdgeWeights(0);
│ │ │ │ -
212 posMask.SetNumFaceWeights(0);
│ │ │ │ -
213 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
214
│ │ │ │ -
215 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ -
216}
│ │ │ │ -
217
│ │ │ │ -
218template <>
│ │ │ │ -
219template <typename VERTEX, typename MASK>
│ │ │ │ -
220inline void
│ │ │ │ -
221Scheme<SCHEME_CATMARK>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ -
222 int const creaseEnds[2]) const {
│ │ │ │ -
223
│ │ │ │ -
224 typedef typename MASK::Weight Weight;
│ │ │ │ -
225
│ │ │ │ -
226 int valence = vertex.GetNumEdges();
│ │ │ │ -
227
│ │ │ │ -
228 posMask.SetNumVertexWeights(1);
│ │ │ │ -
229 posMask.SetNumEdgeWeights(valence);
│ │ │ │ -
230 posMask.SetNumFaceWeights(0);
│ │ │ │ -
231 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
232
│ │ │ │ -
233 Weight vWeight = (Weight)(2.0 / 3.0);
│ │ │ │ -
234 Weight eWeight = (Weight)(1.0 / 6.0);
│ │ │ │ -
235
│ │ │ │ -
236 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
237 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
238 posMask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
239 }
│ │ │ │ -
240 posMask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ -
241 posMask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ -
242}
│ │ │ │ -
243
│ │ │ │ -
244template <>
│ │ │ │ -
245template <typename VERTEX, typename MASK>
│ │ │ │ -
246inline void
│ │ │ │ -
247Scheme<SCHEME_CATMARK>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ -
248
│ │ │ │ -
249 typedef typename MASK::Weight Weight;
│ │ │ │ -
250
│ │ │ │ -
251 int valence = vertex.GetNumFaces();
│ │ │ │ -
252 if (valence == 2) {
│ │ │ │ -
253 assignCornerLimitMask(vertex, posMask);
│ │ │ │ -
254 return;
│ │ │ │ -
255 }
│ │ │ │ -
256
│ │ │ │ -
257 posMask.SetNumVertexWeights(1);
│ │ │ │ -
258 posMask.SetNumEdgeWeights(valence);
│ │ │ │ -
259 posMask.SetNumFaceWeights(valence);
│ │ │ │ -
260 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
261
│ │ │ │ -
262 // Specialize for the regular case:
│ │ │ │ -
263 if (valence == 4) {
│ │ │ │ -
264 Weight fWeight = (Weight)(1.0 / 36.0);
│ │ │ │ -
265 Weight eWeight = (Weight)(1.0 / 9.0);
│ │ │ │ -
266 Weight vWeight = (Weight)(4.0 / 9.0);
│ │ │ │ -
267
│ │ │ │ -
268 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
269
│ │ │ │ -
270 posMask.EdgeWeight(0) = eWeight;
│ │ │ │ -
271 posMask.EdgeWeight(1) = eWeight;
│ │ │ │ -
272 posMask.EdgeWeight(2) = eWeight;
│ │ │ │ -
273 posMask.EdgeWeight(3) = eWeight;
│ │ │ │ -
274
│ │ │ │ -
275 posMask.FaceWeight(0) = fWeight;
│ │ │ │ -
276 posMask.FaceWeight(1) = fWeight;
│ │ │ │ -
277 posMask.FaceWeight(2) = fWeight;
│ │ │ │ -
278 posMask.FaceWeight(3) = fWeight;
│ │ │ │ -
279 } else {
│ │ │ │ -
280 Weight Valence = (Weight) valence;
│ │ │ │ -
281
│ │ │ │ -
282 Weight fWeight = 1.0f / (Valence * (Valence + 5.0f));
│ │ │ │ -
283 Weight eWeight = 4.0f * fWeight;
│ │ │ │ -
284 Weight vWeight = 1.0f - Valence * (eWeight + fWeight);
│ │ │ │ -
285
│ │ │ │ -
286 posMask.VertexWeight(0) = vWeight;
│ │ │ │ -
287 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
288 posMask.EdgeWeight(i) = eWeight;
│ │ │ │ -
289 posMask.FaceWeight(i) = fWeight;
│ │ │ │ -
290 }
│ │ │ │ -
291 }
│ │ │ │ -
292}
│ │ │ │ -
293
│ │ │ │ -
294//
│ │ │ │ -
295// Limit masks for tangents -- these are stubs for now, or have a temporary
│ │ │ │ -
296// implementation
│ │ │ │ -
297//
│ │ │ │ -
298template <>
│ │ │ │ -
299template <typename VERTEX, typename MASK>
│ │ │ │ -
300inline void
│ │ │ │ - │ │ │ │ -
302 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
303
│ │ │ │ -
304 int valence = vertex.GetNumEdges();
│ │ │ │ -
305
│ │ │ │ -
306 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
307 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
308 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ -
309 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
310
│ │ │ │ -
311 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
312 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
313 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ -
314 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
315
│ │ │ │ -
316 // Should be at least 2 edges -- be sure to clear weights for any more:
│ │ │ │ -
317 tan1Mask.VertexWeight(0) = -1.0f;
│ │ │ │ -
318 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ -
319 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ -
320
│ │ │ │ -
321 tan2Mask.VertexWeight(0) = -1.0f;
│ │ │ │ -
322 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ -
323 tan2Mask.EdgeWeight(1) = 1.0f;
│ │ │ │ -
324
│ │ │ │ -
325 for (int i = 2; i < valence; ++i) {
│ │ │ │ -
326 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
327 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
328 }
│ │ │ │ -
329}
│ │ │ │ -
330
│ │ │ │ -
331template <>
│ │ │ │ -
332template <typename VERTEX, typename MASK>
│ │ │ │ -
333inline void
│ │ │ │ - │ │ │ │ -
335 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const {
│ │ │ │ -
336
│ │ │ │ -
337 typedef typename MASK::Weight Weight;
│ │ │ │ -
338
│ │ │ │ -
339 //
│ │ │ │ -
340 // First, the tangent along the crease:
│ │ │ │ -
341 // The first crease edge is considered the "leading" edge of the span
│ │ │ │ -
342 // of surface for which we are evaluating tangents and the second edge the
│ │ │ │ -
343 // "trailing edge". By convention, the tangent along the crease is oriented
│ │ │ │ -
344 // in the direction of the leading edge.
│ │ │ │ -
345 //
│ │ │ │ -
346 int numEdges = vertex.GetNumEdges();
│ │ │ │ -
347 int numFaces = vertex.GetNumFaces();
│ │ │ │ -
348
│ │ │ │ -
349 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
350 tan1Mask.SetNumEdgeWeights(numEdges);
│ │ │ │ -
351 tan1Mask.SetNumFaceWeights(numFaces);
│ │ │ │ -
352 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
353
│ │ │ │ -
354 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
355 for (int i = 0; i < numEdges; ++i) {
│ │ │ │ -
356 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
357 }
│ │ │ │ -
358 for (int i = 0; i < numFaces; ++i) {
│ │ │ │ -
359 tan1Mask.FaceWeight(i) = 0.0f;
│ │ │ │ -
360 }
│ │ │ │ -
361
│ │ │ │ -
362 tan1Mask.EdgeWeight(creaseEnds[0]) = 0.5f;
│ │ │ │ -
363 tan1Mask.EdgeWeight(creaseEnds[1]) = -0.5f;
│ │ │ │ -
364
│ │ │ │ -
365 //
│ │ │ │ -
366 // Second, the tangent across the interior faces:
│ │ │ │ -
367 // Note this is ambiguous for an interior vertex. We currently return
│ │ │ │ -
368 // the tangent for the surface in the counter-clockwise span between the
│ │ │ │ -
369 // leading and trailing edges that form the crease. Given the expected
│ │ │ │ -
370 // computation of a surface normal as Tan1 X Tan2, this tangent should be
│ │ │ │ -
371 // oriented "inward" from the crease/boundary -- across the surface rather
│ │ │ │ -
372 // than outward and away from it.
│ │ │ │ -
373 //
│ │ │ │ -
374 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
375 tan2Mask.SetNumEdgeWeights(numEdges);
│ │ │ │ -
376 tan2Mask.SetNumFaceWeights(numFaces);
│ │ │ │ -
377 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
378
│ │ │ │ -
379 // Prepend weights of 0 preceding the crease:
│ │ │ │ -
380 for (int i = 0; i < creaseEnds[0]; ++i) {
│ │ │ │ -
381 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
382 tan2Mask.FaceWeight(i) = 0.0f;
│ │ │ │ -
383 }
│ │ │ │ -
384
│ │ │ │ -
385 // Assign weights to crease edge and interior points:
│ │ │ │ -
386 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1;
│ │ │ │ -
387 if (interiorEdgeCount == 1) {
│ │ │ │ -
388 // The regular case -- uniform B-spline cross-tangent:
│ │ │ │ -
389
│ │ │ │ -
390 tan2Mask.VertexWeight(0) = (Weight)(-4.0 / 6.0);
│ │ │ │ -
391
│ │ │ │ -
392 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight)(-1.0 / 6.0);
│ │ │ │ -
393 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = (Weight)( 4.0 / 6.0);
│ │ │ │ -
394 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight)(-1.0 / 6.0);
│ │ │ │ -
395
│ │ │ │ -
396 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight)(1.0 / 6.0);
│ │ │ │ -
397 tan2Mask.FaceWeight(creaseEnds[0] + 1) = (Weight)(1.0 / 6.0);
│ │ │ │ -
398 } else if (interiorEdgeCount > 1) {
│ │ │ │ -
399 // The irregular case -- formulae from Biermann et al:
│ │ │ │ -
400
│ │ │ │ -
401 double k = (double) (interiorEdgeCount + 1);
│ │ │ │ -
402 double theta = M_PI / k;
│ │ │ │ -
403
│ │ │ │ -
404 double cosTheta = std::cos(theta);
│ │ │ │ -
405 double sinTheta = std::sin(theta);
│ │ │ │ -
406
│ │ │ │ -
407 // Loop/Schaefer use a different divisor here (3*k + cos(theta)):
│ │ │ │ -
408 double commonDenom = 1.0f / (k * (3.0f + cosTheta));
│ │ │ │ -
409 double R = (cosTheta + 1.0f) / sinTheta;
│ │ │ │ -
410
│ │ │ │ -
411 double vertexWeight = 4.0f * R * (cosTheta - 1.0f);
│ │ │ │ -
412 double creaseWeight = -R * (1.0f + 2.0f * cosTheta);
│ │ │ │ -
413
│ │ │ │ -
414 tan2Mask.VertexWeight(0) = (Weight) (vertexWeight * commonDenom);
│ │ │ │ -
415
│ │ │ │ -
416 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight) (creaseWeight * commonDenom);
│ │ │ │ -
417 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight) (creaseWeight * commonDenom);
│ │ │ │ -
418
│ │ │ │ -
419 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight) (sinTheta * commonDenom);
│ │ │ │ -
420
│ │ │ │ -
421 double sinThetaI = 0.0f;
│ │ │ │ -
422 double sinThetaIplus1 = sinTheta;
│ │ │ │ -
423 for (int i = 1; i < k; ++i) {
│ │ │ │ -
424 sinThetaI = sinThetaIplus1;
│ │ │ │ -
425 sinThetaIplus1 = std::sin((i+1)*theta);
│ │ │ │ -
426
│ │ │ │ -
427 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) ((4.0f * sinThetaI) * commonDenom);
│ │ │ │ -
428 tan2Mask.FaceWeight(creaseEnds[0] + i) = (Weight) ((sinThetaI + sinThetaIplus1) * commonDenom);
│ │ │ │ -
429 }
│ │ │ │ -
430 } else {
│ │ │ │ -
431 // Special case for a single face -- simple average of boundary edges:
│ │ │ │ -
432
│ │ │ │ -
433 tan2Mask.VertexWeight(0) = -6.0f;
│ │ │ │ -
434
│ │ │ │ -
435 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f;
│ │ │ │ -
436 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f;
│ │ │ │ -
437
│ │ │ │ -
438 tan2Mask.FaceWeight(creaseEnds[0]) = 0.0f;
│ │ │ │ -
439 }
│ │ │ │ -
440
│ │ │ │ -
441 // Append weights of 0 following the crease:
│ │ │ │ -
442 for (int i = creaseEnds[1]; i < numFaces; ++i) {
│ │ │ │ -
443 tan2Mask.FaceWeight(i) = 0.0f;
│ │ │ │ -
444 }
│ │ │ │ -
445 for (int i = creaseEnds[1] + 1; i < numEdges; ++i) {
│ │ │ │ -
446 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ -
447 }
│ │ │ │ -
448}
│ │ │ │ -
449
│ │ │ │ -
450template <>
│ │ │ │ -
451template <typename VERTEX, typename MASK>
│ │ │ │ -
452inline void
│ │ │ │ - │ │ │ │ -
454 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
455
│ │ │ │ -
456 typedef typename MASK::Weight Weight;
│ │ │ │ -
457
│ │ │ │ -
458 int valence = vertex.GetNumFaces();
│ │ │ │ -
459 if (valence == 2) {
│ │ │ │ -
460 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ -
461 return;
│ │ │ │ -
462 }
│ │ │ │ -
463
│ │ │ │ -
464 // Compute tan1 initially -- tan2 is simply a rotation:
│ │ │ │ -
465 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
466 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
467 tan1Mask.SetNumFaceWeights(valence);
│ │ │ │ -
468 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
469
│ │ │ │ -
470 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
471
│ │ │ │ -
472 if (valence == 4) {
│ │ │ │ -
473 tan1Mask.EdgeWeight(0) = 4.0f;
│ │ │ │ -
474 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ -
475 tan1Mask.EdgeWeight(2) = -4.0f;
│ │ │ │ -
476 tan1Mask.EdgeWeight(3) = 0.0f;
│ │ │ │ -
477
│ │ │ │ -
478 tan1Mask.FaceWeight(0) = 1.0f;
│ │ │ │ -
479 tan1Mask.FaceWeight(1) = -1.0f;
│ │ │ │ -
480 tan1Mask.FaceWeight(2) = -1.0f;
│ │ │ │ -
481 tan1Mask.FaceWeight(3) = 1.0f;
│ │ │ │ -
482 } else {
│ │ │ │ -
483 double theta = 2.0f * M_PI / (double)valence;
│ │ │ │ -
484
│ │ │ │ -
485 double cosTheta = std::cos(theta);
│ │ │ │ -
486 double cosHalfTheta = std::cos(theta * 0.5f);
│ │ │ │ -
487
│ │ │ │ -
488 double lambda = (5.0 / 16.0) + (1.0 / 16.0) *
│ │ │ │ -
489 (cosTheta + cosHalfTheta * std::sqrt(2.0f * (9.0f + cosTheta)));
│ │ │ │ -
490
│ │ │ │ -
491 double edgeWeightScale = 4.0f;
│ │ │ │ -
492 double faceWeightScale = 1.0f / (4.0f * lambda - 1.0f);
│ │ │ │ -
493
│ │ │ │ -
494 for (int i = 0; i < valence; ++i) {
│ │ │ │ -
495 double cosThetaI = std::cos( i * theta);
│ │ │ │ -
496 double cosThetaIplus1 = std::cos((i+1)* theta);
│ │ │ │ -
497
│ │ │ │ -
498 tan1Mask.EdgeWeight(i) = (Weight) (edgeWeightScale * cosThetaI);
│ │ │ │ -
499 tan1Mask.FaceWeight(i) = (Weight) (faceWeightScale * (cosThetaI + cosThetaIplus1));
│ │ │ │ -
500 }
│ │ │ │ -
501 }
│ │ │ │ -
502
│ │ │ │ -
503 // Now rotate/copy tan1 weights to tan2:
│ │ │ │ -
504 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
505 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ -
506 tan2Mask.SetNumFaceWeights(valence);
│ │ │ │ -
507 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
508
│ │ │ │ -
509 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ -
510 if (valence == 4) {
│ │ │ │ -
511 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ -
512 tan2Mask.EdgeWeight(1) = 4.0f;
│ │ │ │ -
513 tan2Mask.EdgeWeight(2) = 0.0f;
│ │ │ │ -
514 tan2Mask.EdgeWeight(3) = -4.0f;
│ │ │ │ -
515
│ │ │ │ -
516 tan2Mask.FaceWeight(0) = 1.0f;
│ │ │ │ -
517 tan2Mask.FaceWeight(1) = 1.0f;
│ │ │ │ -
518 tan2Mask.FaceWeight(2) = -1.0f;
│ │ │ │ -
519 tan2Mask.FaceWeight(3) = -1.0f;
│ │ │ │ -
520 } else {
│ │ │ │ -
521 tan2Mask.EdgeWeight(0) = tan1Mask.EdgeWeight(valence-1);
│ │ │ │ -
522 tan2Mask.FaceWeight(0) = tan1Mask.FaceWeight(valence-1);
│ │ │ │ -
523 for (int i = 1; i < valence; ++i) {
│ │ │ │ -
524 tan2Mask.EdgeWeight(i) = tan1Mask.EdgeWeight(i-1);
│ │ │ │ -
525 tan2Mask.FaceWeight(i) = tan1Mask.FaceWeight(i-1);
│ │ │ │ -
526 }
│ │ │ │ -
527 }
│ │ │ │ -
528}
│ │ │ │ -
529
│ │ │ │ -
530} // end namespace sdc
│ │ │ │ -
531
│ │ │ │ -
532} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
533using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
534} // end namespace OpenSubdiv
│ │ │ │ -
535
│ │ │ │ -
536#endif /* OPENSUBDIV3_SDC_CATMARK_SCHEME_H */
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
102
│ │ │ │ + │ │ │ │ + │ │ │ │ +
105
│ │ │ │ +
106 std::vector<cl_mem> _fvarPatchArrays;
│ │ │ │ +
107 std::vector<cl_mem> _fvarIndexBuffers;
│ │ │ │ +
108 std::vector<cl_mem> _fvarParamBuffers;
│ │ │ │ +
109
│ │ │ │ +
110};
│ │ │ │ +
111
│ │ │ │ +
112} // end namespace Osd
│ │ │ │ +
113
│ │ │ │ +
114} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
115using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
116
│ │ │ │ +
117} // end namespace OpenSubdiv
│ │ │ │ +
118
│ │ │ │ +
119#endif // OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ -
@ SPLIT_TO_QUADS
Used by Catmark and Bilinear.
Definition: types.h:48
│ │ │ │ -
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:74
│ │ │ │ -
void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const
│ │ │ │ - │ │ │ │ -
void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const creaseEnds[2]) const
│ │ │ │ -
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ - │ │ │ │ -
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ - │ │ │ │ -
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ -
void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const
│ │ │ │ - │ │ │ │ -
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ -
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ -
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
cl_mem GetPatchParamBuffer() const
Returns the CL memory of the array of Osd::PatchParam buffer.
Definition: clPatchTable.h:74
│ │ │ │ + │ │ │ │ +
cl_mem GetFVarPatchArrayBuffer(int fvarChannel=0) const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:86
│ │ │ │ +
cl_mem GetPatchArrayBuffer() const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:68
│ │ │ │ +
static CLPatchTable * Create(Far::PatchTable const *patchTable, cl_context clContext)
Creator. Returns NULL if error.
│ │ │ │ + │ │ │ │ +
cl_mem GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the CL memory of the face-varying control vertices.
Definition: clPatchTable.h:89
│ │ │ │ + │ │ │ │ +
cl_mem GetVaryingPatchIndexBuffer() const
Returns the CL memory of the varying control vertices.
Definition: clPatchTable.h:80
│ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channel buffers.
Definition: clPatchTable.h:83
│ │ │ │ +
cl_mem GetPatchIndexBuffer() const
Returns the CL memory of the patch control vertices.
Definition: clPatchTable.h:71
│ │ │ │ +
static CLPatchTable * Create(Far::PatchTable const *patchTable, DEVICE_CONTEXT context)
Definition: clPatchTable.h:59
│ │ │ │ +
cl_mem GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the CL memory of the array of Osd::PatchParam buffer.
Definition: clPatchTable.h:92
│ │ │ │ + │ │ │ │ +
bool allocate(Far::PatchTable const *patchTable, cl_context clContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
cl_mem GetVaryingPatchArrayBuffer() const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:77
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -catmarkScheme.h │ │ │ │ │ +clPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,595 +29,175 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_CATMARK_SCHEME_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_CATMARK_SCHEME_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29#include "../sdc/scheme.h" │ │ │ │ │ - 30 │ │ │ │ │ - 31#include │ │ │ │ │ - 32#include │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/opencl.h" │ │ │ │ │ + 31#include "../osd/nonCopyable.h" │ │ │ │ │ + 32#include "../osd/types.h" │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Sdc { │ │ │ │ │ + 34#include │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace OpenSubdiv { │ │ │ │ │ + 37namespace OPENSUBDIV_VERSION { │ │ │ │ │ 38 │ │ │ │ │ - 39// │ │ │ │ │ - 40// Specializations for Scheme: │ │ │ │ │ - 41// │ │ │ │ │ + 39namespace Far{ │ │ │ │ │ + 40 class PatchTable; │ │ │ │ │ + 41}; │ │ │ │ │ 42 │ │ │ │ │ - 43// │ │ │ │ │ - 44// Catmark traits: │ │ │ │ │ - 45// │ │ │ │ │ - 46template <> │ │ │ │ │ -47inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ -SPLIT_TO_QUADS; } │ │ │ │ │ - 48 │ │ │ │ │ - 49template <> │ │ │ │ │ -50inline int Scheme::GetRegularFaceSize() { return 4; } │ │ │ │ │ - 51 │ │ │ │ │ - 52template <> │ │ │ │ │ -53inline int Scheme::GetRegularVertexValence() { return 4; } │ │ │ │ │ - 54 │ │ │ │ │ - 55template <> │ │ │ │ │ -56inline int Scheme::GetLocalNeighborhoodSize() { return 1; } │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ + 44 │ │ │ │ │ +52class CLPatchTable : private NonCopyable { │ │ │ │ │ + 53public: │ │ │ │ │ +55 static CLPatchTable *Create(Far::PatchTable const *patchTable, │ │ │ │ │ + 56 cl_context clContext); │ │ │ │ │ 57 │ │ │ │ │ - 58 │ │ │ │ │ - 59// │ │ │ │ │ - 60// Masks for edge-vertices: the hard Crease mask does not need to be │ │ │ │ │ -specialized │ │ │ │ │ - 61// (simply the midpoint), so all that is left is the Smooth case: │ │ │ │ │ - 62// │ │ │ │ │ - 63// The Smooth mask is complicated by the need to support the "triangle │ │ │ │ │ -subdivision" │ │ │ │ │ - 64// option, which applies different weighting in the presence of triangles. │ │ │ │ │ -It is │ │ │ │ │ - 65// up for debate as to whether this is useful or not -- we may be able to │ │ │ │ │ -deprecate │ │ │ │ │ - 66// this option. │ │ │ │ │ - 67// │ │ │ │ │ - 68template <> │ │ │ │ │ - 69template │ │ │ │ │ - 70inline void │ │ │ │ │ -71Scheme::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) │ │ │ │ │ -const { │ │ │ │ │ + 58 template │ │ │ │ │ +59 static CLPatchTable * Create(Far::PatchTable const *patchTable, │ │ │ │ │ + 60 DEVICE_CONTEXT context) { │ │ │ │ │ + 61 return Create(patchTable, context->GetContext()); │ │ │ │ │ + 62 } │ │ │ │ │ + 63 │ │ │ │ │ +65 ~CLPatchTable(); │ │ │ │ │ + 66 │ │ │ │ │ +68 cl_mem GetPatchArrayBuffer() const { return _patchArrays; } │ │ │ │ │ + 69 │ │ │ │ │ +71 cl_mem GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ 72 │ │ │ │ │ - 73 typedef typename MASK::Weight Weight; │ │ │ │ │ - 74 │ │ │ │ │ - 75 int faceCount = edge.GetNumFaces(); │ │ │ │ │ - 76 │ │ │ │ │ - 77 mask.SetNumVertexWeights(2); │ │ │ │ │ - 78 mask.SetNumEdgeWeights(0); │ │ │ │ │ - 79 mask.SetNumFaceWeights(faceCount); │ │ │ │ │ - 80 mask.SetFaceWeightsForFaceCenters(true); │ │ │ │ │ +74 cl_mem GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ + 75 │ │ │ │ │ +77 cl_mem GetVaryingPatchArrayBuffer() const { return _varyingPatchArrays; } │ │ │ │ │ + 78 │ │ │ │ │ +80 cl_mem GetVaryingPatchIndexBuffer() const { return _varyingIndexBuffer; } │ │ │ │ │ 81 │ │ │ │ │ - 82 // │ │ │ │ │ - 83 // Determine if we need to inspect incident faces and apply alternate │ │ │ │ │ -weighting for │ │ │ │ │ - 84 // triangles -- and if so, determine which of the two are triangles. │ │ │ │ │ - 85 // │ │ │ │ │ - 86 bool face0IsTri = false; │ │ │ │ │ - 87 bool face1IsTri = false; │ │ │ │ │ - 88 bool useTriangleOption = (_options.GetTriangleSubdivision() == Options:: │ │ │ │ │ -TRI_SUB_SMOOTH); │ │ │ │ │ - 89 if (useTriangleOption) { │ │ │ │ │ - 90 if (faceCount == 2) { │ │ │ │ │ - 91 // │ │ │ │ │ - 92 // Ideally we want to avoid this inspection when we have already subdivided │ │ │ │ │ -at │ │ │ │ │ - 93 // least once -- need something in the Edge interface to help avoid this, │ │ │ │ │ -e.g. │ │ │ │ │ - 94 // an IsRegular() query, the subdivision level... │ │ │ │ │ - 95 // │ │ │ │ │ - 96 int vertsPerFace[2]; │ │ │ │ │ - 97 edge.GetNumVerticesPerFace(vertsPerFace); │ │ │ │ │ +83 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ + 84 │ │ │ │ │ +86 cl_mem GetFVarPatchArrayBuffer(int fvarChannel = 0) const { return │ │ │ │ │ +_fvarPatchArrays[fvarChannel]; } │ │ │ │ │ + 87 │ │ │ │ │ +89 cl_mem GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return │ │ │ │ │ +_fvarIndexBuffers[fvarChannel]; } │ │ │ │ │ + 90 │ │ │ │ │ +92 cl_mem GetFVarPatchParamBuffer(int fvarChannel = 0) const { return │ │ │ │ │ +_fvarParamBuffers[fvarChannel]; } │ │ │ │ │ + 93 │ │ │ │ │ + 94protected: │ │ │ │ │ +95 CLPatchTable(); │ │ │ │ │ + 96 │ │ │ │ │ +97 bool allocate(Far::PatchTable const *patchTable, cl_context clContext); │ │ │ │ │ 98 │ │ │ │ │ - 99 face0IsTri = (vertsPerFace[0] == 3); │ │ │ │ │ - 100 face1IsTri = (vertsPerFace[1] == 3); │ │ │ │ │ - 101 useTriangleOption = face0IsTri || face1IsTri; │ │ │ │ │ - 102 } else { │ │ │ │ │ - 103 useTriangleOption = false; │ │ │ │ │ - 104 } │ │ │ │ │ - 105 } │ │ │ │ │ - 106 │ │ │ │ │ - 107 if (! useTriangleOption) { │ │ │ │ │ - 108 mask.VertexWeight(0) = 0.25f; │ │ │ │ │ - 109 mask.VertexWeight(1) = 0.25f; │ │ │ │ │ - 110 │ │ │ │ │ - 111 if (faceCount == 2) { │ │ │ │ │ - 112 mask.FaceWeight(0) = 0.25f; │ │ │ │ │ - 113 mask.FaceWeight(1) = 0.25f; │ │ │ │ │ - 114 } else { │ │ │ │ │ - 115 Weight fWeight = 0.5f / (Weight)faceCount; │ │ │ │ │ - 116 for (int i = 0; i < faceCount; ++i) { │ │ │ │ │ - 117 mask.FaceWeight(i) = fWeight; │ │ │ │ │ - 118 } │ │ │ │ │ - 119 } │ │ │ │ │ - 120 } else { │ │ │ │ │ - 121 // │ │ │ │ │ - 122 // This mimics the implementation in Hbr in terms of order of operations. │ │ │ │ │ - 123 // │ │ │ │ │ - 124 const Weight CATMARK_SMOOTH_TRI_EDGE_WEIGHT = (Weight) 0.470; │ │ │ │ │ - 125 │ │ │ │ │ - 126 Weight f0Weight = face0IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f; │ │ │ │ │ - 127 Weight f1Weight = face1IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f; │ │ │ │ │ - 128 │ │ │ │ │ - 129 Weight fWeight = 0.5f * (f0Weight + f1Weight); │ │ │ │ │ - 130 Weight vWeight = 0.5f * (1.0f - 2.0f * fWeight); │ │ │ │ │ - 131 │ │ │ │ │ - 132 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 133 mask.VertexWeight(1) = vWeight; │ │ │ │ │ - 134 │ │ │ │ │ - 135 mask.FaceWeight(0) = fWeight; │ │ │ │ │ - 136 mask.FaceWeight(1) = fWeight; │ │ │ │ │ - 137 } │ │ │ │ │ - 138} │ │ │ │ │ - 139 │ │ │ │ │ - 140 │ │ │ │ │ - 141// │ │ │ │ │ - 142// Masks for vertex-vertices: the hard Corner mask does not need to be │ │ │ │ │ -specialized │ │ │ │ │ - 143// (simply the vertex itself), leaving the Crease and Smooth cases (Dart is │ │ │ │ │ -smooth): │ │ │ │ │ - 144// │ │ │ │ │ - 145template <> │ │ │ │ │ - 146template │ │ │ │ │ - 147inline void │ │ │ │ │ -148Scheme::assignCreaseMaskForVertex(VERTEX const& vertex, │ │ │ │ │ -MASK& mask, │ │ │ │ │ - 149 int const creaseEnds[2]) const { │ │ │ │ │ - 150 typedef typename MASK::Weight Weight; │ │ │ │ │ - 151 │ │ │ │ │ - 152 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 153 │ │ │ │ │ - 154 mask.SetNumVertexWeights(1); │ │ │ │ │ - 155 mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 156 mask.SetNumFaceWeights(0); │ │ │ │ │ - 157 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 158 │ │ │ │ │ - 159 Weight vWeight = 0.75f; │ │ │ │ │ - 160 Weight eWeight = 0.125f; │ │ │ │ │ - 161 │ │ │ │ │ - 162 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 163 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 164 mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 165 } │ │ │ │ │ - 166 mask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ - 167 mask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ - 168} │ │ │ │ │ - 169 │ │ │ │ │ - 170template <> │ │ │ │ │ - 171template │ │ │ │ │ - 172inline void │ │ │ │ │ -173Scheme::assignSmoothMaskForVertex(VERTEX const& vertex, │ │ │ │ │ -MASK& mask) const { │ │ │ │ │ - 174 │ │ │ │ │ - 175 typedef typename MASK::Weight Weight; │ │ │ │ │ - 176 │ │ │ │ │ - 177 // │ │ │ │ │ - 178 // A Smooth vertex must be manifold and interior -- manifold boundary │ │ │ │ │ -vertices will be │ │ │ │ │ - 179 // Creases and non-manifold vertices of any kind will be Corners or │ │ │ │ │ -Creases. If smooth │ │ │ │ │ - 180 // rules for non-manifold vertices are ever defined, this will need │ │ │ │ │ -adjusting: │ │ │ │ │ - 181 // │ │ │ │ │ - 182 assert(vertex.GetNumFaces() == vertex.GetNumEdges()); │ │ │ │ │ - 183 │ │ │ │ │ - 184 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 185 │ │ │ │ │ - 186 mask.SetNumVertexWeights(1); │ │ │ │ │ - 187 mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 188 mask.SetNumFaceWeights(valence); │ │ │ │ │ - 189 mask.SetFaceWeightsForFaceCenters(true); │ │ │ │ │ - 190 │ │ │ │ │ - 191 Weight vWeight = (Weight)(valence - 2) / (Weight)valence; │ │ │ │ │ - 192 Weight fWeight = 1.0f / (Weight)(valence * valence); │ │ │ │ │ - 193 Weight eWeight = fWeight; │ │ │ │ │ - 194 │ │ │ │ │ - 195 mask.VertexWeight(0) = vWeight; │ │ │ │ │ - 196 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 197 mask.EdgeWeight(i) = eWeight; │ │ │ │ │ - 198 mask.FaceWeight(i) = fWeight; │ │ │ │ │ - 199 } │ │ │ │ │ - 200} │ │ │ │ │ - 201 │ │ │ │ │ - 202// │ │ │ │ │ - 203// Limit masks for position: │ │ │ │ │ - 204// │ │ │ │ │ - 205template <> │ │ │ │ │ - 206template │ │ │ │ │ - 207inline void │ │ │ │ │ -208Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, │ │ │ │ │ -MASK& posMask) const { │ │ │ │ │ - 209 │ │ │ │ │ - 210 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 211 posMask.SetNumEdgeWeights(0); │ │ │ │ │ - 212 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 213 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 214 │ │ │ │ │ - 215 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ - 216} │ │ │ │ │ - 217 │ │ │ │ │ - 218template <> │ │ │ │ │ - 219template │ │ │ │ │ - 220inline void │ │ │ │ │ -221Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask, │ │ │ │ │ - 222 int const creaseEnds[2]) const { │ │ │ │ │ - 223 │ │ │ │ │ - 224 typedef typename MASK::Weight Weight; │ │ │ │ │ - 225 │ │ │ │ │ - 226 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 227 │ │ │ │ │ - 228 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 229 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ - 230 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 231 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 232 │ │ │ │ │ - 233 Weight vWeight = (Weight)(2.0 / 3.0); │ │ │ │ │ - 234 Weight eWeight = (Weight)(1.0 / 6.0); │ │ │ │ │ - 235 │ │ │ │ │ - 236 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 237 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 238 posMask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 239 } │ │ │ │ │ - 240 posMask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ - 241 posMask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ - 242} │ │ │ │ │ - 243 │ │ │ │ │ - 244template <> │ │ │ │ │ - 245template │ │ │ │ │ - 246inline void │ │ │ │ │ -247Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask) const { │ │ │ │ │ - 248 │ │ │ │ │ - 249 typedef typename MASK::Weight Weight; │ │ │ │ │ - 250 │ │ │ │ │ - 251 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 252 if (valence == 2) { │ │ │ │ │ - 253 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ - 254 return; │ │ │ │ │ - 255 } │ │ │ │ │ - 256 │ │ │ │ │ - 257 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 258 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ - 259 posMask.SetNumFaceWeights(valence); │ │ │ │ │ - 260 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 261 │ │ │ │ │ - 262 // Specialize for the regular case: │ │ │ │ │ - 263 if (valence == 4) { │ │ │ │ │ - 264 Weight fWeight = (Weight)(1.0 / 36.0); │ │ │ │ │ - 265 Weight eWeight = (Weight)(1.0 / 9.0); │ │ │ │ │ - 266 Weight vWeight = (Weight)(4.0 / 9.0); │ │ │ │ │ - 267 │ │ │ │ │ - 268 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 269 │ │ │ │ │ - 270 posMask.EdgeWeight(0) = eWeight; │ │ │ │ │ - 271 posMask.EdgeWeight(1) = eWeight; │ │ │ │ │ - 272 posMask.EdgeWeight(2) = eWeight; │ │ │ │ │ - 273 posMask.EdgeWeight(3) = eWeight; │ │ │ │ │ - 274 │ │ │ │ │ - 275 posMask.FaceWeight(0) = fWeight; │ │ │ │ │ - 276 posMask.FaceWeight(1) = fWeight; │ │ │ │ │ - 277 posMask.FaceWeight(2) = fWeight; │ │ │ │ │ - 278 posMask.FaceWeight(3) = fWeight; │ │ │ │ │ - 279 } else { │ │ │ │ │ - 280 Weight Valence = (Weight) valence; │ │ │ │ │ - 281 │ │ │ │ │ - 282 Weight fWeight = 1.0f / (Valence * (Valence + 5.0f)); │ │ │ │ │ - 283 Weight eWeight = 4.0f * fWeight; │ │ │ │ │ - 284 Weight vWeight = 1.0f - Valence * (eWeight + fWeight); │ │ │ │ │ - 285 │ │ │ │ │ - 286 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ - 287 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 288 posMask.EdgeWeight(i) = eWeight; │ │ │ │ │ - 289 posMask.FaceWeight(i) = fWeight; │ │ │ │ │ - 290 } │ │ │ │ │ - 291 } │ │ │ │ │ - 292} │ │ │ │ │ - 293 │ │ │ │ │ - 294// │ │ │ │ │ - 295// Limit masks for tangents -- these are stubs for now, or have a temporary │ │ │ │ │ - 296// implementation │ │ │ │ │ - 297// │ │ │ │ │ - 298template <> │ │ │ │ │ - 299template │ │ │ │ │ - 300inline void │ │ │ │ │ -301Scheme::assignCornerLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 302 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 303 │ │ │ │ │ - 304 int valence = vertex.GetNumEdges(); │ │ │ │ │ - 305 │ │ │ │ │ - 306 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 307 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 308 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ - 309 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 310 │ │ │ │ │ - 311 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 312 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 313 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ - 314 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 315 │ │ │ │ │ - 316 // Should be at least 2 edges -- be sure to clear weights for any more: │ │ │ │ │ - 317 tan1Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ - 318 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ - 319 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ - 320 │ │ │ │ │ - 321 tan2Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ - 322 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ - 323 tan2Mask.EdgeWeight(1) = 1.0f; │ │ │ │ │ - 324 │ │ │ │ │ - 325 for (int i = 2; i < valence; ++i) { │ │ │ │ │ - 326 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 327 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 328 } │ │ │ │ │ - 329} │ │ │ │ │ - 330 │ │ │ │ │ - 331template <> │ │ │ │ │ - 332template │ │ │ │ │ - 333inline void │ │ │ │ │ -334Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 335 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const { │ │ │ │ │ - 336 │ │ │ │ │ - 337 typedef typename MASK::Weight Weight; │ │ │ │ │ - 338 │ │ │ │ │ - 339 // │ │ │ │ │ - 340 // First, the tangent along the crease: │ │ │ │ │ - 341 // The first crease edge is considered the "leading" edge of the span │ │ │ │ │ - 342 // of surface for which we are evaluating tangents and the second edge the │ │ │ │ │ - 343 // "trailing edge". By convention, the tangent along the crease is │ │ │ │ │ -oriented │ │ │ │ │ - 344 // in the direction of the leading edge. │ │ │ │ │ - 345 // │ │ │ │ │ - 346 int numEdges = vertex.GetNumEdges(); │ │ │ │ │ - 347 int numFaces = vertex.GetNumFaces(); │ │ │ │ │ - 348 │ │ │ │ │ - 349 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 350 tan1Mask.SetNumEdgeWeights(numEdges); │ │ │ │ │ - 351 tan1Mask.SetNumFaceWeights(numFaces); │ │ │ │ │ - 352 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 353 │ │ │ │ │ - 354 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 355 for (int i = 0; i < numEdges; ++i) { │ │ │ │ │ - 356 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 357 } │ │ │ │ │ - 358 for (int i = 0; i < numFaces; ++i) { │ │ │ │ │ - 359 tan1Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ - 360 } │ │ │ │ │ - 361 │ │ │ │ │ - 362 tan1Mask.EdgeWeight(creaseEnds[0]) = 0.5f; │ │ │ │ │ - 363 tan1Mask.EdgeWeight(creaseEnds[1]) = -0.5f; │ │ │ │ │ - 364 │ │ │ │ │ - 365 // │ │ │ │ │ - 366 // Second, the tangent across the interior faces: │ │ │ │ │ - 367 // Note this is ambiguous for an interior vertex. We currently return │ │ │ │ │ - 368 // the tangent for the surface in the counter-clockwise span between the │ │ │ │ │ - 369 // leading and trailing edges that form the crease. Given the expected │ │ │ │ │ - 370 // computation of a surface normal as Tan1 X Tan2, this tangent should be │ │ │ │ │ - 371 // oriented "inward" from the crease/boundary -- across the surface rather │ │ │ │ │ - 372 // than outward and away from it. │ │ │ │ │ - 373 // │ │ │ │ │ - 374 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 375 tan2Mask.SetNumEdgeWeights(numEdges); │ │ │ │ │ - 376 tan2Mask.SetNumFaceWeights(numFaces); │ │ │ │ │ - 377 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 378 │ │ │ │ │ - 379 // Prepend weights of 0 preceding the crease: │ │ │ │ │ - 380 for (int i = 0; i < creaseEnds[0]; ++i) { │ │ │ │ │ - 381 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 382 tan2Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ - 383 } │ │ │ │ │ - 384 │ │ │ │ │ - 385 // Assign weights to crease edge and interior points: │ │ │ │ │ - 386 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1; │ │ │ │ │ - 387 if (interiorEdgeCount == 1) { │ │ │ │ │ - 388 // The regular case -- uniform B-spline cross-tangent: │ │ │ │ │ - 389 │ │ │ │ │ - 390 tan2Mask.VertexWeight(0) = (Weight)(-4.0 / 6.0); │ │ │ │ │ - 391 │ │ │ │ │ - 392 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight)(-1.0 / 6.0); │ │ │ │ │ - 393 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = (Weight)( 4.0 / 6.0); │ │ │ │ │ - 394 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight)(-1.0 / 6.0); │ │ │ │ │ - 395 │ │ │ │ │ - 396 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight)(1.0 / 6.0); │ │ │ │ │ - 397 tan2Mask.FaceWeight(creaseEnds[0] + 1) = (Weight)(1.0 / 6.0); │ │ │ │ │ - 398 } else if (interiorEdgeCount > 1) { │ │ │ │ │ - 399 // The irregular case -- formulae from Biermann et al: │ │ │ │ │ - 400 │ │ │ │ │ - 401 double k = (double) (interiorEdgeCount + 1); │ │ │ │ │ - 402 double theta = M_PI / k; │ │ │ │ │ - 403 │ │ │ │ │ - 404 double cosTheta = std::cos(theta); │ │ │ │ │ - 405 double sinTheta = std::sin(theta); │ │ │ │ │ - 406 │ │ │ │ │ - 407 // Loop/Schaefer use a different divisor here (3*k + cos(theta)): │ │ │ │ │ - 408 double commonDenom = 1.0f / (k * (3.0f + cosTheta)); │ │ │ │ │ - 409 double R = (cosTheta + 1.0f) / sinTheta; │ │ │ │ │ - 410 │ │ │ │ │ - 411 double vertexWeight = 4.0f * R * (cosTheta - 1.0f); │ │ │ │ │ - 412 double creaseWeight = -R * (1.0f + 2.0f * cosTheta); │ │ │ │ │ - 413 │ │ │ │ │ - 414 tan2Mask.VertexWeight(0) = (Weight) (vertexWeight * commonDenom); │ │ │ │ │ - 415 │ │ │ │ │ - 416 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight) (creaseWeight * │ │ │ │ │ -commonDenom); │ │ │ │ │ - 417 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight) (creaseWeight * │ │ │ │ │ -commonDenom); │ │ │ │ │ - 418 │ │ │ │ │ - 419 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight) (sinTheta * commonDenom); │ │ │ │ │ - 420 │ │ │ │ │ - 421 double sinThetaI = 0.0f; │ │ │ │ │ - 422 double sinThetaIplus1 = sinTheta; │ │ │ │ │ - 423 for (int i = 1; i < k; ++i) { │ │ │ │ │ - 424 sinThetaI = sinThetaIplus1; │ │ │ │ │ - 425 sinThetaIplus1 = std::sin((i+1)*theta); │ │ │ │ │ - 426 │ │ │ │ │ - 427 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) ((4.0f * sinThetaI) * │ │ │ │ │ -commonDenom); │ │ │ │ │ - 428 tan2Mask.FaceWeight(creaseEnds[0] + i) = (Weight) ((sinThetaI + │ │ │ │ │ -sinThetaIplus1) * commonDenom); │ │ │ │ │ - 429 } │ │ │ │ │ - 430 } else { │ │ │ │ │ - 431 // Special case for a single face -- simple average of boundary edges: │ │ │ │ │ - 432 │ │ │ │ │ - 433 tan2Mask.VertexWeight(0) = -6.0f; │ │ │ │ │ - 434 │ │ │ │ │ - 435 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f; │ │ │ │ │ - 436 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f; │ │ │ │ │ - 437 │ │ │ │ │ - 438 tan2Mask.FaceWeight(creaseEnds[0]) = 0.0f; │ │ │ │ │ - 439 } │ │ │ │ │ - 440 │ │ │ │ │ - 441 // Append weights of 0 following the crease: │ │ │ │ │ - 442 for (int i = creaseEnds[1]; i < numFaces; ++i) { │ │ │ │ │ - 443 tan2Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ - 444 } │ │ │ │ │ - 445 for (int i = creaseEnds[1] + 1; i < numEdges; ++i) { │ │ │ │ │ - 446 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ - 447 } │ │ │ │ │ - 448} │ │ │ │ │ - 449 │ │ │ │ │ - 450template <> │ │ │ │ │ - 451template │ │ │ │ │ - 452inline void │ │ │ │ │ -453Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 454 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 455 │ │ │ │ │ - 456 typedef typename MASK::Weight Weight; │ │ │ │ │ - 457 │ │ │ │ │ - 458 int valence = vertex.GetNumFaces(); │ │ │ │ │ - 459 if (valence == 2) { │ │ │ │ │ - 460 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ - 461 return; │ │ │ │ │ - 462 } │ │ │ │ │ - 463 │ │ │ │ │ - 464 // Compute tan1 initially -- tan2 is simply a rotation: │ │ │ │ │ - 465 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 466 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 467 tan1Mask.SetNumFaceWeights(valence); │ │ │ │ │ - 468 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 469 │ │ │ │ │ - 470 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 471 │ │ │ │ │ - 472 if (valence == 4) { │ │ │ │ │ - 473 tan1Mask.EdgeWeight(0) = 4.0f; │ │ │ │ │ - 474 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ - 475 tan1Mask.EdgeWeight(2) = -4.0f; │ │ │ │ │ - 476 tan1Mask.EdgeWeight(3) = 0.0f; │ │ │ │ │ - 477 │ │ │ │ │ - 478 tan1Mask.FaceWeight(0) = 1.0f; │ │ │ │ │ - 479 tan1Mask.FaceWeight(1) = -1.0f; │ │ │ │ │ - 480 tan1Mask.FaceWeight(2) = -1.0f; │ │ │ │ │ - 481 tan1Mask.FaceWeight(3) = 1.0f; │ │ │ │ │ - 482 } else { │ │ │ │ │ - 483 double theta = 2.0f * M_PI / (double)valence; │ │ │ │ │ - 484 │ │ │ │ │ - 485 double cosTheta = std::cos(theta); │ │ │ │ │ - 486 double cosHalfTheta = std::cos(theta * 0.5f); │ │ │ │ │ - 487 │ │ │ │ │ - 488 double lambda = (5.0 / 16.0) + (1.0 / 16.0) * │ │ │ │ │ - 489 (cosTheta + cosHalfTheta * std::sqrt(2.0f * (9.0f + cosTheta))); │ │ │ │ │ - 490 │ │ │ │ │ - 491 double edgeWeightScale = 4.0f; │ │ │ │ │ - 492 double faceWeightScale = 1.0f / (4.0f * lambda - 1.0f); │ │ │ │ │ - 493 │ │ │ │ │ - 494 for (int i = 0; i < valence; ++i) { │ │ │ │ │ - 495 double cosThetaI = std::cos( i * theta); │ │ │ │ │ - 496 double cosThetaIplus1 = std::cos((i+1)* theta); │ │ │ │ │ - 497 │ │ │ │ │ - 498 tan1Mask.EdgeWeight(i) = (Weight) (edgeWeightScale * cosThetaI); │ │ │ │ │ - 499 tan1Mask.FaceWeight(i) = (Weight) (faceWeightScale * (cosThetaI + │ │ │ │ │ -cosThetaIplus1)); │ │ │ │ │ - 500 } │ │ │ │ │ - 501 } │ │ │ │ │ - 502 │ │ │ │ │ - 503 // Now rotate/copy tan1 weights to tan2: │ │ │ │ │ - 504 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 505 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ - 506 tan2Mask.SetNumFaceWeights(valence); │ │ │ │ │ - 507 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 508 │ │ │ │ │ - 509 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ - 510 if (valence == 4) { │ │ │ │ │ - 511 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ - 512 tan2Mask.EdgeWeight(1) = 4.0f; │ │ │ │ │ - 513 tan2Mask.EdgeWeight(2) = 0.0f; │ │ │ │ │ - 514 tan2Mask.EdgeWeight(3) = -4.0f; │ │ │ │ │ - 515 │ │ │ │ │ - 516 tan2Mask.FaceWeight(0) = 1.0f; │ │ │ │ │ - 517 tan2Mask.FaceWeight(1) = 1.0f; │ │ │ │ │ - 518 tan2Mask.FaceWeight(2) = -1.0f; │ │ │ │ │ - 519 tan2Mask.FaceWeight(3) = -1.0f; │ │ │ │ │ - 520 } else { │ │ │ │ │ - 521 tan2Mask.EdgeWeight(0) = tan1Mask.EdgeWeight(valence-1); │ │ │ │ │ - 522 tan2Mask.FaceWeight(0) = tan1Mask.FaceWeight(valence-1); │ │ │ │ │ - 523 for (int i = 1; i < valence; ++i) { │ │ │ │ │ - 524 tan2Mask.EdgeWeight(i) = tan1Mask.EdgeWeight(i-1); │ │ │ │ │ - 525 tan2Mask.FaceWeight(i) = tan1Mask.FaceWeight(i-1); │ │ │ │ │ - 526 } │ │ │ │ │ - 527 } │ │ │ │ │ - 528} │ │ │ │ │ - 529 │ │ │ │ │ - 530} // end namespace sdc │ │ │ │ │ - 531 │ │ │ │ │ - 532} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 533using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 534} // end namespace OpenSubdiv │ │ │ │ │ - 535 │ │ │ │ │ - 536#endif /* OPENSUBDIV3_SDC_CATMARK_SCHEME_H */ │ │ │ │ │ +99 cl_mem _patchArrays; │ │ │ │ │ +100 cl_mem _indexBuffer; │ │ │ │ │ +101 cl_mem _patchParamBuffer; │ │ │ │ │ + 102 │ │ │ │ │ +103 cl_mem _varyingPatchArrays; │ │ │ │ │ +104 cl_mem _varyingIndexBuffer; │ │ │ │ │ + 105 │ │ │ │ │ +106 std::vector _fvarPatchArrays; │ │ │ │ │ +107 std::vector _fvarIndexBuffers; │ │ │ │ │ +108 std::vector _fvarParamBuffers; │ │ │ │ │ + 109 │ │ │ │ │ + 110}; │ │ │ │ │ + 111 │ │ │ │ │ + 112} // end namespace Osd │ │ │ │ │ + 113 │ │ │ │ │ + 114} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 115using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 116 │ │ │ │ │ + 117} // end namespace OpenSubdiv │ │ │ │ │ + 118 │ │ │ │ │ + 119#endif // OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ -Split │ │ │ │ │ -Enumerated type for all face splitting schemes. │ │ │ │ │ -Definition: types.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_QUADS │ │ │ │ │ -@ SPLIT_TO_QUADS │ │ │ │ │ -Used by Catmark and Bilinear. │ │ │ │ │ -Definition: types.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH │ │ │ │ │ -@ TRI_SUB_SMOOTH │ │ │ │ │ -"smooth triangle" weights (Catmark scheme only) │ │ │ │ │ -Definition: options.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForEdge │ │ │ │ │ -void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ -static Split GetTopologicalSplitType() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForVertex │ │ │ │ │ -void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ -void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2, int const creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ -static int GetRegularFaceSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ -void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ -static int GetLocalNeighborhoodSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ -void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForVertex │ │ │ │ │ -void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ -static int GetRegularVertexValence() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ -void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ -void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ -void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable │ │ │ │ │ +CL patch table. │ │ │ │ │ +Definition: clPatchTable.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarPatchArrays │ │ │ │ │ +std::vector< cl_mem > _fvarPatchArrays │ │ │ │ │ +Definition: clPatchTable.h:106 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::~CLPatchTable │ │ │ │ │ +~CLPatchTable() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_patchParamBuffer │ │ │ │ │ +cl_mem _patchParamBuffer │ │ │ │ │ +Definition: clPatchTable.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchParamBuffer │ │ │ │ │ +cl_mem GetPatchParamBuffer() const │ │ │ │ │ +Returns the CL memory of the array of Osd::PatchParam buffer. │ │ │ │ │ +Definition: clPatchTable.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_indexBuffer │ │ │ │ │ +cl_mem _indexBuffer │ │ │ │ │ +Definition: clPatchTable.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ +cl_mem GetFVarPatchArrayBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: clPatchTable.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchArrayBuffer │ │ │ │ │ +cl_mem GetPatchArrayBuffer() const │ │ │ │ │ +Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: clPatchTable.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::Create │ │ │ │ │ +static CLPatchTable * Create(Far::PatchTable const *patchTable, cl_context │ │ │ │ │ +clContext) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_patchArrays │ │ │ │ │ +cl_mem _patchArrays │ │ │ │ │ +Definition: clPatchTable.h:99 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ +cl_mem GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the CL memory of the face-varying control vertices. │ │ │ │ │ +Definition: clPatchTable.h:89 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_varyingIndexBuffer │ │ │ │ │ +cl_mem _varyingIndexBuffer │ │ │ │ │ +Definition: clPatchTable.h:104 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ +cl_mem GetVaryingPatchIndexBuffer() const │ │ │ │ │ +Returns the CL memory of the varying control vertices. │ │ │ │ │ +Definition: clPatchTable.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channel buffers. │ │ │ │ │ +Definition: clPatchTable.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchIndexBuffer │ │ │ │ │ +cl_mem GetPatchIndexBuffer() const │ │ │ │ │ +Returns the CL memory of the patch control vertices. │ │ │ │ │ +Definition: clPatchTable.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::Create │ │ │ │ │ +static CLPatchTable * Create(Far::PatchTable const *patchTable, DEVICE_CONTEXT │ │ │ │ │ +context) │ │ │ │ │ +Definition: clPatchTable.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ +cl_mem GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the CL memory of the array of Osd::PatchParam buffer. │ │ │ │ │ +Definition: clPatchTable.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::CLPatchTable │ │ │ │ │ +CLPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::allocate │ │ │ │ │ +bool allocate(Far::PatchTable const *patchTable, cl_context clContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarParamBuffers │ │ │ │ │ +std::vector< cl_mem > _fvarParamBuffers │ │ │ │ │ +Definition: clPatchTable.h:108 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarIndexBuffers │ │ │ │ │ +std::vector< cl_mem > _fvarIndexBuffers │ │ │ │ │ +Definition: clPatchTable.h:107 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_varyingPatchArrays │ │ │ │ │ +cl_mem _varyingPatchArrays │ │ │ │ │ +Definition: clPatchTable.h:103 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ +cl_mem GetVaryingPatchArrayBuffer() const │ │ │ │ │ +Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ +Definition: clPatchTable.h:77 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * catmarkScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00785.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/bilinearScheme.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/clEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,36 +81,49 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces
│ │ │ │ -
bilinearScheme.h File Reference
│ │ │ │ +
clEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../sdc/scheme.h"
│ │ │ │ +#include "../osd/opencl.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CLStencilTable
 OpenCL stencil table. More...
 
class  CLEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,23 +4,33 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces │ │ │ │ │ -bilinearScheme.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +clEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../sdc/scheme.h" │ │ │ │ │ +#include "../osd/opencl.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CLStencilTable │ │ │ │ │ +  OpenCL stencil table. More... │ │ │ │ │ +  │ │ │ │ │ +class  CLEvaluator │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * bilinearScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00785_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/sdc/bilinearScheme.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/clEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
bilinearScheme.h
│ │ │ │ +
clEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,175 +106,1218 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24#ifndef OPENSUBDIV3_SDC_BILINEAR_SCHEME_H
│ │ │ │ -
25#define OPENSUBDIV3_SDC_BILINEAR_SCHEME_H
│ │ │ │ -
26
│ │ │ │ -
27#include "../version.h"
│ │ │ │ -
28
│ │ │ │ -
29#include "../sdc/scheme.h"
│ │ │ │ -
30
│ │ │ │ -
31namespace OpenSubdiv {
│ │ │ │ -
32namespace OPENSUBDIV_VERSION {
│ │ │ │ +
24
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ +
27
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/opencl.h"
│ │ │ │ +
31#include "../osd/types.h"
│ │ │ │ +
32#include "../osd/bufferDescriptor.h"
│ │ │ │
33
│ │ │ │ -
34namespace Sdc {
│ │ │ │ -
35
│ │ │ │ -
36//
│ │ │ │ -
37// Specializations for Scheme<SCHEME_BILINEAR>:
│ │ │ │ -
38//
│ │ │ │ -
39
│ │ │ │ -
40//
│ │ │ │ -
41// Bilinear traits:
│ │ │ │ -
42//
│ │ │ │ -
43template <>
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ -
46template <>
│ │ │ │ - │ │ │ │ -
48
│ │ │ │ -
49template <>
│ │ │ │ - │ │ │ │ -
51
│ │ │ │ -
52template <>
│ │ │ │ - │ │ │ │ -
54
│ │ │ │ -
55
│ │ │ │ -
56//
│ │ │ │ -
57// Refinement masks:
│ │ │ │ -
58//
│ │ │ │ -
59template <>
│ │ │ │ -
60template <typename EDGE, typename MASK>
│ │ │ │ -
61void
│ │ │ │ - │ │ │ │ - │ │ │ │ -
64 // This should be inline, otherwise trivially replicate it:
│ │ │ │ -
65 assignCreaseMaskForEdge(edge, mask);
│ │ │ │ -
66}
│ │ │ │ -
67
│ │ │ │ -
68template <>
│ │ │ │ -
69template <typename VERTEX, typename MASK>
│ │ │ │ -
70void
│ │ │ │ -
71Scheme<SCHEME_BILINEAR>::ComputeVertexVertexMask(VERTEX const& vertex, MASK& mask,
│ │ │ │ - │ │ │ │ -
73 // This should be inline, otherwise trivially replicate it:
│ │ │ │ -
74 assignCornerMaskForVertex(vertex, mask);
│ │ │ │ -
75}
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ -
78//
│ │ │ │ -
79// Limit masks for position -- the limit position of all vertices is the refined vertex.
│ │ │ │ -
80//
│ │ │ │ -
81template <>
│ │ │ │ -
82template <typename VERTEX, typename MASK>
│ │ │ │ -
83inline void
│ │ │ │ -
84Scheme<SCHEME_BILINEAR>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ -
85
│ │ │ │ -
86 posMask.SetNumVertexWeights(1);
│ │ │ │ -
87 posMask.SetNumEdgeWeights(0);
│ │ │ │ -
88 posMask.SetNumFaceWeights(0);
│ │ │ │ -
89 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
90
│ │ │ │ -
91 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ -
92}
│ │ │ │ -
93
│ │ │ │ -
94template <>
│ │ │ │ -
95template <typename VERTEX, typename MASK>
│ │ │ │ -
96inline void
│ │ │ │ -
97Scheme<SCHEME_BILINEAR>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ -
98 int const /* creaseEnds */[2]) const {
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Far {
│ │ │ │ +
38 class PatchTable;
│ │ │ │ +
39 class StencilTable;
│ │ │ │ +
40 class LimitStencilTable;
│ │ │ │ +
41}
│ │ │ │ +
42
│ │ │ │ +
43namespace Osd {
│ │ │ │ +
44
│ │ │ │ + │ │ │ │ +
53public:
│ │ │ │ +
54 template <typename DEVICE_CONTEXT>
│ │ │ │ +
55 static CLStencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ +
56 DEVICE_CONTEXT context) {
│ │ │ │ +
57 return new CLStencilTable(stencilTable, context->GetContext());
│ │ │ │ +
58 }
│ │ │ │ +
59
│ │ │ │ +
60 template <typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
62 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ +
63 DEVICE_CONTEXT context) {
│ │ │ │ +
64 return new CLStencilTable(limitStencilTable, context->GetContext());
│ │ │ │ +
65 }
│ │ │ │ +
66
│ │ │ │ +
67 CLStencilTable(Far::StencilTable const *stencilTable,
│ │ │ │ +
68 cl_context clContext);
│ │ │ │ +
69 CLStencilTable(Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ +
70 cl_context clContext);
│ │ │ │ + │ │ │ │ +
72
│ │ │ │ +
73 // interfaces needed for CLComputeKernel
│ │ │ │ +
74 cl_mem GetSizesBuffer() const { return _sizes; }
│ │ │ │ +
75 cl_mem GetOffsetsBuffer() const { return _offsets; }
│ │ │ │ +
76 cl_mem GetIndicesBuffer() const { return _indices; }
│ │ │ │ +
77 cl_mem GetWeightsBuffer() const { return _weights; }
│ │ │ │ +
78 cl_mem GetDuWeightsBuffer() const { return _duWeights; }
│ │ │ │ +
79 cl_mem GetDvWeightsBuffer() const { return _dvWeights; }
│ │ │ │ +
80 cl_mem GetDuuWeightsBuffer() const { return _duuWeights; }
│ │ │ │ +
81 cl_mem GetDuvWeightsBuffer() const { return _duvWeights; }
│ │ │ │ +
82 cl_mem GetDvvWeightsBuffer() const { return _dvvWeights; }
│ │ │ │ +
83 int GetNumStencils() const { return _numStencils; }
│ │ │ │ +
84
│ │ │ │ +
85private:
│ │ │ │ +
86 cl_mem _sizes;
│ │ │ │ +
87 cl_mem _offsets;
│ │ │ │ +
88 cl_mem _indices;
│ │ │ │ +
89 cl_mem _weights;
│ │ │ │ +
90 cl_mem _duWeights;
│ │ │ │ +
91 cl_mem _dvWeights;
│ │ │ │ +
92 cl_mem _duuWeights;
│ │ │ │ +
93 cl_mem _duvWeights;
│ │ │ │ +
94 cl_mem _dvvWeights;
│ │ │ │ +
95 int _numStencils;
│ │ │ │ +
96};
│ │ │ │ +
97
│ │ │ │ +
98// ---------------------------------------------------------------------------
│ │ │ │
99
│ │ │ │ -
100 assignCornerLimitMask(vertex, posMask);
│ │ │ │ -
101}
│ │ │ │ -
102
│ │ │ │ -
103template <>
│ │ │ │ -
104template <typename VERTEX, typename MASK>
│ │ │ │ -
105inline void
│ │ │ │ -
106Scheme<SCHEME_BILINEAR>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ -
107
│ │ │ │ -
108 assignCornerLimitMask(vertex, posMask);
│ │ │ │ -
109}
│ │ │ │ -
110
│ │ │ │ -
111//
│ │ │ │ -
112// Limit masks for tangents -- these are ambiguous around all vertices. Provide
│ │ │ │ -
113// the tangents based on the incident edges of the first face.
│ │ │ │ -
114//
│ │ │ │ -
115template <>
│ │ │ │ -
116template <typename VERTEX, typename MASK>
│ │ │ │ -
117inline void
│ │ │ │ - │ │ │ │ -
119 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
120
│ │ │ │ -
121 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ -
122 tan1Mask.SetNumEdgeWeights(2);
│ │ │ │ -
123 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ -
124 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
125
│ │ │ │ -
126 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ -
127 tan2Mask.SetNumEdgeWeights(2);
│ │ │ │ -
128 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ -
129 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ -
130
│ │ │ │ -
131 tan1Mask.VertexWeight(0) = -1.0f;
│ │ │ │ -
132 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ -
133 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ -
134
│ │ │ │ -
135 tan2Mask.VertexWeight(0) = -1.0f;
│ │ │ │ -
136 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ -
137 tan2Mask.EdgeWeight(1) = 1.0f;
│ │ │ │ -
138}
│ │ │ │ -
139
│ │ │ │ -
140template <>
│ │ │ │ -
141template <typename VERTEX, typename MASK>
│ │ │ │ -
142inline void
│ │ │ │ - │ │ │ │ -
144 MASK& tan1Mask, MASK& tan2Mask, int const /* creaseEnds */[2]) const {
│ │ │ │ -
145
│ │ │ │ -
146 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ -
147}
│ │ │ │ -
148
│ │ │ │ -
149template <>
│ │ │ │ -
150template <typename VERTEX, typename MASK>
│ │ │ │ -
151inline void
│ │ │ │ - │ │ │ │ -
153 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ -
154
│ │ │ │ -
155 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ -
156}
│ │ │ │ -
157
│ │ │ │ -
158} // end namespace sdc
│ │ │ │ -
159
│ │ │ │ -
160} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
161using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
162} // end namespace OpenSubdiv
│ │ │ │ -
163
│ │ │ │ -
164#endif /* OPENSUBDIV3_SDC_BILINEAR_SCHEME_H */
│ │ │ │ + │ │ │ │ +
101public:
│ │ │ │ +
102 typedef bool Instantiatable;
│ │ │ │ +
103
│ │ │ │ +
105 template <typename DEVICE_CONTEXT>
│ │ │ │ +
106 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
107 BufferDescriptor const &dstDesc,
│ │ │ │ +
108 BufferDescriptor const &duDesc,
│ │ │ │ +
109 BufferDescriptor const &dvDesc,
│ │ │ │ +
110 DEVICE_CONTEXT deviceContext) {
│ │ │ │ +
111 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
112 deviceContext->GetContext(),
│ │ │ │ +
113 deviceContext->GetCommandQueue());
│ │ │ │ +
114 }
│ │ │ │ +
115
│ │ │ │ +
116 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
117 BufferDescriptor const &dstDesc,
│ │ │ │ +
118 BufferDescriptor const &duDesc,
│ │ │ │ +
119 BufferDescriptor const &dvDesc,
│ │ │ │ +
120 cl_context clContext,
│ │ │ │ +
121 cl_command_queue clCommandQueue) {
│ │ │ │ +
122 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
│ │ │ │ +
123 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
│ │ │ │ +
124 return instance;
│ │ │ │ +
125 delete instance;
│ │ │ │ +
126 return NULL;
│ │ │ │ +
127 }
│ │ │ │ +
128
│ │ │ │ +
130 template <typename DEVICE_CONTEXT>
│ │ │ │ +
131 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
132 BufferDescriptor const &dstDesc,
│ │ │ │ +
133 BufferDescriptor const &duDesc,
│ │ │ │ +
134 BufferDescriptor const &dvDesc,
│ │ │ │ +
135 BufferDescriptor const &duuDesc,
│ │ │ │ +
136 BufferDescriptor const &duvDesc,
│ │ │ │ +
137 BufferDescriptor const &dvvDesc,
│ │ │ │ +
138 DEVICE_CONTEXT deviceContext) {
│ │ │ │ +
139 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
140 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
141 deviceContext->GetContext(),
│ │ │ │ +
142 deviceContext->GetCommandQueue());
│ │ │ │ +
143 }
│ │ │ │ +
144
│ │ │ │ +
145 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
146 BufferDescriptor const &dstDesc,
│ │ │ │ +
147 BufferDescriptor const &duDesc,
│ │ │ │ +
148 BufferDescriptor const &dvDesc,
│ │ │ │ +
149 BufferDescriptor const &duuDesc,
│ │ │ │ +
150 BufferDescriptor const &duvDesc,
│ │ │ │ +
151 BufferDescriptor const &dvvDesc,
│ │ │ │ +
152 cl_context clContext,
│ │ │ │ +
153 cl_command_queue clCommandQueue) {
│ │ │ │ +
154 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
│ │ │ │ +
155 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
156 duuDesc, duvDesc, dvvDesc))
│ │ │ │ +
157 return instance;
│ │ │ │ +
158 delete instance;
│ │ │ │ +
159 return NULL;
│ │ │ │ +
160 }
│ │ │ │ +
161
│ │ │ │ +
163 CLEvaluator(cl_context context, cl_command_queue queue);
│ │ │ │ +
164
│ │ │ │ + │ │ │ │ +
167
│ │ │ │ +
173
│ │ │ │ +
217 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
218 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ +
219 static bool EvalStencils(
│ │ │ │ +
220 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
221 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
222 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
223 CLEvaluator const *instance,
│ │ │ │ +
224 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
225 unsigned int numStartEvents=0,
│ │ │ │ +
226 const cl_event* startEvents=NULL,
│ │ │ │ +
227 cl_event* endEvent=NULL) {
│ │ │ │ +
228
│ │ │ │ +
229 if (instance) {
│ │ │ │ +
230 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
231 dstBuffer, dstDesc,
│ │ │ │ +
232 stencilTable,
│ │ │ │ +
233 numStartEvents, startEvents, endEvent);
│ │ │ │ +
234 } else {
│ │ │ │ +
235 // Create an instance on demand (slow)
│ │ │ │ +
236 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
239 deviceContext);
│ │ │ │ +
240 if (instance) {
│ │ │ │ +
241 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
242 dstBuffer, dstDesc,
│ │ │ │ +
243 stencilTable,
│ │ │ │ +
244 numStartEvents, startEvents, endEvent);
│ │ │ │ +
245 delete instance;
│ │ │ │ +
246 return r;
│ │ │ │ +
247 }
│ │ │ │ +
248 return false;
│ │ │ │ +
249 }
│ │ │ │ +
250 }
│ │ │ │ +
251
│ │ │ │ +
307 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
308 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ +
309 static bool EvalStencils(
│ │ │ │ +
310 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
311 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
312 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
313 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
314 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
315 CLEvaluator const *instance,
│ │ │ │ +
316 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
317 unsigned int numStartEvents=0,
│ │ │ │ +
318 const cl_event* startEvents=NULL,
│ │ │ │ +
319 cl_event* endEvent=NULL) {
│ │ │ │ +
320
│ │ │ │ +
321 if (instance) {
│ │ │ │ +
322 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
323 dstBuffer, dstDesc,
│ │ │ │ +
324 duBuffer, duDesc,
│ │ │ │ +
325 dvBuffer, dvDesc,
│ │ │ │ +
326 stencilTable,
│ │ │ │ +
327 numStartEvents, startEvents, endEvent);
│ │ │ │ +
328 } else {
│ │ │ │ +
329 // Create an instance on demand (slow)
│ │ │ │ +
330 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
331 deviceContext);
│ │ │ │ +
332 if (instance) {
│ │ │ │ +
333 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
334 dstBuffer, dstDesc,
│ │ │ │ +
335 duBuffer, duDesc,
│ │ │ │ +
336 dvBuffer, dvDesc,
│ │ │ │ +
337 stencilTable,
│ │ │ │ +
338 numStartEvents, startEvents, endEvent);
│ │ │ │ +
339 delete instance;
│ │ │ │ +
340 return r;
│ │ │ │ +
341 }
│ │ │ │ +
342 return false;
│ │ │ │ +
343 }
│ │ │ │ +
344 }
│ │ │ │ +
345
│ │ │ │ +
419 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
420 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ +
421 static bool EvalStencils(
│ │ │ │ +
422 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
423 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
424 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
425 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
426 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
427 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
428 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
429 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
430 CLEvaluator const *instance,
│ │ │ │ +
431 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
432 unsigned int numStartEvents=0,
│ │ │ │ +
433 const cl_event* startEvents=NULL,
│ │ │ │ +
434 cl_event* endEvent=NULL) {
│ │ │ │ +
435
│ │ │ │ +
436 if (instance) {
│ │ │ │ +
437 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
438 dstBuffer, dstDesc,
│ │ │ │ +
439 duBuffer, duDesc,
│ │ │ │ +
440 dvBuffer, dvDesc,
│ │ │ │ +
441 duuBuffer, duuDesc,
│ │ │ │ +
442 duvBuffer, duvDesc,
│ │ │ │ +
443 dvvBuffer, dvvDesc,
│ │ │ │ +
444 stencilTable,
│ │ │ │ +
445 numStartEvents, startEvents, endEvent);
│ │ │ │ +
446 } else {
│ │ │ │ +
447 // Create an instance on demand (slow)
│ │ │ │ +
448 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
449 duDesc, dvDesc,
│ │ │ │ +
450 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
451 deviceContext);
│ │ │ │ +
452 if (instance) {
│ │ │ │ +
453 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
454 dstBuffer, dstDesc,
│ │ │ │ +
455 duBuffer, duDesc,
│ │ │ │ +
456 dvBuffer, dvDesc,
│ │ │ │ +
457 duuBuffer, duuDesc,
│ │ │ │ +
458 duvBuffer, duvDesc,
│ │ │ │ +
459 dvvBuffer, dvvDesc,
│ │ │ │ +
460 stencilTable,
│ │ │ │ +
461 numStartEvents, startEvents, endEvent);
│ │ │ │ +
462 delete instance;
│ │ │ │ +
463 return r;
│ │ │ │ +
464 }
│ │ │ │ +
465 return false;
│ │ │ │ +
466 }
│ │ │ │ +
467 }
│ │ │ │ +
468
│ │ │ │ +
499 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
501 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
502 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
503 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
504 unsigned int numStartEvents=0,
│ │ │ │ +
505 const cl_event* startEvents=NULL,
│ │ │ │ +
506 cl_event* endEvent=NULL) const {
│ │ │ │ +
507 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
508 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
509 stencilTable->GetSizesBuffer(),
│ │ │ │ +
510 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
511 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
512 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
513 0,
│ │ │ │ +
514 stencilTable->GetNumStencils(),
│ │ │ │ +
515 numStartEvents, startEvents, endEvent);
│ │ │ │ +
516 }
│ │ │ │ +
517
│ │ │ │ +
560 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
562 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
563 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
564 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
565 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
566 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
567 unsigned int numStartEvents=0,
│ │ │ │ +
568 const cl_event* startEvents=NULL,
│ │ │ │ +
569 cl_event* endEvent=NULL) const {
│ │ │ │ +
570 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
571 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
572 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
573 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
574 stencilTable->GetSizesBuffer(),
│ │ │ │ +
575 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
576 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
577 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
578 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
579 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
580 0,
│ │ │ │ +
581 stencilTable->GetNumStencils(),
│ │ │ │ +
582 numStartEvents, startEvents, endEvent);
│ │ │ │ +
583 }
│ │ │ │ +
584
│ │ │ │ +
645 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
647 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
648 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
649 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
650 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
651 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
652 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
653 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
654 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
655 unsigned int numStartEvents=0,
│ │ │ │ +
656 const cl_event* startEvents=NULL,
│ │ │ │ +
657 cl_event* endEvent=NULL) const {
│ │ │ │ +
658 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
659 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
660 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
661 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
662 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ +
663 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ +
664 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ +
665 stencilTable->GetSizesBuffer(),
│ │ │ │ +
666 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
667 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
668 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
669 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
670 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
671 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ +
672 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ +
673 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ +
674 0,
│ │ │ │ +
675 stencilTable->GetNumStencils(),
│ │ │ │ +
676 numStartEvents, startEvents, endEvent);
│ │ │ │ +
677 }
│ │ │ │ +
678
│ │ │ │ +
681 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ +
682 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
683 cl_mem sizes,
│ │ │ │ +
684 cl_mem offsets,
│ │ │ │ +
685 cl_mem indices,
│ │ │ │ +
686 cl_mem weights,
│ │ │ │ +
687 int start,
│ │ │ │ +
688 int end,
│ │ │ │ +
689 unsigned int numStartEvents=0,
│ │ │ │ +
690 const cl_event* startEvents=NULL,
│ │ │ │ +
691 cl_event* endEvent=NULL) const;
│ │ │ │ +
692
│ │ │ │ +
741 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ +
742 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
743 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ +
744 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
745 cl_mem sizes,
│ │ │ │ +
746 cl_mem offsets,
│ │ │ │ +
747 cl_mem indices,
│ │ │ │ +
748 cl_mem weights,
│ │ │ │ +
749 cl_mem duWeights,
│ │ │ │ +
750 cl_mem dvWeights,
│ │ │ │ +
751 int start,
│ │ │ │ +
752 int end,
│ │ │ │ +
753 unsigned int numStartEvents=0,
│ │ │ │ +
754 const cl_event* startEvents=NULL,
│ │ │ │ +
755 cl_event* endEvent=NULL) const;
│ │ │ │ +
756
│ │ │ │ +
823 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ +
824 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
825 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ +
826 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
827 cl_mem duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
828 cl_mem duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
829 cl_mem dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
830 cl_mem sizes,
│ │ │ │ +
831 cl_mem offsets,
│ │ │ │ +
832 cl_mem indices,
│ │ │ │ +
833 cl_mem weights,
│ │ │ │ +
834 cl_mem duWeights,
│ │ │ │ +
835 cl_mem dvWeights,
│ │ │ │ +
836 cl_mem duuWeights,
│ │ │ │ +
837 cl_mem duvWeights,
│ │ │ │ +
838 cl_mem dvvWeights,
│ │ │ │ +
839 int start,
│ │ │ │ +
840 int end,
│ │ │ │ +
841 unsigned int numStartEvents=0,
│ │ │ │ +
842 const cl_event* startEvents=NULL,
│ │ │ │ +
843 cl_event* endEvent=NULL) const;
│ │ │ │ +
844
│ │ │ │ +
850
│ │ │ │ +
899 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
900 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
901 typename DEVICE_CONTEXT>
│ │ │ │ +
902 static bool EvalPatches(
│ │ │ │ +
903 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
904 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
905 int numPatchCoords,
│ │ │ │ +
906 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
907 PATCH_TABLE *patchTable,
│ │ │ │ +
908 CLEvaluator const *instance,
│ │ │ │ +
909 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
910 unsigned int numStartEvents=0,
│ │ │ │ +
911 const cl_event* startEvents=NULL,
│ │ │ │ +
912 cl_event* endEvent=NULL) {
│ │ │ │ +
913
│ │ │ │ +
914 if (instance) {
│ │ │ │ +
915 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
916 dstBuffer, dstDesc,
│ │ │ │ +
917 numPatchCoords, patchCoords,
│ │ │ │ +
918 patchTable,
│ │ │ │ +
919 numStartEvents, startEvents, endEvent);
│ │ │ │ +
920 } else {
│ │ │ │ +
921 // Create an instance on demand (slow)
│ │ │ │ +
922 (void)deviceContext; // unused
│ │ │ │ +
923 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
926 deviceContext);
│ │ │ │ +
927 if (instance) {
│ │ │ │ +
928 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
929 dstBuffer, dstDesc,
│ │ │ │ +
930 numPatchCoords, patchCoords,
│ │ │ │ +
931 patchTable,
│ │ │ │ +
932 numStartEvents, startEvents, endEvent);
│ │ │ │ +
933 delete instance;
│ │ │ │ +
934 return r;
│ │ │ │ +
935 }
│ │ │ │ +
936 return false;
│ │ │ │ +
937 }
│ │ │ │ +
938 }
│ │ │ │ +
939
│ │ │ │ +
1000 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1001 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
1002 typename DEVICE_CONTEXT>
│ │ │ │ +
1003 static bool EvalPatches(
│ │ │ │ +
1004 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1005 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1006 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1007 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1008 int numPatchCoords,
│ │ │ │ +
1009 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1010 PATCH_TABLE *patchTable,
│ │ │ │ +
1011 CLEvaluator const *instance,
│ │ │ │ +
1012 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
1013 unsigned int numStartEvents=0,
│ │ │ │ +
1014 const cl_event* startEvents=NULL,
│ │ │ │ +
1015 cl_event* endEvent=NULL) {
│ │ │ │ +
1016
│ │ │ │ +
1017 if (instance) {
│ │ │ │ +
1018 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
1019 dstBuffer, dstDesc,
│ │ │ │ +
1020 duBuffer, duDesc,
│ │ │ │ +
1021 dvBuffer, dvDesc,
│ │ │ │ +
1022 numPatchCoords, patchCoords,
│ │ │ │ +
1023 patchTable,
│ │ │ │ +
1024 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1025 } else {
│ │ │ │ +
1026 // Create an instance on demand (slow)
│ │ │ │ +
1027 (void)deviceContext; // unused
│ │ │ │ +
1028 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext);
│ │ │ │ +
1029 if (instance) {
│ │ │ │ +
1030 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
1031 dstBuffer, dstDesc,
│ │ │ │ +
1032 duBuffer, duDesc,
│ │ │ │ +
1033 dvBuffer, dvDesc,
│ │ │ │ +
1034 numPatchCoords, patchCoords,
│ │ │ │ +
1035 patchTable,
│ │ │ │ +
1036 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1037 delete instance;
│ │ │ │ +
1038 return r;
│ │ │ │ +
1039 }
│ │ │ │ +
1040 return false;
│ │ │ │ +
1041 }
│ │ │ │ +
1042 }
│ │ │ │ +
1043
│ │ │ │ +
1122 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1123 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
1124 typename DEVICE_CONTEXT>
│ │ │ │ +
1125 static bool EvalPatches(
│ │ │ │ +
1126 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1127 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1128 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1129 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1130 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1131 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1132 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1133 int numPatchCoords,
│ │ │ │ +
1134 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1135 PATCH_TABLE *patchTable,
│ │ │ │ +
1136 CLEvaluator const *instance,
│ │ │ │ +
1137 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
1138 unsigned int numStartEvents=0,
│ │ │ │ +
1139 const cl_event* startEvents=NULL,
│ │ │ │ +
1140 cl_event* endEvent=NULL) {
│ │ │ │ +
1141
│ │ │ │ +
1142 if (instance) {
│ │ │ │ +
1143 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
1144 dstBuffer, dstDesc,
│ │ │ │ +
1145 duBuffer, duDesc,
│ │ │ │ +
1146 dvBuffer, dvDesc,
│ │ │ │ +
1147 duuBuffer, duuDesc,
│ │ │ │ +
1148 duvBuffer, duvDesc,
│ │ │ │ +
1149 dvvBuffer, dvvDesc,
│ │ │ │ +
1150 numPatchCoords, patchCoords,
│ │ │ │ +
1151 patchTable,
│ │ │ │ +
1152 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1153 } else {
│ │ │ │ +
1154 // Create an instance on demand (slow)
│ │ │ │ +
1155 (void)deviceContext; // unused
│ │ │ │ +
1156 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1157 duDesc, dvDesc,
│ │ │ │ +
1158 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
1159 deviceContext);
│ │ │ │ +
1160 if (instance) {
│ │ │ │ +
1161 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
1162 dstBuffer, dstDesc,
│ │ │ │ +
1163 duBuffer, duDesc,
│ │ │ │ +
1164 dvBuffer, dvDesc,
│ │ │ │ +
1165 duuBuffer, duuDesc,
│ │ │ │ +
1166 duvBuffer, duvDesc,
│ │ │ │ +
1167 dvvBuffer, dvvDesc,
│ │ │ │ +
1168 numPatchCoords, patchCoords,
│ │ │ │ +
1169 patchTable,
│ │ │ │ +
1170 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1171 delete instance;
│ │ │ │ +
1172 return r;
│ │ │ │ +
1173 }
│ │ │ │ +
1174 return false;
│ │ │ │ +
1175 }
│ │ │ │ +
1176 }
│ │ │ │ +
1177
│ │ │ │ +
1215 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1216 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1218 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1219 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1220 int numPatchCoords,
│ │ │ │ +
1221 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1222 PATCH_TABLE *patchTable,
│ │ │ │ +
1223 unsigned int numStartEvents=0,
│ │ │ │ +
1224 const cl_event* startEvents=NULL,
│ │ │ │ +
1225 cl_event* endEvent=NULL) const {
│ │ │ │ +
1226
│ │ │ │ +
1227 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1228 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1229 0, BufferDescriptor(),
│ │ │ │ +
1230 0, BufferDescriptor(),
│ │ │ │ +
1231 numPatchCoords,
│ │ │ │ +
1232 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
1233 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
1234 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1235 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1236 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1237 }
│ │ │ │ +
1238
│ │ │ │ +
1286 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1287 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1289 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1290 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1291 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1292 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1293 int numPatchCoords,
│ │ │ │ +
1294 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1295 PATCH_TABLE *patchTable,
│ │ │ │ +
1296 unsigned int numStartEvents=0,
│ │ │ │ +
1297 const cl_event* startEvents=NULL,
│ │ │ │ +
1298 cl_event* endEvent=NULL) const {
│ │ │ │ +
1299
│ │ │ │ +
1300 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1301 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1302 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
1303 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
1304 numPatchCoords,
│ │ │ │ +
1305 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
1306 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
1307 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1308 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1309 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1310 }
│ │ │ │ +
1311
│ │ │ │ +
1377 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1378 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1380 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1381 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1382 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1383 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1384 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1385 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1386 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1387 int numPatchCoords,
│ │ │ │ +
1388 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1389 PATCH_TABLE *patchTable,
│ │ │ │ +
1390 unsigned int numStartEvents=0,
│ │ │ │ +
1391 const cl_event* startEvents=NULL,
│ │ │ │ +
1392 cl_event* endEvent=NULL) const {
│ │ │ │ +
1393
│ │ │ │ +
1394 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1395 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1396 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
1397 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
1398 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ +
1399 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ +
1400 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ +
1401 numPatchCoords,
│ │ │ │ +
1402 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
1403 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
1404 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1405 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1406 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1407 }
│ │ │ │ +
1408
│ │ │ │ +
1409 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ +
1410 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
1411 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ +
1412 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
1413 int numPatchCoords,
│ │ │ │ +
1414 cl_mem patchCoordsBuffer,
│ │ │ │ +
1415 cl_mem patchArrayBuffer,
│ │ │ │ +
1416 cl_mem patchIndexBuffer,
│ │ │ │ +
1417 cl_mem patchParamsBuffer,
│ │ │ │ +
1418 unsigned int numStartEvents=0,
│ │ │ │ +
1419 const cl_event* startEvents=NULL,
│ │ │ │ +
1420 cl_event* endEvent=NULL) const;
│ │ │ │ +
1421
│ │ │ │ +
1422 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ +
1423 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
1424 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ +
1425 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
1426 cl_mem duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
1427 cl_mem duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
1428 cl_mem dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1429 int numPatchCoords,
│ │ │ │ +
1430 cl_mem patchCoordsBuffer,
│ │ │ │ +
1431 cl_mem patchArrayBuffer,
│ │ │ │ +
1432 cl_mem patchIndexBuffer,
│ │ │ │ +
1433 cl_mem patchParamsBuffer,
│ │ │ │ +
1434 unsigned int numStartEvents=0,
│ │ │ │ +
1435 const cl_event* startEvents=NULL,
│ │ │ │ +
1436 cl_event* endEvent=NULL) const;
│ │ │ │ +
1437
│ │ │ │ +
1486 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1487 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
1488 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
1490 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1491 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1492 int numPatchCoords,
│ │ │ │ +
1493 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1494 PATCH_TABLE *patchTable,
│ │ │ │ +
1495 CLEvaluator const *instance,
│ │ │ │ +
1496 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
1497 unsigned int numStartEvents=0,
│ │ │ │ +
1498 const cl_event* startEvents=NULL,
│ │ │ │ +
1499 cl_event* endEvent=NULL) {
│ │ │ │ +
1500
│ │ │ │ +
1501 if (instance) {
│ │ │ │ +
1502 return instance->EvalPatchesVarying(
│ │ │ │ +
1503 srcBuffer, srcDesc,
│ │ │ │ +
1504 dstBuffer, dstDesc,
│ │ │ │ +
1505 numPatchCoords, patchCoords,
│ │ │ │ +
1506 patchTable,
│ │ │ │ +
1507 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1508 } else {
│ │ │ │ +
1509 // Create an instance on demand (slow)
│ │ │ │ +
1510 (void)deviceContext; // unused
│ │ │ │ +
1511 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1514 deviceContext);
│ │ │ │ +
1515 if (instance) {
│ │ │ │ +
1516 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1517 srcBuffer, srcDesc,
│ │ │ │ +
1518 dstBuffer, dstDesc,
│ │ │ │ +
1519 numPatchCoords, patchCoords,
│ │ │ │ +
1520 patchTable,
│ │ │ │ +
1521 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1522 delete instance;
│ │ │ │ +
1523 return r;
│ │ │ │ +
1524 }
│ │ │ │ +
1525 return false;
│ │ │ │ +
1526 }
│ │ │ │ +
1527 }
│ │ │ │ +
1528
│ │ │ │ +
1566 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1567 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1569 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1570 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1571 int numPatchCoords,
│ │ │ │ +
1572 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1573 PATCH_TABLE *patchTable,
│ │ │ │ +
1574 unsigned int numStartEvents=0,
│ │ │ │ +
1575 const cl_event* startEvents=NULL,
│ │ │ │ +
1576 cl_event* endEvent=NULL) const {
│ │ │ │ +
1577
│ │ │ │ +
1578 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1579 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1580 0, BufferDescriptor(),
│ │ │ │ +
1581 0, BufferDescriptor(),
│ │ │ │ +
1582 numPatchCoords,
│ │ │ │ +
1583 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
1584 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
1585 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1586 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1587 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1588 }
│ │ │ │ +
1589
│ │ │ │ +
1650 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1651 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
1652 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
1654 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1655 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1656 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1657 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1658 int numPatchCoords,
│ │ │ │ +
1659 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1660 PATCH_TABLE *patchTable,
│ │ │ │ +
1661 CLEvaluator const *instance,
│ │ │ │ +
1662 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
1663 unsigned int numStartEvents=0,
│ │ │ │ +
1664 const cl_event* startEvents=NULL,
│ │ │ │ +
1665 cl_event* endEvent=NULL) {
│ │ │ │ +
1666
│ │ │ │ +
1667 if (instance) {
│ │ │ │ +
1668 return instance->EvalPatchesVarying(
│ │ │ │ +
1669 srcBuffer, srcDesc,
│ │ │ │ +
1670 dstBuffer, dstDesc,
│ │ │ │ +
1671 duBuffer, duDesc,
│ │ │ │ +
1672 dvBuffer, dvDesc,
│ │ │ │ +
1673 numPatchCoords, patchCoords,
│ │ │ │ +
1674 patchTable,
│ │ │ │ +
1675 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1676 } else {
│ │ │ │ +
1677 // Create an instance on demand (slow)
│ │ │ │ +
1678 (void)deviceContext; // unused
│ │ │ │ +
1679 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1680 duDesc, dvDesc,
│ │ │ │ +
1681 deviceContext);
│ │ │ │ +
1682 if (instance) {
│ │ │ │ +
1683 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1684 srcBuffer, srcDesc,
│ │ │ │ +
1685 dstBuffer, dstDesc,
│ │ │ │ +
1686 duBuffer, duDesc,
│ │ │ │ +
1687 dvBuffer, dvDesc,
│ │ │ │ +
1688 numPatchCoords, patchCoords,
│ │ │ │ +
1689 patchTable,
│ │ │ │ +
1690 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1691 delete instance;
│ │ │ │ +
1692 return r;
│ │ │ │ +
1693 }
│ │ │ │ +
1694 return false;
│ │ │ │ +
1695 }
│ │ │ │ +
1696 }
│ │ │ │ +
1697
│ │ │ │ +
1747 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1748 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1750 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1751 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1752 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1753 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1754 int numPatchCoords,
│ │ │ │ +
1755 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1756 PATCH_TABLE *patchTable,
│ │ │ │ +
1757 unsigned int numStartEvents=0,
│ │ │ │ +
1758 const cl_event* startEvents=NULL,
│ │ │ │ +
1759 cl_event* endEvent=NULL) const {
│ │ │ │ +
1760
│ │ │ │ +
1761 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1762 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1763 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
1764 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
1765 numPatchCoords,
│ │ │ │ +
1766 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
1767 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
1768 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1769 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1770 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1771 }
│ │ │ │ +
1772
│ │ │ │ +
1851 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1852 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
1853 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
1855 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1856 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1857 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1858 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1859 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1860 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1861 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1862 int numPatchCoords,
│ │ │ │ +
1863 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1864 PATCH_TABLE *patchTable,
│ │ │ │ +
1865 CLEvaluator const *instance,
│ │ │ │ +
1866 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
1867 unsigned int numStartEvents=0,
│ │ │ │ +
1868 const cl_event* startEvents=NULL,
│ │ │ │ +
1869 cl_event* endEvent=NULL) {
│ │ │ │ +
1870
│ │ │ │ +
1871 if (instance) {
│ │ │ │ +
1872 return instance->EvalPatchesVarying(
│ │ │ │ +
1873 srcBuffer, srcDesc,
│ │ │ │ +
1874 dstBuffer, dstDesc,
│ │ │ │ +
1875 duBuffer, duDesc,
│ │ │ │ +
1876 dvBuffer, dvDesc,
│ │ │ │ +
1877 duuBuffer, duuDesc,
│ │ │ │ +
1878 duvBuffer, duvDesc,
│ │ │ │ +
1879 dvvBuffer, dvvDesc,
│ │ │ │ +
1880 numPatchCoords, patchCoords,
│ │ │ │ +
1881 patchTable,
│ │ │ │ +
1882 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1883 } else {
│ │ │ │ +
1884 // Create an instance on demand (slow)
│ │ │ │ +
1885 (void)deviceContext; // unused
│ │ │ │ +
1886 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1887 duDesc, dvDesc,
│ │ │ │ +
1888 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
1889 deviceContext);
│ │ │ │ +
1890 if (instance) {
│ │ │ │ +
1891 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1892 srcBuffer, srcDesc,
│ │ │ │ +
1893 dstBuffer, dstDesc,
│ │ │ │ +
1894 duBuffer, duDesc,
│ │ │ │ +
1895 dvBuffer, dvDesc,
│ │ │ │ +
1896 duuBuffer, duuDesc,
│ │ │ │ +
1897 duvBuffer, duvDesc,
│ │ │ │ +
1898 dvvBuffer, dvvDesc,
│ │ │ │ +
1899 numPatchCoords, patchCoords,
│ │ │ │ +
1900 patchTable,
│ │ │ │ +
1901 numStartEvents, startEvents, endEvent);
│ │ │ │ +
1902 delete instance;
│ │ │ │ +
1903 return r;
│ │ │ │ +
1904 }
│ │ │ │ +
1905 return false;
│ │ │ │ +
1906 }
│ │ │ │ +
1907 }
│ │ │ │ +
1908
│ │ │ │ +
1976 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1977 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1979 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1980 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1981 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1982 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1983 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1984 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1985 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1986 int numPatchCoords,
│ │ │ │ +
1987 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1988 PATCH_TABLE *patchTable,
│ │ │ │ +
1989 unsigned int numStartEvents=0,
│ │ │ │ +
1990 const cl_event* startEvents=NULL,
│ │ │ │ +
1991 cl_event* endEvent=NULL) const {
│ │ │ │ +
1992
│ │ │ │ +
1993 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
1994 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
1995 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
1996 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
1997 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ +
1998 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ +
1999 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ +
2000 numPatchCoords,
│ │ │ │ +
2001 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
2002 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
2003 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
2004 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
2005 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2006 }
│ │ │ │ +
2007
│ │ │ │ +
2058 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2059 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
2060 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
2062 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2063 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2064 int numPatchCoords,
│ │ │ │ +
2065 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2066 PATCH_TABLE *patchTable,
│ │ │ │ +
2067 int fvarChannel,
│ │ │ │ +
2068 CLEvaluator const *instance,
│ │ │ │ +
2069 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
2070 unsigned int numStartEvents=0,
│ │ │ │ +
2071 const cl_event* startEvents=NULL,
│ │ │ │ +
2072 cl_event* endEvent=NULL) {
│ │ │ │ +
2073
│ │ │ │ +
2074 if (instance) {
│ │ │ │ +
2075 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
2076 srcBuffer, srcDesc,
│ │ │ │ +
2077 dstBuffer, dstDesc,
│ │ │ │ +
2078 numPatchCoords, patchCoords,
│ │ │ │ +
2079 patchTable, fvarChannel,
│ │ │ │ +
2080 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2081 } else {
│ │ │ │ +
2082 // Create an instance on demand (slow)
│ │ │ │ +
2083 (void)deviceContext; // unused
│ │ │ │ +
2084 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
2087 deviceContext);
│ │ │ │ +
2088 if (instance) {
│ │ │ │ +
2089 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
2090 srcBuffer, srcDesc,
│ │ │ │ +
2091 dstBuffer, dstDesc,
│ │ │ │ +
2092 numPatchCoords, patchCoords,
│ │ │ │ +
2093 patchTable, fvarChannel,
│ │ │ │ +
2094 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2095 delete instance;
│ │ │ │ +
2096 return r;
│ │ │ │ +
2097 }
│ │ │ │ +
2098 return false;
│ │ │ │ +
2099 }
│ │ │ │ +
2100 }
│ │ │ │ +
2101
│ │ │ │ +
2141 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2142 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2144 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2145 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2146 int numPatchCoords,
│ │ │ │ +
2147 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2148 PATCH_TABLE *patchTable,
│ │ │ │ +
2149 int fvarChannel = 0,
│ │ │ │ +
2150 unsigned int numStartEvents=0,
│ │ │ │ +
2151 const cl_event* startEvents=NULL,
│ │ │ │ +
2152 cl_event* endEvent=NULL) const {
│ │ │ │ +
2153
│ │ │ │ +
2154 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
2155 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
2156 0, BufferDescriptor(),
│ │ │ │ +
2157 0, BufferDescriptor(),
│ │ │ │ +
2158 numPatchCoords,
│ │ │ │ +
2159 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
2160 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
2161 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
2162 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
2163 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2164 }
│ │ │ │ +
2165
│ │ │ │ +
2228 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2229 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
2230 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
2232 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2233 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2234 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2235 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2236 int numPatchCoords,
│ │ │ │ +
2237 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2238 PATCH_TABLE *patchTable,
│ │ │ │ +
2239 int fvarChannel,
│ │ │ │ +
2240 CLEvaluator const *instance,
│ │ │ │ +
2241 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
2242 unsigned int numStartEvents=0,
│ │ │ │ +
2243 const cl_event* startEvents=NULL,
│ │ │ │ +
2244 cl_event* endEvent=NULL) {
│ │ │ │ +
2245
│ │ │ │ +
2246 if (instance) {
│ │ │ │ +
2247 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
2248 srcBuffer, srcDesc,
│ │ │ │ +
2249 dstBuffer, dstDesc,
│ │ │ │ +
2250 duBuffer, duDesc,
│ │ │ │ +
2251 dvBuffer, dvDesc,
│ │ │ │ +
2252 numPatchCoords, patchCoords,
│ │ │ │ +
2253 patchTable, fvarChannel,
│ │ │ │ +
2254 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2255 } else {
│ │ │ │ +
2256 // Create an instance on demand (slow)
│ │ │ │ +
2257 (void)deviceContext; // unused
│ │ │ │ +
2258 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
2259 duDesc, dvDesc, deviceContext);
│ │ │ │ +
2260 if (instance) {
│ │ │ │ +
2261 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
2262 srcBuffer, srcDesc,
│ │ │ │ +
2263 dstBuffer, dstDesc,
│ │ │ │ +
2264 duBuffer, duDesc,
│ │ │ │ +
2265 dvBuffer, dvDesc,
│ │ │ │ +
2266 numPatchCoords, patchCoords,
│ │ │ │ +
2267 patchTable, fvarChannel,
│ │ │ │ +
2268 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2269 delete instance;
│ │ │ │ +
2270 return r;
│ │ │ │ +
2271 }
│ │ │ │ +
2272 return false;
│ │ │ │ +
2273 }
│ │ │ │ +
2274 }
│ │ │ │ +
2275
│ │ │ │ +
2327 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2328 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2330 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2331 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2332 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2333 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2334 int numPatchCoords,
│ │ │ │ +
2335 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2336 PATCH_TABLE *patchTable,
│ │ │ │ +
2337 int fvarChannel = 0,
│ │ │ │ +
2338 unsigned int numStartEvents=0,
│ │ │ │ +
2339 const cl_event* startEvents=NULL,
│ │ │ │ +
2340 cl_event* endEvent=NULL) const {
│ │ │ │ +
2341
│ │ │ │ +
2342 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
2343 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
2344 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
2345 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
2346 numPatchCoords,
│ │ │ │ +
2347 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
2348 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
2349 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
2350 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
2351 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2352 }
│ │ │ │ +
2353
│ │ │ │ +
2434 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2435 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ +
2436 typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
2438 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2439 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2440 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2441 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2442 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
2443 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
2444 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
2445 int numPatchCoords,
│ │ │ │ +
2446 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2447 PATCH_TABLE *patchTable,
│ │ │ │ +
2448 int fvarChannel,
│ │ │ │ +
2449 CLEvaluator const *instance,
│ │ │ │ +
2450 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
2451 unsigned int numStartEvents=0,
│ │ │ │ +
2452 const cl_event* startEvents=NULL,
│ │ │ │ +
2453 cl_event* endEvent=NULL) {
│ │ │ │ +
2454
│ │ │ │ +
2455 if (instance) {
│ │ │ │ +
2456 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
2457 srcBuffer, srcDesc,
│ │ │ │ +
2458 dstBuffer, dstDesc,
│ │ │ │ +
2459 duBuffer, duDesc,
│ │ │ │ +
2460 dvBuffer, dvDesc,
│ │ │ │ +
2461 duuBuffer, duuDesc,
│ │ │ │ +
2462 duvBuffer, duvDesc,
│ │ │ │ +
2463 dvvBuffer, dvvDesc,
│ │ │ │ +
2464 numPatchCoords, patchCoords,
│ │ │ │ +
2465 patchTable, fvarChannel,
│ │ │ │ +
2466 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2467 } else {
│ │ │ │ +
2468 // Create an instance on demand (slow)
│ │ │ │ +
2469 (void)deviceContext; // unused
│ │ │ │ +
2470 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
2471 duDesc, dvDesc,
│ │ │ │ +
2472 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
2473 deviceContext);
│ │ │ │ +
2474 if (instance) {
│ │ │ │ +
2475 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
2476 srcBuffer, srcDesc,
│ │ │ │ +
2477 dstBuffer, dstDesc,
│ │ │ │ +
2478 duBuffer, duDesc,
│ │ │ │ +
2479 dvBuffer, dvDesc,
│ │ │ │ +
2480 duuBuffer, duuDesc,
│ │ │ │ +
2481 duvBuffer, duvDesc,
│ │ │ │ +
2482 dvvBuffer, dvvDesc,
│ │ │ │ +
2483 numPatchCoords, patchCoords,
│ │ │ │ +
2484 patchTable, fvarChannel,
│ │ │ │ +
2485 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2486 delete instance;
│ │ │ │ +
2487 return r;
│ │ │ │ +
2488 }
│ │ │ │ +
2489 return false;
│ │ │ │ +
2490 }
│ │ │ │ +
2491 }
│ │ │ │ +
2492
│ │ │ │ +
2562 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2563 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2565 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2566 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2567 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2568 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2569 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
2570 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
2571 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
2572 int numPatchCoords,
│ │ │ │ +
2573 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2574 PATCH_TABLE *patchTable,
│ │ │ │ +
2575 int fvarChannel = 0,
│ │ │ │ +
2576 unsigned int numStartEvents=0,
│ │ │ │ +
2577 const cl_event* startEvents=NULL,
│ │ │ │ +
2578 cl_event* endEvent=NULL) const {
│ │ │ │ +
2579
│ │ │ │ +
2580 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ +
2581 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ +
2582 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ +
2583 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ +
2584 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ +
2585 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ +
2586 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ +
2587 numPatchCoords,
│ │ │ │ +
2588 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ +
2589 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
2590 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
2591 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
2592 numStartEvents, startEvents, endEvent);
│ │ │ │ +
2593 }
│ │ │ │ +
2594
│ │ │ │ +
2600
│ │ │ │ +
2603 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2604 BufferDescriptor const &dstDesc,
│ │ │ │ +
2605 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ +
2606 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ +
2607 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ +
2608 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ +
2609 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ +
2610
│ │ │ │ +
2612 template <typename DEVICE_CONTEXT>
│ │ │ │ +
2613 static void Synchronize(DEVICE_CONTEXT deviceContext) {
│ │ │ │ +
2614 Synchronize(deviceContext->GetCommandQueue());
│ │ │ │ +
2615 }
│ │ │ │ +
2616
│ │ │ │ +
2617 static void Synchronize(cl_command_queue queue);
│ │ │ │ +
2618
│ │ │ │ +
2619private:
│ │ │ │ +
2620 cl_context _clContext;
│ │ │ │ +
2621 cl_command_queue _clCommandQueue;
│ │ │ │ +
2622 cl_program _program;
│ │ │ │ +
2623 cl_kernel _stencilKernel;
│ │ │ │ +
2624 cl_kernel _stencilDerivKernel;
│ │ │ │ +
2625 cl_kernel _patchKernel;
│ │ │ │ +
2626};
│ │ │ │ +
2627
│ │ │ │ +
2628} // end namespace Osd
│ │ │ │ +
2629
│ │ │ │ +
2630} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
2631using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
2632
│ │ │ │ +
2633} // end namespace OpenSubdiv
│ │ │ │ +
2634
│ │ │ │ +
2635
│ │ │ │ +
2636#endif // OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ │ │ │ │ -
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ -
@ SPLIT_TO_QUADS
Used by Catmark and Bilinear.
Definition: types.h:48
│ │ │ │ - │ │ │ │ - │ │ │ │ -
void ComputeVertexVertexMask(VERTEX const &vertexNeighborhood, MASK &vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease tr...
Definition: scheme.h:512
│ │ │ │ -
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ - │ │ │ │ -
void ComputeEdgeVertexMask(EDGE const &edgeNeighborhood, MASK &edgeVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accel...
Definition: scheme.h:392
│ │ │ │ -
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ - │ │ │ │ -
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ - │ │ │ │ -
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ -
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ -
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ +
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ + │ │ │ │ +
CLStencilTable(Far::StencilTable const *stencilTable, cl_context clContext)
│ │ │ │ + │ │ │ │ +
static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:61
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static CLStencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:55
│ │ │ │ +
CLStencilTable(Far::LimitStencilTable const *limitStencilTable, cl_context clContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:309
│ │ │ │ +
static void Synchronize(cl_command_queue queue)
│ │ │ │ + │ │ │ │ +
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:219
│ │ │ │ +
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition: clEvaluator.h:116
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2231
│ │ │ │ +
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1978
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:561
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: clEvaluator.h:1379
│ │ │ │ + │ │ │ │ +
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition: clEvaluator.h:106
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2061
│ │ │ │ +
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition: clEvaluator.h:131
│ │ │ │ +
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ +
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, cl_mem duuWeights, cl_mem duvWeights, cl_mem dvvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2564
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1217
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:646
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1653
│ │ │ │ +
static void Synchronize(DEVICE_CONTEXT deviceContext)
Wait the OpenCL kernels finish.
Definition: clEvaluator.h:2613
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1125
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:421
│ │ │ │ +
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1489
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2329
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2437
│ │ │ │ +
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition: clEvaluator.h:145
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1003
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1749
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:902
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1568
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1854
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:500
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: clEvaluator.h:1288
│ │ │ │ +
CLEvaluator(cl_context context, cl_command_queue queue)
Constructor.
│ │ │ │ +
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2143
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -bilinearScheme.h │ │ │ │ │ +clEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,211 +29,1557 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24#ifndef OPENSUBDIV3_SDC_BILINEAR_SCHEME_H │ │ │ │ │ - 25#define OPENSUBDIV3_SDC_BILINEAR_SCHEME_H │ │ │ │ │ - 26 │ │ │ │ │ - 27#include "../version.h" │ │ │ │ │ - 28 │ │ │ │ │ - 29#include "../sdc/scheme.h" │ │ │ │ │ - 30 │ │ │ │ │ - 31namespace OpenSubdiv { │ │ │ │ │ - 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 24 │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/opencl.h" │ │ │ │ │ + 31#include "../osd/types.h" │ │ │ │ │ + 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ 33 │ │ │ │ │ -34namespace Sdc { │ │ │ │ │ - 35 │ │ │ │ │ - 36// │ │ │ │ │ - 37// Specializations for Scheme: │ │ │ │ │ - 38// │ │ │ │ │ - 39 │ │ │ │ │ - 40// │ │ │ │ │ - 41// Bilinear traits: │ │ │ │ │ - 42// │ │ │ │ │ - 43template <> │ │ │ │ │ -44inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ -SPLIT_TO_QUADS; } │ │ │ │ │ - 45 │ │ │ │ │ - 46template <> │ │ │ │ │ -47inline int Scheme::GetRegularFaceSize() { return 4; } │ │ │ │ │ - 48 │ │ │ │ │ - 49template <> │ │ │ │ │ -50inline int Scheme::GetRegularVertexValence() { return 4; } │ │ │ │ │ - 51 │ │ │ │ │ - 52template <> │ │ │ │ │ -53inline int Scheme::GetLocalNeighborhoodSize() { return 0; } │ │ │ │ │ - 54 │ │ │ │ │ - 55 │ │ │ │ │ - 56// │ │ │ │ │ - 57// Refinement masks: │ │ │ │ │ - 58// │ │ │ │ │ - 59template <> │ │ │ │ │ - 60template │ │ │ │ │ - 61void │ │ │ │ │ -62Scheme::ComputeEdgeVertexMask(EDGE const& edge, MASK& mask, │ │ │ │ │ - 63 Crease::Rule, Crease::Rule) const { │ │ │ │ │ - 64 // This should be inline, otherwise trivially replicate it: │ │ │ │ │ - 65 assignCreaseMaskForEdge(edge, mask); │ │ │ │ │ - 66} │ │ │ │ │ - 67 │ │ │ │ │ - 68template <> │ │ │ │ │ - 69template │ │ │ │ │ - 70void │ │ │ │ │ -71Scheme::ComputeVertexVertexMask(VERTEX const& vertex, MASK& │ │ │ │ │ -mask, │ │ │ │ │ - 72 Crease::Rule, Crease::Rule) const { │ │ │ │ │ - 73 // This should be inline, otherwise trivially replicate it: │ │ │ │ │ - 74 assignCornerMaskForVertex(vertex, mask); │ │ │ │ │ - 75} │ │ │ │ │ - 76 │ │ │ │ │ - 77 │ │ │ │ │ - 78// │ │ │ │ │ - 79// Limit masks for position -- the limit position of all vertices is the │ │ │ │ │ -refined vertex. │ │ │ │ │ - 80// │ │ │ │ │ - 81template <> │ │ │ │ │ - 82template │ │ │ │ │ - 83inline void │ │ │ │ │ -84Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, │ │ │ │ │ -MASK& posMask) const { │ │ │ │ │ - 85 │ │ │ │ │ - 86 posMask.SetNumVertexWeights(1); │ │ │ │ │ - 87 posMask.SetNumEdgeWeights(0); │ │ │ │ │ - 88 posMask.SetNumFaceWeights(0); │ │ │ │ │ - 89 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 90 │ │ │ │ │ - 91 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ - 92} │ │ │ │ │ - 93 │ │ │ │ │ - 94template <> │ │ │ │ │ - 95template │ │ │ │ │ - 96inline void │ │ │ │ │ -97Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask, │ │ │ │ │ - 98 int const /* creaseEnds */[2]) const { │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 class PatchTable; │ │ │ │ │ + 39 class StencilTable; │ │ │ │ │ + 40 class LimitStencilTable; │ │ │ │ │ + 41} │ │ │ │ │ + 42 │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ + 44 │ │ │ │ │ +52class CLStencilTable { │ │ │ │ │ + 53public: │ │ │ │ │ + 54 template │ │ │ │ │ +55 static CLStencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ + 56 DEVICE_CONTEXT context) { │ │ │ │ │ + 57 return new CLStencilTable(stencilTable, context->GetContext()); │ │ │ │ │ + 58 } │ │ │ │ │ + 59 │ │ │ │ │ + 60 template │ │ │ │ │ +61 static CLStencilTable *Create( │ │ │ │ │ + 62 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ + 63 DEVICE_CONTEXT context) { │ │ │ │ │ + 64 return new CLStencilTable(limitStencilTable, context->GetContext()); │ │ │ │ │ + 65 } │ │ │ │ │ + 66 │ │ │ │ │ +67 CLStencilTable(Far::StencilTable const *stencilTable, │ │ │ │ │ + 68 cl_context clContext); │ │ │ │ │ +69 CLStencilTable(Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ + 70 cl_context clContext); │ │ │ │ │ +71 ~CLStencilTable(); │ │ │ │ │ + 72 │ │ │ │ │ + 73 // interfaces needed for CLComputeKernel │ │ │ │ │ +74 cl_mem GetSizesBuffer() const { return _sizes; } │ │ │ │ │ +75 cl_mem GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ +76 cl_mem GetIndicesBuffer() const { return _indices; } │ │ │ │ │ +77 cl_mem GetWeightsBuffer() const { return _weights; } │ │ │ │ │ +78 cl_mem GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ +79 cl_mem GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ +80 cl_mem GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ +81 cl_mem GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ +82 cl_mem GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ +83 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 84 │ │ │ │ │ + 85private: │ │ │ │ │ + 86 cl_mem _sizes; │ │ │ │ │ + 87 cl_mem _offsets; │ │ │ │ │ + 88 cl_mem _indices; │ │ │ │ │ + 89 cl_mem _weights; │ │ │ │ │ + 90 cl_mem _duWeights; │ │ │ │ │ + 91 cl_mem _dvWeights; │ │ │ │ │ + 92 cl_mem _duuWeights; │ │ │ │ │ + 93 cl_mem _duvWeights; │ │ │ │ │ + 94 cl_mem _dvvWeights; │ │ │ │ │ + 95 int _numStencils; │ │ │ │ │ + 96}; │ │ │ │ │ + 97 │ │ │ │ │ + 98// ------------------------------------------------------------------------- │ │ │ │ │ +-- │ │ │ │ │ 99 │ │ │ │ │ - 100 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ - 101} │ │ │ │ │ - 102 │ │ │ │ │ - 103template <> │ │ │ │ │ - 104template │ │ │ │ │ - 105inline void │ │ │ │ │ -106Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ -posMask) const { │ │ │ │ │ - 107 │ │ │ │ │ - 108 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ - 109} │ │ │ │ │ - 110 │ │ │ │ │ - 111// │ │ │ │ │ - 112// Limit masks for tangents -- these are ambiguous around all vertices. │ │ │ │ │ -Provide │ │ │ │ │ - 113// the tangents based on the incident edges of the first face. │ │ │ │ │ - 114// │ │ │ │ │ - 115template <> │ │ │ │ │ - 116template │ │ │ │ │ - 117inline void │ │ │ │ │ -118Scheme::assignCornerLimitTangentMasks(VERTEX const& / │ │ │ │ │ -* vertex */, │ │ │ │ │ - 119 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 120 │ │ │ │ │ - 121 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ - 122 tan1Mask.SetNumEdgeWeights(2); │ │ │ │ │ - 123 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ - 124 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 125 │ │ │ │ │ - 126 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ - 127 tan2Mask.SetNumEdgeWeights(2); │ │ │ │ │ - 128 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ - 129 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ - 130 │ │ │ │ │ - 131 tan1Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ - 132 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ - 133 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ - 134 │ │ │ │ │ - 135 tan2Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ - 136 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ - 137 tan2Mask.EdgeWeight(1) = 1.0f; │ │ │ │ │ - 138} │ │ │ │ │ - 139 │ │ │ │ │ - 140template <> │ │ │ │ │ - 141template │ │ │ │ │ - 142inline void │ │ │ │ │ -143Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 144 MASK& tan1Mask, MASK& tan2Mask, int const /* creaseEnds */[2]) const { │ │ │ │ │ - 145 │ │ │ │ │ - 146 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ - 147} │ │ │ │ │ - 148 │ │ │ │ │ - 149template <> │ │ │ │ │ - 150template │ │ │ │ │ - 151inline void │ │ │ │ │ -152Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ - 153 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ - 154 │ │ │ │ │ - 155 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ - 156} │ │ │ │ │ - 157 │ │ │ │ │ - 158} // end namespace sdc │ │ │ │ │ - 159 │ │ │ │ │ - 160} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 161using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 162} // end namespace OpenSubdiv │ │ │ │ │ - 163 │ │ │ │ │ - 164#endif /* OPENSUBDIV3_SDC_BILINEAR_SCHEME_H */ │ │ │ │ │ +100class CLEvaluator { │ │ │ │ │ + 101public: │ │ │ │ │ +102 typedef bool Instantiatable; │ │ │ │ │ + 103 │ │ │ │ │ + 105 template │ │ │ │ │ +106 static CLEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 107 BufferDescriptor const &dstDesc, │ │ │ │ │ + 108 BufferDescriptor const &duDesc, │ │ │ │ │ + 109 BufferDescriptor const &dvDesc, │ │ │ │ │ + 110 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ + 111 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 112 deviceContext->GetContext(), │ │ │ │ │ + 113 deviceContext->GetCommandQueue()); │ │ │ │ │ + 114 } │ │ │ │ │ + 115 │ │ │ │ │ +116 static CLEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 117 BufferDescriptor const &dstDesc, │ │ │ │ │ + 118 BufferDescriptor const &duDesc, │ │ │ │ │ + 119 BufferDescriptor const &dvDesc, │ │ │ │ │ + 120 cl_context clContext, │ │ │ │ │ + 121 cl_command_queue clCommandQueue) { │ │ │ │ │ + 122 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue); │ │ │ │ │ + 123 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc)) │ │ │ │ │ + 124 return instance; │ │ │ │ │ + 125 delete instance; │ │ │ │ │ + 126 return NULL; │ │ │ │ │ + 127 } │ │ │ │ │ + 128 │ │ │ │ │ + 130 template │ │ │ │ │ +131 static CLEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 132 BufferDescriptor const &dstDesc, │ │ │ │ │ + 133 BufferDescriptor const &duDesc, │ │ │ │ │ + 134 BufferDescriptor const &dvDesc, │ │ │ │ │ + 135 BufferDescriptor const &duuDesc, │ │ │ │ │ + 136 BufferDescriptor const &duvDesc, │ │ │ │ │ + 137 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 138 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ + 139 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 140 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 141 deviceContext->GetContext(), │ │ │ │ │ + 142 deviceContext->GetCommandQueue()); │ │ │ │ │ + 143 } │ │ │ │ │ + 144 │ │ │ │ │ +145 static CLEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 146 BufferDescriptor const &dstDesc, │ │ │ │ │ + 147 BufferDescriptor const &duDesc, │ │ │ │ │ + 148 BufferDescriptor const &dvDesc, │ │ │ │ │ + 149 BufferDescriptor const &duuDesc, │ │ │ │ │ + 150 BufferDescriptor const &duvDesc, │ │ │ │ │ + 151 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 152 cl_context clContext, │ │ │ │ │ + 153 cl_command_queue clCommandQueue) { │ │ │ │ │ + 154 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue); │ │ │ │ │ + 155 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 156 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ + 157 return instance; │ │ │ │ │ + 158 delete instance; │ │ │ │ │ + 159 return NULL; │ │ │ │ │ + 160 } │ │ │ │ │ + 161 │ │ │ │ │ +163 CLEvaluator(cl_context context, cl_command_queue queue); │ │ │ │ │ + 164 │ │ │ │ │ +166 ~CLEvaluator(); │ │ │ │ │ + 167 │ │ │ │ │ + 173 │ │ │ │ │ + 217 template │ │ │ │ │ +219 static bool EvalStencils( │ │ │ │ │ + 220 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 221 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 222 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 223 CLEvaluator const *instance, │ │ │ │ │ + 224 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 225 unsigned int numStartEvents=0, │ │ │ │ │ + 226 const cl_event* startEvents=NULL, │ │ │ │ │ + 227 cl_event* endEvent=NULL) { │ │ │ │ │ + 228 │ │ │ │ │ + 229 if (instance) { │ │ │ │ │ + 230 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 231 dstBuffer, dstDesc, │ │ │ │ │ + 232 stencilTable, │ │ │ │ │ + 233 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 234 } else { │ │ │ │ │ + 235 // Create an instance on demand (slow) │ │ │ │ │ + 236 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 237 BufferDescriptor(), │ │ │ │ │ + 238 BufferDescriptor(), │ │ │ │ │ + 239 deviceContext); │ │ │ │ │ + 240 if (instance) { │ │ │ │ │ + 241 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 242 dstBuffer, dstDesc, │ │ │ │ │ + 243 stencilTable, │ │ │ │ │ + 244 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 245 delete instance; │ │ │ │ │ + 246 return r; │ │ │ │ │ + 247 } │ │ │ │ │ + 248 return false; │ │ │ │ │ + 249 } │ │ │ │ │ + 250 } │ │ │ │ │ + 251 │ │ │ │ │ + 307 template │ │ │ │ │ +309 static bool EvalStencils( │ │ │ │ │ + 310 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 311 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 312 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 313 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 314 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 315 CLEvaluator const *instance, │ │ │ │ │ + 316 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 317 unsigned int numStartEvents=0, │ │ │ │ │ + 318 const cl_event* startEvents=NULL, │ │ │ │ │ + 319 cl_event* endEvent=NULL) { │ │ │ │ │ + 320 │ │ │ │ │ + 321 if (instance) { │ │ │ │ │ + 322 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 323 dstBuffer, dstDesc, │ │ │ │ │ + 324 duBuffer, duDesc, │ │ │ │ │ + 325 dvBuffer, dvDesc, │ │ │ │ │ + 326 stencilTable, │ │ │ │ │ + 327 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 328 } else { │ │ │ │ │ + 329 // Create an instance on demand (slow) │ │ │ │ │ + 330 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 331 deviceContext); │ │ │ │ │ + 332 if (instance) { │ │ │ │ │ + 333 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 334 dstBuffer, dstDesc, │ │ │ │ │ + 335 duBuffer, duDesc, │ │ │ │ │ + 336 dvBuffer, dvDesc, │ │ │ │ │ + 337 stencilTable, │ │ │ │ │ + 338 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 339 delete instance; │ │ │ │ │ + 340 return r; │ │ │ │ │ + 341 } │ │ │ │ │ + 342 return false; │ │ │ │ │ + 343 } │ │ │ │ │ + 344 } │ │ │ │ │ + 345 │ │ │ │ │ + 419 template │ │ │ │ │ +421 static bool EvalStencils( │ │ │ │ │ + 422 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 423 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 424 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 425 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 426 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 427 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 428 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 429 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 430 CLEvaluator const *instance, │ │ │ │ │ + 431 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 432 unsigned int numStartEvents=0, │ │ │ │ │ + 433 const cl_event* startEvents=NULL, │ │ │ │ │ + 434 cl_event* endEvent=NULL) { │ │ │ │ │ + 435 │ │ │ │ │ + 436 if (instance) { │ │ │ │ │ + 437 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 438 dstBuffer, dstDesc, │ │ │ │ │ + 439 duBuffer, duDesc, │ │ │ │ │ + 440 dvBuffer, dvDesc, │ │ │ │ │ + 441 duuBuffer, duuDesc, │ │ │ │ │ + 442 duvBuffer, duvDesc, │ │ │ │ │ + 443 dvvBuffer, dvvDesc, │ │ │ │ │ + 444 stencilTable, │ │ │ │ │ + 445 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 446 } else { │ │ │ │ │ + 447 // Create an instance on demand (slow) │ │ │ │ │ + 448 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 449 duDesc, dvDesc, │ │ │ │ │ + 450 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 451 deviceContext); │ │ │ │ │ + 452 if (instance) { │ │ │ │ │ + 453 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 454 dstBuffer, dstDesc, │ │ │ │ │ + 455 duBuffer, duDesc, │ │ │ │ │ + 456 dvBuffer, dvDesc, │ │ │ │ │ + 457 duuBuffer, duuDesc, │ │ │ │ │ + 458 duvBuffer, duvDesc, │ │ │ │ │ + 459 dvvBuffer, dvvDesc, │ │ │ │ │ + 460 stencilTable, │ │ │ │ │ + 461 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 462 delete instance; │ │ │ │ │ + 463 return r; │ │ │ │ │ + 464 } │ │ │ │ │ + 465 return false; │ │ │ │ │ + 466 } │ │ │ │ │ + 467 } │ │ │ │ │ + 468 │ │ │ │ │ + 499 template │ │ │ │ │ +500 bool EvalStencils( │ │ │ │ │ + 501 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 502 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 503 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 504 unsigned int numStartEvents=0, │ │ │ │ │ + 505 const cl_event* startEvents=NULL, │ │ │ │ │ + 506 cl_event* endEvent=NULL) const { │ │ │ │ │ + 507 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 508 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 509 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 510 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 511 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 512 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 513 0, │ │ │ │ │ + 514 stencilTable->GetNumStencils(), │ │ │ │ │ + 515 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 516 } │ │ │ │ │ + 517 │ │ │ │ │ + 560 template │ │ │ │ │ +561 bool EvalStencils( │ │ │ │ │ + 562 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 563 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 564 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 565 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 566 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 567 unsigned int numStartEvents=0, │ │ │ │ │ + 568 const cl_event* startEvents=NULL, │ │ │ │ │ + 569 cl_event* endEvent=NULL) const { │ │ │ │ │ + 570 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 571 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 572 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 573 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 574 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 575 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 576 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 577 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 578 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 579 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 580 0, │ │ │ │ │ + 581 stencilTable->GetNumStencils(), │ │ │ │ │ + 582 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 583 } │ │ │ │ │ + 584 │ │ │ │ │ + 645 template │ │ │ │ │ +646 bool EvalStencils( │ │ │ │ │ + 647 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 648 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 649 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 650 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 651 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 652 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 653 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 654 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 655 unsigned int numStartEvents=0, │ │ │ │ │ + 656 const cl_event* startEvents=NULL, │ │ │ │ │ + 657 cl_event* endEvent=NULL) const { │ │ │ │ │ + 658 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 659 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 660 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 661 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 662 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ + 663 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ + 664 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ + 665 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 666 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 667 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 668 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 669 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 670 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 671 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ + 672 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ + 673 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ + 674 0, │ │ │ │ │ + 675 stencilTable->GetNumStencils(), │ │ │ │ │ + 676 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 677 } │ │ │ │ │ + 678 │ │ │ │ │ +681 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 682 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 683 cl_mem sizes, │ │ │ │ │ + 684 cl_mem offsets, │ │ │ │ │ + 685 cl_mem indices, │ │ │ │ │ + 686 cl_mem weights, │ │ │ │ │ + 687 int start, │ │ │ │ │ + 688 int end, │ │ │ │ │ + 689 unsigned int numStartEvents=0, │ │ │ │ │ + 690 const cl_event* startEvents=NULL, │ │ │ │ │ + 691 cl_event* endEvent=NULL) const; │ │ │ │ │ + 692 │ │ │ │ │ +741 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 742 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 743 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ + 744 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 745 cl_mem sizes, │ │ │ │ │ + 746 cl_mem offsets, │ │ │ │ │ + 747 cl_mem indices, │ │ │ │ │ + 748 cl_mem weights, │ │ │ │ │ + 749 cl_mem duWeights, │ │ │ │ │ + 750 cl_mem dvWeights, │ │ │ │ │ + 751 int start, │ │ │ │ │ + 752 int end, │ │ │ │ │ + 753 unsigned int numStartEvents=0, │ │ │ │ │ + 754 const cl_event* startEvents=NULL, │ │ │ │ │ + 755 cl_event* endEvent=NULL) const; │ │ │ │ │ + 756 │ │ │ │ │ +823 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 824 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 825 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ + 826 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 827 cl_mem duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 828 cl_mem duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 829 cl_mem dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 830 cl_mem sizes, │ │ │ │ │ + 831 cl_mem offsets, │ │ │ │ │ + 832 cl_mem indices, │ │ │ │ │ + 833 cl_mem weights, │ │ │ │ │ + 834 cl_mem duWeights, │ │ │ │ │ + 835 cl_mem dvWeights, │ │ │ │ │ + 836 cl_mem duuWeights, │ │ │ │ │ + 837 cl_mem duvWeights, │ │ │ │ │ + 838 cl_mem dvvWeights, │ │ │ │ │ + 839 int start, │ │ │ │ │ + 840 int end, │ │ │ │ │ + 841 unsigned int numStartEvents=0, │ │ │ │ │ + 842 const cl_event* startEvents=NULL, │ │ │ │ │ + 843 cl_event* endEvent=NULL) const; │ │ │ │ │ + 844 │ │ │ │ │ + 850 │ │ │ │ │ + 899 template │ │ │ │ │ +902 static bool EvalPatches( │ │ │ │ │ + 903 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 904 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 905 int numPatchCoords, │ │ │ │ │ + 906 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 907 PATCH_TABLE *patchTable, │ │ │ │ │ + 908 CLEvaluator const *instance, │ │ │ │ │ + 909 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 910 unsigned int numStartEvents=0, │ │ │ │ │ + 911 const cl_event* startEvents=NULL, │ │ │ │ │ + 912 cl_event* endEvent=NULL) { │ │ │ │ │ + 913 │ │ │ │ │ + 914 if (instance) { │ │ │ │ │ + 915 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 916 dstBuffer, dstDesc, │ │ │ │ │ + 917 numPatchCoords, patchCoords, │ │ │ │ │ + 918 patchTable, │ │ │ │ │ + 919 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 920 } else { │ │ │ │ │ + 921 // Create an instance on demand (slow) │ │ │ │ │ + 922 (void)deviceContext; // unused │ │ │ │ │ + 923 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 924 BufferDescriptor(), │ │ │ │ │ + 925 BufferDescriptor(), │ │ │ │ │ + 926 deviceContext); │ │ │ │ │ + 927 if (instance) { │ │ │ │ │ + 928 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 929 dstBuffer, dstDesc, │ │ │ │ │ + 930 numPatchCoords, patchCoords, │ │ │ │ │ + 931 patchTable, │ │ │ │ │ + 932 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 933 delete instance; │ │ │ │ │ + 934 return r; │ │ │ │ │ + 935 } │ │ │ │ │ + 936 return false; │ │ │ │ │ + 937 } │ │ │ │ │ + 938 } │ │ │ │ │ + 939 │ │ │ │ │ + 1000 template │ │ │ │ │ +1003 static bool EvalPatches( │ │ │ │ │ + 1004 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1005 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1006 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1007 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1008 int numPatchCoords, │ │ │ │ │ + 1009 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1010 PATCH_TABLE *patchTable, │ │ │ │ │ + 1011 CLEvaluator const *instance, │ │ │ │ │ + 1012 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 1013 unsigned int numStartEvents=0, │ │ │ │ │ + 1014 const cl_event* startEvents=NULL, │ │ │ │ │ + 1015 cl_event* endEvent=NULL) { │ │ │ │ │ + 1016 │ │ │ │ │ + 1017 if (instance) { │ │ │ │ │ + 1018 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 1019 dstBuffer, dstDesc, │ │ │ │ │ + 1020 duBuffer, duDesc, │ │ │ │ │ + 1021 dvBuffer, dvDesc, │ │ │ │ │ + 1022 numPatchCoords, patchCoords, │ │ │ │ │ + 1023 patchTable, │ │ │ │ │ + 1024 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1025 } else { │ │ │ │ │ + 1026 // Create an instance on demand (slow) │ │ │ │ │ + 1027 (void)deviceContext; // unused │ │ │ │ │ + 1028 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext); │ │ │ │ │ + 1029 if (instance) { │ │ │ │ │ + 1030 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 1031 dstBuffer, dstDesc, │ │ │ │ │ + 1032 duBuffer, duDesc, │ │ │ │ │ + 1033 dvBuffer, dvDesc, │ │ │ │ │ + 1034 numPatchCoords, patchCoords, │ │ │ │ │ + 1035 patchTable, │ │ │ │ │ + 1036 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1037 delete instance; │ │ │ │ │ + 1038 return r; │ │ │ │ │ + 1039 } │ │ │ │ │ + 1040 return false; │ │ │ │ │ + 1041 } │ │ │ │ │ + 1042 } │ │ │ │ │ + 1043 │ │ │ │ │ + 1122 template │ │ │ │ │ +1125 static bool EvalPatches( │ │ │ │ │ + 1126 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1127 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1128 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1129 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1130 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1131 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1132 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1133 int numPatchCoords, │ │ │ │ │ + 1134 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1135 PATCH_TABLE *patchTable, │ │ │ │ │ + 1136 CLEvaluator const *instance, │ │ │ │ │ + 1137 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 1138 unsigned int numStartEvents=0, │ │ │ │ │ + 1139 const cl_event* startEvents=NULL, │ │ │ │ │ + 1140 cl_event* endEvent=NULL) { │ │ │ │ │ + 1141 │ │ │ │ │ + 1142 if (instance) { │ │ │ │ │ + 1143 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 1144 dstBuffer, dstDesc, │ │ │ │ │ + 1145 duBuffer, duDesc, │ │ │ │ │ + 1146 dvBuffer, dvDesc, │ │ │ │ │ + 1147 duuBuffer, duuDesc, │ │ │ │ │ + 1148 duvBuffer, duvDesc, │ │ │ │ │ + 1149 dvvBuffer, dvvDesc, │ │ │ │ │ + 1150 numPatchCoords, patchCoords, │ │ │ │ │ + 1151 patchTable, │ │ │ │ │ + 1152 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1153 } else { │ │ │ │ │ + 1154 // Create an instance on demand (slow) │ │ │ │ │ + 1155 (void)deviceContext; // unused │ │ │ │ │ + 1156 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1157 duDesc, dvDesc, │ │ │ │ │ + 1158 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 1159 deviceContext); │ │ │ │ │ + 1160 if (instance) { │ │ │ │ │ + 1161 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 1162 dstBuffer, dstDesc, │ │ │ │ │ + 1163 duBuffer, duDesc, │ │ │ │ │ + 1164 dvBuffer, dvDesc, │ │ │ │ │ + 1165 duuBuffer, duuDesc, │ │ │ │ │ + 1166 duvBuffer, duvDesc, │ │ │ │ │ + 1167 dvvBuffer, dvvDesc, │ │ │ │ │ + 1168 numPatchCoords, patchCoords, │ │ │ │ │ + 1169 patchTable, │ │ │ │ │ + 1170 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1171 delete instance; │ │ │ │ │ + 1172 return r; │ │ │ │ │ + 1173 } │ │ │ │ │ + 1174 return false; │ │ │ │ │ + 1175 } │ │ │ │ │ + 1176 } │ │ │ │ │ + 1177 │ │ │ │ │ + 1215 template │ │ │ │ │ +1217 bool EvalPatches( │ │ │ │ │ + 1218 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1219 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1220 int numPatchCoords, │ │ │ │ │ + 1221 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1222 PATCH_TABLE *patchTable, │ │ │ │ │ + 1223 unsigned int numStartEvents=0, │ │ │ │ │ + 1224 const cl_event* startEvents=NULL, │ │ │ │ │ + 1225 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1226 │ │ │ │ │ + 1227 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1228 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1229 0, BufferDescriptor(), │ │ │ │ │ + 1230 0, BufferDescriptor(), │ │ │ │ │ + 1231 numPatchCoords, │ │ │ │ │ + 1232 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 1233 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 1234 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1235 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1236 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1237 } │ │ │ │ │ + 1238 │ │ │ │ │ + 1286 template │ │ │ │ │ +1288 bool EvalPatches( │ │ │ │ │ + 1289 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1290 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1291 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1292 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1293 int numPatchCoords, │ │ │ │ │ + 1294 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1295 PATCH_TABLE *patchTable, │ │ │ │ │ + 1296 unsigned int numStartEvents=0, │ │ │ │ │ + 1297 const cl_event* startEvents=NULL, │ │ │ │ │ + 1298 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1299 │ │ │ │ │ + 1300 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1301 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1302 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 1303 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 1304 numPatchCoords, │ │ │ │ │ + 1305 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 1306 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 1307 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1308 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1309 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1310 } │ │ │ │ │ + 1311 │ │ │ │ │ + 1377 template │ │ │ │ │ +1379 bool EvalPatches( │ │ │ │ │ + 1380 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1381 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1382 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1383 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1384 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1385 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1386 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1387 int numPatchCoords, │ │ │ │ │ + 1388 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1389 PATCH_TABLE *patchTable, │ │ │ │ │ + 1390 unsigned int numStartEvents=0, │ │ │ │ │ + 1391 const cl_event* startEvents=NULL, │ │ │ │ │ + 1392 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1393 │ │ │ │ │ + 1394 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1395 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1396 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 1397 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 1398 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ + 1399 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ + 1400 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ + 1401 numPatchCoords, │ │ │ │ │ + 1402 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 1403 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 1404 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1405 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1406 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1407 } │ │ │ │ │ + 1408 │ │ │ │ │ +1409 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1410 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1411 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ + 1412 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1413 int numPatchCoords, │ │ │ │ │ + 1414 cl_mem patchCoordsBuffer, │ │ │ │ │ + 1415 cl_mem patchArrayBuffer, │ │ │ │ │ + 1416 cl_mem patchIndexBuffer, │ │ │ │ │ + 1417 cl_mem patchParamsBuffer, │ │ │ │ │ + 1418 unsigned int numStartEvents=0, │ │ │ │ │ + 1419 const cl_event* startEvents=NULL, │ │ │ │ │ + 1420 cl_event* endEvent=NULL) const; │ │ │ │ │ + 1421 │ │ │ │ │ +1422 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1423 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1424 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ + 1425 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1426 cl_mem duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1427 cl_mem duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1428 cl_mem dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1429 int numPatchCoords, │ │ │ │ │ + 1430 cl_mem patchCoordsBuffer, │ │ │ │ │ + 1431 cl_mem patchArrayBuffer, │ │ │ │ │ + 1432 cl_mem patchIndexBuffer, │ │ │ │ │ + 1433 cl_mem patchParamsBuffer, │ │ │ │ │ + 1434 unsigned int numStartEvents=0, │ │ │ │ │ + 1435 const cl_event* startEvents=NULL, │ │ │ │ │ + 1436 cl_event* endEvent=NULL) const; │ │ │ │ │ + 1437 │ │ │ │ │ + 1486 template │ │ │ │ │ +1489 static bool EvalPatchesVarying( │ │ │ │ │ + 1490 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1491 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1492 int numPatchCoords, │ │ │ │ │ + 1493 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1494 PATCH_TABLE *patchTable, │ │ │ │ │ + 1495 CLEvaluator const *instance, │ │ │ │ │ + 1496 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 1497 unsigned int numStartEvents=0, │ │ │ │ │ + 1498 const cl_event* startEvents=NULL, │ │ │ │ │ + 1499 cl_event* endEvent=NULL) { │ │ │ │ │ + 1500 │ │ │ │ │ + 1501 if (instance) { │ │ │ │ │ + 1502 return instance->EvalPatchesVarying( │ │ │ │ │ + 1503 srcBuffer, srcDesc, │ │ │ │ │ + 1504 dstBuffer, dstDesc, │ │ │ │ │ + 1505 numPatchCoords, patchCoords, │ │ │ │ │ + 1506 patchTable, │ │ │ │ │ + 1507 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1508 } else { │ │ │ │ │ + 1509 // Create an instance on demand (slow) │ │ │ │ │ + 1510 (void)deviceContext; // unused │ │ │ │ │ + 1511 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1512 BufferDescriptor(), │ │ │ │ │ + 1513 BufferDescriptor(), │ │ │ │ │ + 1514 deviceContext); │ │ │ │ │ + 1515 if (instance) { │ │ │ │ │ + 1516 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1517 srcBuffer, srcDesc, │ │ │ │ │ + 1518 dstBuffer, dstDesc, │ │ │ │ │ + 1519 numPatchCoords, patchCoords, │ │ │ │ │ + 1520 patchTable, │ │ │ │ │ + 1521 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1522 delete instance; │ │ │ │ │ + 1523 return r; │ │ │ │ │ + 1524 } │ │ │ │ │ + 1525 return false; │ │ │ │ │ + 1526 } │ │ │ │ │ + 1527 } │ │ │ │ │ + 1528 │ │ │ │ │ + 1566 template │ │ │ │ │ +1568 bool EvalPatchesVarying( │ │ │ │ │ + 1569 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1570 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1571 int numPatchCoords, │ │ │ │ │ + 1572 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1573 PATCH_TABLE *patchTable, │ │ │ │ │ + 1574 unsigned int numStartEvents=0, │ │ │ │ │ + 1575 const cl_event* startEvents=NULL, │ │ │ │ │ + 1576 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1577 │ │ │ │ │ + 1578 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1579 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1580 0, BufferDescriptor(), │ │ │ │ │ + 1581 0, BufferDescriptor(), │ │ │ │ │ + 1582 numPatchCoords, │ │ │ │ │ + 1583 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 1584 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 1585 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1586 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1587 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1588 } │ │ │ │ │ + 1589 │ │ │ │ │ + 1650 template │ │ │ │ │ +1653 static bool EvalPatchesVarying( │ │ │ │ │ + 1654 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1655 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1656 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1657 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1658 int numPatchCoords, │ │ │ │ │ + 1659 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1660 PATCH_TABLE *patchTable, │ │ │ │ │ + 1661 CLEvaluator const *instance, │ │ │ │ │ + 1662 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 1663 unsigned int numStartEvents=0, │ │ │ │ │ + 1664 const cl_event* startEvents=NULL, │ │ │ │ │ + 1665 cl_event* endEvent=NULL) { │ │ │ │ │ + 1666 │ │ │ │ │ + 1667 if (instance) { │ │ │ │ │ + 1668 return instance->EvalPatchesVarying( │ │ │ │ │ + 1669 srcBuffer, srcDesc, │ │ │ │ │ + 1670 dstBuffer, dstDesc, │ │ │ │ │ + 1671 duBuffer, duDesc, │ │ │ │ │ + 1672 dvBuffer, dvDesc, │ │ │ │ │ + 1673 numPatchCoords, patchCoords, │ │ │ │ │ + 1674 patchTable, │ │ │ │ │ + 1675 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1676 } else { │ │ │ │ │ + 1677 // Create an instance on demand (slow) │ │ │ │ │ + 1678 (void)deviceContext; // unused │ │ │ │ │ + 1679 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1680 duDesc, dvDesc, │ │ │ │ │ + 1681 deviceContext); │ │ │ │ │ + 1682 if (instance) { │ │ │ │ │ + 1683 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1684 srcBuffer, srcDesc, │ │ │ │ │ + 1685 dstBuffer, dstDesc, │ │ │ │ │ + 1686 duBuffer, duDesc, │ │ │ │ │ + 1687 dvBuffer, dvDesc, │ │ │ │ │ + 1688 numPatchCoords, patchCoords, │ │ │ │ │ + 1689 patchTable, │ │ │ │ │ + 1690 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1691 delete instance; │ │ │ │ │ + 1692 return r; │ │ │ │ │ + 1693 } │ │ │ │ │ + 1694 return false; │ │ │ │ │ + 1695 } │ │ │ │ │ + 1696 } │ │ │ │ │ + 1697 │ │ │ │ │ + 1747 template │ │ │ │ │ +1749 bool EvalPatchesVarying( │ │ │ │ │ + 1750 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1751 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1752 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1753 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1754 int numPatchCoords, │ │ │ │ │ + 1755 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1756 PATCH_TABLE *patchTable, │ │ │ │ │ + 1757 unsigned int numStartEvents=0, │ │ │ │ │ + 1758 const cl_event* startEvents=NULL, │ │ │ │ │ + 1759 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1760 │ │ │ │ │ + 1761 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1762 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1763 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 1764 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 1765 numPatchCoords, │ │ │ │ │ + 1766 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 1767 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 1768 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1769 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1770 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1771 } │ │ │ │ │ + 1772 │ │ │ │ │ + 1851 template │ │ │ │ │ +1854 static bool EvalPatchesVarying( │ │ │ │ │ + 1855 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1856 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1857 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1858 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1859 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1860 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1861 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1862 int numPatchCoords, │ │ │ │ │ + 1863 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1864 PATCH_TABLE *patchTable, │ │ │ │ │ + 1865 CLEvaluator const *instance, │ │ │ │ │ + 1866 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 1867 unsigned int numStartEvents=0, │ │ │ │ │ + 1868 const cl_event* startEvents=NULL, │ │ │ │ │ + 1869 cl_event* endEvent=NULL) { │ │ │ │ │ + 1870 │ │ │ │ │ + 1871 if (instance) { │ │ │ │ │ + 1872 return instance->EvalPatchesVarying( │ │ │ │ │ + 1873 srcBuffer, srcDesc, │ │ │ │ │ + 1874 dstBuffer, dstDesc, │ │ │ │ │ + 1875 duBuffer, duDesc, │ │ │ │ │ + 1876 dvBuffer, dvDesc, │ │ │ │ │ + 1877 duuBuffer, duuDesc, │ │ │ │ │ + 1878 duvBuffer, duvDesc, │ │ │ │ │ + 1879 dvvBuffer, dvvDesc, │ │ │ │ │ + 1880 numPatchCoords, patchCoords, │ │ │ │ │ + 1881 patchTable, │ │ │ │ │ + 1882 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1883 } else { │ │ │ │ │ + 1884 // Create an instance on demand (slow) │ │ │ │ │ + 1885 (void)deviceContext; // unused │ │ │ │ │ + 1886 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1887 duDesc, dvDesc, │ │ │ │ │ + 1888 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 1889 deviceContext); │ │ │ │ │ + 1890 if (instance) { │ │ │ │ │ + 1891 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1892 srcBuffer, srcDesc, │ │ │ │ │ + 1893 dstBuffer, dstDesc, │ │ │ │ │ + 1894 duBuffer, duDesc, │ │ │ │ │ + 1895 dvBuffer, dvDesc, │ │ │ │ │ + 1896 duuBuffer, duuDesc, │ │ │ │ │ + 1897 duvBuffer, duvDesc, │ │ │ │ │ + 1898 dvvBuffer, dvvDesc, │ │ │ │ │ + 1899 numPatchCoords, patchCoords, │ │ │ │ │ + 1900 patchTable, │ │ │ │ │ + 1901 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 1902 delete instance; │ │ │ │ │ + 1903 return r; │ │ │ │ │ + 1904 } │ │ │ │ │ + 1905 return false; │ │ │ │ │ + 1906 } │ │ │ │ │ + 1907 } │ │ │ │ │ + 1908 │ │ │ │ │ + 1976 template │ │ │ │ │ +1978 bool EvalPatchesVarying( │ │ │ │ │ + 1979 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1980 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1981 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1982 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1983 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1984 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1985 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1986 int numPatchCoords, │ │ │ │ │ + 1987 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1988 PATCH_TABLE *patchTable, │ │ │ │ │ + 1989 unsigned int numStartEvents=0, │ │ │ │ │ + 1990 const cl_event* startEvents=NULL, │ │ │ │ │ + 1991 cl_event* endEvent=NULL) const { │ │ │ │ │ + 1992 │ │ │ │ │ + 1993 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 1994 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 1995 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 1996 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 1997 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ + 1998 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ + 1999 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ + 2000 numPatchCoords, │ │ │ │ │ + 2001 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 2002 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 2003 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 2004 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 2005 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2006 } │ │ │ │ │ + 2007 │ │ │ │ │ + 2058 template │ │ │ │ │ +2061 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 2062 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2063 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2064 int numPatchCoords, │ │ │ │ │ + 2065 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2066 PATCH_TABLE *patchTable, │ │ │ │ │ + 2067 int fvarChannel, │ │ │ │ │ + 2068 CLEvaluator const *instance, │ │ │ │ │ + 2069 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 2070 unsigned int numStartEvents=0, │ │ │ │ │ + 2071 const cl_event* startEvents=NULL, │ │ │ │ │ + 2072 cl_event* endEvent=NULL) { │ │ │ │ │ + 2073 │ │ │ │ │ + 2074 if (instance) { │ │ │ │ │ + 2075 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2076 srcBuffer, srcDesc, │ │ │ │ │ + 2077 dstBuffer, dstDesc, │ │ │ │ │ + 2078 numPatchCoords, patchCoords, │ │ │ │ │ + 2079 patchTable, fvarChannel, │ │ │ │ │ + 2080 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2081 } else { │ │ │ │ │ + 2082 // Create an instance on demand (slow) │ │ │ │ │ + 2083 (void)deviceContext; // unused │ │ │ │ │ + 2084 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 2085 BufferDescriptor(), │ │ │ │ │ + 2086 BufferDescriptor(), │ │ │ │ │ + 2087 deviceContext); │ │ │ │ │ + 2088 if (instance) { │ │ │ │ │ + 2089 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2090 srcBuffer, srcDesc, │ │ │ │ │ + 2091 dstBuffer, dstDesc, │ │ │ │ │ + 2092 numPatchCoords, patchCoords, │ │ │ │ │ + 2093 patchTable, fvarChannel, │ │ │ │ │ + 2094 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2095 delete instance; │ │ │ │ │ + 2096 return r; │ │ │ │ │ + 2097 } │ │ │ │ │ + 2098 return false; │ │ │ │ │ + 2099 } │ │ │ │ │ + 2100 } │ │ │ │ │ + 2101 │ │ │ │ │ + 2141 template │ │ │ │ │ +2143 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2144 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2145 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2146 int numPatchCoords, │ │ │ │ │ + 2147 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2148 PATCH_TABLE *patchTable, │ │ │ │ │ + 2149 int fvarChannel = 0, │ │ │ │ │ + 2150 unsigned int numStartEvents=0, │ │ │ │ │ + 2151 const cl_event* startEvents=NULL, │ │ │ │ │ + 2152 cl_event* endEvent=NULL) const { │ │ │ │ │ + 2153 │ │ │ │ │ + 2154 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 2155 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 2156 0, BufferDescriptor(), │ │ │ │ │ + 2157 0, BufferDescriptor(), │ │ │ │ │ + 2158 numPatchCoords, │ │ │ │ │ + 2159 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 2160 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 2161 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 2162 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 2163 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2164 } │ │ │ │ │ + 2165 │ │ │ │ │ + 2228 template │ │ │ │ │ +2231 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 2232 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2233 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2234 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2235 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2236 int numPatchCoords, │ │ │ │ │ + 2237 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2238 PATCH_TABLE *patchTable, │ │ │ │ │ + 2239 int fvarChannel, │ │ │ │ │ + 2240 CLEvaluator const *instance, │ │ │ │ │ + 2241 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 2242 unsigned int numStartEvents=0, │ │ │ │ │ + 2243 const cl_event* startEvents=NULL, │ │ │ │ │ + 2244 cl_event* endEvent=NULL) { │ │ │ │ │ + 2245 │ │ │ │ │ + 2246 if (instance) { │ │ │ │ │ + 2247 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2248 srcBuffer, srcDesc, │ │ │ │ │ + 2249 dstBuffer, dstDesc, │ │ │ │ │ + 2250 duBuffer, duDesc, │ │ │ │ │ + 2251 dvBuffer, dvDesc, │ │ │ │ │ + 2252 numPatchCoords, patchCoords, │ │ │ │ │ + 2253 patchTable, fvarChannel, │ │ │ │ │ + 2254 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2255 } else { │ │ │ │ │ + 2256 // Create an instance on demand (slow) │ │ │ │ │ + 2257 (void)deviceContext; // unused │ │ │ │ │ + 2258 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 2259 duDesc, dvDesc, deviceContext); │ │ │ │ │ + 2260 if (instance) { │ │ │ │ │ + 2261 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2262 srcBuffer, srcDesc, │ │ │ │ │ + 2263 dstBuffer, dstDesc, │ │ │ │ │ + 2264 duBuffer, duDesc, │ │ │ │ │ + 2265 dvBuffer, dvDesc, │ │ │ │ │ + 2266 numPatchCoords, patchCoords, │ │ │ │ │ + 2267 patchTable, fvarChannel, │ │ │ │ │ + 2268 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2269 delete instance; │ │ │ │ │ + 2270 return r; │ │ │ │ │ + 2271 } │ │ │ │ │ + 2272 return false; │ │ │ │ │ + 2273 } │ │ │ │ │ + 2274 } │ │ │ │ │ + 2275 │ │ │ │ │ + 2327 template │ │ │ │ │ +2329 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2330 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2331 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2332 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2333 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2334 int numPatchCoords, │ │ │ │ │ + 2335 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2336 PATCH_TABLE *patchTable, │ │ │ │ │ + 2337 int fvarChannel = 0, │ │ │ │ │ + 2338 unsigned int numStartEvents=0, │ │ │ │ │ + 2339 const cl_event* startEvents=NULL, │ │ │ │ │ + 2340 cl_event* endEvent=NULL) const { │ │ │ │ │ + 2341 │ │ │ │ │ + 2342 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 2343 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 2344 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 2345 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 2346 numPatchCoords, │ │ │ │ │ + 2347 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 2348 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 2349 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 2350 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 2351 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2352 } │ │ │ │ │ + 2353 │ │ │ │ │ + 2434 template │ │ │ │ │ +2437 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 2438 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2439 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2440 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2441 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2442 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 2443 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 2444 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2445 int numPatchCoords, │ │ │ │ │ + 2446 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2447 PATCH_TABLE *patchTable, │ │ │ │ │ + 2448 int fvarChannel, │ │ │ │ │ + 2449 CLEvaluator const *instance, │ │ │ │ │ + 2450 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 2451 unsigned int numStartEvents=0, │ │ │ │ │ + 2452 const cl_event* startEvents=NULL, │ │ │ │ │ + 2453 cl_event* endEvent=NULL) { │ │ │ │ │ + 2454 │ │ │ │ │ + 2455 if (instance) { │ │ │ │ │ + 2456 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2457 srcBuffer, srcDesc, │ │ │ │ │ + 2458 dstBuffer, dstDesc, │ │ │ │ │ + 2459 duBuffer, duDesc, │ │ │ │ │ + 2460 dvBuffer, dvDesc, │ │ │ │ │ + 2461 duuBuffer, duuDesc, │ │ │ │ │ + 2462 duvBuffer, duvDesc, │ │ │ │ │ + 2463 dvvBuffer, dvvDesc, │ │ │ │ │ + 2464 numPatchCoords, patchCoords, │ │ │ │ │ + 2465 patchTable, fvarChannel, │ │ │ │ │ + 2466 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2467 } else { │ │ │ │ │ + 2468 // Create an instance on demand (slow) │ │ │ │ │ + 2469 (void)deviceContext; // unused │ │ │ │ │ + 2470 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 2471 duDesc, dvDesc, │ │ │ │ │ + 2472 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 2473 deviceContext); │ │ │ │ │ + 2474 if (instance) { │ │ │ │ │ + 2475 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2476 srcBuffer, srcDesc, │ │ │ │ │ + 2477 dstBuffer, dstDesc, │ │ │ │ │ + 2478 duBuffer, duDesc, │ │ │ │ │ + 2479 dvBuffer, dvDesc, │ │ │ │ │ + 2480 duuBuffer, duuDesc, │ │ │ │ │ + 2481 duvBuffer, duvDesc, │ │ │ │ │ + 2482 dvvBuffer, dvvDesc, │ │ │ │ │ + 2483 numPatchCoords, patchCoords, │ │ │ │ │ + 2484 patchTable, fvarChannel, │ │ │ │ │ + 2485 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2486 delete instance; │ │ │ │ │ + 2487 return r; │ │ │ │ │ + 2488 } │ │ │ │ │ + 2489 return false; │ │ │ │ │ + 2490 } │ │ │ │ │ + 2491 } │ │ │ │ │ + 2492 │ │ │ │ │ + 2562 template │ │ │ │ │ +2564 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2565 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2566 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2567 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2568 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2569 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 2570 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 2571 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2572 int numPatchCoords, │ │ │ │ │ + 2573 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2574 PATCH_TABLE *patchTable, │ │ │ │ │ + 2575 int fvarChannel = 0, │ │ │ │ │ + 2576 unsigned int numStartEvents=0, │ │ │ │ │ + 2577 const cl_event* startEvents=NULL, │ │ │ │ │ + 2578 cl_event* endEvent=NULL) const { │ │ │ │ │ + 2579 │ │ │ │ │ + 2580 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ + 2581 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ + 2582 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ + 2583 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ + 2584 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ + 2585 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ + 2586 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ + 2587 numPatchCoords, │ │ │ │ │ + 2588 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ + 2589 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 2590 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 2591 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 2592 numStartEvents, startEvents, endEvent); │ │ │ │ │ + 2593 } │ │ │ │ │ + 2594 │ │ │ │ │ + 2600 │ │ │ │ │ +2603 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2604 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2605 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ + 2606 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ + 2607 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ + 2608 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ + 2609 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ + 2610 │ │ │ │ │ + 2612 template │ │ │ │ │ +2613 static void Synchronize(DEVICE_CONTEXT deviceContext) { │ │ │ │ │ + 2614 Synchronize(deviceContext->GetCommandQueue()); │ │ │ │ │ + 2615 } │ │ │ │ │ + 2616 │ │ │ │ │ +2617 static void Synchronize(cl_command_queue queue); │ │ │ │ │ + 2618 │ │ │ │ │ + 2619private: │ │ │ │ │ + 2620 cl_context _clContext; │ │ │ │ │ + 2621 cl_command_queue _clCommandQueue; │ │ │ │ │ + 2622 cl_program _program; │ │ │ │ │ + 2623 cl_kernel _stencilKernel; │ │ │ │ │ + 2624 cl_kernel _stencilDerivKernel; │ │ │ │ │ + 2625 cl_kernel _patchKernel; │ │ │ │ │ + 2626}; │ │ │ │ │ + 2627 │ │ │ │ │ + 2628} // end namespace Osd │ │ │ │ │ + 2629 │ │ │ │ │ + 2630} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 2631using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 2632 │ │ │ │ │ + 2633} // end namespace OpenSubdiv │ │ │ │ │ + 2634 │ │ │ │ │ + 2635 │ │ │ │ │ + 2636#endif // OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ -Split │ │ │ │ │ -Enumerated type for all face splitting schemes. │ │ │ │ │ -Definition: types.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_QUADS │ │ │ │ │ -@ SPLIT_TO_QUADS │ │ │ │ │ -Used by Catmark and Bilinear. │ │ │ │ │ -Definition: types.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule │ │ │ │ │ -Rule │ │ │ │ │ -Definition: crease.h:82 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ -static Split GetTopologicalSplitType() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeVertexVertexMask │ │ │ │ │ -void ComputeVertexVertexMask(VERTEX const &vertexNeighborhood, MASK │ │ │ │ │ -&vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule │ │ │ │ │ -childRule=Crease::RULE_UNKNOWN) const │ │ │ │ │ -Vertex-vertex masks If known, a single Rule or pair of Rules can be specified │ │ │ │ │ -(indicating a crease tr... │ │ │ │ │ -Definition: scheme.h:512 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ -void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2, int const creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ -static int GetRegularFaceSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeEdgeVertexMask │ │ │ │ │ -void ComputeEdgeVertexMask(EDGE const &edgeNeighborhood, MASK &edgeVertexMask, │ │ │ │ │ -Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease:: │ │ │ │ │ -RULE_UNKNOWN) const │ │ │ │ │ -Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can │ │ │ │ │ -be specified to accel... │ │ │ │ │ -Definition: scheme.h:392 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ -void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ -static int GetLocalNeighborhoodSize() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ -void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ -creaseEnds[2]) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ -static int GetRegularVertexValence() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ -void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ -void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ -void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ -&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ +Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:583 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable │ │ │ │ │ +OpenCL stencil table. │ │ │ │ │ +Definition: clEvaluator.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvvWeightsBuffer │ │ │ │ │ +cl_mem GetDvvWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:82 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable │ │ │ │ │ +CLStencilTable(Far::StencilTable const *stencilTable, cl_context clContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetOffsetsBuffer │ │ │ │ │ +cl_mem GetOffsetsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create │ │ │ │ │ +static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ +Definition: clEvaluator.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetIndicesBuffer │ │ │ │ │ +cl_mem GetIndicesBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Definition: clEvaluator.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetSizesBuffer │ │ │ │ │ +cl_mem GetSizesBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuuWeightsBuffer │ │ │ │ │ +cl_mem GetDuuWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvWeightsBuffer │ │ │ │ │ +cl_mem GetDvWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuvWeightsBuffer │ │ │ │ │ +cl_mem GetDuvWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:81 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuWeightsBuffer │ │ │ │ │ +cl_mem GetDuWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::~CLStencilTable │ │ │ │ │ +~CLStencilTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create │ │ │ │ │ +static CLStencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ +Definition: clEvaluator.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable │ │ │ │ │ +CLStencilTable(Far::LimitStencilTable const *limitStencilTable, cl_context │ │ │ │ │ +clContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetWeightsBuffer │ │ │ │ │ +cl_mem GetWeightsBuffer() const │ │ │ │ │ +Definition: clEvaluator.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator │ │ │ │ │ +Definition: clEvaluator.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator │ │ │ │ │ +const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, │ │ │ │ │ +const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: clEvaluator.h:309 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(cl_command_queue queue) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::~CLEvaluator │ │ │ │ │ +~CLEvaluator() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ +BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ +cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem │ │ │ │ │ +indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int │ │ │ │ │ +end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) const │ │ │ │ │ +Dispatch the CL compute kernel asynchronously. returns false if the kernel │ │ │ │ │ +hasn't been compiled yet. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ +unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: clEvaluator.h:219 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ +static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +cl_context clContext, cl_command_queue clCommandQueue) │ │ │ │ │ +Definition: clEvaluator.h:116 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const │ │ │ │ │ +*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2231 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ +BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ +cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem │ │ │ │ │ +patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem │ │ │ │ │ +patchParamsBuffer, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ +*startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1978 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, │ │ │ │ │ +const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: clEvaluator.h:561 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: clEvaluator.h:1379 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Instantiatable │ │ │ │ │ +bool Instantiatable │ │ │ │ │ +Definition: clEvaluator.h:102 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ +static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +DEVICE_CONTEXT deviceContext) │ │ │ │ │ +Generic creator template. │ │ │ │ │ +Definition: clEvaluator.h:106 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ +unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2061 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ +static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ +BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext) │ │ │ │ │ +Generic creator template. │ │ │ │ │ +Definition: clEvaluator.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ +BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ +cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const │ │ │ │ │ +&duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, │ │ │ │ │ +cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, │ │ │ │ │ +unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ +BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ +cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const │ │ │ │ │ +&duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, │ │ │ │ │ +BufferDescriptor const &dvvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, │ │ │ │ │ +cl_mem weights, cl_mem duWeights, cl_mem dvWeights, cl_mem duuWeights, cl_mem │ │ │ │ │ +duvWeights, cl_mem dvvWeights, int start, int end, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +const │ │ │ │ │ +Dispatch the CL compute kernel asynchronously. returns false if the kernel │ │ │ │ │ +hasn't been compiled yet. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, │ │ │ │ │ +unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2564 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1217 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, unsigned │ │ │ │ │ +int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: clEvaluator.h:646 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, │ │ │ │ │ +DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ +*startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1653 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(DEVICE_CONTEXT deviceContext) │ │ │ │ │ +Wait the OpenCL kernels finish. │ │ │ │ │ +Definition: clEvaluator.h:2613 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, │ │ │ │ │ +DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ +*startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1125 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: clEvaluator.h:421 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ +BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, │ │ │ │ │ +cl_mem weights, int start, int end, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1489 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2329 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2437 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ +static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ +BufferDescriptor const &dvvDesc, cl_context clContext, cl_command_queue │ │ │ │ │ +clCommandQueue) │ │ │ │ │ +Definition: clEvaluator.h:145 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ +unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ +*endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1003 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ +cl_event *endEvent=NULL) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1749 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const │ │ │ │ │ +*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:902 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int │ │ │ │ │ +numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1568 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const │ │ │ │ │ +*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ +cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:1854 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ +*stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ +cl_event *endEvent=NULL) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: clEvaluator.h:500 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ +cl_event *endEvent=NULL) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: clEvaluator.h:1288 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::CLEvaluator │ │ │ │ │ +CLEvaluator(cl_context context, cl_command_queue queue) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Compile │ │ │ │ │ +bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ +BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ +BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvvDesc=BufferDescriptor()) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ +cl_event *endEvent=NULL) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: clEvaluator.h:2143 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * sdc │ │ │ │ │ - * bilinearScheme.h │ │ │ │ │ + * osd │ │ │ │ │ + * clEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00788.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlCommon.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,45 +83,40 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
cudaPatchTable.h File Reference
│ │ │ │ +
mtlCommon.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include <vector>
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CudaPatchTable
 CUDA patch table. More...
class  MTLContext
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -cudaPatchTable.h File Reference │ │ │ │ │ +mtlCommon.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CudaPatchTable │ │ │ │ │ -  CUDA patch table. More... │ │ │ │ │ +class  MTLContext │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cudaPatchTable.h │ │ │ │ │ + * mtlCommon.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00788.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00788 = [ │ │ │ │ │ - ["CudaPatchTable", "a01181.html", "a01181"] │ │ │ │ │ + ["MTLContext", "a01277.html", "a01277"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00788_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlCommon.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cudaPatchTable.h
│ │ │ │ +
mtlCommon.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,119 +107,51 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/nonCopyable.h"
│ │ │ │ -
31#include "../osd/types.h"
│ │ │ │ -
32
│ │ │ │ -
33#include <vector>
│ │ │ │ +
30#include <cstddef>
│ │ │ │ +
31
│ │ │ │ +
32@protocol MTLDevice;
│ │ │ │ +
33@protocol MTLCommandQueue;
│ │ │ │
34
│ │ │ │
35namespace OpenSubdiv {
│ │ │ │
36namespace OPENSUBDIV_VERSION {
│ │ │ │
37
│ │ │ │ -
38namespace Far{
│ │ │ │ -
39 class PatchTable;
│ │ │ │ -
40};
│ │ │ │ -
41
│ │ │ │ -
42namespace Osd {
│ │ │ │ -
43
│ │ │ │ -
51class CudaPatchTable : private NonCopyable<CudaPatchTable> {
│ │ │ │ -
52public:
│ │ │ │ -
54 static CudaPatchTable *Create(Far::PatchTable const *patchTable,
│ │ │ │ -
55 void *deviceContext = NULL);
│ │ │ │ - │ │ │ │ -
58
│ │ │ │ -
60 void *GetPatchArrayBuffer() const { return _patchArrays; }
│ │ │ │ -
61
│ │ │ │ -
63 void *GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │ -
64
│ │ │ │ -
66 void *GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ -
67
│ │ │ │ - │ │ │ │ - │ │ │ │ -
71 }
│ │ │ │ - │ │ │ │ - │ │ │ │ -
75 }
│ │ │ │ -
76
│ │ │ │ -
78 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ -
79
│ │ │ │ -
81 void *GetFVarPatchArrayBuffer(int fvarChannel) const {
│ │ │ │ -
82 return _fvarPatchArrays[fvarChannel];
│ │ │ │ -
83 }
│ │ │ │ -
84
│ │ │ │ -
86 void *GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ -
87 return _fvarIndexBuffers[fvarChannel];
│ │ │ │ -
88 }
│ │ │ │ -
89
│ │ │ │ -
91 void *GetFVarPatchParamBuffer(int fvarChannel = 0) const {
│ │ │ │ -
92 return _fvarParamBuffers[fvarChannel];
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
95protected:
│ │ │ │ - │ │ │ │ -
97
│ │ │ │ -
98 bool allocate(Far::PatchTable const *patchTable);
│ │ │ │ -
99
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
103
│ │ │ │ - │ │ │ │ - │ │ │ │ -
106
│ │ │ │ -
107 std::vector<void *> _fvarPatchArrays;
│ │ │ │ -
108 std::vector<void *> _fvarIndexBuffers;
│ │ │ │ -
109 std::vector<void *> _fvarParamBuffers;
│ │ │ │ -
110};
│ │ │ │ -
111
│ │ │ │ -
112} // end namespace Osd
│ │ │ │ -
113
│ │ │ │ -
114} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
115using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
116
│ │ │ │ -
117} // end namespace OpenSubdiv
│ │ │ │ -
118
│ │ │ │ -
119#endif // OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H
│ │ │ │ +
38namespace Osd {
│ │ │ │ +
39
│ │ │ │ + │ │ │ │ +
41public:
│ │ │ │ +
42 id<MTLDevice> device = nullptr;
│ │ │ │ +
43 id<MTLCommandQueue> commandQueue = nullptr;
│ │ │ │ +
44};
│ │ │ │ +
45
│ │ │ │ +
46} // end namespace Osd
│ │ │ │ +
47
│ │ │ │ +
48} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
49using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
50
│ │ │ │ +
51} // end namespace OpenSubdiv
│ │ │ │ +
52
│ │ │ │ +
53#endif //OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │ │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ -
void * GetFVarPatchArrayBuffer(int fvarChannel) const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ - │ │ │ │ -
static CudaPatchTable * Create(Far::PatchTable const *patchTable, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ - │ │ │ │ -
void * GetVaryingPatchIndexBuffer() const
Returns the cuda memory of the array of varying control vertices.
│ │ │ │ - │ │ │ │ -
void * GetVaryingPatchArrayBuffer() const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
void * GetPatchArrayBuffer() const
Returns the cuda memory of the array of Osd::PatchArray buffer.
│ │ │ │ - │ │ │ │ -
bool allocate(Far::PatchTable const *patchTable)
│ │ │ │ -
void * GetPatchIndexBuffer() const
Returns the cuda memory of the patch control vertices.
│ │ │ │ -
int GetNumFVarChannels() const
Returns the number of face-varying channels buffers.
│ │ │ │ - │ │ │ │ -
void * GetPatchParamBuffer() const
Returns the cuda memory of the array of Osd::PatchParam buffer.
│ │ │ │ -
void * GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the cuda memory of the array of face-varying control vertices.
│ │ │ │ -
void * GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the cuda memory of the array of face-varying param.
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cudaPatchTable.h │ │ │ │ │ +mtlCommon.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,167 +30,50 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/nonCopyable.h" │ │ │ │ │ - 31#include "../osd/types.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33#include │ │ │ │ │ + 30#include │ │ │ │ │ + 31 │ │ │ │ │ + 32@protocol MTLDevice; │ │ │ │ │ + 33@protocol MTLCommandQueue; │ │ │ │ │ 34 │ │ │ │ │ 35namespace OpenSubdiv { │ │ │ │ │ 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ 37 │ │ │ │ │ - 38namespace Far{ │ │ │ │ │ - 39 class PatchTable; │ │ │ │ │ - 40}; │ │ │ │ │ - 41 │ │ │ │ │ - 42namespace Osd { │ │ │ │ │ - 43 │ │ │ │ │ -51class CudaPatchTable : private NonCopyable { │ │ │ │ │ - 52public: │ │ │ │ │ -54 static CudaPatchTable *Create(Far::PatchTable const *patchTable, │ │ │ │ │ - 55 void *deviceContext = NULL); │ │ │ │ │ -57 ~CudaPatchTable(); │ │ │ │ │ - 58 │ │ │ │ │ -60 void *GetPatchArrayBuffer() const { return _patchArrays; } │ │ │ │ │ - 61 │ │ │ │ │ -63 void *GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ - 64 │ │ │ │ │ -66 void *GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ - 67 │ │ │ │ │ -69 void *GetVaryingPatchArrayBuffer() const { │ │ │ │ │ - 70 return _varyingPatchArrays; │ │ │ │ │ - 71 } │ │ │ │ │ -73 void *GetVaryingPatchIndexBuffer() const { │ │ │ │ │ - 74 return _varyingIndexBuffer; │ │ │ │ │ - 75 } │ │ │ │ │ - 76 │ │ │ │ │ -78 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ - 79 │ │ │ │ │ -81 void *GetFVarPatchArrayBuffer(int fvarChannel) const { │ │ │ │ │ - 82 return _fvarPatchArrays[fvarChannel]; │ │ │ │ │ - 83 } │ │ │ │ │ - 84 │ │ │ │ │ -86 void *GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 87 return _fvarIndexBuffers[fvarChannel]; │ │ │ │ │ - 88 } │ │ │ │ │ - 89 │ │ │ │ │ -91 void *GetFVarPatchParamBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 92 return _fvarParamBuffers[fvarChannel]; │ │ │ │ │ - 93 } │ │ │ │ │ - 94 │ │ │ │ │ - 95protected: │ │ │ │ │ -96 CudaPatchTable(); │ │ │ │ │ - 97 │ │ │ │ │ -98 bool allocate(Far::PatchTable const *patchTable); │ │ │ │ │ - 99 │ │ │ │ │ -100 void *_patchArrays; │ │ │ │ │ -101 void *_indexBuffer; │ │ │ │ │ -102 void *_patchParamBuffer; │ │ │ │ │ - 103 │ │ │ │ │ -104 void *_varyingPatchArrays; │ │ │ │ │ -105 void *_varyingIndexBuffer; │ │ │ │ │ - 106 │ │ │ │ │ -107 std::vector _fvarPatchArrays; │ │ │ │ │ -108 std::vector _fvarIndexBuffers; │ │ │ │ │ -109 std::vector _fvarParamBuffers; │ │ │ │ │ - 110}; │ │ │ │ │ - 111 │ │ │ │ │ - 112} // end namespace Osd │ │ │ │ │ - 113 │ │ │ │ │ - 114} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 115using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 116 │ │ │ │ │ - 117} // end namespace OpenSubdiv │ │ │ │ │ - 118 │ │ │ │ │ - 119#endif // OPENSUBDIV3_OSD_CUDA_PATCH_TABLE_H │ │ │ │ │ + 38namespace Osd { │ │ │ │ │ + 39 │ │ │ │ │ +40class MTLContext { │ │ │ │ │ + 41public: │ │ │ │ │ +42 id device = nullptr; │ │ │ │ │ +43 id commandQueue = nullptr; │ │ │ │ │ + 44}; │ │ │ │ │ + 45 │ │ │ │ │ + 46} // end namespace Osd │ │ │ │ │ + 47 │ │ │ │ │ + 48} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 49using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 50 │ │ │ │ │ + 51} // end namespace OpenSubdiv │ │ │ │ │ + 52 │ │ │ │ │ + 53#endif //OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable │ │ │ │ │ -CUDA patch table. │ │ │ │ │ -Definition: cudaPatchTable.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ -void * GetFVarPatchArrayBuffer(int fvarChannel) const │ │ │ │ │ -Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: cudaPatchTable.h:81 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarParamBuffers │ │ │ │ │ -std::vector< void * > _fvarParamBuffers │ │ │ │ │ -Definition: cudaPatchTable.h:109 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::Create │ │ │ │ │ -static CudaPatchTable * Create(Far::PatchTable const *patchTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_varyingPatchArrays │ │ │ │ │ -void * _varyingPatchArrays │ │ │ │ │ -Definition: cudaPatchTable.h:104 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ -void * GetVaryingPatchIndexBuffer() const │ │ │ │ │ -Returns the cuda memory of the array of varying control vertices. │ │ │ │ │ -Definition: cudaPatchTable.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarIndexBuffers │ │ │ │ │ -std::vector< void * > _fvarIndexBuffers │ │ │ │ │ -Definition: cudaPatchTable.h:108 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ -void * GetVaryingPatchArrayBuffer() const │ │ │ │ │ -Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: cudaPatchTable.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_varyingIndexBuffer │ │ │ │ │ -void * _varyingIndexBuffer │ │ │ │ │ -Definition: cudaPatchTable.h:105 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::~CudaPatchTable │ │ │ │ │ -~CudaPatchTable() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchArrayBuffer │ │ │ │ │ -void * GetPatchArrayBuffer() const │ │ │ │ │ -Returns the cuda memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: cudaPatchTable.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_fvarPatchArrays │ │ │ │ │ -std::vector< void * > _fvarPatchArrays │ │ │ │ │ -Definition: cudaPatchTable.h:107 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::allocate │ │ │ │ │ -bool allocate(Far::PatchTable const *patchTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchIndexBuffer │ │ │ │ │ -void * GetPatchIndexBuffer() const │ │ │ │ │ -Returns the cuda memory of the patch control vertices. │ │ │ │ │ -Definition: cudaPatchTable.h:63 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Returns the number of face-varying channels buffers. │ │ │ │ │ -Definition: cudaPatchTable.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_patchArrays │ │ │ │ │ -void * _patchArrays │ │ │ │ │ -Definition: cudaPatchTable.h:100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetPatchParamBuffer │ │ │ │ │ -void * GetPatchParamBuffer() const │ │ │ │ │ -Returns the cuda memory of the array of Osd::PatchParam buffer. │ │ │ │ │ -Definition: cudaPatchTable.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ -void * GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the cuda memory of the array of face-varying control vertices. │ │ │ │ │ -Definition: cudaPatchTable.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ -void * GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the cuda memory of the array of face-varying param. │ │ │ │ │ -Definition: cudaPatchTable.h:91 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::CudaPatchTable │ │ │ │ │ -CudaPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_patchParamBuffer │ │ │ │ │ -void * _patchParamBuffer │ │ │ │ │ -Definition: cudaPatchTable.h:102 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaPatchTable::_indexBuffer │ │ │ │ │ -void * _indexBuffer │ │ │ │ │ -Definition: cudaPatchTable.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ +Definition: mtlCommon.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext::commandQueue │ │ │ │ │ +id< MTLCommandQueue > commandQueue │ │ │ │ │ +Definition: mtlCommon.h:43 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext::device │ │ │ │ │ +id< MTLDevice > device │ │ │ │ │ +Definition: mtlCommon.h:42 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cudaPatchTable.h │ │ │ │ │ + * mtlCommon.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00791.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlPatchShaderSource.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,47 +83,41 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
cudaEvaluator.h File Reference
│ │ │ │ +
mtlPatchShaderSource.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include "../version.h"
│ │ │ │ -#include <vector>
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ +
#import "../version.h"
│ │ │ │ +#import "../far/patchDescriptor.h"
│ │ │ │ +#import <string>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CudaStencilTable
 CUDA stencil table. More...
 
class  CudaEvaluator
class  MTLPatchShaderSource
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -cudaEvaluator.h File Reference │ │ │ │ │ -#include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ +mtlPatchShaderSource.h File Reference │ │ │ │ │ +#import "../version.h" │ │ │ │ │ +#import "../far/patchDescriptor.h" │ │ │ │ │ +#import │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CudaStencilTable │ │ │ │ │ -  CUDA stencil table. More... │ │ │ │ │ -  │ │ │ │ │ -class  CudaEvaluator │ │ │ │ │ +class  MTLPatchShaderSource │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cudaEvaluator.h │ │ │ │ │ + * mtlPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00791.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00791 = [ │ │ │ │ │ - ["CudaStencilTable", "a01173.html", "a01173"], │ │ │ │ │ - ["CudaEvaluator", "a01177.html", null] │ │ │ │ │ + ["MTLPatchShaderSource", "a01293.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00791_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlPatchShaderSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cudaEvaluator.h
│ │ │ │ +
mtlPatchShaderSource.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,550 +107,72 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H
│ │ │ │
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <vector>
│ │ │ │ -
31#include "../osd/bufferDescriptor.h"
│ │ │ │ -
32#include "../osd/types.h"
│ │ │ │ -
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
28#import "../version.h"
│ │ │ │ +
29#import "../far/patchDescriptor.h"
│ │ │ │ +
30#import <string>
│ │ │ │ +
31
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
34
│ │ │ │ +
35namespace Osd {
│ │ │ │
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38 class PatchTable;
│ │ │ │ -
39 class StencilTable;
│ │ │ │ -
40 class LimitStencilTable;
│ │ │ │ -
41}
│ │ │ │ + │ │ │ │ +
38 public:
│ │ │ │ +
39 static std::string GetCommonShaderSource();
│ │ │ │ +
40
│ │ │ │ +
41 static std::string GetPatchBasisShaderSource();
│ │ │ │
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ + │ │ │ │
44
│ │ │ │ - │ │ │ │ -
53public:
│ │ │ │ -
54 static CudaStencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ -
55 void *deviceContext = NULL) {
│ │ │ │ -
56 (void)deviceContext; // unused
│ │ │ │ -
57 return new CudaStencilTable(stencilTable);
│ │ │ │ -
58 }
│ │ │ │ -
59 static CudaStencilTable *Create(Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ -
60 void *deviceContext = NULL) {
│ │ │ │ -
61 (void)deviceContext; // unused
│ │ │ │ -
62 return new CudaStencilTable(limitStencilTable);
│ │ │ │ -
63 }
│ │ │ │ -
64
│ │ │ │ -
65 explicit CudaStencilTable(Far::StencilTable const *stencilTable);
│ │ │ │ -
66 explicit CudaStencilTable(Far::LimitStencilTable const *limitStencilTable);
│ │ │ │ - │ │ │ │ -
68
│ │ │ │ -
69 // interfaces needed for CudaCompute
│ │ │ │ -
70 void *GetSizesBuffer() const { return _sizes; }
│ │ │ │ -
71 void *GetOffsetsBuffer() const { return _offsets; }
│ │ │ │ -
72 void *GetIndicesBuffer() const { return _indices; }
│ │ │ │ -
73 void *GetWeightsBuffer() const { return _weights; }
│ │ │ │ -
74 void *GetDuWeightsBuffer() const { return _duWeights; }
│ │ │ │ -
75 void *GetDvWeightsBuffer() const { return _dvWeights; }
│ │ │ │ -
76 void *GetDuuWeightsBuffer() const { return _duuWeights; }
│ │ │ │ -
77 void *GetDuvWeightsBuffer() const { return _duvWeights; }
│ │ │ │ -
78 void *GetDvvWeightsBuffer() const { return _dvvWeights; }
│ │ │ │ -
79 int GetNumStencils() const { return _numStencils; }
│ │ │ │ -
80
│ │ │ │ -
81private:
│ │ │ │ -
82 void * _sizes,
│ │ │ │ -
83 * _offsets,
│ │ │ │ -
84 * _indices,
│ │ │ │ -
85 * _weights,
│ │ │ │ -
86 * _duWeights,
│ │ │ │ -
87 * _dvWeights,
│ │ │ │ -
88 * _duuWeights,
│ │ │ │ -
89 * _duvWeights,
│ │ │ │ -
90 * _dvvWeights;
│ │ │ │ -
91 int _numStencils;
│ │ │ │ -
92};
│ │ │ │ -
93
│ │ │ │ - │ │ │ │ -
95public:
│ │ │ │ -
101
│ │ │ │ -
125 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
126 static bool EvalStencils(
│ │ │ │ -
127 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
128 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
129 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
130 const void *instance = NULL,
│ │ │ │ -
131 void * deviceContext = NULL) {
│ │ │ │ -
132
│ │ │ │ -
133 (void)instance; // unused
│ │ │ │ -
134 (void)deviceContext; // unused
│ │ │ │ -
135 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
136 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
137 (int const *)stencilTable->GetSizesBuffer(),
│ │ │ │ -
138 (int const *)stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
139 (int const *)stencilTable->GetIndicesBuffer(),
│ │ │ │ -
140 (float const *)stencilTable->GetWeightsBuffer(),
│ │ │ │ -
141 /*start = */ 0,
│ │ │ │ -
142 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
143 }
│ │ │ │ -
144
│ │ │ │ -
171 static bool EvalStencils(
│ │ │ │ -
172 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
173 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
174 const int * sizes,
│ │ │ │ -
175 const int * offsets,
│ │ │ │ -
176 const int * indices,
│ │ │ │ -
177 const float * weights,
│ │ │ │ -
178 int start, int end);
│ │ │ │ -
179
│ │ │ │ -
217 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
218 static bool EvalStencils(
│ │ │ │ -
219 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
220 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
221 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
222 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
223 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
224 const CudaEvaluator *instance = NULL,
│ │ │ │ -
225 void * deviceContext = NULL) {
│ │ │ │ -
226
│ │ │ │ -
227 (void)instance; // unused
│ │ │ │ -
228 (void)deviceContext; // unused
│ │ │ │ -
229
│ │ │ │ -
230 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
231 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
232 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
233 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
234 (int const *)stencilTable->GetSizesBuffer(),
│ │ │ │ -
235 (int const *)stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
236 (int const *)stencilTable->GetIndicesBuffer(),
│ │ │ │ -
237 (float const *)stencilTable->GetWeightsBuffer(),
│ │ │ │ -
238 (float const *)stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
239 (float const *)stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
240 /*start = */ 0,
│ │ │ │ -
241 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
242 }
│ │ │ │ -
243
│ │ │ │ -
284 static bool EvalStencils(
│ │ │ │ -
285 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
286 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
287 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
288 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
289 const int * sizes,
│ │ │ │ -
290 const int * offsets,
│ │ │ │ -
291 const int * indices,
│ │ │ │ -
292 const float * weights,
│ │ │ │ -
293 const float * duWeights,
│ │ │ │ -
294 const float * dvWeights,
│ │ │ │ -
295 int start, int end);
│ │ │ │ -
296
│ │ │ │ -
352 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
353 static bool EvalStencils(
│ │ │ │ -
354 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
355 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
356 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
357 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
358 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
359 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
360 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
361 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
362 const CudaEvaluator *instance = NULL,
│ │ │ │ -
363 void * deviceContext = NULL) {
│ │ │ │ -
364
│ │ │ │ -
365 (void)instance; // unused
│ │ │ │ -
366 (void)deviceContext; // unused
│ │ │ │ -
367
│ │ │ │ -
368 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
369 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
370 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
371 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
372 duuBuffer->BindCudaBuffer(), duuDesc,
│ │ │ │ -
373 duvBuffer->BindCudaBuffer(), duvDesc,
│ │ │ │ -
374 dvvBuffer->BindCudaBuffer(), dvvDesc,
│ │ │ │ -
375 (int const *)stencilTable->GetSizesBuffer(),
│ │ │ │ -
376 (int const *)stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
377 (int const *)stencilTable->GetIndicesBuffer(),
│ │ │ │ -
378 (float const *)stencilTable->GetWeightsBuffer(),
│ │ │ │ -
379 (float const *)stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
380 (float const *)stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
381 (float const *)stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ -
382 (float const *)stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ -
383 (float const *)stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ -
384 /*start = */ 0,
│ │ │ │ -
385 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
386 }
│ │ │ │ -
387
│ │ │ │ -
449 static bool EvalStencils(
│ │ │ │ -
450 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
451 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
452 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
453 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
454 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
455 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
456 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
457 const int * sizes,
│ │ │ │ -
458 const int * offsets,
│ │ │ │ -
459 const int * indices,
│ │ │ │ -
460 const float * weights,
│ │ │ │ -
461 const float * duWeights,
│ │ │ │ -
462 const float * dvWeights,
│ │ │ │ -
463 const float * duuWeights,
│ │ │ │ -
464 const float * duvWeights,
│ │ │ │ -
465 const float * dvvWeights,
│ │ │ │ -
466 int start, int end);
│ │ │ │ -
467
│ │ │ │ -
473
│ │ │ │ -
502 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
503 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
504 static bool EvalPatches(
│ │ │ │ -
505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
507 int numPatchCoords,
│ │ │ │ -
508 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
509 PATCH_TABLE *patchTable,
│ │ │ │ -
510 CudaEvaluator const *instance,
│ │ │ │ -
511 void * deviceContext = NULL) {
│ │ │ │ -
512
│ │ │ │ -
513 (void)instance; // unused
│ │ │ │ -
514 (void)deviceContext; // unused
│ │ │ │ -
515
│ │ │ │ -
516 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
517 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
518 numPatchCoords,
│ │ │ │ -
519 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
520 (const PatchArray *)patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
521 (const int *)patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
522 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
523 }
│ │ │ │ -
524
│ │ │ │ -
563 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
564 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
565 static bool EvalPatches(
│ │ │ │ -
566 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
567 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
568 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
569 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
570 int numPatchCoords,
│ │ │ │ -
571 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
572 PATCH_TABLE *patchTable,
│ │ │ │ -
573 CudaEvaluator const *instance,
│ │ │ │ -
574 void * deviceContext = NULL) {
│ │ │ │ -
575
│ │ │ │ -
576 (void)instance; // unused
│ │ │ │ -
577 (void)deviceContext; // unused
│ │ │ │ -
578
│ │ │ │ -
579 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
580 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
581 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
582 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
583 numPatchCoords,
│ │ │ │ -
584 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
585 (const PatchArray *)patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
586 (const int *)patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
587 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
588 }
│ │ │ │ -
589
│ │ │ │ -
646 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
647 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
648 static bool EvalPatches(
│ │ │ │ -
649 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
650 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
651 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
652 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
653 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
654 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
655 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
656 int numPatchCoords,
│ │ │ │ -
657 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
658 PATCH_TABLE *patchTable,
│ │ │ │ -
659 CudaEvaluator const *instance,
│ │ │ │ -
660 void * deviceContext = NULL) {
│ │ │ │ -
661
│ │ │ │ -
662 (void)instance; // unused
│ │ │ │ -
663 (void)deviceContext; // unused
│ │ │ │ -
664
│ │ │ │ -
665 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
666 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
667 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
668 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
669 duuBuffer->BindCudaBuffer(), duuDesc,
│ │ │ │ -
670 duvBuffer->BindCudaBuffer(), duvDesc,
│ │ │ │ -
671 dvvBuffer->BindCudaBuffer(), dvvDesc,
│ │ │ │ -
672 numPatchCoords,
│ │ │ │ -
673 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
674 (const PatchArray *)patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
675 (const int *)patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
676 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
677 }
│ │ │ │ -
678
│ │ │ │ -
706 static bool EvalPatches(
│ │ │ │ -
707 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
708 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
709 int numPatchCoords,
│ │ │ │ -
710 const PatchCoord *patchCoords,
│ │ │ │ -
711 const PatchArray *patchArrays,
│ │ │ │ -
712 const int *patchIndices,
│ │ │ │ -
713 const PatchParam *patchParams);
│ │ │ │ -
714
│ │ │ │ -
752 static bool EvalPatches(
│ │ │ │ -
753 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
754 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
755 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
756 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
757 int numPatchCoords,
│ │ │ │ -
758 PatchCoord const *patchCoords,
│ │ │ │ -
759 PatchArray const *patchArrays,
│ │ │ │ -
760 const int *patchIndices,
│ │ │ │ -
761 PatchParam const *patchParams);
│ │ │ │ -
762
│ │ │ │ -
815 static bool EvalPatches(
│ │ │ │ -
816 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
817 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
818 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
819 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
820 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
821 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
822 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
823 int numPatchCoords,
│ │ │ │ -
824 PatchCoord const *patchCoords,
│ │ │ │ -
825 PatchArray const *patchArrays,
│ │ │ │ -
826 const int *patchIndices,
│ │ │ │ -
827 PatchParam const *patchParams);
│ │ │ │ -
828
│ │ │ │ -
857 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
858 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
860 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
861 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
862 int numPatchCoords,
│ │ │ │ -
863 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
864 PATCH_TABLE *patchTable,
│ │ │ │ -
865 CudaEvaluator const *instance,
│ │ │ │ -
866 void * deviceContext = NULL) {
│ │ │ │ -
867
│ │ │ │ -
868 (void)instance; // unused
│ │ │ │ -
869 (void)deviceContext; // unused
│ │ │ │ -
870
│ │ │ │ -
871 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
872 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
873 numPatchCoords,
│ │ │ │ -
874 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
875 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
876 (const int *)patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
877 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
878 }
│ │ │ │ -
879
│ │ │ │ -
920 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
921 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
923 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
924 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
925 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
926 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
927 int numPatchCoords,
│ │ │ │ -
928 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
929 PATCH_TABLE *patchTable,
│ │ │ │ -
930 CudaEvaluator const *instance,
│ │ │ │ -
931 void * deviceContext = NULL) {
│ │ │ │ -
932
│ │ │ │ -
933 (void)instance; // unused
│ │ │ │ -
934 (void)deviceContext; // unused
│ │ │ │ -
935
│ │ │ │ -
936 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
937 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
938 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
939 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
940 numPatchCoords,
│ │ │ │ -
941 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
942 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
943 (const int *)patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
944 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
945 }
│ │ │ │ -
946
│ │ │ │ -
1005 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1006 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1008 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1009 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1010 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1011 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1012 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1013 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1014 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1015 int numPatchCoords,
│ │ │ │ -
1016 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1017 PATCH_TABLE *patchTable,
│ │ │ │ -
1018 CudaEvaluator const *instance,
│ │ │ │ -
1019 void * deviceContext = NULL) {
│ │ │ │ -
1020
│ │ │ │ -
1021 (void)instance; // unused
│ │ │ │ -
1022 (void)deviceContext; // unused
│ │ │ │ -
1023
│ │ │ │ -
1024 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
1025 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
1026 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
1027 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
1028 duuBuffer->BindCudaBuffer(), duuDesc,
│ │ │ │ -
1029 duvBuffer->BindCudaBuffer(), duvDesc,
│ │ │ │ -
1030 dvvBuffer->BindCudaBuffer(), dvvDesc,
│ │ │ │ -
1031 numPatchCoords,
│ │ │ │ -
1032 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
1033 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
1034 (const int *)patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1035 (const PatchParam *)patchTable->GetPatchParamBuffer());
│ │ │ │ -
1036 }
│ │ │ │ -
1037
│ │ │ │ -
1068 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1069 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1073 int numPatchCoords,
│ │ │ │ -
1074 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1075 PATCH_TABLE *patchTable,
│ │ │ │ -
1076 int fvarChannel,
│ │ │ │ -
1077 CudaEvaluator const *instance,
│ │ │ │ -
1078 void * deviceContext = NULL) {
│ │ │ │ -
1079
│ │ │ │ -
1080 (void)instance; // unused
│ │ │ │ -
1081 (void)deviceContext; // unused
│ │ │ │ -
1082
│ │ │ │ -
1083 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
1084 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
1085 numPatchCoords,
│ │ │ │ -
1086 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
1087 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1088 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1089 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1090 }
│ │ │ │ -
1091
│ │ │ │ -
1134 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1135 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1137 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1138 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1139 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1140 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1141 int numPatchCoords,
│ │ │ │ -
1142 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1143 PATCH_TABLE *patchTable,
│ │ │ │ -
1144 int fvarChannel,
│ │ │ │ -
1145 CudaEvaluator const *instance,
│ │ │ │ -
1146 void * deviceContext = NULL) {
│ │ │ │ -
1147
│ │ │ │ -
1148 (void)instance; // unused
│ │ │ │ -
1149 (void)deviceContext; // unused
│ │ │ │ -
1150
│ │ │ │ -
1151 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
1152 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
1153 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
1154 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
1155 numPatchCoords,
│ │ │ │ -
1156 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
1157 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1158 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1159 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1160 }
│ │ │ │ -
1161
│ │ │ │ -
1222 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1223 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1225 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1226 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1227 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1228 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1229 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1230 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1231 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1232 int numPatchCoords,
│ │ │ │ -
1233 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1234 PATCH_TABLE *patchTable,
│ │ │ │ -
1235 int fvarChannel,
│ │ │ │ -
1236 CudaEvaluator const *instance,
│ │ │ │ -
1237 void * deviceContext = NULL) {
│ │ │ │ -
1238
│ │ │ │ -
1239 (void)instance; // unused
│ │ │ │ -
1240 (void)deviceContext; // unused
│ │ │ │ -
1241
│ │ │ │ -
1242 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
│ │ │ │ -
1243 dstBuffer->BindCudaBuffer(), dstDesc,
│ │ │ │ -
1244 duBuffer->BindCudaBuffer(), duDesc,
│ │ │ │ -
1245 dvBuffer->BindCudaBuffer(), dvDesc,
│ │ │ │ -
1246 duuBuffer->BindCudaBuffer(), duuDesc,
│ │ │ │ -
1247 duvBuffer->BindCudaBuffer(), duvDesc,
│ │ │ │ -
1248 dvvBuffer->BindCudaBuffer(), dvvDesc,
│ │ │ │ -
1249 numPatchCoords,
│ │ │ │ -
1250 (const PatchCoord *)patchCoords->BindCudaBuffer(),
│ │ │ │ -
1251 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1252 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1253 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1254 }
│ │ │ │ -
1255
│ │ │ │ -
1261 static void Synchronize(void *deviceContext = NULL);
│ │ │ │ -
1262};
│ │ │ │ -
1263
│ │ │ │ -
1264
│ │ │ │ -
1265} // end namespace Osd
│ │ │ │ -
1266
│ │ │ │ -
1267} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
1268using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
1269
│ │ │ │ -
1270} // end namespace OpenSubdiv
│ │ │ │ -
1271
│ │ │ │ -
1272
│ │ │ │ -
1273#endif // OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
│ │ │ │ + │ │ │ │ +
46
│ │ │ │ + │ │ │ │ +
48
│ │ │ │ +
53 static std::string GetVertexShaderSource(
│ │ │ │ + │ │ │ │ + │ │ │ │ +
56 static std::string GetHullShaderSource(
│ │ │ │ + │ │ │ │ + │ │ │ │ +
59 static std::string GetDomainShaderSource(
│ │ │ │ + │ │ │ │ + │ │ │ │ +
62};
│ │ │ │ +
63
│ │ │ │ +
64} // end namespace Osd
│ │ │ │ +
65
│ │ │ │ +
66} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
67using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
68
│ │ │ │ +
69} // end namespace OpenSubdiv
│ │ │ │ +
70
│ │ │ │ +
71#endif // OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE
│ │ │ │ │ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ -
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
CudaStencilTable(Far::LimitStencilTable const *limitStencilTable)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static CudaStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
Definition: cudaEvaluator.h:59
│ │ │ │ - │ │ │ │ - │ │ │ │ -
CudaStencilTable(Far::StencilTable const *stencilTable)
│ │ │ │ -
static CudaStencilTable * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
Definition: cudaEvaluator.h:54
│ │ │ │ - │ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndices, const PatchParam *patchParams)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const CudaEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw cuda buffers for input and output.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const CudaEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndices, PatchParam const *patchParams)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const void *instance=NULL, void *deviceContext=NULL)
Generic static compute function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw cuda pointers for input and output.
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw cuda pointers for input and output.
│ │ │ │ -
static void Synchronize(void *deviceContext=NULL)
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndices, PatchParam const *patchParams)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
│ │ │ │ +
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
Deprecated.
│ │ │ │ +
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
│ │ │ │ +
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cudaEvaluator.h │ │ │ │ │ +mtlPatchShaderSource.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,740 +30,87 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H │ │ │ │ │ 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 32#include "../osd/types.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 28#import "../version.h" │ │ │ │ │ + 29#import "../far/patchDescriptor.h" │ │ │ │ │ + 30#import │ │ │ │ │ + 31 │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Osd { │ │ │ │ │ 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 class PatchTable; │ │ │ │ │ - 39 class StencilTable; │ │ │ │ │ - 40 class LimitStencilTable; │ │ │ │ │ - 41} │ │ │ │ │ +37class MTLPatchShaderSource { │ │ │ │ │ + 38 public: │ │ │ │ │ +39 static std::string GetCommonShaderSource(); │ │ │ │ │ + 40 │ │ │ │ │ +41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ +43 static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ 44 │ │ │ │ │ -52class CudaStencilTable { │ │ │ │ │ - 53public: │ │ │ │ │ -54 static CudaStencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ - 55 void *deviceContext = NULL) { │ │ │ │ │ - 56 (void)deviceContext; // unused │ │ │ │ │ - 57 return new CudaStencilTable(stencilTable); │ │ │ │ │ - 58 } │ │ │ │ │ -59 static CudaStencilTable *Create(Far::LimitStencilTable const │ │ │ │ │ -*limitStencilTable, │ │ │ │ │ - 60 void *deviceContext = NULL) { │ │ │ │ │ - 61 (void)deviceContext; // unused │ │ │ │ │ - 62 return new CudaStencilTable(limitStencilTable); │ │ │ │ │ - 63 } │ │ │ │ │ - 64 │ │ │ │ │ -65 explicit CudaStencilTable(Far::StencilTable const *stencilTable); │ │ │ │ │ -66 explicit CudaStencilTable(Far::LimitStencilTable const *limitStencilTable); │ │ │ │ │ -67 ~CudaStencilTable(); │ │ │ │ │ +45 static std::string GetHullShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ + 46 │ │ │ │ │ +47 static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ + 48 │ │ │ │ │ +53 static std::string GetVertexShaderSource( │ │ │ │ │ + 54 Far::PatchDescriptor::Type type, │ │ │ │ │ + 55 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ +56 static std::string GetHullShaderSource( │ │ │ │ │ + 57 Far::PatchDescriptor::Type type, │ │ │ │ │ + 58 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ +59 static std::string GetDomainShaderSource( │ │ │ │ │ + 60 Far::PatchDescriptor::Type type, │ │ │ │ │ + 61 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ + 62}; │ │ │ │ │ + 63 │ │ │ │ │ + 64} // end namespace Osd │ │ │ │ │ + 65 │ │ │ │ │ + 66} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 67using namespace OPENSUBDIV_VERSION; │ │ │ │ │ 68 │ │ │ │ │ - 69 // interfaces needed for CudaCompute │ │ │ │ │ -70 void *GetSizesBuffer() const { return _sizes; } │ │ │ │ │ -71 void *GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ -72 void *GetIndicesBuffer() const { return _indices; } │ │ │ │ │ -73 void *GetWeightsBuffer() const { return _weights; } │ │ │ │ │ -74 void *GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ -75 void *GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ -76 void *GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ -77 void *GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ -78 void *GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ -79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ - 80 │ │ │ │ │ - 81private: │ │ │ │ │ - 82 void * _sizes, │ │ │ │ │ - 83 * _offsets, │ │ │ │ │ - 84 * _indices, │ │ │ │ │ - 85 * _weights, │ │ │ │ │ - 86 * _duWeights, │ │ │ │ │ - 87 * _dvWeights, │ │ │ │ │ - 88 * _duuWeights, │ │ │ │ │ - 89 * _duvWeights, │ │ │ │ │ - 90 * _dvvWeights; │ │ │ │ │ - 91 int _numStencils; │ │ │ │ │ - 92}; │ │ │ │ │ - 93 │ │ │ │ │ -94class CudaEvaluator { │ │ │ │ │ - 95public: │ │ │ │ │ - 101 │ │ │ │ │ - 125 template │ │ │ │ │ -126 static bool EvalStencils( │ │ │ │ │ - 127 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 128 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 129 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 130 const void *instance = NULL, │ │ │ │ │ - 131 void * deviceContext = NULL) { │ │ │ │ │ - 132 │ │ │ │ │ - 133 (void)instance; // unused │ │ │ │ │ - 134 (void)deviceContext; // unused │ │ │ │ │ - 135 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 136 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 137 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ - 138 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 139 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 140 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 141 /*start = */ 0, │ │ │ │ │ - 142 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 143 } │ │ │ │ │ - 144 │ │ │ │ │ -171 static bool EvalStencils( │ │ │ │ │ - 172 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 173 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 174 const int * sizes, │ │ │ │ │ - 175 const int * offsets, │ │ │ │ │ - 176 const int * indices, │ │ │ │ │ - 177 const float * weights, │ │ │ │ │ - 178 int start, int end); │ │ │ │ │ - 179 │ │ │ │ │ - 217 template │ │ │ │ │ -218 static bool EvalStencils( │ │ │ │ │ - 219 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 220 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 221 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 222 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 223 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 224 const CudaEvaluator *instance = NULL, │ │ │ │ │ - 225 void * deviceContext = NULL) { │ │ │ │ │ - 226 │ │ │ │ │ - 227 (void)instance; // unused │ │ │ │ │ - 228 (void)deviceContext; // unused │ │ │ │ │ - 229 │ │ │ │ │ - 230 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 231 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 232 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 233 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 234 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ - 235 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 236 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 237 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 238 (float const *)stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 239 (float const *)stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 240 /*start = */ 0, │ │ │ │ │ - 241 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 242 } │ │ │ │ │ - 243 │ │ │ │ │ -284 static bool EvalStencils( │ │ │ │ │ - 285 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 286 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 287 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 288 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 289 const int * sizes, │ │ │ │ │ - 290 const int * offsets, │ │ │ │ │ - 291 const int * indices, │ │ │ │ │ - 292 const float * weights, │ │ │ │ │ - 293 const float * duWeights, │ │ │ │ │ - 294 const float * dvWeights, │ │ │ │ │ - 295 int start, int end); │ │ │ │ │ - 296 │ │ │ │ │ - 352 template │ │ │ │ │ -353 static bool EvalStencils( │ │ │ │ │ - 354 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 355 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 356 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 357 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 358 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 359 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 360 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 361 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 362 const CudaEvaluator *instance = NULL, │ │ │ │ │ - 363 void * deviceContext = NULL) { │ │ │ │ │ - 364 │ │ │ │ │ - 365 (void)instance; // unused │ │ │ │ │ - 366 (void)deviceContext; // unused │ │ │ │ │ - 367 │ │ │ │ │ - 368 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 369 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 370 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 371 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 372 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ - 373 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ - 374 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ - 375 (int const *)stencilTable->GetSizesBuffer(), │ │ │ │ │ - 376 (int const *)stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 377 (int const *)stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 378 (float const *)stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 379 (float const *)stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 380 (float const *)stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 381 (float const *)stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ - 382 (float const *)stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ - 383 (float const *)stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ - 384 /*start = */ 0, │ │ │ │ │ - 385 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 386 } │ │ │ │ │ - 387 │ │ │ │ │ -449 static bool EvalStencils( │ │ │ │ │ - 450 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 451 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 452 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 453 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 454 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 455 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 456 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 457 const int * sizes, │ │ │ │ │ - 458 const int * offsets, │ │ │ │ │ - 459 const int * indices, │ │ │ │ │ - 460 const float * weights, │ │ │ │ │ - 461 const float * duWeights, │ │ │ │ │ - 462 const float * dvWeights, │ │ │ │ │ - 463 const float * duuWeights, │ │ │ │ │ - 464 const float * duvWeights, │ │ │ │ │ - 465 const float * dvvWeights, │ │ │ │ │ - 466 int start, int end); │ │ │ │ │ - 467 │ │ │ │ │ - 473 │ │ │ │ │ - 502 template │ │ │ │ │ -504 static bool EvalPatches( │ │ │ │ │ - 505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 507 int numPatchCoords, │ │ │ │ │ - 508 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 509 PATCH_TABLE *patchTable, │ │ │ │ │ - 510 CudaEvaluator const *instance, │ │ │ │ │ - 511 void * deviceContext = NULL) { │ │ │ │ │ - 512 │ │ │ │ │ - 513 (void)instance; // unused │ │ │ │ │ - 514 (void)deviceContext; // unused │ │ │ │ │ - 515 │ │ │ │ │ - 516 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 517 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 518 numPatchCoords, │ │ │ │ │ - 519 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 520 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 521 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 522 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 523 } │ │ │ │ │ - 524 │ │ │ │ │ - 563 template │ │ │ │ │ -565 static bool EvalPatches( │ │ │ │ │ - 566 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 567 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 568 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 569 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 570 int numPatchCoords, │ │ │ │ │ - 571 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 572 PATCH_TABLE *patchTable, │ │ │ │ │ - 573 CudaEvaluator const *instance, │ │ │ │ │ - 574 void * deviceContext = NULL) { │ │ │ │ │ - 575 │ │ │ │ │ - 576 (void)instance; // unused │ │ │ │ │ - 577 (void)deviceContext; // unused │ │ │ │ │ - 578 │ │ │ │ │ - 579 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 580 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 581 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 582 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 583 numPatchCoords, │ │ │ │ │ - 584 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 585 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 586 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 587 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 588 } │ │ │ │ │ - 589 │ │ │ │ │ - 646 template │ │ │ │ │ -648 static bool EvalPatches( │ │ │ │ │ - 649 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 650 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 651 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 652 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 653 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 654 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 655 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 656 int numPatchCoords, │ │ │ │ │ - 657 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 658 PATCH_TABLE *patchTable, │ │ │ │ │ - 659 CudaEvaluator const *instance, │ │ │ │ │ - 660 void * deviceContext = NULL) { │ │ │ │ │ - 661 │ │ │ │ │ - 662 (void)instance; // unused │ │ │ │ │ - 663 (void)deviceContext; // unused │ │ │ │ │ - 664 │ │ │ │ │ - 665 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 666 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 667 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 668 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 669 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ - 670 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ - 671 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ - 672 numPatchCoords, │ │ │ │ │ - 673 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 674 (const PatchArray *)patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 675 (const int *)patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 676 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 677 } │ │ │ │ │ - 678 │ │ │ │ │ -706 static bool EvalPatches( │ │ │ │ │ - 707 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 708 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 709 int numPatchCoords, │ │ │ │ │ - 710 const PatchCoord *patchCoords, │ │ │ │ │ - 711 const PatchArray *patchArrays, │ │ │ │ │ - 712 const int *patchIndices, │ │ │ │ │ - 713 const PatchParam *patchParams); │ │ │ │ │ - 714 │ │ │ │ │ -752 static bool EvalPatches( │ │ │ │ │ - 753 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 754 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 755 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 756 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 757 int numPatchCoords, │ │ │ │ │ - 758 PatchCoord const *patchCoords, │ │ │ │ │ - 759 PatchArray const *patchArrays, │ │ │ │ │ - 760 const int *patchIndices, │ │ │ │ │ - 761 PatchParam const *patchParams); │ │ │ │ │ - 762 │ │ │ │ │ -815 static bool EvalPatches( │ │ │ │ │ - 816 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 817 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 818 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 819 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 820 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 821 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 822 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 823 int numPatchCoords, │ │ │ │ │ - 824 PatchCoord const *patchCoords, │ │ │ │ │ - 825 PatchArray const *patchArrays, │ │ │ │ │ - 826 const int *patchIndices, │ │ │ │ │ - 827 PatchParam const *patchParams); │ │ │ │ │ - 828 │ │ │ │ │ - 857 template │ │ │ │ │ -859 static bool EvalPatchesVarying( │ │ │ │ │ - 860 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 861 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 862 int numPatchCoords, │ │ │ │ │ - 863 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 864 PATCH_TABLE *patchTable, │ │ │ │ │ - 865 CudaEvaluator const *instance, │ │ │ │ │ - 866 void * deviceContext = NULL) { │ │ │ │ │ - 867 │ │ │ │ │ - 868 (void)instance; // unused │ │ │ │ │ - 869 (void)deviceContext; // unused │ │ │ │ │ - 870 │ │ │ │ │ - 871 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 872 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 873 numPatchCoords, │ │ │ │ │ - 874 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 875 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 876 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 877 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 878 } │ │ │ │ │ - 879 │ │ │ │ │ - 920 template │ │ │ │ │ -922 static bool EvalPatchesVarying( │ │ │ │ │ - 923 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 924 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 925 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 926 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 927 int numPatchCoords, │ │ │ │ │ - 928 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 929 PATCH_TABLE *patchTable, │ │ │ │ │ - 930 CudaEvaluator const *instance, │ │ │ │ │ - 931 void * deviceContext = NULL) { │ │ │ │ │ - 932 │ │ │ │ │ - 933 (void)instance; // unused │ │ │ │ │ - 934 (void)deviceContext; // unused │ │ │ │ │ - 935 │ │ │ │ │ - 936 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 937 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 938 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 939 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 940 numPatchCoords, │ │ │ │ │ - 941 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 942 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 943 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 944 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 945 } │ │ │ │ │ - 946 │ │ │ │ │ - 1005 template │ │ │ │ │ -1007 static bool EvalPatchesVarying( │ │ │ │ │ - 1008 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1009 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1010 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1011 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1012 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1013 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1014 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1015 int numPatchCoords, │ │ │ │ │ - 1016 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1017 PATCH_TABLE *patchTable, │ │ │ │ │ - 1018 CudaEvaluator const *instance, │ │ │ │ │ - 1019 void * deviceContext = NULL) { │ │ │ │ │ - 1020 │ │ │ │ │ - 1021 (void)instance; // unused │ │ │ │ │ - 1022 (void)deviceContext; // unused │ │ │ │ │ - 1023 │ │ │ │ │ - 1024 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 1025 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 1026 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 1027 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 1028 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ - 1029 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ - 1030 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ - 1031 numPatchCoords, │ │ │ │ │ - 1032 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 1033 (const PatchArray *)patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 1034 (const int *)patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1035 (const PatchParam *)patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1036 } │ │ │ │ │ - 1037 │ │ │ │ │ - 1068 template │ │ │ │ │ -1070 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1073 int numPatchCoords, │ │ │ │ │ - 1074 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1075 PATCH_TABLE *patchTable, │ │ │ │ │ - 1076 int fvarChannel, │ │ │ │ │ - 1077 CudaEvaluator const *instance, │ │ │ │ │ - 1078 void * deviceContext = NULL) { │ │ │ │ │ - 1079 │ │ │ │ │ - 1080 (void)instance; // unused │ │ │ │ │ - 1081 (void)deviceContext; // unused │ │ │ │ │ - 1082 │ │ │ │ │ - 1083 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 1084 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 1085 numPatchCoords, │ │ │ │ │ - 1086 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 1087 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1088 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1089 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1090 } │ │ │ │ │ - 1091 │ │ │ │ │ - 1134 template │ │ │ │ │ -1136 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1137 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1138 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1139 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1140 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1141 int numPatchCoords, │ │ │ │ │ - 1142 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1143 PATCH_TABLE *patchTable, │ │ │ │ │ - 1144 int fvarChannel, │ │ │ │ │ - 1145 CudaEvaluator const *instance, │ │ │ │ │ - 1146 void * deviceContext = NULL) { │ │ │ │ │ - 1147 │ │ │ │ │ - 1148 (void)instance; // unused │ │ │ │ │ - 1149 (void)deviceContext; // unused │ │ │ │ │ - 1150 │ │ │ │ │ - 1151 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 1152 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 1153 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 1154 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 1155 numPatchCoords, │ │ │ │ │ - 1156 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 1157 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1158 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1159 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1160 } │ │ │ │ │ - 1161 │ │ │ │ │ - 1222 template │ │ │ │ │ -1224 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1225 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1226 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1227 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1228 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1229 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1230 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1231 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1232 int numPatchCoords, │ │ │ │ │ - 1233 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1234 PATCH_TABLE *patchTable, │ │ │ │ │ - 1235 int fvarChannel, │ │ │ │ │ - 1236 CudaEvaluator const *instance, │ │ │ │ │ - 1237 void * deviceContext = NULL) { │ │ │ │ │ - 1238 │ │ │ │ │ - 1239 (void)instance; // unused │ │ │ │ │ - 1240 (void)deviceContext; // unused │ │ │ │ │ - 1241 │ │ │ │ │ - 1242 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc, │ │ │ │ │ - 1243 dstBuffer->BindCudaBuffer(), dstDesc, │ │ │ │ │ - 1244 duBuffer->BindCudaBuffer(), duDesc, │ │ │ │ │ - 1245 dvBuffer->BindCudaBuffer(), dvDesc, │ │ │ │ │ - 1246 duuBuffer->BindCudaBuffer(), duuDesc, │ │ │ │ │ - 1247 duvBuffer->BindCudaBuffer(), duvDesc, │ │ │ │ │ - 1248 dvvBuffer->BindCudaBuffer(), dvvDesc, │ │ │ │ │ - 1249 numPatchCoords, │ │ │ │ │ - 1250 (const PatchCoord *)patchCoords->BindCudaBuffer(), │ │ │ │ │ - 1251 (const PatchArray *)patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1252 (const int *)patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1253 (const PatchParam *)patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1254 } │ │ │ │ │ - 1255 │ │ │ │ │ -1261 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ - 1262}; │ │ │ │ │ - 1263 │ │ │ │ │ - 1264 │ │ │ │ │ - 1265} // end namespace Osd │ │ │ │ │ - 1266 │ │ │ │ │ - 1267} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 1268using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 1269 │ │ │ │ │ - 1270} // end namespace OpenSubdiv │ │ │ │ │ - 1271 │ │ │ │ │ - 1272 │ │ │ │ │ - 1273#endif // OPENSUBDIV3_OSD_CUDA_EVALUATOR_H │ │ │ │ │ + 69} // end namespace OpenSubdiv │ │ │ │ │ + 70 │ │ │ │ │ + 71#endif // OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ -Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:583 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable │ │ │ │ │ -CUDA stencil table. │ │ │ │ │ -Definition: cudaEvaluator.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuvWeightsBuffer │ │ │ │ │ -void * GetDuvWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::~CudaStencilTable │ │ │ │ │ -~CudaStencilTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuWeightsBuffer │ │ │ │ │ -void * GetDuWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDvvWeightsBuffer │ │ │ │ │ -void * GetDvvWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetOffsetsBuffer │ │ │ │ │ -void * GetOffsetsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::CudaStencilTable │ │ │ │ │ -CudaStencilTable(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDvWeightsBuffer │ │ │ │ │ -void * GetDvWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetNumStencils │ │ │ │ │ -int GetNumStencils() const │ │ │ │ │ -Definition: cudaEvaluator.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetDuuWeightsBuffer │ │ │ │ │ -void * GetDuuWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetWeightsBuffer │ │ │ │ │ -void * GetWeightsBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::Create │ │ │ │ │ -static CudaStencilTable * Create(Far::LimitStencilTable const │ │ │ │ │ -*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ -Definition: cudaEvaluator.h:59 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetSizesBuffer │ │ │ │ │ -void * GetSizesBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::GetIndicesBuffer │ │ │ │ │ -void * GetIndicesBuffer() const │ │ │ │ │ -Definition: cudaEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::CudaStencilTable │ │ │ │ │ -CudaStencilTable(Far::StencilTable const *stencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaStencilTable::Create │ │ │ │ │ -static CudaStencilTable * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Definition: cudaEvaluator.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator │ │ │ │ │ -Definition: cudaEvaluator.h:94 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ -PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ -*patchIndices, const PatchParam *patchParams) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:922 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: cudaEvaluator.h:648 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -const CudaEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: cudaEvaluator.h:353 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ -Static eval stencils function which takes raw cuda buffers for input and │ │ │ │ │ -output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:859 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ -CudaEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: cudaEvaluator.h:218 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ -const *patchCoords, PatchArray const *patchArrays, const int *patchIndices, │ │ │ │ │ -PatchParam const *patchParams) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CudaEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:1136 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, const void *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static compute function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: cudaEvaluator.h:126 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw cuda pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ -float *dvvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw cuda pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ -PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ -*patchIndices, PatchParam const *patchParams) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:1007 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:504 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:1224 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: cudaEvaluator.h:565 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, CudaEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cudaEvaluator.h:1070 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ -Coordinates set on a patch table. │ │ │ │ │ -Definition: types.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ -Definition: types.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ -Definition: types.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource │ │ │ │ │ +Definition: mtlPatchShaderSource.h:37 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetVertexShaderSource │ │ │ │ │ +static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource::GetHullShaderSource │ │ │ │ │ +static std::string GetHullShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ +PatchDescriptor::Type fvarType) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetDomainShaderSource │ │ │ │ │ +static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetVertexShaderSource │ │ │ │ │ +static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ +PatchDescriptor::Type fvarType) │ │ │ │ │ +Deprecated. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetDomainShaderSource │ │ │ │ │ +static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ +PatchDescriptor::Type fvarType) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource::GetHullShaderSource │ │ │ │ │ +static std::string GetHullShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetPatchBasisShaderSource │ │ │ │ │ +static std::string GetPatchBasisShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ +GetCommonShaderSource │ │ │ │ │ +static std::string GetCommonShaderSource() │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cudaEvaluator.h │ │ │ │ │ + * mtlPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00794.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/opencl.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlMesh.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,24 +80,44 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
opencl.h File Reference
│ │ │ │ +
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs
│ │ │ │ +
mtlMesh.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <CL/opencl.h>
│ │ │ │ +
#include "../version.h"
│ │ │ │ +#include "../osd/mesh.h"
│ │ │ │ +#include "../osd/mtlPatchTable.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

typedef MeshInterface< MTLPatchTable > MTLMeshInterface
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,14 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -opencl.h File Reference │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Typedefs │ │ │ │ │ +mtlMesh.h File Reference │ │ │ │ │ +#include "../version.h" │ │ │ │ │ +#include "../osd/mesh.h" │ │ │ │ │ +#include "../osd/mtlPatchTable.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Namespaces │ │ │ │ │ +namespace  OpenSubdiv │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +  │ │ │ │ │ + Typedefs │ │ │ │ │ +typedef MeshInterface< MTLPatchTable > MTLMeshInterface │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * opencl.h │ │ │ │ │ + * mtlMesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00794_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/opencl.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlMesh.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
opencl.h
│ │ │ │ +
mtlMesh.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2014 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,32 +107,44 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_OPENCL_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_OPENCL_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │
27
│ │ │ │ -
28#if defined(OPENSUBDIV_HAS_CLEW)
│ │ │ │ -
29# include <clew.h>
│ │ │ │ -
30#else
│ │ │ │ -
31# if defined(__APPLE__)
│ │ │ │ -
32# include <OpenCL/opencl.h>
│ │ │ │ -
33# else
│ │ │ │ -
34# include <CL/opencl.h>
│ │ │ │ -
35# endif
│ │ │ │ -
36#endif
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29#include "../osd/mesh.h"
│ │ │ │ +
30#include "../osd/mtlPatchTable.h"
│ │ │ │ +
31
│ │ │ │ +
32
│ │ │ │ +
33namespace OpenSubdiv {
│ │ │ │ +
34namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35
│ │ │ │ +
36namespace Osd {
│ │ │ │
37
│ │ │ │ -
38#endif // OPENSUBDIV3_OSD_CL_UTIL_H
│ │ │ │ + │ │ │ │ +
39
│ │ │ │ +
40} // end namespace Osd
│ │ │ │ +
41
│ │ │ │ +
42} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
43using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
44
│ │ │ │ +
45} // end namespace OpenSubdiv
│ │ │ │ +
46
│ │ │ │ +
47#endif // OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │ + │ │ │ │ +
MeshInterface< MTLPatchTable > MTLMeshInterface
Definition: mtlMesh.h:38
│ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -opencl.h │ │ │ │ │ +mtlMesh.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2014 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,25 +30,41 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_OPENCL_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_OPENCL_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ 27 │ │ │ │ │ - 28#if defined(OPENSUBDIV_HAS_CLEW) │ │ │ │ │ - 29# include │ │ │ │ │ - 30#else │ │ │ │ │ - 31# if defined(__APPLE__) │ │ │ │ │ - 32# include │ │ │ │ │ - 33# else │ │ │ │ │ - 34# include │ │ │ │ │ - 35# endif │ │ │ │ │ - 36#endif │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29#include "../osd/mesh.h" │ │ │ │ │ + 30#include "../osd/mtlPatchTable.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32 │ │ │ │ │ + 33namespace OpenSubdiv { │ │ │ │ │ + 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Osd { │ │ │ │ │ 37 │ │ │ │ │ - 38#endif // OPENSUBDIV3_OSD_CL_UTIL_H │ │ │ │ │ +38typedef MeshInterface MTLMeshInterface; │ │ │ │ │ + 39 │ │ │ │ │ + 40} // end namespace Osd │ │ │ │ │ + 41 │ │ │ │ │ + 42} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 43using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 44 │ │ │ │ │ + 45} // end namespace OpenSubdiv │ │ │ │ │ + 46 │ │ │ │ │ + 47#endif // OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ +OpenSubdiv │ │ │ │ │ +Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLMeshInterface │ │ │ │ │ +MeshInterface< MTLPatchTable > MTLMeshInterface │ │ │ │ │ +Definition: mtlMesh.h:38 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ +Definition: mesh.h:68 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * opencl.h │ │ │ │ │ + * mtlMesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00797.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clVertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,41 +83,45 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
clVertexBuffer.h File Reference
│ │ │ │ +
mtlPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opencl.h"
│ │ │ │ +#include "../far/patchDescriptor.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include "../osd/mtlCommon.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CLVertexBuffer
 Concrete vertex buffer class for OpenCL subdivision. More...
class  MTLPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,26 +5,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -clVertexBuffer.h File Reference │ │ │ │ │ +mtlPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/opencl.h" │ │ │ │ │ +#include "../far/patchDescriptor.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include "../osd/mtlCommon.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CLVertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for OpenCL subdivision. More... │ │ │ │ │ +class  MTLPatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clVertexBuffer.h │ │ │ │ │ + * mtlPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00797.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00797 = [ │ │ │ │ │ - ["CLVertexBuffer", "a01149.html", "a01149"] │ │ │ │ │ + ["MTLPatchTable", "a01297.html", "a01297"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00797_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
clVertexBuffer.h
│ │ │ │ +
mtlPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,89 +107,119 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../osd/opencl.h"
│ │ │ │ -
30
│ │ │ │ -
31namespace OpenSubdiv {
│ │ │ │ -
32namespace OPENSUBDIV_VERSION {
│ │ │ │ +
29#include "../far/patchDescriptor.h"
│ │ │ │ +
30#include "../osd/nonCopyable.h"
│ │ │ │ +
31#include "../osd/types.h"
│ │ │ │ +
32#include "../osd/mtlCommon.h"
│ │ │ │
33
│ │ │ │ -
34namespace Osd {
│ │ │ │ -
35
│ │ │ │ - │ │ │ │ +
34@protocol MTLDevice;
│ │ │ │ +
35@protocol MTLBuffer;
│ │ │ │ +
36
│ │ │ │ +
37namespace OpenSubdiv {
│ │ │ │ +
38namespace OPENSUBDIV_VERSION {
│ │ │ │ +
39
│ │ │ │ +
40namespace Far {
│ │ │ │ +
41 class PatchTable;
│ │ │ │ +
42};
│ │ │ │
43
│ │ │ │ -
44public:
│ │ │ │ -
46 static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext);
│ │ │ │ -
47
│ │ │ │ -
48 template <typename DEVICE_CONTEXT>
│ │ │ │ -
49 static CLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
50 DEVICE_CONTEXT context) {
│ │ │ │ -
51 return Create(numElements, numVertices, context->GetContext());
│ │ │ │ -
52 }
│ │ │ │ -
53
│ │ │ │ - │ │ │ │ -
56
│ │ │ │ -
59 void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue,
│ │ │ │ -
60 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* endEvent = NULL);
│ │ │ │ -
61
│ │ │ │ -
62 template<typename DEVICE_CONTEXT>
│ │ │ │ -
63 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
64 DEVICE_CONTEXT context,
│ │ │ │ -
65 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* endEvent = NULL) {
│ │ │ │ -
66 UpdateData(src, startVertex, numVertices, context->GetCommandQueue(), startEvents, numStartEvents, endEvent);
│ │ │ │ -
67 }
│ │ │ │ -
68
│ │ │ │ -
70 int GetNumElements() const;
│ │ │ │ -
71
│ │ │ │ -
73 int GetNumVertices() const;
│ │ │ │ -
74
│ │ │ │ -
76 cl_mem BindCLBuffer(cl_command_queue queue);
│ │ │ │ +
44namespace Osd {
│ │ │ │ +
45
│ │ │ │ +
46class MTLPatchTable : private NonCopyable<MTLPatchTable> {
│ │ │ │ +
47public:
│ │ │ │ +
48 typedef id<MTLBuffer> VertexBufferBinding;
│ │ │ │ +
49
│ │ │ │ + │ │ │ │ + │ │ │ │ +
52
│ │ │ │ +
53 template<typename DEVICE_CONTEXT>
│ │ │ │ +
54 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ +
55 {
│ │ │ │ +
56 return Create(farPatchTable, context);
│ │ │ │ +
57 }
│ │ │ │ +
58
│ │ │ │ +
59 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, MTLContext* context);
│ │ │ │ +
60
│ │ │ │ +
61 PatchArrayVector const &GetPatchArrays() const { return _patchArrays; }
│ │ │ │ +
62 id<MTLBuffer> GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │ +
63 id<MTLBuffer> GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ +
64
│ │ │ │ + │ │ │ │ +
66 id<MTLBuffer> GetVaryingPatchIndexBuffer() const { return _varyingPatchIndexBuffer; }
│ │ │ │ +
67
│ │ │ │ +
68 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ +
69 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const { return _fvarPatchArrays[fvarChannel]; }
│ │ │ │ +
70 id<MTLBuffer> GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return _fvarIndexBuffers[fvarChannel]; }
│ │ │ │ +
71 id<MTLBuffer> GetFVarPatchParamBuffer(int fvarChannel = 0) const { return _fvarParamBuffers[fvarChannel]; }
│ │ │ │ +
72
│ │ │ │ +
73protected:
│ │ │ │ +
74 bool allocate(Far::PatchTable const *farPatchTable, MTLContext* context);
│ │ │ │ +
75
│ │ │ │ + │ │ │ │
77
│ │ │ │ -
78protected:
│ │ │ │ -
80 CLVertexBuffer(int numElements, int numVertices, cl_context clContext);
│ │ │ │ -
81
│ │ │ │ -
84 bool allocate(cl_context clContext);
│ │ │ │ -
85
│ │ │ │ -
86private:
│ │ │ │ -
87 int _numElements;
│ │ │ │ -
88 int _numVertices;
│ │ │ │ -
89 cl_mem _clMemory;
│ │ │ │ -
90};
│ │ │ │ +
78 id<MTLBuffer> _indexBuffer;
│ │ │ │ +
79 id<MTLBuffer> _patchParamBuffer;
│ │ │ │ +
80
│ │ │ │ + │ │ │ │ +
82
│ │ │ │ + │ │ │ │ +
84
│ │ │ │ +
85 std::vector<PatchArrayVector> _fvarPatchArrays;
│ │ │ │ +
86 std::vector<id<MTLBuffer>> _fvarIndexBuffers;
│ │ │ │ +
87 std::vector<id<MTLBuffer>> _fvarParamBuffers;
│ │ │ │ +
88};
│ │ │ │ +
89
│ │ │ │ +
90} // end namespace Osd
│ │ │ │
91
│ │ │ │ -
92} // end namespace Osd
│ │ │ │ -
93
│ │ │ │ -
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
92} //end namespace OPENSUBDIV_VERSION
│ │ │ │ +
93using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
94
│ │ │ │ +
95} //end namespace OpenSubdiv
│ │ │ │
96
│ │ │ │ -
97} // end namespace OpenSubdiv
│ │ │ │ -
98
│ │ │ │ -
99#endif // OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
│ │ │ │ +
97#endif //end OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for OpenCL subdivision.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
│ │ │ │ - │ │ │ │ -
CLVertexBuffer(int numElements, int numVertices, cl_context clContext)
Constructor.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
│ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ - │ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext)
Creator. Returns NULL if error.
│ │ │ │ -
static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT context)
│ │ │ │ -
cl_mem BindCLBuffer(cl_command_queue queue)
Returns the CL memory object.
│ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ + │ │ │ │ +
PatchArrayVector const & GetPatchArrays() const
Definition: mtlPatchTable.h:61
│ │ │ │ +
bool allocate(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ +
static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ + │ │ │ │ +
std::vector< id< MTLBuffer > > _fvarIndexBuffers
Definition: mtlPatchTable.h:86
│ │ │ │ +
id< MTLBuffer > GetFVarPatchParamBuffer(int fvarChannel=0) const
Definition: mtlPatchTable.h:71
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const
Definition: mtlPatchTable.h:69
│ │ │ │ + │ │ │ │ +
std::vector< id< MTLBuffer > > _fvarParamBuffers
Definition: mtlPatchTable.h:87
│ │ │ │ +
std::vector< PatchArrayVector > _fvarPatchArrays
Definition: mtlPatchTable.h:85
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
Definition: mtlPatchTable.h:54
│ │ │ │ + │ │ │ │ +
id< MTLBuffer > GetFVarPatchIndexBuffer(int fvarChannel=0) const
Definition: mtlPatchTable.h:70
│ │ │ │ +
PatchArrayVector const & GetVaryingPatchArrays() const
Definition: mtlPatchTable.h:65
│ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -clVertexBuffer.h │ │ │ │ │ +mtlPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,114 +30,170 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/opencl.h" │ │ │ │ │ - 30 │ │ │ │ │ - 31namespace OpenSubdiv { │ │ │ │ │ - 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 29#include "../far/patchDescriptor.h" │ │ │ │ │ + 30#include "../osd/nonCopyable.h" │ │ │ │ │ + 31#include "../osd/types.h" │ │ │ │ │ + 32#include "../osd/mtlCommon.h" │ │ │ │ │ 33 │ │ │ │ │ - 34namespace Osd { │ │ │ │ │ - 35 │ │ │ │ │ -42class CLVertexBuffer { │ │ │ │ │ + 34@protocol MTLDevice; │ │ │ │ │ + 35@protocol MTLBuffer; │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace OpenSubdiv { │ │ │ │ │ + 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 39 │ │ │ │ │ + 40namespace Far { │ │ │ │ │ + 41 class PatchTable; │ │ │ │ │ + 42}; │ │ │ │ │ 43 │ │ │ │ │ - 44public: │ │ │ │ │ -46 static CLVertexBuffer * Create(int numElements, int numVertices, cl_context │ │ │ │ │ -clContext); │ │ │ │ │ - 47 │ │ │ │ │ - 48 template │ │ │ │ │ -49 static CLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 50 DEVICE_CONTEXT context) { │ │ │ │ │ - 51 return Create(numElements, numVertices, context->GetContext()); │ │ │ │ │ - 52 } │ │ │ │ │ - 53 │ │ │ │ │ -55 ~CLVertexBuffer(); │ │ │ │ │ - 56 │ │ │ │ │ -59 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ -cl_command_queue clQueue, │ │ │ │ │ - 60 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* │ │ │ │ │ -endEvent = NULL); │ │ │ │ │ - 61 │ │ │ │ │ - 62 template │ │ │ │ │ -63 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 64 DEVICE_CONTEXT context, │ │ │ │ │ - 65 cl_event* startEvents = NULL, unsigned int numStartEvents = 0, cl_event* │ │ │ │ │ -endEvent = NULL) { │ │ │ │ │ - 66 UpdateData(src, startVertex, numVertices, context->GetCommandQueue(), │ │ │ │ │ -startEvents, numStartEvents, endEvent); │ │ │ │ │ - 67 } │ │ │ │ │ - 68 │ │ │ │ │ -70 int GetNumElements() const; │ │ │ │ │ - 71 │ │ │ │ │ -73 int GetNumVertices() const; │ │ │ │ │ - 74 │ │ │ │ │ -76 cl_mem BindCLBuffer(cl_command_queue queue); │ │ │ │ │ + 44namespace Osd { │ │ │ │ │ + 45 │ │ │ │ │ +46class MTLPatchTable : private NonCopyable { │ │ │ │ │ + 47public: │ │ │ │ │ +48 typedef id VertexBufferBinding; │ │ │ │ │ + 49 │ │ │ │ │ +50 MTLPatchTable(); │ │ │ │ │ +51 ~MTLPatchTable(); │ │ │ │ │ + 52 │ │ │ │ │ + 53 template │ │ │ │ │ +54 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ + 55 { │ │ │ │ │ + 56 return Create(farPatchTable, context); │ │ │ │ │ + 57 } │ │ │ │ │ + 58 │ │ │ │ │ +59 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ +MTLContext* context); │ │ │ │ │ + 60 │ │ │ │ │ +61 PatchArrayVector const &GetPatchArrays() const { return _patchArrays; } │ │ │ │ │ +62 id GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ +63 id GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ + 64 │ │ │ │ │ +65 PatchArrayVector const &GetVaryingPatchArrays() const { return │ │ │ │ │ +_varyingPatchArrays; } │ │ │ │ │ +66 id GetVaryingPatchIndexBuffer() const { return │ │ │ │ │ +_varyingPatchIndexBuffer; } │ │ │ │ │ + 67 │ │ │ │ │ +68 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ +69 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const │ │ │ │ │ +{ return _fvarPatchArrays[fvarChannel]; } │ │ │ │ │ +70 id GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return │ │ │ │ │ +_fvarIndexBuffers[fvarChannel]; } │ │ │ │ │ +71 id GetFVarPatchParamBuffer(int fvarChannel = 0) const { return │ │ │ │ │ +_fvarParamBuffers[fvarChannel]; } │ │ │ │ │ + 72 │ │ │ │ │ + 73protected: │ │ │ │ │ +74 bool allocate(Far::PatchTable const *farPatchTable, MTLContext* context); │ │ │ │ │ + 75 │ │ │ │ │ +76 PatchArrayVector _patchArrays; │ │ │ │ │ 77 │ │ │ │ │ - 78protected: │ │ │ │ │ -80 CLVertexBuffer(int numElements, int numVertices, cl_context clContext); │ │ │ │ │ - 81 │ │ │ │ │ -84 bool allocate(cl_context clContext); │ │ │ │ │ - 85 │ │ │ │ │ - 86private: │ │ │ │ │ - 87 int _numElements; │ │ │ │ │ - 88 int _numVertices; │ │ │ │ │ - 89 cl_mem _clMemory; │ │ │ │ │ - 90}; │ │ │ │ │ +78 id _indexBuffer; │ │ │ │ │ +79 id _patchParamBuffer; │ │ │ │ │ + 80 │ │ │ │ │ +81 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ + 82 │ │ │ │ │ +83 id _varyingPatchIndexBuffer; │ │ │ │ │ + 84 │ │ │ │ │ +85 std::vector _fvarPatchArrays; │ │ │ │ │ +86 std::vector> _fvarIndexBuffers; │ │ │ │ │ +87 std::vector> _fvarParamBuffers; │ │ │ │ │ + 88}; │ │ │ │ │ + 89 │ │ │ │ │ + 90} // end namespace Osd │ │ │ │ │ 91 │ │ │ │ │ - 92} // end namespace Osd │ │ │ │ │ - 93 │ │ │ │ │ - 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 92} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 93using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 94 │ │ │ │ │ + 95} //end namespace OpenSubdiv │ │ │ │ │ 96 │ │ │ │ │ - 97} // end namespace OpenSubdiv │ │ │ │ │ - 98 │ │ │ │ │ - 99#endif // OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H │ │ │ │ │ + 97#endif //end OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer │ │ │ │ │ -Concrete vertex buffer class for OpenCL subdivision. │ │ │ │ │ -Definition: clVertexBuffer.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ -DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int │ │ │ │ │ -numStartEvents=0, cl_event *endEvent=NULL) │ │ │ │ │ -Definition: clVertexBuffer.h:63 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::~CLVertexBuffer │ │ │ │ │ -~CLVertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::CLVertexBuffer │ │ │ │ │ -CLVertexBuffer(int numElements, int numVertices, cl_context clContext) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ -cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int │ │ │ │ │ -numStartEvents=0, cl_event *endEvent=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::allocate │ │ │ │ │ -bool allocate(cl_context clContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::GetNumVertices │ │ │ │ │ -int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::Create │ │ │ │ │ -static CLVertexBuffer * Create(int numElements, int numVertices, cl_context │ │ │ │ │ -clContext) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::Create │ │ │ │ │ -static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT │ │ │ │ │ -context) │ │ │ │ │ -Definition: clVertexBuffer.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLVertexBuffer::BindCLBuffer │ │ │ │ │ -cl_mem BindCLBuffer(cl_command_queue queue) │ │ │ │ │ -Returns the CL memory object. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ +Definition: mtlCommon.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable │ │ │ │ │ +Definition: mtlPatchTable.h:46 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchArrays │ │ │ │ │ +PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ +Definition: mtlPatchTable.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::allocate │ │ │ │ │ +bool allocate(Far::PatchTable const *farPatchTable, MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::Create │ │ │ │ │ +static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext │ │ │ │ │ +*context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ +id< MTLBuffer > GetVaryingPatchIndexBuffer() const │ │ │ │ │ +Definition: mtlPatchTable.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarIndexBuffers │ │ │ │ │ +std::vector< id< MTLBuffer > > _fvarIndexBuffers │ │ │ │ │ +Definition: mtlPatchTable.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ +id< MTLBuffer > GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ +Definition: mtlPatchTable.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::MTLPatchTable │ │ │ │ │ +MTLPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchParamBuffer │ │ │ │ │ +id< MTLBuffer > GetPatchParamBuffer() const │ │ │ │ │ +Definition: mtlPatchTable.h:63 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchIndexBuffer │ │ │ │ │ +id< MTLBuffer > GetPatchIndexBuffer() const │ │ │ │ │ +Definition: mtlPatchTable.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_patchArrays │ │ │ │ │ +PatchArrayVector _patchArrays │ │ │ │ │ +Definition: mtlPatchTable.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::VertexBufferBinding │ │ │ │ │ +id< MTLBuffer > VertexBufferBinding │ │ │ │ │ +Definition: mtlPatchTable.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Definition: mtlPatchTable.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchArrays │ │ │ │ │ +PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const │ │ │ │ │ +Definition: mtlPatchTable.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_varyingPatchIndexBuffer │ │ │ │ │ +id< MTLBuffer > _varyingPatchIndexBuffer │ │ │ │ │ +Definition: mtlPatchTable.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarParamBuffers │ │ │ │ │ +std::vector< id< MTLBuffer > > _fvarParamBuffers │ │ │ │ │ +Definition: mtlPatchTable.h:87 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarPatchArrays │ │ │ │ │ +std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ +Definition: mtlPatchTable.h:85 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_patchParamBuffer │ │ │ │ │ +id< MTLBuffer > _patchParamBuffer │ │ │ │ │ +Definition: mtlPatchTable.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_varyingPatchArrays │ │ │ │ │ +PatchArrayVector _varyingPatchArrays │ │ │ │ │ +Definition: mtlPatchTable.h:81 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::Create │ │ │ │ │ +static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ +Definition: mtlPatchTable.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::~MTLPatchTable │ │ │ │ │ +~MTLPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ +id< MTLBuffer > GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ +Definition: mtlPatchTable.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetVaryingPatchArrays │ │ │ │ │ +PatchArrayVector const & GetVaryingPatchArrays() const │ │ │ │ │ +Definition: mtlPatchTable.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_indexBuffer │ │ │ │ │ +id< MTLBuffer > _indexBuffer │ │ │ │ │ +Definition: mtlPatchTable.h:78 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clVertexBuffer.h │ │ │ │ │ + * mtlPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00800.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlLegacyGregoryPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,46 +83,42 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
clPatchTable.h File Reference
│ │ │ │ +
mtlLegacyGregoryPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opencl.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ #include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include <vector>
│ │ │ │ +#include "../osd/mtlCommon.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CLPatchTable
 CL patch table. More...
class  MTLLegacyGregoryPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,31 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -clPatchTable.h File Reference │ │ │ │ │ +mtlLegacyGregoryPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/opencl.h" │ │ │ │ │ +#include "../far/patchTable.h" │ │ │ │ │ #include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../osd/mtlCommon.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CLPatchTable │ │ │ │ │ -  CL patch table. More... │ │ │ │ │ +class  MTLLegacyGregoryPatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clPatchTable.h │ │ │ │ │ + * mtlLegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00800.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00800 = [ │ │ │ │ │ - ["CLPatchTable", "a01145.html", "a01145"] │ │ │ │ │ + ["MTLLegacyGregoryPatchTable", "a01289.html", "a01289"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00800_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlLegacyGregoryPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
clPatchTable.h
│ │ │ │ +
mtlLegacyGregoryPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,120 +107,100 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include "../osd/opencl.h"
│ │ │ │ -
31#include "../osd/nonCopyable.h"
│ │ │ │ -
32#include "../osd/types.h"
│ │ │ │ -
33
│ │ │ │ -
34#include <vector>
│ │ │ │ +
29#include "../far/patchTable.h"
│ │ │ │ +
30#include "../osd/nonCopyable.h"
│ │ │ │ +
31#include "../osd/mtlCommon.h"
│ │ │ │ +
32
│ │ │ │ +
33@protocol MTLDevice;
│ │ │ │ +
34@protocol MTLBuffer;
│ │ │ │
35
│ │ │ │
36namespace OpenSubdiv {
│ │ │ │
37namespace OPENSUBDIV_VERSION {
│ │ │ │
38
│ │ │ │ -
39namespace Far{
│ │ │ │ -
40 class PatchTable;
│ │ │ │ -
41};
│ │ │ │ -
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ -
44
│ │ │ │ -
52class CLPatchTable : private NonCopyable<CLPatchTable> {
│ │ │ │ -
53public:
│ │ │ │ -
55 static CLPatchTable *Create(Far::PatchTable const *patchTable,
│ │ │ │ -
56 cl_context clContext);
│ │ │ │ -
57
│ │ │ │ -
58 template <typename DEVICE_CONTEXT>
│ │ │ │ -
59 static CLPatchTable * Create(Far::PatchTable const *patchTable,
│ │ │ │ -
60 DEVICE_CONTEXT context) {
│ │ │ │ -
61 return Create(patchTable, context->GetContext());
│ │ │ │ -
62 }
│ │ │ │ -
63
│ │ │ │ - │ │ │ │ -
66
│ │ │ │ -
68 cl_mem GetPatchArrayBuffer() const { return _patchArrays; }
│ │ │ │ -
69
│ │ │ │ -
71 cl_mem GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │ -
72
│ │ │ │ -
74 cl_mem GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ -
75
│ │ │ │ - │ │ │ │ -
78
│ │ │ │ - │ │ │ │ -
81
│ │ │ │ -
83 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ +
39namespace Osd {
│ │ │ │ +
40
│ │ │ │ + │ │ │ │ +
42: private NonCopyable<MTLLegacyGregoryPatchTable>
│ │ │ │ +
43{
│ │ │ │ +
44public:
│ │ │ │ + │ │ │ │ +
46
│ │ │ │ +
47 template<typename DEVICE_CONTEXT>
│ │ │ │ +
48 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* farPatchTable, DEVICE_CONTEXT context) {
│ │ │ │ +
49 return Create(farPatchTable, context);
│ │ │ │ +
50 }
│ │ │ │ +
51
│ │ │ │ +
52 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* farPatchTable, MTLContext* context);
│ │ │ │ +
53
│ │ │ │ +
54 void UpdateVertexBuffer(id<MTLBuffer> vbo, int numVertices, int numVertexElements, MTLContext* context);
│ │ │ │ +
55
│ │ │ │ +
56 id<MTLBuffer> GetVertexBuffer() const
│ │ │ │ +
57 {
│ │ │ │ +
58 return _vertexBuffer;
│ │ │ │ +
59 }
│ │ │ │ +
60
│ │ │ │ +
61 id<MTLBuffer> GetVertexValenceBuffer() const
│ │ │ │ +
62 {
│ │ │ │ +
63 return _vertexValenceBuffer;
│ │ │ │ +
64 }
│ │ │ │ +
65
│ │ │ │ +
66 id<MTLBuffer> GetQuadOffsetsBuffer() const
│ │ │ │ +
67 {
│ │ │ │ +
68 return _quadOffsetsBuffer;
│ │ │ │ +
69 }
│ │ │ │ +
70
│ │ │ │ + │ │ │ │ +
72 {
│ │ │ │ + │ │ │ │ +
74 return _quadOffsetsBase[1];
│ │ │ │ +
75 return _quadOffsetsBase[0];
│ │ │ │ +
76 }
│ │ │ │ +
77
│ │ │ │ +
78private:
│ │ │ │ +
79 id<MTLBuffer> _vertexBuffer;
│ │ │ │ +
80 id<MTLBuffer> _vertexValenceBuffer;
│ │ │ │ +
81 id<MTLBuffer> _quadOffsetsBuffer;
│ │ │ │ +
82 int _quadOffsetsBase[2];
│ │ │ │ +
83};
│ │ │ │
84
│ │ │ │ -
86 cl_mem GetFVarPatchArrayBuffer(int fvarChannel = 0) const { return _fvarPatchArrays[fvarChannel]; }
│ │ │ │ -
87
│ │ │ │ -
89 cl_mem GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return _fvarIndexBuffers[fvarChannel]; }
│ │ │ │ -
90
│ │ │ │ -
92 cl_mem GetFVarPatchParamBuffer(int fvarChannel = 0) const { return _fvarParamBuffers[fvarChannel]; }
│ │ │ │ -
93
│ │ │ │ -
94protected:
│ │ │ │ - │ │ │ │ -
96
│ │ │ │ -
97 bool allocate(Far::PatchTable const *patchTable, cl_context clContext);
│ │ │ │ -
98
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
102
│ │ │ │ - │ │ │ │ - │ │ │ │ -
105
│ │ │ │ -
106 std::vector<cl_mem> _fvarPatchArrays;
│ │ │ │ -
107 std::vector<cl_mem> _fvarIndexBuffers;
│ │ │ │ -
108 std::vector<cl_mem> _fvarParamBuffers;
│ │ │ │ -
109
│ │ │ │ -
110};
│ │ │ │ -
111
│ │ │ │ -
112} // end namespace Osd
│ │ │ │ -
113
│ │ │ │ -
114} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
115using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
116
│ │ │ │ -
117} // end namespace OpenSubdiv
│ │ │ │ -
118
│ │ │ │ -
119#endif // OPENSUBDIV3_OSD_CL_PATCH_TABLE_H
│ │ │ │ +
85} //end namespace Osd
│ │ │ │ +
86
│ │ │ │ +
87} //end namespace OPENSUBDIV_VERSION
│ │ │ │ +
88using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
89
│ │ │ │ +
90} //end namespace OpenSuddiv
│ │ │ │ +
91
│ │ │ │ +
92#endif // OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
cl_mem GetPatchParamBuffer() const
Returns the CL memory of the array of Osd::PatchParam buffer.
Definition: clPatchTable.h:74
│ │ │ │ - │ │ │ │ -
cl_mem GetFVarPatchArrayBuffer(int fvarChannel=0) const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:86
│ │ │ │ -
cl_mem GetPatchArrayBuffer() const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:68
│ │ │ │ -
static CLPatchTable * Create(Far::PatchTable const *patchTable, cl_context clContext)
Creator. Returns NULL if error.
│ │ │ │ - │ │ │ │ -
cl_mem GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the CL memory of the face-varying control vertices.
Definition: clPatchTable.h:89
│ │ │ │ - │ │ │ │ -
cl_mem GetVaryingPatchIndexBuffer() const
Returns the CL memory of the varying control vertices.
Definition: clPatchTable.h:80
│ │ │ │ -
int GetNumFVarChannels() const
Returns the number of face-varying channel buffers.
Definition: clPatchTable.h:83
│ │ │ │ -
cl_mem GetPatchIndexBuffer() const
Returns the CL memory of the patch control vertices.
Definition: clPatchTable.h:71
│ │ │ │ -
static CLPatchTable * Create(Far::PatchTable const *patchTable, DEVICE_CONTEXT context)
Definition: clPatchTable.h:59
│ │ │ │ -
cl_mem GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the CL memory of the array of Osd::PatchParam buffer.
Definition: clPatchTable.h:92
│ │ │ │ - │ │ │ │ -
bool allocate(Far::PatchTable const *patchTable, cl_context clContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
cl_mem GetVaryingPatchArrayBuffer() const
Returns the CL memory of the array of Osd::PatchArray buffer.
Definition: clPatchTable.h:77
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ +
void UpdateVertexBuffer(id< MTLBuffer > vbo, int numVertices, int numVertexElements, MTLContext *context)
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -clPatchTable.h │ │ │ │ │ +mtlLegacyGregoryPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,174 +30,127 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include "../osd/opencl.h" │ │ │ │ │ - 31#include "../osd/nonCopyable.h" │ │ │ │ │ - 32#include "../osd/types.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34#include │ │ │ │ │ + 29#include "../far/patchTable.h" │ │ │ │ │ + 30#include "../osd/nonCopyable.h" │ │ │ │ │ + 31#include "../osd/mtlCommon.h" │ │ │ │ │ + 32 │ │ │ │ │ + 33@protocol MTLDevice; │ │ │ │ │ + 34@protocol MTLBuffer; │ │ │ │ │ 35 │ │ │ │ │ 36namespace OpenSubdiv { │ │ │ │ │ 37namespace OPENSUBDIV_VERSION { │ │ │ │ │ 38 │ │ │ │ │ - 39namespace Far{ │ │ │ │ │ - 40 class PatchTable; │ │ │ │ │ - 41}; │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ - 44 │ │ │ │ │ -52class CLPatchTable : private NonCopyable { │ │ │ │ │ - 53public: │ │ │ │ │ -55 static CLPatchTable *Create(Far::PatchTable const *patchTable, │ │ │ │ │ - 56 cl_context clContext); │ │ │ │ │ - 57 │ │ │ │ │ - 58 template │ │ │ │ │ -59 static CLPatchTable * Create(Far::PatchTable const *patchTable, │ │ │ │ │ - 60 DEVICE_CONTEXT context) { │ │ │ │ │ - 61 return Create(patchTable, context->GetContext()); │ │ │ │ │ - 62 } │ │ │ │ │ - 63 │ │ │ │ │ -65 ~CLPatchTable(); │ │ │ │ │ - 66 │ │ │ │ │ -68 cl_mem GetPatchArrayBuffer() const { return _patchArrays; } │ │ │ │ │ - 69 │ │ │ │ │ -71 cl_mem GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ - 72 │ │ │ │ │ -74 cl_mem GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ - 75 │ │ │ │ │ -77 cl_mem GetVaryingPatchArrayBuffer() const { return _varyingPatchArrays; } │ │ │ │ │ - 78 │ │ │ │ │ -80 cl_mem GetVaryingPatchIndexBuffer() const { return _varyingIndexBuffer; } │ │ │ │ │ - 81 │ │ │ │ │ -83 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ + 39namespace Osd { │ │ │ │ │ + 40 │ │ │ │ │ +41class MTLLegacyGregoryPatchTable │ │ │ │ │ + 42: private NonCopyable │ │ │ │ │ + 43{ │ │ │ │ │ + 44public: │ │ │ │ │ +45 ~MTLLegacyGregoryPatchTable(); │ │ │ │ │ + 46 │ │ │ │ │ + 47 template │ │ │ │ │ +48 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* │ │ │ │ │ +farPatchTable, DEVICE_CONTEXT context) { │ │ │ │ │ + 49 return Create(farPatchTable, context); │ │ │ │ │ + 50 } │ │ │ │ │ + 51 │ │ │ │ │ +52 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* │ │ │ │ │ +farPatchTable, MTLContext* context); │ │ │ │ │ + 53 │ │ │ │ │ +54 void UpdateVertexBuffer(id vbo, int numVertices, int │ │ │ │ │ +numVertexElements, MTLContext* context); │ │ │ │ │ + 55 │ │ │ │ │ +56 id GetVertexBuffer() const │ │ │ │ │ + 57 { │ │ │ │ │ + 58 return _vertexBuffer; │ │ │ │ │ + 59 } │ │ │ │ │ + 60 │ │ │ │ │ +61 id GetVertexValenceBuffer() const │ │ │ │ │ + 62 { │ │ │ │ │ + 63 return _vertexValenceBuffer; │ │ │ │ │ + 64 } │ │ │ │ │ + 65 │ │ │ │ │ +66 id GetQuadOffsetsBuffer() const │ │ │ │ │ + 67 { │ │ │ │ │ + 68 return _quadOffsetsBuffer; │ │ │ │ │ + 69 } │ │ │ │ │ + 70 │ │ │ │ │ +71 int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ + 72 { │ │ │ │ │ + 73 if(type == Far::PatchDescriptor::GREGORY_BOUNDARY) │ │ │ │ │ + 74 return _quadOffsetsBase[1]; │ │ │ │ │ + 75 return _quadOffsetsBase[0]; │ │ │ │ │ + 76 } │ │ │ │ │ + 77 │ │ │ │ │ + 78private: │ │ │ │ │ + 79 id _vertexBuffer; │ │ │ │ │ + 80 id _vertexValenceBuffer; │ │ │ │ │ + 81 id _quadOffsetsBuffer; │ │ │ │ │ + 82 int _quadOffsetsBase[2]; │ │ │ │ │ + 83}; │ │ │ │ │ 84 │ │ │ │ │ -86 cl_mem GetFVarPatchArrayBuffer(int fvarChannel = 0) const { return │ │ │ │ │ -_fvarPatchArrays[fvarChannel]; } │ │ │ │ │ - 87 │ │ │ │ │ -89 cl_mem GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return │ │ │ │ │ -_fvarIndexBuffers[fvarChannel]; } │ │ │ │ │ - 90 │ │ │ │ │ -92 cl_mem GetFVarPatchParamBuffer(int fvarChannel = 0) const { return │ │ │ │ │ -_fvarParamBuffers[fvarChannel]; } │ │ │ │ │ - 93 │ │ │ │ │ - 94protected: │ │ │ │ │ -95 CLPatchTable(); │ │ │ │ │ - 96 │ │ │ │ │ -97 bool allocate(Far::PatchTable const *patchTable, cl_context clContext); │ │ │ │ │ - 98 │ │ │ │ │ -99 cl_mem _patchArrays; │ │ │ │ │ -100 cl_mem _indexBuffer; │ │ │ │ │ -101 cl_mem _patchParamBuffer; │ │ │ │ │ - 102 │ │ │ │ │ -103 cl_mem _varyingPatchArrays; │ │ │ │ │ -104 cl_mem _varyingIndexBuffer; │ │ │ │ │ - 105 │ │ │ │ │ -106 std::vector _fvarPatchArrays; │ │ │ │ │ -107 std::vector _fvarIndexBuffers; │ │ │ │ │ -108 std::vector _fvarParamBuffers; │ │ │ │ │ - 109 │ │ │ │ │ - 110}; │ │ │ │ │ - 111 │ │ │ │ │ - 112} // end namespace Osd │ │ │ │ │ - 113 │ │ │ │ │ - 114} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 115using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 116 │ │ │ │ │ - 117} // end namespace OpenSubdiv │ │ │ │ │ - 118 │ │ │ │ │ - 119#endif // OPENSUBDIV3_OSD_CL_PATCH_TABLE_H │ │ │ │ │ + 85} //end namespace Osd │ │ │ │ │ + 86 │ │ │ │ │ + 87} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 88using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 89 │ │ │ │ │ + 90} //end namespace OpenSuddiv │ │ │ │ │ + 91 │ │ │ │ │ + 92#endif // OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ +@ GREGORY_BOUNDARY │ │ │ │ │ +Definition: patchDescriptor.h:61 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ Container for arrays of parametric patches. │ │ │ │ │ Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable │ │ │ │ │ -CL patch table. │ │ │ │ │ -Definition: clPatchTable.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarPatchArrays │ │ │ │ │ -std::vector< cl_mem > _fvarPatchArrays │ │ │ │ │ -Definition: clPatchTable.h:106 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::~CLPatchTable │ │ │ │ │ -~CLPatchTable() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_patchParamBuffer │ │ │ │ │ -cl_mem _patchParamBuffer │ │ │ │ │ -Definition: clPatchTable.h:101 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchParamBuffer │ │ │ │ │ -cl_mem GetPatchParamBuffer() const │ │ │ │ │ -Returns the CL memory of the array of Osd::PatchParam buffer. │ │ │ │ │ -Definition: clPatchTable.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_indexBuffer │ │ │ │ │ -cl_mem _indexBuffer │ │ │ │ │ -Definition: clPatchTable.h:100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ -cl_mem GetFVarPatchArrayBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: clPatchTable.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchArrayBuffer │ │ │ │ │ -cl_mem GetPatchArrayBuffer() const │ │ │ │ │ -Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: clPatchTable.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::Create │ │ │ │ │ -static CLPatchTable * Create(Far::PatchTable const *patchTable, cl_context │ │ │ │ │ -clContext) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_patchArrays │ │ │ │ │ -cl_mem _patchArrays │ │ │ │ │ -Definition: clPatchTable.h:99 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ -cl_mem GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the CL memory of the face-varying control vertices. │ │ │ │ │ -Definition: clPatchTable.h:89 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_varyingIndexBuffer │ │ │ │ │ -cl_mem _varyingIndexBuffer │ │ │ │ │ -Definition: clPatchTable.h:104 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ -cl_mem GetVaryingPatchIndexBuffer() const │ │ │ │ │ -Returns the CL memory of the varying control vertices. │ │ │ │ │ -Definition: clPatchTable.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Returns the number of face-varying channel buffers. │ │ │ │ │ -Definition: clPatchTable.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetPatchIndexBuffer │ │ │ │ │ -cl_mem GetPatchIndexBuffer() const │ │ │ │ │ -Returns the CL memory of the patch control vertices. │ │ │ │ │ -Definition: clPatchTable.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::Create │ │ │ │ │ -static CLPatchTable * Create(Far::PatchTable const *patchTable, DEVICE_CONTEXT │ │ │ │ │ -context) │ │ │ │ │ -Definition: clPatchTable.h:59 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ -cl_mem GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the CL memory of the array of Osd::PatchParam buffer. │ │ │ │ │ -Definition: clPatchTable.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::CLPatchTable │ │ │ │ │ -CLPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::allocate │ │ │ │ │ -bool allocate(Far::PatchTable const *patchTable, cl_context clContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarParamBuffers │ │ │ │ │ -std::vector< cl_mem > _fvarParamBuffers │ │ │ │ │ -Definition: clPatchTable.h:108 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_fvarIndexBuffers │ │ │ │ │ -std::vector< cl_mem > _fvarIndexBuffers │ │ │ │ │ -Definition: clPatchTable.h:107 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::_varyingPatchArrays │ │ │ │ │ -cl_mem _varyingPatchArrays │ │ │ │ │ -Definition: clPatchTable.h:103 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ -cl_mem GetVaryingPatchArrayBuffer() const │ │ │ │ │ -Returns the CL memory of the array of Osd::PatchArray buffer. │ │ │ │ │ -Definition: clPatchTable.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ +Definition: mtlCommon.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:43 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsBase │ │ │ │ │ +int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable::Create │ │ │ │ │ +static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ +*farPatchTable, DEVICE_CONTEXT context) │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +GetVertexValenceBuffer │ │ │ │ │ +id< MTLBuffer > GetVertexValenceBuffer() const │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsBuffer │ │ │ │ │ +id< MTLBuffer > GetQuadOffsetsBuffer() const │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable::Create │ │ │ │ │ +static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ +*farPatchTable, MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +UpdateVertexBuffer │ │ │ │ │ +void UpdateVertexBuffer(id< MTLBuffer > vbo, int numVertices, int │ │ │ │ │ +numVertexElements, MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +~MTLLegacyGregoryPatchTable │ │ │ │ │ +~MTLLegacyGregoryPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ +GetVertexBuffer │ │ │ │ │ +id< MTLBuffer > GetVertexBuffer() const │ │ │ │ │ +Definition: mtlLegacyGregoryPatchTable.h:56 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clPatchTable.h │ │ │ │ │ + * mtlLegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00803.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlComputeEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,30 +83,29 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
clEvaluator.h File Reference
│ │ │ │ +
mtlComputeEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opencl.h"
│ │ │ │ #include "../osd/types.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/mtlCommon.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CLStencilTable
 OpenCL stencil table. More...
class  MTLStencilTable
 
class  CLEvaluator
class  MTLComputeEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -117,13 +116,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -clEvaluator.h File Reference │ │ │ │ │ +mtlComputeEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/opencl.h" │ │ │ │ │ #include "../osd/types.h" │ │ │ │ │ #include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/mtlCommon.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CLStencilTable │ │ │ │ │ -  OpenCL stencil table. More... │ │ │ │ │ +class  MTLStencilTable │ │ │ │ │   │ │ │ │ │ -class  CLEvaluator │ │ │ │ │ +class  MTLComputeEvaluator │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clEvaluator.h │ │ │ │ │ + * mtlComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00803.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,4 @@ │ │ │ │ │ var a00803 = [ │ │ │ │ │ - ["CLStencilTable", "a01137.html", "a01137"], │ │ │ │ │ - ["CLEvaluator", "a01141.html", "a01141"] │ │ │ │ │ + ["MTLStencilTable", "a01281.html", "a01281"], │ │ │ │ │ + ["MTLComputeEvaluator", "a01285.html", "a01285"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00803_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/clEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlComputeEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
clEvaluator.h
│ │ │ │ +
mtlComputeEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,1217 +107,1084 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/opencl.h"
│ │ │ │ -
31#include "../osd/types.h"
│ │ │ │ -
32#include "../osd/bufferDescriptor.h"
│ │ │ │ +
30#include "../osd/types.h"
│ │ │ │ +
31#include "../osd/bufferDescriptor.h"
│ │ │ │ +
32#include "../osd/mtlCommon.h"
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38 class PatchTable;
│ │ │ │ -
39 class StencilTable;
│ │ │ │ -
40 class LimitStencilTable;
│ │ │ │ -
41}
│ │ │ │ -
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ -
44
│ │ │ │ - │ │ │ │ -
53public:
│ │ │ │ -
54 template <typename DEVICE_CONTEXT>
│ │ │ │ -
55 static CLStencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ -
56 DEVICE_CONTEXT context) {
│ │ │ │ -
57 return new CLStencilTable(stencilTable, context->GetContext());
│ │ │ │ +
34@protocol MTLDevice;
│ │ │ │ +
35@protocol MTLBuffer;
│ │ │ │ +
36@protocol MTLLibrary;
│ │ │ │ +
37@protocol MTLComputePipelineState;
│ │ │ │ +
38
│ │ │ │ +
39namespace OpenSubdiv {
│ │ │ │ +
40namespace OPENSUBDIV_VERSION {
│ │ │ │ +
41
│ │ │ │ +
42namespace Far {
│ │ │ │ +
43 class PatchTable;
│ │ │ │ +
44 class StencilTable;
│ │ │ │ +
45 class LimitStencilTable;
│ │ │ │ +
46}
│ │ │ │ +
47
│ │ │ │ +
48namespace Osd {
│ │ │ │ +
49
│ │ │ │ + │ │ │ │ +
51{
│ │ │ │ +
52public:
│ │ │ │ +
53 template<typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ +
54 static MTLStencilTable* Create(STENCIL_TABLE* stencilTable,
│ │ │ │ +
55 DEVICE_CONTEXT context)
│ │ │ │ +
56 {
│ │ │ │ +
57 return new MTLStencilTable(stencilTable, context);
│ │ │ │
58 }
│ │ │ │
59
│ │ │ │ -
60 template <typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
62 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ -
63 DEVICE_CONTEXT context) {
│ │ │ │ -
64 return new CLStencilTable(limitStencilTable, context->GetContext());
│ │ │ │ -
65 }
│ │ │ │ -
66
│ │ │ │ -
67 CLStencilTable(Far::StencilTable const *stencilTable,
│ │ │ │ -
68 cl_context clContext);
│ │ │ │ -
69 CLStencilTable(Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ -
70 cl_context clContext);
│ │ │ │ - │ │ │ │ -
72
│ │ │ │ -
73 // interfaces needed for CLComputeKernel
│ │ │ │ -
74 cl_mem GetSizesBuffer() const { return _sizes; }
│ │ │ │ -
75 cl_mem GetOffsetsBuffer() const { return _offsets; }
│ │ │ │ -
76 cl_mem GetIndicesBuffer() const { return _indices; }
│ │ │ │ -
77 cl_mem GetWeightsBuffer() const { return _weights; }
│ │ │ │ -
78 cl_mem GetDuWeightsBuffer() const { return _duWeights; }
│ │ │ │ -
79 cl_mem GetDvWeightsBuffer() const { return _dvWeights; }
│ │ │ │ -
80 cl_mem GetDuuWeightsBuffer() const { return _duuWeights; }
│ │ │ │ -
81 cl_mem GetDuvWeightsBuffer() const { return _duvWeights; }
│ │ │ │ -
82 cl_mem GetDvvWeightsBuffer() const { return _dvvWeights; }
│ │ │ │ -
83 int GetNumStencils() const { return _numStencils; }
│ │ │ │ -
84
│ │ │ │ -
85private:
│ │ │ │ -
86 cl_mem _sizes;
│ │ │ │ -
87 cl_mem _offsets;
│ │ │ │ -
88 cl_mem _indices;
│ │ │ │ -
89 cl_mem _weights;
│ │ │ │ -
90 cl_mem _duWeights;
│ │ │ │ -
91 cl_mem _dvWeights;
│ │ │ │ -
92 cl_mem _duuWeights;
│ │ │ │ -
93 cl_mem _duvWeights;
│ │ │ │ -
94 cl_mem _dvvWeights;
│ │ │ │ -
95 int _numStencils;
│ │ │ │ -
96};
│ │ │ │ -
97
│ │ │ │ -
98// ---------------------------------------------------------------------------
│ │ │ │ -
99
│ │ │ │ - │ │ │ │ -
101public:
│ │ │ │ -
102 typedef bool Instantiatable;
│ │ │ │ -
103
│ │ │ │ -
105 template <typename DEVICE_CONTEXT>
│ │ │ │ -
106 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
107 BufferDescriptor const &dstDesc,
│ │ │ │ -
108 BufferDescriptor const &duDesc,
│ │ │ │ -
109 BufferDescriptor const &dvDesc,
│ │ │ │ -
110 DEVICE_CONTEXT deviceContext) {
│ │ │ │ -
111 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
112 deviceContext->GetContext(),
│ │ │ │ -
113 deviceContext->GetCommandQueue());
│ │ │ │ -
114 }
│ │ │ │ -
115
│ │ │ │ -
116 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
117 BufferDescriptor const &dstDesc,
│ │ │ │ -
118 BufferDescriptor const &duDesc,
│ │ │ │ -
119 BufferDescriptor const &dvDesc,
│ │ │ │ -
120 cl_context clContext,
│ │ │ │ -
121 cl_command_queue clCommandQueue) {
│ │ │ │ -
122 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
│ │ │ │ -
123 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
│ │ │ │ -
124 return instance;
│ │ │ │ -
125 delete instance;
│ │ │ │ -
126 return NULL;
│ │ │ │ -
127 }
│ │ │ │ -
128
│ │ │ │ -
130 template <typename DEVICE_CONTEXT>
│ │ │ │ -
131 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
132 BufferDescriptor const &dstDesc,
│ │ │ │ -
133 BufferDescriptor const &duDesc,
│ │ │ │ -
134 BufferDescriptor const &dvDesc,
│ │ │ │ -
135 BufferDescriptor const &duuDesc,
│ │ │ │ -
136 BufferDescriptor const &duvDesc,
│ │ │ │ -
137 BufferDescriptor const &dvvDesc,
│ │ │ │ -
138 DEVICE_CONTEXT deviceContext) {
│ │ │ │ -
139 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
140 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
141 deviceContext->GetContext(),
│ │ │ │ -
142 deviceContext->GetCommandQueue());
│ │ │ │ -
143 }
│ │ │ │ -
144
│ │ │ │ -
145 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
146 BufferDescriptor const &dstDesc,
│ │ │ │ -
147 BufferDescriptor const &duDesc,
│ │ │ │ -
148 BufferDescriptor const &dvDesc,
│ │ │ │ -
149 BufferDescriptor const &duuDesc,
│ │ │ │ -
150 BufferDescriptor const &duvDesc,
│ │ │ │ -
151 BufferDescriptor const &dvvDesc,
│ │ │ │ -
152 cl_context clContext,
│ │ │ │ -
153 cl_command_queue clCommandQueue) {
│ │ │ │ -
154 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
│ │ │ │ -
155 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
156 duuDesc, duvDesc, dvvDesc))
│ │ │ │ -
157 return instance;
│ │ │ │ -
158 delete instance;
│ │ │ │ -
159 return NULL;
│ │ │ │ -
160 }
│ │ │ │ -
161
│ │ │ │ -
163 CLEvaluator(cl_context context, cl_command_queue queue);
│ │ │ │ -
164
│ │ │ │ - │ │ │ │ -
167
│ │ │ │ -
173
│ │ │ │ -
217 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
218 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ -
219 static bool EvalStencils(
│ │ │ │ -
220 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
221 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
222 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
223 CLEvaluator const *instance,
│ │ │ │ -
224 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
225 unsigned int numStartEvents=0,
│ │ │ │ -
226 const cl_event* startEvents=NULL,
│ │ │ │ -
227 cl_event* endEvent=NULL) {
│ │ │ │ +
60
│ │ │ │ +
61 MTLStencilTable(Far::StencilTable const* stencilTable, MTLContext* context);
│ │ │ │ +
62 MTLStencilTable(Far::LimitStencilTable const* stencilTable, MTLContext* context);
│ │ │ │ + │ │ │ │ +
64
│ │ │ │ +
65 id<MTLBuffer> GetSizesBuffer() const { return _sizesBuffer; }
│ │ │ │ +
66 id<MTLBuffer> GetOffsetsBuffer() const { return _offsetsBuffer; }
│ │ │ │ +
67 id<MTLBuffer> GetIndicesBuffer() const { return _indicesBuffer; }
│ │ │ │ +
68 id<MTLBuffer> GetWeightsBuffer() const { return _weightsBuffer; }
│ │ │ │ +
69 id<MTLBuffer> GetDuWeightsBuffer() const { return _duWeightsBuffer; }
│ │ │ │ +
70 id<MTLBuffer> GetDvWeightsBuffer() const { return _dvWeightsBuffer; }
│ │ │ │ +
71 id<MTLBuffer> GetDuuWeightsBuffer() const { return _duuWeightsBuffer; }
│ │ │ │ +
72 id<MTLBuffer> GetDuvWeightsBuffer() const { return _duvWeightsBuffer; }
│ │ │ │ +
73 id<MTLBuffer> GetDvvWeightsBuffer() const { return _dvvWeightsBuffer; }
│ │ │ │ +
74
│ │ │ │ +
75 int GetNumStencils() const { return _numStencils; }
│ │ │ │ +
76
│ │ │ │ +
77private:
│ │ │ │ +
78 id<MTLBuffer> _sizesBuffer;
│ │ │ │ +
79 id<MTLBuffer> _offsetsBuffer;
│ │ │ │ +
80 id<MTLBuffer> _indicesBuffer;
│ │ │ │ +
81 id<MTLBuffer> _weightsBuffer;
│ │ │ │ +
82 id<MTLBuffer> _duWeightsBuffer;
│ │ │ │ +
83 id<MTLBuffer> _dvWeightsBuffer;
│ │ │ │ +
84 id<MTLBuffer> _duuWeightsBuffer;
│ │ │ │ +
85 id<MTLBuffer> _duvWeightsBuffer;
│ │ │ │ +
86 id<MTLBuffer> _dvvWeightsBuffer;
│ │ │ │ +
87
│ │ │ │ +
88 int _numStencils;
│ │ │ │ +
89};
│ │ │ │ +
90
│ │ │ │ + │ │ │ │ +
92{
│ │ │ │ +
93public:
│ │ │ │ +
94 typedef bool Instantiatable;
│ │ │ │ +
95
│ │ │ │ + │ │ │ │ +
97 BufferDescriptor const &dstDesc,
│ │ │ │ +
98 BufferDescriptor const &duDesc,
│ │ │ │ +
99 BufferDescriptor const &dvDesc,
│ │ │ │ +
100 MTLContext* context);
│ │ │ │ +
101
│ │ │ │ + │ │ │ │ +
103 BufferDescriptor const &dstDesc,
│ │ │ │ +
104 BufferDescriptor const &duDesc,
│ │ │ │ +
105 BufferDescriptor const &dvDesc,
│ │ │ │ +
106 BufferDescriptor const &duuDesc,
│ │ │ │ +
107 BufferDescriptor const &duvDesc,
│ │ │ │ +
108 BufferDescriptor const &dvvDesc,
│ │ │ │ +
109 MTLContext* context);
│ │ │ │ +
110
│ │ │ │ + │ │ │ │ + │ │ │ │ +
113
│ │ │ │ +
119
│ │ │ │ +
148 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
149 static bool EvalStencils(
│ │ │ │ +
150 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
151 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
152 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
153 MTLComputeEvaluator const *instance,
│ │ │ │ +
154 MTLContext* context)
│ │ │ │ +
155 {
│ │ │ │ +
156 if (instance) {
│ │ │ │ +
157 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
158 dstBuffer, dstDesc,
│ │ │ │ +
159 stencilTable,
│ │ │ │ +
160 context);
│ │ │ │ +
161 } else {
│ │ │ │ +
162 // Create an instance on demand (slow)
│ │ │ │ +
163 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
166 context);
│ │ │ │ +
167 if (instance) {
│ │ │ │ +
168 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
169 dstBuffer, dstDesc,
│ │ │ │ +
170 stencilTable,
│ │ │ │ +
171 context);
│ │ │ │ +
172 delete instance;
│ │ │ │ +
173 return r;
│ │ │ │ +
174 }
│ │ │ │ +
175 return false;
│ │ │ │ +
176 }
│ │ │ │ +
177 }
│ │ │ │ +
178
│ │ │ │ +
219 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
220 static bool EvalStencils(
│ │ │ │ +
221 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
222 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
223 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
224 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
225 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
226 MTLComputeEvaluator const *instance,
│ │ │ │ +
227 MTLContext* context) {
│ │ │ │
228
│ │ │ │
229 if (instance) {
│ │ │ │ -
230 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
230 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │
231 dstBuffer, dstDesc,
│ │ │ │ -
232 stencilTable,
│ │ │ │ -
233 numStartEvents, startEvents, endEvent);
│ │ │ │ -
234 } else {
│ │ │ │ -
235 // Create an instance on demand (slow)
│ │ │ │ -
236 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
239 deviceContext);
│ │ │ │ -
240 if (instance) {
│ │ │ │ -
241 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
242 dstBuffer, dstDesc,
│ │ │ │ -
243 stencilTable,
│ │ │ │ -
244 numStartEvents, startEvents, endEvent);
│ │ │ │ -
245 delete instance;
│ │ │ │ -
246 return r;
│ │ │ │ -
247 }
│ │ │ │ -
248 return false;
│ │ │ │ -
249 }
│ │ │ │ -
250 }
│ │ │ │ -
251
│ │ │ │ -
307 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
308 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ -
309 static bool EvalStencils(
│ │ │ │ -
310 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
311 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
312 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
313 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
314 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
315 CLEvaluator const *instance,
│ │ │ │ -
316 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
317 unsigned int numStartEvents=0,
│ │ │ │ -
318 const cl_event* startEvents=NULL,
│ │ │ │ -
319 cl_event* endEvent=NULL) {
│ │ │ │ -
320
│ │ │ │ -
321 if (instance) {
│ │ │ │ -
322 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
323 dstBuffer, dstDesc,
│ │ │ │ -
324 duBuffer, duDesc,
│ │ │ │ -
325 dvBuffer, dvDesc,
│ │ │ │ -
326 stencilTable,
│ │ │ │ -
327 numStartEvents, startEvents, endEvent);
│ │ │ │ -
328 } else {
│ │ │ │ -
329 // Create an instance on demand (slow)
│ │ │ │ -
330 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
331 deviceContext);
│ │ │ │ -
332 if (instance) {
│ │ │ │ -
333 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
334 dstBuffer, dstDesc,
│ │ │ │ -
335 duBuffer, duDesc,
│ │ │ │ -
336 dvBuffer, dvDesc,
│ │ │ │ -
337 stencilTable,
│ │ │ │ -
338 numStartEvents, startEvents, endEvent);
│ │ │ │ -
339 delete instance;
│ │ │ │ -
340 return r;
│ │ │ │ -
341 }
│ │ │ │ -
342 return false;
│ │ │ │ -
343 }
│ │ │ │ -
344 }
│ │ │ │ -
345
│ │ │ │ -
419 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
420 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ -
421 static bool EvalStencils(
│ │ │ │ -
422 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
423 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
424 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
425 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
426 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
427 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
428 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
429 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
430 CLEvaluator const *instance,
│ │ │ │ -
431 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
432 unsigned int numStartEvents=0,
│ │ │ │ -
433 const cl_event* startEvents=NULL,
│ │ │ │ -
434 cl_event* endEvent=NULL) {
│ │ │ │ -
435
│ │ │ │ -
436 if (instance) {
│ │ │ │ -
437 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
438 dstBuffer, dstDesc,
│ │ │ │ -
439 duBuffer, duDesc,
│ │ │ │ -
440 dvBuffer, dvDesc,
│ │ │ │ -
441 duuBuffer, duuDesc,
│ │ │ │ -
442 duvBuffer, duvDesc,
│ │ │ │ -
443 dvvBuffer, dvvDesc,
│ │ │ │ -
444 stencilTable,
│ │ │ │ -
445 numStartEvents, startEvents, endEvent);
│ │ │ │ -
446 } else {
│ │ │ │ -
447 // Create an instance on demand (slow)
│ │ │ │ -
448 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
449 duDesc, dvDesc,
│ │ │ │ -
450 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
451 deviceContext);
│ │ │ │ -
452 if (instance) {
│ │ │ │ -
453 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
454 dstBuffer, dstDesc,
│ │ │ │ -
455 duBuffer, duDesc,
│ │ │ │ -
456 dvBuffer, dvDesc,
│ │ │ │ -
457 duuBuffer, duuDesc,
│ │ │ │ -
458 duvBuffer, duvDesc,
│ │ │ │ -
459 dvvBuffer, dvvDesc,
│ │ │ │ -
460 stencilTable,
│ │ │ │ -
461 numStartEvents, startEvents, endEvent);
│ │ │ │ -
462 delete instance;
│ │ │ │ -
463 return r;
│ │ │ │ -
464 }
│ │ │ │ -
465 return false;
│ │ │ │ -
466 }
│ │ │ │ -
467 }
│ │ │ │ -
468
│ │ │ │ -
499 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
501 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
502 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
503 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
504 unsigned int numStartEvents=0,
│ │ │ │ -
505 const cl_event* startEvents=NULL,
│ │ │ │ -
506 cl_event* endEvent=NULL) const {
│ │ │ │ -
507 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
508 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
509 stencilTable->GetSizesBuffer(),
│ │ │ │ -
510 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
511 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
512 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
513 0,
│ │ │ │ -
514 stencilTable->GetNumStencils(),
│ │ │ │ -
515 numStartEvents, startEvents, endEvent);
│ │ │ │ -
516 }
│ │ │ │ -
517
│ │ │ │ -
560 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
562 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
563 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
564 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
565 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
566 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
567 unsigned int numStartEvents=0,
│ │ │ │ -
568 const cl_event* startEvents=NULL,
│ │ │ │ -
569 cl_event* endEvent=NULL) const {
│ │ │ │ -
570 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
571 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
572 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
573 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
574 stencilTable->GetSizesBuffer(),
│ │ │ │ -
575 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
576 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
577 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
578 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
579 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
580 0,
│ │ │ │ -
581 stencilTable->GetNumStencils(),
│ │ │ │ -
582 numStartEvents, startEvents, endEvent);
│ │ │ │ -
583 }
│ │ │ │ -
584
│ │ │ │ -
645 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
647 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
648 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
649 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
650 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
651 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
652 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
653 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
654 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
655 unsigned int numStartEvents=0,
│ │ │ │ -
656 const cl_event* startEvents=NULL,
│ │ │ │ -
657 cl_event* endEvent=NULL) const {
│ │ │ │ -
658 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
659 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
660 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
661 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
662 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ -
663 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ -
664 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ -
665 stencilTable->GetSizesBuffer(),
│ │ │ │ -
666 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
667 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
668 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
669 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
670 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
671 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ -
672 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ -
673 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ -
674 0,
│ │ │ │ -
675 stencilTable->GetNumStencils(),
│ │ │ │ -
676 numStartEvents, startEvents, endEvent);
│ │ │ │ -
677 }
│ │ │ │ -
678
│ │ │ │ -
681 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ -
682 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
683 cl_mem sizes,
│ │ │ │ -
684 cl_mem offsets,
│ │ │ │ -
685 cl_mem indices,
│ │ │ │ -
686 cl_mem weights,
│ │ │ │ -
687 int start,
│ │ │ │ -
688 int end,
│ │ │ │ -
689 unsigned int numStartEvents=0,
│ │ │ │ -
690 const cl_event* startEvents=NULL,
│ │ │ │ -
691 cl_event* endEvent=NULL) const;
│ │ │ │ -
692
│ │ │ │ -
741 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ -
742 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
743 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ -
744 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
745 cl_mem sizes,
│ │ │ │ -
746 cl_mem offsets,
│ │ │ │ -
747 cl_mem indices,
│ │ │ │ -
748 cl_mem weights,
│ │ │ │ -
749 cl_mem duWeights,
│ │ │ │ -
750 cl_mem dvWeights,
│ │ │ │ -
751 int start,
│ │ │ │ -
752 int end,
│ │ │ │ -
753 unsigned int numStartEvents=0,
│ │ │ │ -
754 const cl_event* startEvents=NULL,
│ │ │ │ -
755 cl_event* endEvent=NULL) const;
│ │ │ │ -
756
│ │ │ │ -
823 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ -
824 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
825 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ -
826 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
827 cl_mem duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
828 cl_mem duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
829 cl_mem dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
830 cl_mem sizes,
│ │ │ │ -
831 cl_mem offsets,
│ │ │ │ -
832 cl_mem indices,
│ │ │ │ -
833 cl_mem weights,
│ │ │ │ -
834 cl_mem duWeights,
│ │ │ │ -
835 cl_mem dvWeights,
│ │ │ │ -
836 cl_mem duuWeights,
│ │ │ │ -
837 cl_mem duvWeights,
│ │ │ │ -
838 cl_mem dvvWeights,
│ │ │ │ -
839 int start,
│ │ │ │ -
840 int end,
│ │ │ │ -
841 unsigned int numStartEvents=0,
│ │ │ │ -
842 const cl_event* startEvents=NULL,
│ │ │ │ -
843 cl_event* endEvent=NULL) const;
│ │ │ │ -
844
│ │ │ │ -
850
│ │ │ │ -
899 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
900 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
901 typename DEVICE_CONTEXT>
│ │ │ │ -
902 static bool EvalPatches(
│ │ │ │ -
903 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
904 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
905 int numPatchCoords,
│ │ │ │ -
906 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
907 PATCH_TABLE *patchTable,
│ │ │ │ -
908 CLEvaluator const *instance,
│ │ │ │ -
909 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
910 unsigned int numStartEvents=0,
│ │ │ │ -
911 const cl_event* startEvents=NULL,
│ │ │ │ -
912 cl_event* endEvent=NULL) {
│ │ │ │ -
913
│ │ │ │ -
914 if (instance) {
│ │ │ │ -
915 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
916 dstBuffer, dstDesc,
│ │ │ │ -
917 numPatchCoords, patchCoords,
│ │ │ │ -
918 patchTable,
│ │ │ │ -
919 numStartEvents, startEvents, endEvent);
│ │ │ │ -
920 } else {
│ │ │ │ -
921 // Create an instance on demand (slow)
│ │ │ │ -
922 (void)deviceContext; // unused
│ │ │ │ -
923 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
926 deviceContext);
│ │ │ │ -
927 if (instance) {
│ │ │ │ -
928 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
929 dstBuffer, dstDesc,
│ │ │ │ -
930 numPatchCoords, patchCoords,
│ │ │ │ -
931 patchTable,
│ │ │ │ -
932 numStartEvents, startEvents, endEvent);
│ │ │ │ -
933 delete instance;
│ │ │ │ -
934 return r;
│ │ │ │ -
935 }
│ │ │ │ -
936 return false;
│ │ │ │ -
937 }
│ │ │ │ -
938 }
│ │ │ │ -
939
│ │ │ │ -
1000 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1001 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
1002 typename DEVICE_CONTEXT>
│ │ │ │ -
1003 static bool EvalPatches(
│ │ │ │ -
1004 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1005 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1006 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1007 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1008 int numPatchCoords,
│ │ │ │ -
1009 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1010 PATCH_TABLE *patchTable,
│ │ │ │ -
1011 CLEvaluator const *instance,
│ │ │ │ -
1012 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
1013 unsigned int numStartEvents=0,
│ │ │ │ -
1014 const cl_event* startEvents=NULL,
│ │ │ │ -
1015 cl_event* endEvent=NULL) {
│ │ │ │ -
1016
│ │ │ │ -
1017 if (instance) {
│ │ │ │ -
1018 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
1019 dstBuffer, dstDesc,
│ │ │ │ -
1020 duBuffer, duDesc,
│ │ │ │ -
1021 dvBuffer, dvDesc,
│ │ │ │ -
1022 numPatchCoords, patchCoords,
│ │ │ │ -
1023 patchTable,
│ │ │ │ -
1024 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1025 } else {
│ │ │ │ -
1026 // Create an instance on demand (slow)
│ │ │ │ -
1027 (void)deviceContext; // unused
│ │ │ │ -
1028 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext);
│ │ │ │ -
1029 if (instance) {
│ │ │ │ -
1030 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
1031 dstBuffer, dstDesc,
│ │ │ │ -
1032 duBuffer, duDesc,
│ │ │ │ -
1033 dvBuffer, dvDesc,
│ │ │ │ -
1034 numPatchCoords, patchCoords,
│ │ │ │ -
1035 patchTable,
│ │ │ │ -
1036 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1037 delete instance;
│ │ │ │ -
1038 return r;
│ │ │ │ -
1039 }
│ │ │ │ -
1040 return false;
│ │ │ │ -
1041 }
│ │ │ │ -
1042 }
│ │ │ │ -
1043
│ │ │ │ -
1122 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1123 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
1124 typename DEVICE_CONTEXT>
│ │ │ │ -
1125 static bool EvalPatches(
│ │ │ │ -
1126 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1127 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1128 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1129 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1130 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1131 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1132 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1133 int numPatchCoords,
│ │ │ │ -
1134 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1135 PATCH_TABLE *patchTable,
│ │ │ │ -
1136 CLEvaluator const *instance,
│ │ │ │ -
1137 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
1138 unsigned int numStartEvents=0,
│ │ │ │ -
1139 const cl_event* startEvents=NULL,
│ │ │ │ -
1140 cl_event* endEvent=NULL) {
│ │ │ │ -
1141
│ │ │ │ -
1142 if (instance) {
│ │ │ │ -
1143 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
1144 dstBuffer, dstDesc,
│ │ │ │ -
1145 duBuffer, duDesc,
│ │ │ │ -
1146 dvBuffer, dvDesc,
│ │ │ │ -
1147 duuBuffer, duuDesc,
│ │ │ │ -
1148 duvBuffer, duvDesc,
│ │ │ │ -
1149 dvvBuffer, dvvDesc,
│ │ │ │ -
1150 numPatchCoords, patchCoords,
│ │ │ │ -
1151 patchTable,
│ │ │ │ -
1152 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1153 } else {
│ │ │ │ -
1154 // Create an instance on demand (slow)
│ │ │ │ -
1155 (void)deviceContext; // unused
│ │ │ │ -
1156 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1157 duDesc, dvDesc,
│ │ │ │ -
1158 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
1159 deviceContext);
│ │ │ │ -
1160 if (instance) {
│ │ │ │ -
1161 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
1162 dstBuffer, dstDesc,
│ │ │ │ -
1163 duBuffer, duDesc,
│ │ │ │ -
1164 dvBuffer, dvDesc,
│ │ │ │ -
1165 duuBuffer, duuDesc,
│ │ │ │ -
1166 duvBuffer, duvDesc,
│ │ │ │ -
1167 dvvBuffer, dvvDesc,
│ │ │ │ -
1168 numPatchCoords, patchCoords,
│ │ │ │ -
1169 patchTable,
│ │ │ │ -
1170 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1171 delete instance;
│ │ │ │ -
1172 return r;
│ │ │ │ -
1173 }
│ │ │ │ -
1174 return false;
│ │ │ │ -
1175 }
│ │ │ │ -
1176 }
│ │ │ │ -
1177
│ │ │ │ -
1215 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1216 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1218 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1219 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1220 int numPatchCoords,
│ │ │ │ -
1221 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1222 PATCH_TABLE *patchTable,
│ │ │ │ -
1223 unsigned int numStartEvents=0,
│ │ │ │ -
1224 const cl_event* startEvents=NULL,
│ │ │ │ -
1225 cl_event* endEvent=NULL) const {
│ │ │ │ -
1226
│ │ │ │ -
1227 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1228 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1229 0, BufferDescriptor(),
│ │ │ │ -
1230 0, BufferDescriptor(),
│ │ │ │ -
1231 numPatchCoords,
│ │ │ │ -
1232 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
1233 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
1234 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1235 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1236 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1237 }
│ │ │ │ -
1238
│ │ │ │ -
1286 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1287 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1289 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1290 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1291 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1292 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1293 int numPatchCoords,
│ │ │ │ -
1294 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1295 PATCH_TABLE *patchTable,
│ │ │ │ -
1296 unsigned int numStartEvents=0,
│ │ │ │ -
1297 const cl_event* startEvents=NULL,
│ │ │ │ -
1298 cl_event* endEvent=NULL) const {
│ │ │ │ -
1299
│ │ │ │ -
1300 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1301 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1302 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
1303 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
1304 numPatchCoords,
│ │ │ │ -
1305 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
1306 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
1307 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1308 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1309 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1310 }
│ │ │ │ -
1311
│ │ │ │ -
1377 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1378 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1380 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1381 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1382 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1383 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1384 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1385 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1386 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1387 int numPatchCoords,
│ │ │ │ -
1388 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1389 PATCH_TABLE *patchTable,
│ │ │ │ -
1390 unsigned int numStartEvents=0,
│ │ │ │ -
1391 const cl_event* startEvents=NULL,
│ │ │ │ -
1392 cl_event* endEvent=NULL) const {
│ │ │ │ -
1393
│ │ │ │ -
1394 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1395 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1396 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
1397 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
1398 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ -
1399 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ -
1400 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ -
1401 numPatchCoords,
│ │ │ │ -
1402 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
1403 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
1404 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1405 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1406 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1407 }
│ │ │ │ -
1408
│ │ │ │ -
1409 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ -
1410 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
1411 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ -
1412 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
1413 int numPatchCoords,
│ │ │ │ -
1414 cl_mem patchCoordsBuffer,
│ │ │ │ -
1415 cl_mem patchArrayBuffer,
│ │ │ │ -
1416 cl_mem patchIndexBuffer,
│ │ │ │ -
1417 cl_mem patchParamsBuffer,
│ │ │ │ -
1418 unsigned int numStartEvents=0,
│ │ │ │ -
1419 const cl_event* startEvents=NULL,
│ │ │ │ -
1420 cl_event* endEvent=NULL) const;
│ │ │ │ -
1421
│ │ │ │ -
1422 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
│ │ │ │ -
1423 cl_mem dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
1424 cl_mem du, BufferDescriptor const &duDesc,
│ │ │ │ -
1425 cl_mem dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
1426 cl_mem duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
1427 cl_mem duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
1428 cl_mem dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1429 int numPatchCoords,
│ │ │ │ -
1430 cl_mem patchCoordsBuffer,
│ │ │ │ -
1431 cl_mem patchArrayBuffer,
│ │ │ │ -
1432 cl_mem patchIndexBuffer,
│ │ │ │ -
1433 cl_mem patchParamsBuffer,
│ │ │ │ -
1434 unsigned int numStartEvents=0,
│ │ │ │ -
1435 const cl_event* startEvents=NULL,
│ │ │ │ -
1436 cl_event* endEvent=NULL) const;
│ │ │ │ -
1437
│ │ │ │ -
1486 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1487 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
1488 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
1490 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1491 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1492 int numPatchCoords,
│ │ │ │ -
1493 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1494 PATCH_TABLE *patchTable,
│ │ │ │ -
1495 CLEvaluator const *instance,
│ │ │ │ -
1496 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
1497 unsigned int numStartEvents=0,
│ │ │ │ -
1498 const cl_event* startEvents=NULL,
│ │ │ │ -
1499 cl_event* endEvent=NULL) {
│ │ │ │ -
1500
│ │ │ │ -
1501 if (instance) {
│ │ │ │ -
1502 return instance->EvalPatchesVarying(
│ │ │ │ -
1503 srcBuffer, srcDesc,
│ │ │ │ -
1504 dstBuffer, dstDesc,
│ │ │ │ -
1505 numPatchCoords, patchCoords,
│ │ │ │ -
1506 patchTable,
│ │ │ │ -
1507 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1508 } else {
│ │ │ │ -
1509 // Create an instance on demand (slow)
│ │ │ │ -
1510 (void)deviceContext; // unused
│ │ │ │ -
1511 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1514 deviceContext);
│ │ │ │ -
1515 if (instance) {
│ │ │ │ -
1516 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1517 srcBuffer, srcDesc,
│ │ │ │ -
1518 dstBuffer, dstDesc,
│ │ │ │ -
1519 numPatchCoords, patchCoords,
│ │ │ │ -
1520 patchTable,
│ │ │ │ -
1521 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1522 delete instance;
│ │ │ │ -
1523 return r;
│ │ │ │ -
1524 }
│ │ │ │ -
1525 return false;
│ │ │ │ -
1526 }
│ │ │ │ -
1527 }
│ │ │ │ -
1528
│ │ │ │ -
1566 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1567 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1569 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1570 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1571 int numPatchCoords,
│ │ │ │ -
1572 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1573 PATCH_TABLE *patchTable,
│ │ │ │ -
1574 unsigned int numStartEvents=0,
│ │ │ │ -
1575 const cl_event* startEvents=NULL,
│ │ │ │ -
1576 cl_event* endEvent=NULL) const {
│ │ │ │ -
1577
│ │ │ │ -
1578 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1579 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1580 0, BufferDescriptor(),
│ │ │ │ -
1581 0, BufferDescriptor(),
│ │ │ │ -
1582 numPatchCoords,
│ │ │ │ -
1583 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
1584 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
1585 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1586 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1587 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1588 }
│ │ │ │ -
1589
│ │ │ │ -
1650 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1651 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
1652 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
1654 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1655 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1656 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1657 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1658 int numPatchCoords,
│ │ │ │ -
1659 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1660 PATCH_TABLE *patchTable,
│ │ │ │ -
1661 CLEvaluator const *instance,
│ │ │ │ -
1662 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
1663 unsigned int numStartEvents=0,
│ │ │ │ -
1664 const cl_event* startEvents=NULL,
│ │ │ │ -
1665 cl_event* endEvent=NULL) {
│ │ │ │ -
1666
│ │ │ │ -
1667 if (instance) {
│ │ │ │ -
1668 return instance->EvalPatchesVarying(
│ │ │ │ -
1669 srcBuffer, srcDesc,
│ │ │ │ -
1670 dstBuffer, dstDesc,
│ │ │ │ -
1671 duBuffer, duDesc,
│ │ │ │ -
1672 dvBuffer, dvDesc,
│ │ │ │ -
1673 numPatchCoords, patchCoords,
│ │ │ │ -
1674 patchTable,
│ │ │ │ -
1675 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1676 } else {
│ │ │ │ -
1677 // Create an instance on demand (slow)
│ │ │ │ -
1678 (void)deviceContext; // unused
│ │ │ │ -
1679 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1680 duDesc, dvDesc,
│ │ │ │ -
1681 deviceContext);
│ │ │ │ -
1682 if (instance) {
│ │ │ │ -
1683 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1684 srcBuffer, srcDesc,
│ │ │ │ -
1685 dstBuffer, dstDesc,
│ │ │ │ -
1686 duBuffer, duDesc,
│ │ │ │ -
1687 dvBuffer, dvDesc,
│ │ │ │ -
1688 numPatchCoords, patchCoords,
│ │ │ │ -
1689 patchTable,
│ │ │ │ -
1690 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1691 delete instance;
│ │ │ │ -
1692 return r;
│ │ │ │ -
1693 }
│ │ │ │ -
1694 return false;
│ │ │ │ -
1695 }
│ │ │ │ -
1696 }
│ │ │ │ -
1697
│ │ │ │ -
1747 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1748 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1750 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1751 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1752 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1753 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1754 int numPatchCoords,
│ │ │ │ -
1755 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1756 PATCH_TABLE *patchTable,
│ │ │ │ -
1757 unsigned int numStartEvents=0,
│ │ │ │ -
1758 const cl_event* startEvents=NULL,
│ │ │ │ -
1759 cl_event* endEvent=NULL) const {
│ │ │ │ -
1760
│ │ │ │ -
1761 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1762 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1763 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
1764 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
1765 numPatchCoords,
│ │ │ │ -
1766 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
1767 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
1768 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1769 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1770 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1771 }
│ │ │ │ -
1772
│ │ │ │ -
1851 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1852 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
1853 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
1855 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1856 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1857 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1858 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1859 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1860 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1861 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1862 int numPatchCoords,
│ │ │ │ -
1863 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1864 PATCH_TABLE *patchTable,
│ │ │ │ -
1865 CLEvaluator const *instance,
│ │ │ │ -
1866 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
1867 unsigned int numStartEvents=0,
│ │ │ │ -
1868 const cl_event* startEvents=NULL,
│ │ │ │ -
1869 cl_event* endEvent=NULL) {
│ │ │ │ -
1870
│ │ │ │ -
1871 if (instance) {
│ │ │ │ -
1872 return instance->EvalPatchesVarying(
│ │ │ │ -
1873 srcBuffer, srcDesc,
│ │ │ │ -
1874 dstBuffer, dstDesc,
│ │ │ │ -
1875 duBuffer, duDesc,
│ │ │ │ -
1876 dvBuffer, dvDesc,
│ │ │ │ -
1877 duuBuffer, duuDesc,
│ │ │ │ -
1878 duvBuffer, duvDesc,
│ │ │ │ -
1879 dvvBuffer, dvvDesc,
│ │ │ │ -
1880 numPatchCoords, patchCoords,
│ │ │ │ -
1881 patchTable,
│ │ │ │ -
1882 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1883 } else {
│ │ │ │ -
1884 // Create an instance on demand (slow)
│ │ │ │ -
1885 (void)deviceContext; // unused
│ │ │ │ -
1886 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1887 duDesc, dvDesc,
│ │ │ │ -
1888 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
1889 deviceContext);
│ │ │ │ -
1890 if (instance) {
│ │ │ │ -
1891 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1892 srcBuffer, srcDesc,
│ │ │ │ -
1893 dstBuffer, dstDesc,
│ │ │ │ -
1894 duBuffer, duDesc,
│ │ │ │ -
1895 dvBuffer, dvDesc,
│ │ │ │ -
1896 duuBuffer, duuDesc,
│ │ │ │ -
1897 duvBuffer, duvDesc,
│ │ │ │ -
1898 dvvBuffer, dvvDesc,
│ │ │ │ -
1899 numPatchCoords, patchCoords,
│ │ │ │ -
1900 patchTable,
│ │ │ │ -
1901 numStartEvents, startEvents, endEvent);
│ │ │ │ -
1902 delete instance;
│ │ │ │ -
1903 return r;
│ │ │ │ -
1904 }
│ │ │ │ -
1905 return false;
│ │ │ │ -
1906 }
│ │ │ │ -
1907 }
│ │ │ │ -
1908
│ │ │ │ -
1976 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1977 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1979 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1980 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1981 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1982 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1983 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1984 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1985 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1986 int numPatchCoords,
│ │ │ │ -
1987 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1988 PATCH_TABLE *patchTable,
│ │ │ │ -
1989 unsigned int numStartEvents=0,
│ │ │ │ -
1990 const cl_event* startEvents=NULL,
│ │ │ │ -
1991 cl_event* endEvent=NULL) const {
│ │ │ │ -
1992
│ │ │ │ -
1993 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
1994 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
1995 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
1996 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
1997 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ -
1998 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ -
1999 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ -
2000 numPatchCoords,
│ │ │ │ -
2001 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
2002 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
2003 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
2004 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
2005 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2006 }
│ │ │ │ -
2007
│ │ │ │ -
2058 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2059 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
2060 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
2062 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2063 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2064 int numPatchCoords,
│ │ │ │ -
2065 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2066 PATCH_TABLE *patchTable,
│ │ │ │ -
2067 int fvarChannel,
│ │ │ │ -
2068 CLEvaluator const *instance,
│ │ │ │ -
2069 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
2070 unsigned int numStartEvents=0,
│ │ │ │ -
2071 const cl_event* startEvents=NULL,
│ │ │ │ -
2072 cl_event* endEvent=NULL) {
│ │ │ │ -
2073
│ │ │ │ -
2074 if (instance) {
│ │ │ │ -
2075 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
2076 srcBuffer, srcDesc,
│ │ │ │ -
2077 dstBuffer, dstDesc,
│ │ │ │ -
2078 numPatchCoords, patchCoords,
│ │ │ │ -
2079 patchTable, fvarChannel,
│ │ │ │ -
2080 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2081 } else {
│ │ │ │ -
2082 // Create an instance on demand (slow)
│ │ │ │ -
2083 (void)deviceContext; // unused
│ │ │ │ -
2084 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
2087 deviceContext);
│ │ │ │ -
2088 if (instance) {
│ │ │ │ -
2089 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
2090 srcBuffer, srcDesc,
│ │ │ │ -
2091 dstBuffer, dstDesc,
│ │ │ │ -
2092 numPatchCoords, patchCoords,
│ │ │ │ -
2093 patchTable, fvarChannel,
│ │ │ │ -
2094 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2095 delete instance;
│ │ │ │ -
2096 return r;
│ │ │ │ -
2097 }
│ │ │ │ -
2098 return false;
│ │ │ │ -
2099 }
│ │ │ │ -
2100 }
│ │ │ │ -
2101
│ │ │ │ -
2141 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2142 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2144 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2145 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2146 int numPatchCoords,
│ │ │ │ -
2147 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2148 PATCH_TABLE *patchTable,
│ │ │ │ -
2149 int fvarChannel = 0,
│ │ │ │ -
2150 unsigned int numStartEvents=0,
│ │ │ │ -
2151 const cl_event* startEvents=NULL,
│ │ │ │ -
2152 cl_event* endEvent=NULL) const {
│ │ │ │ -
2153
│ │ │ │ -
2154 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
2155 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
2156 0, BufferDescriptor(),
│ │ │ │ -
2157 0, BufferDescriptor(),
│ │ │ │ -
2158 numPatchCoords,
│ │ │ │ -
2159 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
2160 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
2161 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
2162 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
2163 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2164 }
│ │ │ │ -
2165
│ │ │ │ -
2228 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2229 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
2230 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
2232 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2233 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2234 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2235 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2236 int numPatchCoords,
│ │ │ │ -
2237 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2238 PATCH_TABLE *patchTable,
│ │ │ │ -
2239 int fvarChannel,
│ │ │ │ -
2240 CLEvaluator const *instance,
│ │ │ │ -
2241 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
2242 unsigned int numStartEvents=0,
│ │ │ │ -
2243 const cl_event* startEvents=NULL,
│ │ │ │ -
2244 cl_event* endEvent=NULL) {
│ │ │ │ -
2245
│ │ │ │ -
2246 if (instance) {
│ │ │ │ -
2247 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
2248 srcBuffer, srcDesc,
│ │ │ │ -
2249 dstBuffer, dstDesc,
│ │ │ │ -
2250 duBuffer, duDesc,
│ │ │ │ -
2251 dvBuffer, dvDesc,
│ │ │ │ -
2252 numPatchCoords, patchCoords,
│ │ │ │ -
2253 patchTable, fvarChannel,
│ │ │ │ -
2254 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2255 } else {
│ │ │ │ -
2256 // Create an instance on demand (slow)
│ │ │ │ -
2257 (void)deviceContext; // unused
│ │ │ │ -
2258 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
2259 duDesc, dvDesc, deviceContext);
│ │ │ │ -
2260 if (instance) {
│ │ │ │ -
2261 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
2262 srcBuffer, srcDesc,
│ │ │ │ -
2263 dstBuffer, dstDesc,
│ │ │ │ -
2264 duBuffer, duDesc,
│ │ │ │ -
2265 dvBuffer, dvDesc,
│ │ │ │ -
2266 numPatchCoords, patchCoords,
│ │ │ │ -
2267 patchTable, fvarChannel,
│ │ │ │ -
2268 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2269 delete instance;
│ │ │ │ -
2270 return r;
│ │ │ │ -
2271 }
│ │ │ │ -
2272 return false;
│ │ │ │ -
2273 }
│ │ │ │ -
2274 }
│ │ │ │ -
2275
│ │ │ │ -
2327 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2328 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2330 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2331 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2332 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2333 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2334 int numPatchCoords,
│ │ │ │ -
2335 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2336 PATCH_TABLE *patchTable,
│ │ │ │ -
2337 int fvarChannel = 0,
│ │ │ │ -
2338 unsigned int numStartEvents=0,
│ │ │ │ -
2339 const cl_event* startEvents=NULL,
│ │ │ │ -
2340 cl_event* endEvent=NULL) const {
│ │ │ │ -
2341
│ │ │ │ -
2342 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
2343 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
2344 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
2345 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
2346 numPatchCoords,
│ │ │ │ -
2347 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
2348 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
2349 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
2350 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
2351 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2352 }
│ │ │ │ -
2353
│ │ │ │ -
2434 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2435 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
│ │ │ │ -
2436 typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
2438 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2439 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2440 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2441 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2442 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
2443 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
2444 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
2445 int numPatchCoords,
│ │ │ │ -
2446 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2447 PATCH_TABLE *patchTable,
│ │ │ │ -
2448 int fvarChannel,
│ │ │ │ -
2449 CLEvaluator const *instance,
│ │ │ │ -
2450 DEVICE_CONTEXT deviceContext,
│ │ │ │ -
2451 unsigned int numStartEvents=0,
│ │ │ │ -
2452 const cl_event* startEvents=NULL,
│ │ │ │ -
2453 cl_event* endEvent=NULL) {
│ │ │ │ -
2454
│ │ │ │ -
2455 if (instance) {
│ │ │ │ -
2456 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
2457 srcBuffer, srcDesc,
│ │ │ │ -
2458 dstBuffer, dstDesc,
│ │ │ │ -
2459 duBuffer, duDesc,
│ │ │ │ -
2460 dvBuffer, dvDesc,
│ │ │ │ -
2461 duuBuffer, duuDesc,
│ │ │ │ -
2462 duvBuffer, duvDesc,
│ │ │ │ -
2463 dvvBuffer, dvvDesc,
│ │ │ │ -
2464 numPatchCoords, patchCoords,
│ │ │ │ -
2465 patchTable, fvarChannel,
│ │ │ │ -
2466 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2467 } else {
│ │ │ │ -
2468 // Create an instance on demand (slow)
│ │ │ │ -
2469 (void)deviceContext; // unused
│ │ │ │ -
2470 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
2471 duDesc, dvDesc,
│ │ │ │ -
2472 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
2473 deviceContext);
│ │ │ │ -
2474 if (instance) {
│ │ │ │ -
2475 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
2476 srcBuffer, srcDesc,
│ │ │ │ -
2477 dstBuffer, dstDesc,
│ │ │ │ -
2478 duBuffer, duDesc,
│ │ │ │ -
2479 dvBuffer, dvDesc,
│ │ │ │ -
2480 duuBuffer, duuDesc,
│ │ │ │ -
2481 duvBuffer, duvDesc,
│ │ │ │ -
2482 dvvBuffer, dvvDesc,
│ │ │ │ -
2483 numPatchCoords, patchCoords,
│ │ │ │ -
2484 patchTable, fvarChannel,
│ │ │ │ -
2485 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2486 delete instance;
│ │ │ │ -
2487 return r;
│ │ │ │ -
2488 }
│ │ │ │ -
2489 return false;
│ │ │ │ -
2490 }
│ │ │ │ -
2491 }
│ │ │ │ -
2492
│ │ │ │ -
2562 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2563 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2565 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2566 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2567 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2568 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2569 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
2570 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
2571 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
2572 int numPatchCoords,
│ │ │ │ -
2573 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2574 PATCH_TABLE *patchTable,
│ │ │ │ -
2575 int fvarChannel = 0,
│ │ │ │ -
2576 unsigned int numStartEvents=0,
│ │ │ │ -
2577 const cl_event* startEvents=NULL,
│ │ │ │ -
2578 cl_event* endEvent=NULL) const {
│ │ │ │ -
2579
│ │ │ │ -
2580 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
│ │ │ │ -
2581 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
│ │ │ │ -
2582 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
│ │ │ │ -
2583 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
│ │ │ │ -
2584 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
│ │ │ │ -
2585 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
│ │ │ │ -
2586 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
│ │ │ │ -
2587 numPatchCoords,
│ │ │ │ -
2588 patchCoords->BindCLBuffer(_clCommandQueue),
│ │ │ │ -
2589 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
2590 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
2591 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
2592 numStartEvents, startEvents, endEvent);
│ │ │ │ -
2593 }
│ │ │ │ -
2594
│ │ │ │ -
2600
│ │ │ │ -
2603 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2604 BufferDescriptor const &dstDesc,
│ │ │ │ -
2605 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ -
2606 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ -
2607 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ -
2608 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ -
2609 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ -
2610
│ │ │ │ -
2612 template <typename DEVICE_CONTEXT>
│ │ │ │ -
2613 static void Synchronize(DEVICE_CONTEXT deviceContext) {
│ │ │ │ -
2614 Synchronize(deviceContext->GetCommandQueue());
│ │ │ │ -
2615 }
│ │ │ │ -
2616
│ │ │ │ -
2617 static void Synchronize(cl_command_queue queue);
│ │ │ │ -
2618
│ │ │ │ -
2619private:
│ │ │ │ -
2620 cl_context _clContext;
│ │ │ │ -
2621 cl_command_queue _clCommandQueue;
│ │ │ │ -
2622 cl_program _program;
│ │ │ │ -
2623 cl_kernel _stencilKernel;
│ │ │ │ -
2624 cl_kernel _stencilDerivKernel;
│ │ │ │ -
2625 cl_kernel _patchKernel;
│ │ │ │ -
2626};
│ │ │ │ -
2627
│ │ │ │ -
2628} // end namespace Osd
│ │ │ │ -
2629
│ │ │ │ -
2630} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
2631using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
2632
│ │ │ │ -
2633} // end namespace OpenSubdiv
│ │ │ │ -
2634
│ │ │ │ -
2635
│ │ │ │ -
2636#endif // OPENSUBDIV3_OSD_CL_EVALUATOR_H
│ │ │ │ +
232 duBuffer, duDesc,
│ │ │ │ +
233 dvBuffer, dvDesc,
│ │ │ │ +
234 stencilTable,
│ │ │ │ +
235 context);
│ │ │ │ +
236 } else {
│ │ │ │ +
237 // Create an instance on demand (slow)
│ │ │ │ +
238 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context);
│ │ │ │ +
239 if (instance) {
│ │ │ │ +
240 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
241 dstBuffer, dstDesc,
│ │ │ │ +
242 duBuffer, duDesc,
│ │ │ │ +
243 dvBuffer, dvDesc,
│ │ │ │ +
244 stencilTable,
│ │ │ │ +
245 context);
│ │ │ │ +
246 delete instance;
│ │ │ │ +
247 return r;
│ │ │ │ +
248 }
│ │ │ │ +
249 return false;
│ │ │ │ +
250 }
│ │ │ │ +
251 }
│ │ │ │ +
252
│ │ │ │ +
311 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
312 static bool EvalStencils(
│ │ │ │ +
313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
317 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
318 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
319 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
320 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
321 MTLComputeEvaluator const *instance,
│ │ │ │ +
322 MTLContext* context) {
│ │ │ │ +
323
│ │ │ │ +
324 if (instance) {
│ │ │ │ +
325 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
326 dstBuffer, dstDesc,
│ │ │ │ +
327 duBuffer, duDesc,
│ │ │ │ +
328 dvBuffer, dvDesc,
│ │ │ │ +
329 duuBuffer, duuDesc,
│ │ │ │ +
330 duvBuffer, duvDesc,
│ │ │ │ +
331 dvvBuffer, dvvDesc,
│ │ │ │ +
332 stencilTable,
│ │ │ │ +
333 context);
│ │ │ │ +
334 } else {
│ │ │ │ +
335 // Create an instance on demand (slow)
│ │ │ │ +
336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
337 duuDesc, duvDesc, dvvDesc, context);
│ │ │ │ +
338 if (instance) {
│ │ │ │ +
339 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
340 dstBuffer, dstDesc,
│ │ │ │ +
341 duBuffer, duDesc,
│ │ │ │ +
342 dvBuffer, dvDesc,
│ │ │ │ +
343 duuBuffer, duuDesc,
│ │ │ │ +
344 duvBuffer, duvDesc,
│ │ │ │ +
345 dvvBuffer, dvvDesc,
│ │ │ │ +
346 stencilTable,
│ │ │ │ +
347 context);
│ │ │ │ +
348 delete instance;
│ │ │ │ +
349 return r;
│ │ │ │ +
350 }
│ │ │ │ +
351 return false;
│ │ │ │ +
352 }
│ │ │ │ +
353 }
│ │ │ │ +
354
│ │ │ │ +
375 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
377 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
378 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
379 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
380 MTLContext* context) const
│ │ │ │ +
381 {
│ │ │ │ +
382 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
383 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
384 0, BufferDescriptor(),
│ │ │ │ +
385 0, BufferDescriptor(),
│ │ │ │ +
386 stencilTable->GetSizesBuffer(),
│ │ │ │ +
387 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
388 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
389 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
390 0,
│ │ │ │ +
391 0,
│ │ │ │ +
392 /* start = */ 0,
│ │ │ │ +
393 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ +
394 context);
│ │ │ │ +
395 }
│ │ │ │ +
396
│ │ │ │ +
429 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
431 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
432 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
433 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
434 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
435 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
436 MTLContext* context) const
│ │ │ │ +
437 {
│ │ │ │ +
438 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
439 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
440 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ +
441 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ +
442 stencilTable->GetSizesBuffer(),
│ │ │ │ +
443 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
444 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
445 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
446 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
447 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
448 /* start = */ 0,
│ │ │ │ +
449 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ +
450 context);
│ │ │ │ +
451 }
│ │ │ │ +
452
│ │ │ │ +
503 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
507 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
508 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
509 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
510 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
511 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
512 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
513 MTLContext* context) const
│ │ │ │ +
514 {
│ │ │ │ +
515 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
516 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
517 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ +
518 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ +
519 duuBuffer->BindMTLBuffer(context), duuDesc,
│ │ │ │ +
520 duvBuffer->BindMTLBuffer(context), duvDesc,
│ │ │ │ +
521 dvvBuffer->BindMTLBuffer(context), dvvDesc,
│ │ │ │ +
522 stencilTable->GetSizesBuffer(),
│ │ │ │ +
523 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
524 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
525 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
526 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
527 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
528 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ +
529 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ +
530 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ +
531 /* start = */ 0,
│ │ │ │ +
532 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ +
533 context);
│ │ │ │ +
534 }
│ │ │ │ +
535
│ │ │ │ +
574 bool EvalStencils(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
575 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
576 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
577 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
578 id<MTLBuffer> sizesBuffer,
│ │ │ │ +
579 id<MTLBuffer> offsetsBuffer,
│ │ │ │ +
580 id<MTLBuffer> indicesBuffer,
│ │ │ │ +
581 id<MTLBuffer> weightsBuffer,
│ │ │ │ +
582 id<MTLBuffer> duWeightsBuffer,
│ │ │ │ +
583 id<MTLBuffer> dvWeightsBuffer,
│ │ │ │ +
584 int start,
│ │ │ │ +
585 int end,
│ │ │ │ +
586 MTLContext* context) const;
│ │ │ │ +
587
│ │ │ │ +
644 bool EvalStencils(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
645 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
646 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
647 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
648 id<MTLBuffer> duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
649 id<MTLBuffer> duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
650 id<MTLBuffer> dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
651 id<MTLBuffer> sizesBuffer,
│ │ │ │ +
652 id<MTLBuffer> offsetsBuffer,
│ │ │ │ +
653 id<MTLBuffer> indicesBuffer,
│ │ │ │ +
654 id<MTLBuffer> weightsBuffer,
│ │ │ │ +
655 id<MTLBuffer> duWeightsBuffer,
│ │ │ │ +
656 id<MTLBuffer> dvWeightsBuffer,
│ │ │ │ +
657 id<MTLBuffer> duuWeightsBuffer,
│ │ │ │ +
658 id<MTLBuffer> duvWeightsBuffer,
│ │ │ │ +
659 id<MTLBuffer> dvvWeightsBuffer,
│ │ │ │ +
660 int start,
│ │ │ │ +
661 int end,
│ │ │ │ +
662 MTLContext* context) const;
│ │ │ │ +
663
│ │ │ │ +
669
│ │ │ │ +
703 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
704 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
705 static bool EvalPatches(
│ │ │ │ +
706 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
707 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
708 int numPatchCoords,
│ │ │ │ +
709 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
710 PATCH_TABLE *patchTable,
│ │ │ │ +
711 MTLComputeEvaluator const *instance,
│ │ │ │ +
712 MTLContext* context) {
│ │ │ │ +
713
│ │ │ │ +
714 if (instance) {
│ │ │ │ +
715 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
716 dstBuffer, dstDesc,
│ │ │ │ +
717 numPatchCoords, patchCoords,
│ │ │ │ +
718 patchTable,
│ │ │ │ +
719 context);
│ │ │ │ +
720 } else {
│ │ │ │ +
721 // Create an instance on demand (slow)
│ │ │ │ +
722 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
725 context);
│ │ │ │ +
726 if (instance) {
│ │ │ │ +
727 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
728 dstBuffer, dstDesc,
│ │ │ │ +
729 numPatchCoords, patchCoords,
│ │ │ │ +
730 patchTable,
│ │ │ │ +
731 context);
│ │ │ │ +
732 delete instance;
│ │ │ │ +
733 return r;
│ │ │ │ +
734 }
│ │ │ │ +
735 return false;
│ │ │ │ +
736 }
│ │ │ │ +
737 }
│ │ │ │ +
738
│ │ │ │ +
784 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
785 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
786 static bool EvalPatches(
│ │ │ │ +
787 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
788 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
789 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
790 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
791 int numPatchCoords,
│ │ │ │ +
792 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
793 PATCH_TABLE *patchTable,
│ │ │ │ +
794 MTLComputeEvaluator* instance,
│ │ │ │ +
795 MTLContext* context) {
│ │ │ │ +
796
│ │ │ │ +
797 if (instance) {
│ │ │ │ +
798 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
799 dstBuffer, dstDesc,
│ │ │ │ +
800 duBuffer, duDesc,
│ │ │ │ +
801 dvBuffer, dvDesc,
│ │ │ │ +
802 numPatchCoords, patchCoords,
│ │ │ │ +
803 patchTable,
│ │ │ │ +
804 context);
│ │ │ │ +
805 } else {
│ │ │ │ +
806 // Create an instance on demand (slow)
│ │ │ │ +
807 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
808 duDesc, dvDesc, context);
│ │ │ │ +
809 if (instance) {
│ │ │ │ +
810 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
811 dstBuffer, dstDesc,
│ │ │ │ +
812 duBuffer, duDesc,
│ │ │ │ +
813 dvBuffer, dvDesc,
│ │ │ │ +
814 numPatchCoords, patchCoords,
│ │ │ │ +
815 patchTable,
│ │ │ │ +
816 context);
│ │ │ │ +
817 delete instance;
│ │ │ │ +
818 return r;
│ │ │ │ +
819 }
│ │ │ │ +
820 return false;
│ │ │ │ +
821 }
│ │ │ │ +
822 }
│ │ │ │ +
823
│ │ │ │ +
887 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
888 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
889 static bool EvalPatches(
│ │ │ │ +
890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
894 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
895 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
896 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
897 int numPatchCoords,
│ │ │ │ +
898 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
899 PATCH_TABLE *patchTable,
│ │ │ │ +
900 MTLComputeEvaluator* instance,
│ │ │ │ +
901 MTLContext* context) {
│ │ │ │ +
902
│ │ │ │ +
903 if (instance) {
│ │ │ │ +
904 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
905 dstBuffer, dstDesc,
│ │ │ │ +
906 duBuffer, duDesc,
│ │ │ │ +
907 dvBuffer, dvDesc,
│ │ │ │ +
908 duuBuffer, duuDesc,
│ │ │ │ +
909 duvBuffer, duvDesc,
│ │ │ │ +
910 dvvBuffer, dvvDesc,
│ │ │ │ +
911 numPatchCoords, patchCoords,
│ │ │ │ +
912 patchTable,
│ │ │ │ +
913 context);
│ │ │ │ +
914 } else {
│ │ │ │ +
915 // Create an instance on demand (slow)
│ │ │ │ +
916 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
917 duDesc, dvDesc,
│ │ │ │ +
918 duuDesc, duvDesc, dvvDesc, context);
│ │ │ │ +
919 if (instance) {
│ │ │ │ +
920 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
921 dstBuffer, dstDesc,
│ │ │ │ +
922 duBuffer, duDesc,
│ │ │ │ +
923 dvBuffer, dvDesc,
│ │ │ │ +
924 duuBuffer, duuDesc,
│ │ │ │ +
925 duvBuffer, duvDesc,
│ │ │ │ +
926 dvvBuffer, dvvDesc,
│ │ │ │ +
927 numPatchCoords, patchCoords,
│ │ │ │ +
928 patchTable,
│ │ │ │ +
929 context);
│ │ │ │ +
930 delete instance;
│ │ │ │ +
931 return r;
│ │ │ │ +
932 }
│ │ │ │ +
933 return false;
│ │ │ │ +
934 }
│ │ │ │ +
935 }
│ │ │ │ +
936
│ │ │ │ +
964 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
965 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
967 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
968 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
969 int numPatchCoords,
│ │ │ │ +
970 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
971 PATCH_TABLE *patchTable,
│ │ │ │ +
972 MTLContext* context) const {
│ │ │ │ +
973
│ │ │ │ +
974 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
975 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
976 0, BufferDescriptor(),
│ │ │ │ +
977 0, BufferDescriptor(),
│ │ │ │ +
978 numPatchCoords,
│ │ │ │ +
979 patchCoords->BindMTLBuffer(context),
│ │ │ │ +
980 patchTable->GetPatchArrays(),
│ │ │ │ +
981 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
982 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
983 context);
│ │ │ │ +
984 }
│ │ │ │ +
985
│ │ │ │ +
1023 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1024 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1026 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1027 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1028 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1029 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1030 int numPatchCoords,
│ │ │ │ +
1031 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1032 PATCH_TABLE *patchTable,
│ │ │ │ +
1033 MTLContext* context) const {
│ │ │ │ +
1034
│ │ │ │ +
1035 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
1036 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
1037 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ +
1038 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ +
1039 numPatchCoords,
│ │ │ │ +
1040 patchCoords->BindMTLBuffer(context),
│ │ │ │ +
1041 patchTable->GetPatchArrays(),
│ │ │ │ +
1042 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1043 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1044 context);
│ │ │ │ +
1045 }
│ │ │ │ +
1046
│ │ │ │ +
1102 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1103 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1105 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1106 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1107 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1108 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1109 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1110 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1111 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1112 int numPatchCoords,
│ │ │ │ +
1113 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1114 PATCH_TABLE *patchTable,
│ │ │ │ +
1115 MTLContext* context) const {
│ │ │ │ +
1116
│ │ │ │ +
1117 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ +
1118 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ +
1119 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ +
1120 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ +
1121 duuBuffer->BindMTLBuffer(context), duuDesc,
│ │ │ │ +
1122 duvBuffer->BindMTLBuffer(context), duvDesc,
│ │ │ │ +
1123 dvvBuffer->BindMTLBuffer(context), dvvDesc,
│ │ │ │ +
1124 numPatchCoords,
│ │ │ │ +
1125 patchCoords->BindMTLBuffer(context),
│ │ │ │ +
1126 patchTable->GetPatchArrays(),
│ │ │ │ +
1127 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1128 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1129 context);
│ │ │ │ +
1130 }
│ │ │ │ +
1131
│ │ │ │ +
1132 bool EvalPatches(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1133 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1134 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1135 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1136 int numPatchCoords,
│ │ │ │ +
1137 id<MTLBuffer> patchCoordsBuffer,
│ │ │ │ +
1138 const PatchArrayVector &patchArrays,
│ │ │ │ +
1139 id<MTLBuffer> patchIndexBuffer,
│ │ │ │ +
1140 id<MTLBuffer> patchParamsBuffer,
│ │ │ │ +
1141 MTLContext* context) const;
│ │ │ │ +
1142
│ │ │ │ +
1143 bool EvalPatches(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1144 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1145 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1146 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1147 id<MTLBuffer> duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1148 id<MTLBuffer> duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1149 id<MTLBuffer> dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1150 int numPatchCoords,
│ │ │ │ +
1151 id<MTLBuffer> patchCoordsBuffer,
│ │ │ │ +
1152 const PatchArrayVector &patchArrays,
│ │ │ │ +
1153 id<MTLBuffer> patchIndexBuffer,
│ │ │ │ +
1154 id<MTLBuffer> patchParamsBuffer,
│ │ │ │ +
1155 MTLContext* context) const;
│ │ │ │ +
1156
│ │ │ │ +
1190 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1191 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1193 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1194 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1195 int numPatchCoords,
│ │ │ │ +
1196 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1197 PATCH_TABLE *patchTable,
│ │ │ │ +
1198 MTLComputeEvaluator const *instance,
│ │ │ │ +
1199 MTLContext* deviceContext) {
│ │ │ │ +
1200
│ │ │ │ +
1201 if (instance) {
│ │ │ │ +
1202 return instance->EvalPatchesVarying(
│ │ │ │ +
1203 srcBuffer, srcDesc,
│ │ │ │ +
1204 dstBuffer, dstDesc,
│ │ │ │ +
1205 numPatchCoords, patchCoords,
│ │ │ │ +
1206 patchTable,
│ │ │ │ +
1207 deviceContext);
│ │ │ │ +
1208 } else {
│ │ │ │ +
1209 // Create an instance on demand (slow)
│ │ │ │ +
1210 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1213 deviceContext);
│ │ │ │ +
1214 if (instance) {
│ │ │ │ +
1215 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1216 srcBuffer, srcDesc,
│ │ │ │ +
1217 dstBuffer, dstDesc,
│ │ │ │ +
1218 numPatchCoords, patchCoords,
│ │ │ │ +
1219 patchTable,
│ │ │ │ +
1220 deviceContext);
│ │ │ │ +
1221 delete instance;
│ │ │ │ +
1222 return r;
│ │ │ │ +
1223 }
│ │ │ │ +
1224 return false;
│ │ │ │ +
1225 }
│ │ │ │ +
1226 }
│ │ │ │ +
1227
│ │ │ │ +
1255 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1256 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1258 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1259 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1260 int numPatchCoords,
│ │ │ │ +
1261 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1262 PATCH_TABLE *patchTable,
│ │ │ │ +
1263 MTLContext* deviceContext) const {
│ │ │ │ +
1264
│ │ │ │ +
1265 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
1266 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
1267 0, BufferDescriptor(),
│ │ │ │ +
1268 0, BufferDescriptor(),
│ │ │ │ +
1269 numPatchCoords,
│ │ │ │ +
1270 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
1271 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1272 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1273 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1274 deviceContext
│ │ │ │ +
1275 );
│ │ │ │ +
1276 }
│ │ │ │ +
1277
│ │ │ │ +
1323 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1324 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1326 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1327 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1328 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1329 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1330 int numPatchCoords,
│ │ │ │ +
1331 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1332 PATCH_TABLE *patchTable,
│ │ │ │ +
1333 MTLComputeEvaluator const *instance,
│ │ │ │ +
1334 MTLContext* deviceContext) {
│ │ │ │ +
1335
│ │ │ │ +
1336 if (instance) {
│ │ │ │ +
1337 return instance->EvalPatchesVarying(
│ │ │ │ +
1338 srcBuffer, srcDesc,
│ │ │ │ +
1339 dstBuffer, dstDesc,
│ │ │ │ +
1340 duBuffer, duDesc,
│ │ │ │ +
1341 dvBuffer, dvDesc,
│ │ │ │ +
1342 numPatchCoords, patchCoords,
│ │ │ │ +
1343 patchTable,
│ │ │ │ +
1344 deviceContext);
│ │ │ │ +
1345 } else {
│ │ │ │ +
1346 // Create an instance on demand (slow)
│ │ │ │ +
1347 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1348 duDesc, dvDesc,
│ │ │ │ +
1349 deviceContext);
│ │ │ │ +
1350 if (instance) {
│ │ │ │ +
1351 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1352 srcBuffer, srcDesc,
│ │ │ │ +
1353 dstBuffer, dstDesc,
│ │ │ │ +
1354 duBuffer, duDesc,
│ │ │ │ +
1355 dvBuffer, dvDesc,
│ │ │ │ +
1356 numPatchCoords, patchCoords,
│ │ │ │ +
1357 patchTable,
│ │ │ │ +
1358 deviceContext);
│ │ │ │ +
1359 delete instance;
│ │ │ │ +
1360 return r;
│ │ │ │ +
1361 }
│ │ │ │ +
1362 return false;
│ │ │ │ +
1363 }
│ │ │ │ +
1364 }
│ │ │ │ +
1365
│ │ │ │ +
1405 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1406 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1408 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1409 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1410 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1411 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1412 int numPatchCoords,
│ │ │ │ +
1413 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1414 PATCH_TABLE *patchTable,
│ │ │ │ +
1415 MTLContext* deviceContext) const {
│ │ │ │ +
1416
│ │ │ │ +
1417 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
1418 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
1419 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ +
1420 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ +
1421 numPatchCoords,
│ │ │ │ +
1422 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
1423 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1424 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1425 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1426 deviceContext
│ │ │ │ +
1427 );
│ │ │ │ +
1428 }
│ │ │ │ +
1429
│ │ │ │ +
1430
│ │ │ │ +
1494 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1495 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1497 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1498 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1499 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1500 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1501 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1502 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1503 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1504 int numPatchCoords,
│ │ │ │ +
1505 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1506 PATCH_TABLE *patchTable,
│ │ │ │ +
1507 MTLComputeEvaluator const *instance,
│ │ │ │ +
1508 MTLContext* deviceContext) {
│ │ │ │ +
1509
│ │ │ │ +
1510 if (instance) {
│ │ │ │ +
1511 return instance->EvalPatchesVarying(
│ │ │ │ +
1512 srcBuffer, srcDesc,
│ │ │ │ +
1513 dstBuffer, dstDesc,
│ │ │ │ +
1514 duBuffer, duDesc,
│ │ │ │ +
1515 dvBuffer, dvDesc,
│ │ │ │ +
1516 duuBuffer, duuDesc,
│ │ │ │ +
1517 duvBuffer, duvDesc,
│ │ │ │ +
1518 dvvBuffer, dvvDesc,
│ │ │ │ +
1519 numPatchCoords, patchCoords,
│ │ │ │ +
1520 patchTable,
│ │ │ │ +
1521 deviceContext);
│ │ │ │ +
1522 } else {
│ │ │ │ +
1523 // Create an instance on demand (slow)
│ │ │ │ +
1524 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1525 duDesc, dvDesc,
│ │ │ │ +
1526 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
1527 deviceContext);
│ │ │ │ +
1528 if (instance) {
│ │ │ │ +
1529 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1530 srcBuffer, srcDesc,
│ │ │ │ +
1531 dstBuffer, dstDesc,
│ │ │ │ +
1532 duBuffer, duDesc,
│ │ │ │ +
1533 dvBuffer, dvDesc,
│ │ │ │ +
1534 duuBuffer, duuDesc,
│ │ │ │ +
1535 duvBuffer, duvDesc,
│ │ │ │ +
1536 dvvBuffer, dvvDesc,
│ │ │ │ +
1537 numPatchCoords, patchCoords,
│ │ │ │ +
1538 patchTable,
│ │ │ │ +
1539 deviceContext);
│ │ │ │ +
1540 delete instance;
│ │ │ │ +
1541 return r;
│ │ │ │ +
1542 }
│ │ │ │ +
1543 return false;
│ │ │ │ +
1544 }
│ │ │ │ +
1545 }
│ │ │ │ +
1546
│ │ │ │ +
1604 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1605 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1609 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1610 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1611 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1612 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1613 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1614 int numPatchCoords,
│ │ │ │ +
1615 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1616 PATCH_TABLE *patchTable,
│ │ │ │ +
1617 MTLContext* deviceContext) const {
│ │ │ │ +
1618
│ │ │ │ +
1619 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
1620 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
1621 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ +
1622 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ +
1623 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
│ │ │ │ +
1624 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
│ │ │ │ +
1625 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
│ │ │ │ +
1626 numPatchCoords,
│ │ │ │ +
1627 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
1628 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1629 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1630 patchTable->GetPatchParamBuffer(),
│ │ │ │ +
1631 deviceContext
│ │ │ │ +
1632 );
│ │ │ │ +
1633 }
│ │ │ │ +
1634
│ │ │ │ +
1670 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1671 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1673 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1674 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1675 int numPatchCoords,
│ │ │ │ +
1676 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1677 PATCH_TABLE *patchTable,
│ │ │ │ +
1678 int fvarChannel,
│ │ │ │ +
1679 MTLComputeEvaluator const *instance,
│ │ │ │ +
1680 MTLContext* deviceContext) {
│ │ │ │ +
1681
│ │ │ │ +
1682 if (instance) {
│ │ │ │ +
1683 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1684 srcBuffer, srcDesc,
│ │ │ │ +
1685 dstBuffer, dstDesc,
│ │ │ │ +
1686 numPatchCoords, patchCoords,
│ │ │ │ +
1687 patchTable,
│ │ │ │ +
1688 fvarChannel,
│ │ │ │ +
1689 deviceContext);
│ │ │ │ +
1690 } else {
│ │ │ │ +
1691 // Create an instance on demand (slow)
│ │ │ │ +
1692 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1695 deviceContext);
│ │ │ │ +
1696 if (instance) {
│ │ │ │ +
1697 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1698 srcBuffer, srcDesc,
│ │ │ │ +
1699 dstBuffer, dstDesc,
│ │ │ │ +
1700 numPatchCoords, patchCoords,
│ │ │ │ +
1701 patchTable,
│ │ │ │ +
1702 fvarChannel,
│ │ │ │ +
1703 deviceContext);
│ │ │ │ +
1704 delete instance;
│ │ │ │ +
1705 return r;
│ │ │ │ +
1706 }
│ │ │ │ +
1707 return false;
│ │ │ │ +
1708 }
│ │ │ │ +
1709 }
│ │ │ │ +
1710
│ │ │ │ +
1740 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1741 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1745 int numPatchCoords,
│ │ │ │ +
1746 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1747 PATCH_TABLE *patchTable,
│ │ │ │ +
1748 int fvarChannel,
│ │ │ │ +
1749 MTLContext* deviceContext) const {
│ │ │ │ +
1750
│ │ │ │ +
1751 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
1752 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
1753 0, BufferDescriptor(),
│ │ │ │ +
1754 0, BufferDescriptor(),
│ │ │ │ +
1755 numPatchCoords,
│ │ │ │ +
1756 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
1757 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1758 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1759 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
1760 deviceContext
│ │ │ │ +
1761 );
│ │ │ │ +
1762 }
│ │ │ │ +
1763
│ │ │ │ +
1811 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1812 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1814 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1815 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1816 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1817 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1818 int numPatchCoords,
│ │ │ │ +
1819 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1820 PATCH_TABLE *patchTable,
│ │ │ │ +
1821 int fvarChannel,
│ │ │ │ +
1822 MTLComputeEvaluator const *instance,
│ │ │ │ +
1823 MTLContext* deviceContext) {
│ │ │ │ +
1824
│ │ │ │ +
1825 if (instance) {
│ │ │ │ +
1826 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1827 srcBuffer, srcDesc,
│ │ │ │ +
1828 dstBuffer, dstDesc,
│ │ │ │ +
1829 duBuffer, duDesc,
│ │ │ │ +
1830 dvBuffer, dvDesc,
│ │ │ │ +
1831 numPatchCoords, patchCoords,
│ │ │ │ +
1832 patchTable,
│ │ │ │ +
1833 fvarChannel,
│ │ │ │ +
1834 deviceContext);
│ │ │ │ +
1835 } else {
│ │ │ │ +
1836 // Create an instance on demand (slow)
│ │ │ │ +
1837 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1838 duDesc, dvDesc,
│ │ │ │ +
1839 deviceContext);
│ │ │ │ +
1840 if (instance) {
│ │ │ │ +
1841 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1842 srcBuffer, srcDesc,
│ │ │ │ +
1843 dstBuffer, dstDesc,
│ │ │ │ +
1844 duBuffer, duDesc,
│ │ │ │ +
1845 dvBuffer, dvDesc,
│ │ │ │ +
1846 numPatchCoords, patchCoords,
│ │ │ │ +
1847 patchTable,
│ │ │ │ +
1848 fvarChannel,
│ │ │ │ +
1849 deviceContext);
│ │ │ │ +
1850 delete instance;
│ │ │ │ +
1851 return r;
│ │ │ │ +
1852 }
│ │ │ │ +
1853 return false;
│ │ │ │ +
1854 }
│ │ │ │ +
1855 }
│ │ │ │ +
1856
│ │ │ │ +
1898 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1899 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1901 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1902 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1903 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1904 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1905 int numPatchCoords,
│ │ │ │ +
1906 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1907 PATCH_TABLE *patchTable,
│ │ │ │ +
1908 int fvarChannel,
│ │ │ │ +
1909 MTLContext* deviceContext) const {
│ │ │ │ +
1910
│ │ │ │ +
1911 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
1912 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
1913 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ +
1914 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ +
1915 numPatchCoords,
│ │ │ │ +
1916 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
1917 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1918 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1919 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
1920 deviceContext
│ │ │ │ +
1921 );
│ │ │ │ +
1922 }
│ │ │ │ +
1923
│ │ │ │ +
1989 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1990 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1992 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1993 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1994 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1995 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1996 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1997 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1998 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1999 int numPatchCoords,
│ │ │ │ +
2000 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2001 PATCH_TABLE *patchTable,
│ │ │ │ +
2002 int fvarChannel,
│ │ │ │ +
2003 MTLComputeEvaluator const *instance,
│ │ │ │ +
2004 MTLContext* deviceContext) {
│ │ │ │ +
2005
│ │ │ │ +
2006 if (instance) {
│ │ │ │ +
2007 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
2008 srcBuffer, srcDesc,
│ │ │ │ +
2009 dstBuffer, dstDesc,
│ │ │ │ +
2010 duBuffer, duDesc,
│ │ │ │ +
2011 dvBuffer, dvDesc,
│ │ │ │ +
2012 duuBuffer, duuDesc,
│ │ │ │ +
2013 duvBuffer, duvDesc,
│ │ │ │ +
2014 dvvBuffer, dvvDesc,
│ │ │ │ +
2015 numPatchCoords, patchCoords,
│ │ │ │ +
2016 patchTable,
│ │ │ │ +
2017 fvarChannel,
│ │ │ │ +
2018 deviceContext);
│ │ │ │ +
2019 } else {
│ │ │ │ +
2020 // Create an instance on demand (slow)
│ │ │ │ +
2021 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
2022 duDesc, dvDesc,
│ │ │ │ +
2023 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
2024 deviceContext);
│ │ │ │ +
2025 if (instance) {
│ │ │ │ +
2026 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
2027 srcBuffer, srcDesc,
│ │ │ │ +
2028 dstBuffer, dstDesc,
│ │ │ │ +
2029 duBuffer, duDesc,
│ │ │ │ +
2030 dvBuffer, dvDesc,
│ │ │ │ +
2031 duuBuffer, duuDesc,
│ │ │ │ +
2032 duvBuffer, duvDesc,
│ │ │ │ +
2033 dvvBuffer, dvvDesc,
│ │ │ │ +
2034 numPatchCoords, patchCoords,
│ │ │ │ +
2035 patchTable,
│ │ │ │ +
2036 fvarChannel,
│ │ │ │ +
2037 deviceContext);
│ │ │ │ +
2038 delete instance;
│ │ │ │ +
2039 return r;
│ │ │ │ +
2040 }
│ │ │ │ +
2041 return false;
│ │ │ │ +
2042 }
│ │ │ │ +
2043 }
│ │ │ │ +
2044
│ │ │ │ +
2104 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2105 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2107 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2108 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2109 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2110 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2111 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
2112 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
2113 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
2114 int numPatchCoords,
│ │ │ │ +
2115 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2116 PATCH_TABLE *patchTable,
│ │ │ │ +
2117 int fvarChannel,
│ │ │ │ +
2118 MTLContext* deviceContext) const {
│ │ │ │ +
2119
│ │ │ │ +
2120 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ +
2121 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ +
2122 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ +
2123 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ +
2124 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
│ │ │ │ +
2125 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
│ │ │ │ +
2126 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
│ │ │ │ +
2127 numPatchCoords,
│ │ │ │ +
2128 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ +
2129 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
2130 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
2131 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ +
2132 fvarChannel,
│ │ │ │ +
2133 deviceContext
│ │ │ │ +
2134 );
│ │ │ │ +
2135 }
│ │ │ │ +
2136
│ │ │ │ +
2138 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2139 BufferDescriptor const &dstDesc,
│ │ │ │ +
2140 BufferDescriptor const &duDesc,
│ │ │ │ +
2141 BufferDescriptor const &dvDesc,
│ │ │ │ +
2142 BufferDescriptor const &duuDesc,
│ │ │ │ +
2143 BufferDescriptor const &duvDesc,
│ │ │ │ +
2144 BufferDescriptor const &dvvDesc,
│ │ │ │ +
2145 MTLContext* context);
│ │ │ │ +
2146
│ │ │ │ +
2148 static void Synchronize(MTLContext* context);
│ │ │ │ +
2149
│ │ │ │ +
2150 private:
│ │ │ │ +
2151
│ │ │ │ +
2152 id<MTLLibrary> _computeLibrary;
│ │ │ │ +
2153 id<MTLComputePipelineState> _evalStencils;
│ │ │ │ +
2154 id<MTLComputePipelineState> _evalPatches;
│ │ │ │ +
2155 id<MTLBuffer> _parameterBuffer;
│ │ │ │ +
2156
│ │ │ │ +
2157 int _workGroupSize;
│ │ │ │ +
2158};
│ │ │ │ +
2159
│ │ │ │ +
2160} //end namespace Osd
│ │ │ │ +
2161
│ │ │ │ +
2162} //end namespace OPENSUBDIV_VERSION
│ │ │ │ +
2163using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
2164
│ │ │ │ +
2165} //end namespace OpenSubdiv
│ │ │ │ +
2166
│ │ │ │ +
2167#endif // OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │ │ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ - │ │ │ │ -
CLStencilTable(Far::StencilTable const *stencilTable, cl_context clContext)
│ │ │ │ - │ │ │ │ -
static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:61
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static CLStencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:55
│ │ │ │ -
CLStencilTable(Far::LimitStencilTable const *limitStencilTable, cl_context clContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:309
│ │ │ │ -
static void Synchronize(cl_command_queue queue)
│ │ │ │ - │ │ │ │ -
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:219
│ │ │ │ -
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition: clEvaluator.h:116
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2231
│ │ │ │ -
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1978
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:561
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: clEvaluator.h:1379
│ │ │ │ - │ │ │ │ -
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition: clEvaluator.h:106
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2061
│ │ │ │ -
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition: clEvaluator.h:131
│ │ │ │ -
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ -
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, cl_mem duuWeights, cl_mem duvWeights, cl_mem dvvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2564
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1217
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:646
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1653
│ │ │ │ -
static void Synchronize(DEVICE_CONTEXT deviceContext)
Wait the OpenCL kernels finish.
Definition: clEvaluator.h:2613
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1125
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:421
│ │ │ │ -
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1489
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2329
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2437
│ │ │ │ -
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition: clEvaluator.h:145
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1003
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1749
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:902
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1568
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1854
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition: clEvaluator.h:500
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: clEvaluator.h:1288
│ │ │ │ -
CLEvaluator(cl_context context, cl_command_queue queue)
Constructor.
│ │ │ │ -
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:2143
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ + │ │ │ │ +
MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext *context)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT context)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, id< MTLBuffer > duuWeightsBuffer, id< MTLBuffer > duvWeightsBuffer, id< MTLBuffer > dvvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ + │ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ +
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static void Synchronize(MTLContext *context)
Wait for the dispatched kernel to finish.
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ +
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, MTLContext *context)
│ │ │ │ +
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
│ │ │ │ +
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
Configure compute pipline state. Returns false if it fails to create the pipeline state.
│ │ │ │ +
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -clEvaluator.h │ │ │ │ │ +mtlComputeEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,1556 +30,1388 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/opencl.h" │ │ │ │ │ - 31#include "../osd/types.h" │ │ │ │ │ - 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 30#include "../osd/types.h" │ │ │ │ │ + 31#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 32#include "../osd/mtlCommon.h" │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 class PatchTable; │ │ │ │ │ - 39 class StencilTable; │ │ │ │ │ - 40 class LimitStencilTable; │ │ │ │ │ - 41} │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ - 44 │ │ │ │ │ -52class CLStencilTable { │ │ │ │ │ - 53public: │ │ │ │ │ - 54 template │ │ │ │ │ -55 static CLStencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ - 56 DEVICE_CONTEXT context) { │ │ │ │ │ - 57 return new CLStencilTable(stencilTable, context->GetContext()); │ │ │ │ │ + 34@protocol MTLDevice; │ │ │ │ │ + 35@protocol MTLBuffer; │ │ │ │ │ + 36@protocol MTLLibrary; │ │ │ │ │ + 37@protocol MTLComputePipelineState; │ │ │ │ │ + 38 │ │ │ │ │ + 39namespace OpenSubdiv { │ │ │ │ │ + 40namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 41 │ │ │ │ │ + 42namespace Far { │ │ │ │ │ + 43 class PatchTable; │ │ │ │ │ + 44 class StencilTable; │ │ │ │ │ + 45 class LimitStencilTable; │ │ │ │ │ + 46} │ │ │ │ │ + 47 │ │ │ │ │ + 48namespace Osd { │ │ │ │ │ + 49 │ │ │ │ │ +50class MTLStencilTable │ │ │ │ │ + 51{ │ │ │ │ │ + 52public: │ │ │ │ │ + 53 template │ │ │ │ │ +54 static MTLStencilTable* Create(STENCIL_TABLE* stencilTable, │ │ │ │ │ + 55 DEVICE_CONTEXT context) │ │ │ │ │ + 56 { │ │ │ │ │ + 57 return new MTLStencilTable(stencilTable, context); │ │ │ │ │ 58 } │ │ │ │ │ 59 │ │ │ │ │ - 60 template │ │ │ │ │ -61 static CLStencilTable *Create( │ │ │ │ │ - 62 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ - 63 DEVICE_CONTEXT context) { │ │ │ │ │ - 64 return new CLStencilTable(limitStencilTable, context->GetContext()); │ │ │ │ │ - 65 } │ │ │ │ │ - 66 │ │ │ │ │ -67 CLStencilTable(Far::StencilTable const *stencilTable, │ │ │ │ │ - 68 cl_context clContext); │ │ │ │ │ -69 CLStencilTable(Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ - 70 cl_context clContext); │ │ │ │ │ -71 ~CLStencilTable(); │ │ │ │ │ - 72 │ │ │ │ │ - 73 // interfaces needed for CLComputeKernel │ │ │ │ │ -74 cl_mem GetSizesBuffer() const { return _sizes; } │ │ │ │ │ -75 cl_mem GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ -76 cl_mem GetIndicesBuffer() const { return _indices; } │ │ │ │ │ -77 cl_mem GetWeightsBuffer() const { return _weights; } │ │ │ │ │ -78 cl_mem GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ -79 cl_mem GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ -80 cl_mem GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ -81 cl_mem GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ -82 cl_mem GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ -83 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ - 84 │ │ │ │ │ - 85private: │ │ │ │ │ - 86 cl_mem _sizes; │ │ │ │ │ - 87 cl_mem _offsets; │ │ │ │ │ - 88 cl_mem _indices; │ │ │ │ │ - 89 cl_mem _weights; │ │ │ │ │ - 90 cl_mem _duWeights; │ │ │ │ │ - 91 cl_mem _dvWeights; │ │ │ │ │ - 92 cl_mem _duuWeights; │ │ │ │ │ - 93 cl_mem _duvWeights; │ │ │ │ │ - 94 cl_mem _dvvWeights; │ │ │ │ │ - 95 int _numStencils; │ │ │ │ │ - 96}; │ │ │ │ │ - 97 │ │ │ │ │ - 98// ------------------------------------------------------------------------- │ │ │ │ │ --- │ │ │ │ │ - 99 │ │ │ │ │ -100class CLEvaluator { │ │ │ │ │ - 101public: │ │ │ │ │ -102 typedef bool Instantiatable; │ │ │ │ │ - 103 │ │ │ │ │ - 105 template │ │ │ │ │ -106 static CLEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 107 BufferDescriptor const &dstDesc, │ │ │ │ │ - 108 BufferDescriptor const &duDesc, │ │ │ │ │ - 109 BufferDescriptor const &dvDesc, │ │ │ │ │ - 110 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ - 111 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 112 deviceContext->GetContext(), │ │ │ │ │ - 113 deviceContext->GetCommandQueue()); │ │ │ │ │ - 114 } │ │ │ │ │ - 115 │ │ │ │ │ -116 static CLEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 117 BufferDescriptor const &dstDesc, │ │ │ │ │ - 118 BufferDescriptor const &duDesc, │ │ │ │ │ - 119 BufferDescriptor const &dvDesc, │ │ │ │ │ - 120 cl_context clContext, │ │ │ │ │ - 121 cl_command_queue clCommandQueue) { │ │ │ │ │ - 122 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue); │ │ │ │ │ - 123 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc)) │ │ │ │ │ - 124 return instance; │ │ │ │ │ - 125 delete instance; │ │ │ │ │ - 126 return NULL; │ │ │ │ │ - 127 } │ │ │ │ │ - 128 │ │ │ │ │ - 130 template │ │ │ │ │ -131 static CLEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 132 BufferDescriptor const &dstDesc, │ │ │ │ │ - 133 BufferDescriptor const &duDesc, │ │ │ │ │ - 134 BufferDescriptor const &dvDesc, │ │ │ │ │ - 135 BufferDescriptor const &duuDesc, │ │ │ │ │ - 136 BufferDescriptor const &duvDesc, │ │ │ │ │ - 137 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 138 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ - 139 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 140 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 141 deviceContext->GetContext(), │ │ │ │ │ - 142 deviceContext->GetCommandQueue()); │ │ │ │ │ - 143 } │ │ │ │ │ - 144 │ │ │ │ │ -145 static CLEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 146 BufferDescriptor const &dstDesc, │ │ │ │ │ - 147 BufferDescriptor const &duDesc, │ │ │ │ │ - 148 BufferDescriptor const &dvDesc, │ │ │ │ │ - 149 BufferDescriptor const &duuDesc, │ │ │ │ │ - 150 BufferDescriptor const &duvDesc, │ │ │ │ │ - 151 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 152 cl_context clContext, │ │ │ │ │ - 153 cl_command_queue clCommandQueue) { │ │ │ │ │ - 154 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue); │ │ │ │ │ - 155 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 156 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ - 157 return instance; │ │ │ │ │ - 158 delete instance; │ │ │ │ │ - 159 return NULL; │ │ │ │ │ - 160 } │ │ │ │ │ - 161 │ │ │ │ │ -163 CLEvaluator(cl_context context, cl_command_queue queue); │ │ │ │ │ - 164 │ │ │ │ │ -166 ~CLEvaluator(); │ │ │ │ │ - 167 │ │ │ │ │ - 173 │ │ │ │ │ - 217 template │ │ │ │ │ -219 static bool EvalStencils( │ │ │ │ │ - 220 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 221 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 222 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 223 CLEvaluator const *instance, │ │ │ │ │ - 224 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 225 unsigned int numStartEvents=0, │ │ │ │ │ - 226 const cl_event* startEvents=NULL, │ │ │ │ │ - 227 cl_event* endEvent=NULL) { │ │ │ │ │ + 60 │ │ │ │ │ +61 MTLStencilTable(Far::StencilTable const* stencilTable, MTLContext* context); │ │ │ │ │ +62 MTLStencilTable(Far::LimitStencilTable const* stencilTable, MTLContext* │ │ │ │ │ +context); │ │ │ │ │ +63 ~MTLStencilTable(); │ │ │ │ │ + 64 │ │ │ │ │ +65 id GetSizesBuffer() const { return _sizesBuffer; } │ │ │ │ │ +66 id GetOffsetsBuffer() const { return _offsetsBuffer; } │ │ │ │ │ +67 id GetIndicesBuffer() const { return _indicesBuffer; } │ │ │ │ │ +68 id GetWeightsBuffer() const { return _weightsBuffer; } │ │ │ │ │ +69 id GetDuWeightsBuffer() const { return _duWeightsBuffer; } │ │ │ │ │ +70 id GetDvWeightsBuffer() const { return _dvWeightsBuffer; } │ │ │ │ │ +71 id GetDuuWeightsBuffer() const { return _duuWeightsBuffer; } │ │ │ │ │ +72 id GetDuvWeightsBuffer() const { return _duvWeightsBuffer; } │ │ │ │ │ +73 id GetDvvWeightsBuffer() const { return _dvvWeightsBuffer; } │ │ │ │ │ + 74 │ │ │ │ │ +75 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 76 │ │ │ │ │ + 77private: │ │ │ │ │ + 78 id _sizesBuffer; │ │ │ │ │ + 79 id _offsetsBuffer; │ │ │ │ │ + 80 id _indicesBuffer; │ │ │ │ │ + 81 id _weightsBuffer; │ │ │ │ │ + 82 id _duWeightsBuffer; │ │ │ │ │ + 83 id _dvWeightsBuffer; │ │ │ │ │ + 84 id _duuWeightsBuffer; │ │ │ │ │ + 85 id _duvWeightsBuffer; │ │ │ │ │ + 86 id _dvvWeightsBuffer; │ │ │ │ │ + 87 │ │ │ │ │ + 88 int _numStencils; │ │ │ │ │ + 89}; │ │ │ │ │ + 90 │ │ │ │ │ +91class MTLComputeEvaluator │ │ │ │ │ + 92{ │ │ │ │ │ + 93public: │ │ │ │ │ +94 typedef bool Instantiatable; │ │ │ │ │ + 95 │ │ │ │ │ +96 static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 97 BufferDescriptor const &dstDesc, │ │ │ │ │ + 98 BufferDescriptor const &duDesc, │ │ │ │ │ + 99 BufferDescriptor const &dvDesc, │ │ │ │ │ + 100 MTLContext* context); │ │ │ │ │ + 101 │ │ │ │ │ +102 static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 103 BufferDescriptor const &dstDesc, │ │ │ │ │ + 104 BufferDescriptor const &duDesc, │ │ │ │ │ + 105 BufferDescriptor const &dvDesc, │ │ │ │ │ + 106 BufferDescriptor const &duuDesc, │ │ │ │ │ + 107 BufferDescriptor const &duvDesc, │ │ │ │ │ + 108 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 109 MTLContext* context); │ │ │ │ │ + 110 │ │ │ │ │ +111 MTLComputeEvaluator(); │ │ │ │ │ +112 ~MTLComputeEvaluator(); │ │ │ │ │ + 113 │ │ │ │ │ + 119 │ │ │ │ │ + 148 template │ │ │ │ │ +149 static bool EvalStencils( │ │ │ │ │ + 150 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 151 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 152 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 153 MTLComputeEvaluator const *instance, │ │ │ │ │ + 154 MTLContext* context) │ │ │ │ │ + 155 { │ │ │ │ │ + 156 if (instance) { │ │ │ │ │ + 157 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 158 dstBuffer, dstDesc, │ │ │ │ │ + 159 stencilTable, │ │ │ │ │ + 160 context); │ │ │ │ │ + 161 } else { │ │ │ │ │ + 162 // Create an instance on demand (slow) │ │ │ │ │ + 163 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 164 BufferDescriptor(), │ │ │ │ │ + 165 BufferDescriptor(), │ │ │ │ │ + 166 context); │ │ │ │ │ + 167 if (instance) { │ │ │ │ │ + 168 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 169 dstBuffer, dstDesc, │ │ │ │ │ + 170 stencilTable, │ │ │ │ │ + 171 context); │ │ │ │ │ + 172 delete instance; │ │ │ │ │ + 173 return r; │ │ │ │ │ + 174 } │ │ │ │ │ + 175 return false; │ │ │ │ │ + 176 } │ │ │ │ │ + 177 } │ │ │ │ │ + 178 │ │ │ │ │ + 219 template │ │ │ │ │ +220 static bool EvalStencils( │ │ │ │ │ + 221 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 222 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 223 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 224 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 225 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 226 MTLComputeEvaluator const *instance, │ │ │ │ │ + 227 MTLContext* context) { │ │ │ │ │ 228 │ │ │ │ │ 229 if (instance) { │ │ │ │ │ 230 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ 231 dstBuffer, dstDesc, │ │ │ │ │ - 232 stencilTable, │ │ │ │ │ - 233 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 234 } else { │ │ │ │ │ - 235 // Create an instance on demand (slow) │ │ │ │ │ - 236 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 237 BufferDescriptor(), │ │ │ │ │ - 238 BufferDescriptor(), │ │ │ │ │ - 239 deviceContext); │ │ │ │ │ - 240 if (instance) { │ │ │ │ │ - 241 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 242 dstBuffer, dstDesc, │ │ │ │ │ - 243 stencilTable, │ │ │ │ │ - 244 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 245 delete instance; │ │ │ │ │ - 246 return r; │ │ │ │ │ - 247 } │ │ │ │ │ - 248 return false; │ │ │ │ │ - 249 } │ │ │ │ │ + 232 duBuffer, duDesc, │ │ │ │ │ + 233 dvBuffer, dvDesc, │ │ │ │ │ + 234 stencilTable, │ │ │ │ │ + 235 context); │ │ │ │ │ + 236 } else { │ │ │ │ │ + 237 // Create an instance on demand (slow) │ │ │ │ │ + 238 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context); │ │ │ │ │ + 239 if (instance) { │ │ │ │ │ + 240 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 241 dstBuffer, dstDesc, │ │ │ │ │ + 242 duBuffer, duDesc, │ │ │ │ │ + 243 dvBuffer, dvDesc, │ │ │ │ │ + 244 stencilTable, │ │ │ │ │ + 245 context); │ │ │ │ │ + 246 delete instance; │ │ │ │ │ + 247 return r; │ │ │ │ │ + 248 } │ │ │ │ │ + 249 return false; │ │ │ │ │ 250 } │ │ │ │ │ - 251 │ │ │ │ │ - 307 template │ │ │ │ │ -309 static bool EvalStencils( │ │ │ │ │ - 310 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 311 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 312 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 313 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 314 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 315 CLEvaluator const *instance, │ │ │ │ │ - 316 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 317 unsigned int numStartEvents=0, │ │ │ │ │ - 318 const cl_event* startEvents=NULL, │ │ │ │ │ - 319 cl_event* endEvent=NULL) { │ │ │ │ │ - 320 │ │ │ │ │ - 321 if (instance) { │ │ │ │ │ - 322 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 323 dstBuffer, dstDesc, │ │ │ │ │ - 324 duBuffer, duDesc, │ │ │ │ │ - 325 dvBuffer, dvDesc, │ │ │ │ │ - 326 stencilTable, │ │ │ │ │ - 327 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 328 } else { │ │ │ │ │ - 329 // Create an instance on demand (slow) │ │ │ │ │ - 330 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 331 deviceContext); │ │ │ │ │ - 332 if (instance) { │ │ │ │ │ - 333 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 334 dstBuffer, dstDesc, │ │ │ │ │ - 335 duBuffer, duDesc, │ │ │ │ │ - 336 dvBuffer, dvDesc, │ │ │ │ │ - 337 stencilTable, │ │ │ │ │ - 338 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 339 delete instance; │ │ │ │ │ - 340 return r; │ │ │ │ │ - 341 } │ │ │ │ │ - 342 return false; │ │ │ │ │ - 343 } │ │ │ │ │ - 344 } │ │ │ │ │ - 345 │ │ │ │ │ - 419 template │ │ │ │ │ -421 static bool EvalStencils( │ │ │ │ │ - 422 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 423 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 424 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 425 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 426 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 427 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 428 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 429 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 430 CLEvaluator const *instance, │ │ │ │ │ - 431 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 432 unsigned int numStartEvents=0, │ │ │ │ │ - 433 const cl_event* startEvents=NULL, │ │ │ │ │ - 434 cl_event* endEvent=NULL) { │ │ │ │ │ - 435 │ │ │ │ │ - 436 if (instance) { │ │ │ │ │ - 437 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 438 dstBuffer, dstDesc, │ │ │ │ │ - 439 duBuffer, duDesc, │ │ │ │ │ - 440 dvBuffer, dvDesc, │ │ │ │ │ - 441 duuBuffer, duuDesc, │ │ │ │ │ - 442 duvBuffer, duvDesc, │ │ │ │ │ - 443 dvvBuffer, dvvDesc, │ │ │ │ │ - 444 stencilTable, │ │ │ │ │ - 445 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 446 } else { │ │ │ │ │ - 447 // Create an instance on demand (slow) │ │ │ │ │ - 448 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 449 duDesc, dvDesc, │ │ │ │ │ - 450 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 451 deviceContext); │ │ │ │ │ - 452 if (instance) { │ │ │ │ │ - 453 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 454 dstBuffer, dstDesc, │ │ │ │ │ - 455 duBuffer, duDesc, │ │ │ │ │ - 456 dvBuffer, dvDesc, │ │ │ │ │ - 457 duuBuffer, duuDesc, │ │ │ │ │ - 458 duvBuffer, duvDesc, │ │ │ │ │ - 459 dvvBuffer, dvvDesc, │ │ │ │ │ - 460 stencilTable, │ │ │ │ │ - 461 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 462 delete instance; │ │ │ │ │ - 463 return r; │ │ │ │ │ - 464 } │ │ │ │ │ - 465 return false; │ │ │ │ │ - 466 } │ │ │ │ │ - 467 } │ │ │ │ │ - 468 │ │ │ │ │ - 499 template │ │ │ │ │ +312 static bool EvalStencils( │ │ │ │ │ + 313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 317 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 318 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 319 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 320 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 321 MTLComputeEvaluator const *instance, │ │ │ │ │ + 322 MTLContext* context) { │ │ │ │ │ + 323 │ │ │ │ │ + 324 if (instance) { │ │ │ │ │ + 325 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 326 dstBuffer, dstDesc, │ │ │ │ │ + 327 duBuffer, duDesc, │ │ │ │ │ + 328 dvBuffer, dvDesc, │ │ │ │ │ + 329 duuBuffer, duuDesc, │ │ │ │ │ + 330 duvBuffer, duvDesc, │ │ │ │ │ + 331 dvvBuffer, dvvDesc, │ │ │ │ │ + 332 stencilTable, │ │ │ │ │ + 333 context); │ │ │ │ │ + 334 } else { │ │ │ │ │ + 335 // Create an instance on demand (slow) │ │ │ │ │ + 336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 337 duuDesc, duvDesc, dvvDesc, context); │ │ │ │ │ + 338 if (instance) { │ │ │ │ │ + 339 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 340 dstBuffer, dstDesc, │ │ │ │ │ + 341 duBuffer, duDesc, │ │ │ │ │ + 342 dvBuffer, dvDesc, │ │ │ │ │ + 343 duuBuffer, duuDesc, │ │ │ │ │ + 344 duvBuffer, duvDesc, │ │ │ │ │ + 345 dvvBuffer, dvvDesc, │ │ │ │ │ + 346 stencilTable, │ │ │ │ │ + 347 context); │ │ │ │ │ + 348 delete instance; │ │ │ │ │ + 349 return r; │ │ │ │ │ + 350 } │ │ │ │ │ + 351 return false; │ │ │ │ │ + 352 } │ │ │ │ │ + 353 } │ │ │ │ │ + 354 │ │ │ │ │ + 375 template │ │ │ │ │ -500 bool EvalStencils( │ │ │ │ │ - 501 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 502 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 503 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 504 unsigned int numStartEvents=0, │ │ │ │ │ - 505 const cl_event* startEvents=NULL, │ │ │ │ │ - 506 cl_event* endEvent=NULL) const { │ │ │ │ │ - 507 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 508 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 509 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 510 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 511 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 512 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 513 0, │ │ │ │ │ - 514 stencilTable->GetNumStencils(), │ │ │ │ │ - 515 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 516 } │ │ │ │ │ - 517 │ │ │ │ │ - 560 template BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 383 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 384 0, BufferDescriptor(), │ │ │ │ │ + 385 0, BufferDescriptor(), │ │ │ │ │ + 386 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 387 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 388 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 389 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 390 0, │ │ │ │ │ + 391 0, │ │ │ │ │ + 392 /* start = */ 0, │ │ │ │ │ + 393 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ + 394 context); │ │ │ │ │ + 395 } │ │ │ │ │ + 396 │ │ │ │ │ + 429 template │ │ │ │ │ -561 bool EvalStencils( │ │ │ │ │ - 562 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 563 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 564 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 565 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 566 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 567 unsigned int numStartEvents=0, │ │ │ │ │ - 568 const cl_event* startEvents=NULL, │ │ │ │ │ - 569 cl_event* endEvent=NULL) const { │ │ │ │ │ - 570 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 571 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 572 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 573 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 574 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 575 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 576 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 577 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 578 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 579 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 580 0, │ │ │ │ │ - 581 stencilTable->GetNumStencils(), │ │ │ │ │ - 582 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 583 } │ │ │ │ │ - 584 │ │ │ │ │ - 645 template BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 439 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 440 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ + 441 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ + 442 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 443 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 444 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 445 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 446 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 447 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 448 /* start = */ 0, │ │ │ │ │ + 449 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ + 450 context); │ │ │ │ │ + 451 } │ │ │ │ │ + 452 │ │ │ │ │ + 503 template │ │ │ │ │ -646 bool EvalStencils( │ │ │ │ │ - 647 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 648 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 649 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 650 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 651 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 652 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 653 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 654 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 655 unsigned int numStartEvents=0, │ │ │ │ │ - 656 const cl_event* startEvents=NULL, │ │ │ │ │ - 657 cl_event* endEvent=NULL) const { │ │ │ │ │ - 658 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 659 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 660 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 661 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 662 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ - 663 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ - 664 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ - 665 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 666 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 667 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 668 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 669 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 670 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 671 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ - 672 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ - 673 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ - 674 0, │ │ │ │ │ - 675 stencilTable->GetNumStencils(), │ │ │ │ │ - 676 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 677 } │ │ │ │ │ - 678 │ │ │ │ │ -681 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 682 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 683 cl_mem sizes, │ │ │ │ │ - 684 cl_mem offsets, │ │ │ │ │ - 685 cl_mem indices, │ │ │ │ │ - 686 cl_mem weights, │ │ │ │ │ - 687 int start, │ │ │ │ │ - 688 int end, │ │ │ │ │ - 689 unsigned int numStartEvents=0, │ │ │ │ │ - 690 const cl_event* startEvents=NULL, │ │ │ │ │ - 691 cl_event* endEvent=NULL) const; │ │ │ │ │ - 692 │ │ │ │ │ -741 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 742 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 743 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ - 744 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 745 cl_mem sizes, │ │ │ │ │ - 746 cl_mem offsets, │ │ │ │ │ - 747 cl_mem indices, │ │ │ │ │ - 748 cl_mem weights, │ │ │ │ │ - 749 cl_mem duWeights, │ │ │ │ │ - 750 cl_mem dvWeights, │ │ │ │ │ - 751 int start, │ │ │ │ │ - 752 int end, │ │ │ │ │ - 753 unsigned int numStartEvents=0, │ │ │ │ │ - 754 const cl_event* startEvents=NULL, │ │ │ │ │ - 755 cl_event* endEvent=NULL) const; │ │ │ │ │ - 756 │ │ │ │ │ -823 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 824 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 825 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ - 826 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 827 cl_mem duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 828 cl_mem duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 829 cl_mem dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 830 cl_mem sizes, │ │ │ │ │ - 831 cl_mem offsets, │ │ │ │ │ - 832 cl_mem indices, │ │ │ │ │ - 833 cl_mem weights, │ │ │ │ │ - 834 cl_mem duWeights, │ │ │ │ │ - 835 cl_mem dvWeights, │ │ │ │ │ - 836 cl_mem duuWeights, │ │ │ │ │ - 837 cl_mem duvWeights, │ │ │ │ │ - 838 cl_mem dvvWeights, │ │ │ │ │ - 839 int start, │ │ │ │ │ - 840 int end, │ │ │ │ │ - 841 unsigned int numStartEvents=0, │ │ │ │ │ - 842 const cl_event* startEvents=NULL, │ │ │ │ │ - 843 cl_event* endEvent=NULL) const; │ │ │ │ │ - 844 │ │ │ │ │ - 850 │ │ │ │ │ - 899 template │ │ │ │ │ -902 static bool EvalPatches( │ │ │ │ │ - 903 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 904 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 905 int numPatchCoords, │ │ │ │ │ - 906 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 907 PATCH_TABLE *patchTable, │ │ │ │ │ - 908 CLEvaluator const *instance, │ │ │ │ │ - 909 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 910 unsigned int numStartEvents=0, │ │ │ │ │ - 911 const cl_event* startEvents=NULL, │ │ │ │ │ - 912 cl_event* endEvent=NULL) { │ │ │ │ │ - 913 │ │ │ │ │ - 914 if (instance) { │ │ │ │ │ - 915 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 916 dstBuffer, dstDesc, │ │ │ │ │ - 917 numPatchCoords, patchCoords, │ │ │ │ │ - 918 patchTable, │ │ │ │ │ - 919 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 920 } else { │ │ │ │ │ - 921 // Create an instance on demand (slow) │ │ │ │ │ - 922 (void)deviceContext; // unused │ │ │ │ │ - 923 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 924 BufferDescriptor(), │ │ │ │ │ - 925 BufferDescriptor(), │ │ │ │ │ - 926 deviceContext); │ │ │ │ │ - 927 if (instance) { │ │ │ │ │ - 928 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 929 dstBuffer, dstDesc, │ │ │ │ │ - 930 numPatchCoords, patchCoords, │ │ │ │ │ - 931 patchTable, │ │ │ │ │ - 932 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 933 delete instance; │ │ │ │ │ - 934 return r; │ │ │ │ │ +504 bool EvalStencils( │ │ │ │ │ + 505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 507 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 508 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 509 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 510 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 511 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 512 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 513 MTLContext* context) const │ │ │ │ │ + 514 { │ │ │ │ │ + 515 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 516 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 517 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ + 518 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ + 519 duuBuffer->BindMTLBuffer(context), duuDesc, │ │ │ │ │ + 520 duvBuffer->BindMTLBuffer(context), duvDesc, │ │ │ │ │ + 521 dvvBuffer->BindMTLBuffer(context), dvvDesc, │ │ │ │ │ + 522 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 523 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 524 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 525 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 526 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 527 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 528 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ + 529 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ + 530 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ + 531 /* start = */ 0, │ │ │ │ │ + 532 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ + 533 context); │ │ │ │ │ + 534 } │ │ │ │ │ + 535 │ │ │ │ │ +574 bool EvalStencils(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 575 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 576 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 577 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 578 id sizesBuffer, │ │ │ │ │ + 579 id offsetsBuffer, │ │ │ │ │ + 580 id indicesBuffer, │ │ │ │ │ + 581 id weightsBuffer, │ │ │ │ │ + 582 id duWeightsBuffer, │ │ │ │ │ + 583 id dvWeightsBuffer, │ │ │ │ │ + 584 int start, │ │ │ │ │ + 585 int end, │ │ │ │ │ + 586 MTLContext* context) const; │ │ │ │ │ + 587 │ │ │ │ │ +644 bool EvalStencils(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 645 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 646 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 647 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 648 id duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 649 id duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 650 id dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 651 id sizesBuffer, │ │ │ │ │ + 652 id offsetsBuffer, │ │ │ │ │ + 653 id indicesBuffer, │ │ │ │ │ + 654 id weightsBuffer, │ │ │ │ │ + 655 id duWeightsBuffer, │ │ │ │ │ + 656 id dvWeightsBuffer, │ │ │ │ │ + 657 id duuWeightsBuffer, │ │ │ │ │ + 658 id duvWeightsBuffer, │ │ │ │ │ + 659 id dvvWeightsBuffer, │ │ │ │ │ + 660 int start, │ │ │ │ │ + 661 int end, │ │ │ │ │ + 662 MTLContext* context) const; │ │ │ │ │ + 663 │ │ │ │ │ + 669 │ │ │ │ │ + 703 template │ │ │ │ │ +705 static bool EvalPatches( │ │ │ │ │ + 706 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 707 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 708 int numPatchCoords, │ │ │ │ │ + 709 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 710 PATCH_TABLE *patchTable, │ │ │ │ │ + 711 MTLComputeEvaluator const *instance, │ │ │ │ │ + 712 MTLContext* context) { │ │ │ │ │ + 713 │ │ │ │ │ + 714 if (instance) { │ │ │ │ │ + 715 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 716 dstBuffer, dstDesc, │ │ │ │ │ + 717 numPatchCoords, patchCoords, │ │ │ │ │ + 718 patchTable, │ │ │ │ │ + 719 context); │ │ │ │ │ + 720 } else { │ │ │ │ │ + 721 // Create an instance on demand (slow) │ │ │ │ │ + 722 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 723 BufferDescriptor(), │ │ │ │ │ + 724 BufferDescriptor(), │ │ │ │ │ + 725 context); │ │ │ │ │ + 726 if (instance) { │ │ │ │ │ + 727 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 728 dstBuffer, dstDesc, │ │ │ │ │ + 729 numPatchCoords, patchCoords, │ │ │ │ │ + 730 patchTable, │ │ │ │ │ + 731 context); │ │ │ │ │ + 732 delete instance; │ │ │ │ │ + 733 return r; │ │ │ │ │ + 734 } │ │ │ │ │ + 735 return false; │ │ │ │ │ + 736 } │ │ │ │ │ + 737 } │ │ │ │ │ + 738 │ │ │ │ │ + 784 template │ │ │ │ │ +786 static bool EvalPatches( │ │ │ │ │ + 787 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 788 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 789 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 790 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 791 int numPatchCoords, │ │ │ │ │ + 792 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 793 PATCH_TABLE *patchTable, │ │ │ │ │ + 794 MTLComputeEvaluator* instance, │ │ │ │ │ + 795 MTLContext* context) { │ │ │ │ │ + 796 │ │ │ │ │ + 797 if (instance) { │ │ │ │ │ + 798 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 799 dstBuffer, dstDesc, │ │ │ │ │ + 800 duBuffer, duDesc, │ │ │ │ │ + 801 dvBuffer, dvDesc, │ │ │ │ │ + 802 numPatchCoords, patchCoords, │ │ │ │ │ + 803 patchTable, │ │ │ │ │ + 804 context); │ │ │ │ │ + 805 } else { │ │ │ │ │ + 806 // Create an instance on demand (slow) │ │ │ │ │ + 807 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 808 duDesc, dvDesc, context); │ │ │ │ │ + 809 if (instance) { │ │ │ │ │ + 810 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 811 dstBuffer, dstDesc, │ │ │ │ │ + 812 duBuffer, duDesc, │ │ │ │ │ + 813 dvBuffer, dvDesc, │ │ │ │ │ + 814 numPatchCoords, patchCoords, │ │ │ │ │ + 815 patchTable, │ │ │ │ │ + 816 context); │ │ │ │ │ + 817 delete instance; │ │ │ │ │ + 818 return r; │ │ │ │ │ + 819 } │ │ │ │ │ + 820 return false; │ │ │ │ │ + 821 } │ │ │ │ │ + 822 } │ │ │ │ │ + 823 │ │ │ │ │ + 887 template │ │ │ │ │ +889 static bool EvalPatches( │ │ │ │ │ + 890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 894 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 895 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 896 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 897 int numPatchCoords, │ │ │ │ │ + 898 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 899 PATCH_TABLE *patchTable, │ │ │ │ │ + 900 MTLComputeEvaluator* instance, │ │ │ │ │ + 901 MTLContext* context) { │ │ │ │ │ + 902 │ │ │ │ │ + 903 if (instance) { │ │ │ │ │ + 904 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 905 dstBuffer, dstDesc, │ │ │ │ │ + 906 duBuffer, duDesc, │ │ │ │ │ + 907 dvBuffer, dvDesc, │ │ │ │ │ + 908 duuBuffer, duuDesc, │ │ │ │ │ + 909 duvBuffer, duvDesc, │ │ │ │ │ + 910 dvvBuffer, dvvDesc, │ │ │ │ │ + 911 numPatchCoords, patchCoords, │ │ │ │ │ + 912 patchTable, │ │ │ │ │ + 913 context); │ │ │ │ │ + 914 } else { │ │ │ │ │ + 915 // Create an instance on demand (slow) │ │ │ │ │ + 916 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 917 duDesc, dvDesc, │ │ │ │ │ + 918 duuDesc, duvDesc, dvvDesc, context); │ │ │ │ │ + 919 if (instance) { │ │ │ │ │ + 920 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 921 dstBuffer, dstDesc, │ │ │ │ │ + 922 duBuffer, duDesc, │ │ │ │ │ + 923 dvBuffer, dvDesc, │ │ │ │ │ + 924 duuBuffer, duuDesc, │ │ │ │ │ + 925 duvBuffer, duvDesc, │ │ │ │ │ + 926 dvvBuffer, dvvDesc, │ │ │ │ │ + 927 numPatchCoords, patchCoords, │ │ │ │ │ + 928 patchTable, │ │ │ │ │ + 929 context); │ │ │ │ │ + 930 delete instance; │ │ │ │ │ + 931 return r; │ │ │ │ │ + 932 } │ │ │ │ │ + 933 return false; │ │ │ │ │ + 934 } │ │ │ │ │ 935 } │ │ │ │ │ - 936 return false; │ │ │ │ │ - 937 } │ │ │ │ │ - 938 } │ │ │ │ │ - 939 │ │ │ │ │ - 1000 template │ │ │ │ │ -1003 static bool EvalPatches( │ │ │ │ │ - 1004 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1005 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1006 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1007 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1008 int numPatchCoords, │ │ │ │ │ - 1009 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1010 PATCH_TABLE *patchTable, │ │ │ │ │ - 1011 CLEvaluator const *instance, │ │ │ │ │ - 1012 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 1013 unsigned int numStartEvents=0, │ │ │ │ │ - 1014 const cl_event* startEvents=NULL, │ │ │ │ │ - 1015 cl_event* endEvent=NULL) { │ │ │ │ │ - 1016 │ │ │ │ │ - 1017 if (instance) { │ │ │ │ │ - 1018 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 1019 dstBuffer, dstDesc, │ │ │ │ │ - 1020 duBuffer, duDesc, │ │ │ │ │ - 1021 dvBuffer, dvDesc, │ │ │ │ │ - 1022 numPatchCoords, patchCoords, │ │ │ │ │ - 1023 patchTable, │ │ │ │ │ - 1024 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1025 } else { │ │ │ │ │ - 1026 // Create an instance on demand (slow) │ │ │ │ │ - 1027 (void)deviceContext; // unused │ │ │ │ │ - 1028 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext); │ │ │ │ │ - 1029 if (instance) { │ │ │ │ │ - 1030 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 1031 dstBuffer, dstDesc, │ │ │ │ │ - 1032 duBuffer, duDesc, │ │ │ │ │ - 1033 dvBuffer, dvDesc, │ │ │ │ │ - 1034 numPatchCoords, patchCoords, │ │ │ │ │ - 1035 patchTable, │ │ │ │ │ - 1036 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1037 delete instance; │ │ │ │ │ - 1038 return r; │ │ │ │ │ - 1039 } │ │ │ │ │ - 1040 return false; │ │ │ │ │ - 1041 } │ │ │ │ │ - 1042 } │ │ │ │ │ - 1043 │ │ │ │ │ - 1122 template │ │ │ │ │ -1125 static bool EvalPatches( │ │ │ │ │ - 1126 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1127 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1128 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1129 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1130 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1131 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1132 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1133 int numPatchCoords, │ │ │ │ │ - 1134 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1135 PATCH_TABLE *patchTable, │ │ │ │ │ - 1136 CLEvaluator const *instance, │ │ │ │ │ - 1137 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 1138 unsigned int numStartEvents=0, │ │ │ │ │ - 1139 const cl_event* startEvents=NULL, │ │ │ │ │ - 1140 cl_event* endEvent=NULL) { │ │ │ │ │ - 1141 │ │ │ │ │ - 1142 if (instance) { │ │ │ │ │ - 1143 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 1144 dstBuffer, dstDesc, │ │ │ │ │ - 1145 duBuffer, duDesc, │ │ │ │ │ - 1146 dvBuffer, dvDesc, │ │ │ │ │ - 1147 duuBuffer, duuDesc, │ │ │ │ │ - 1148 duvBuffer, duvDesc, │ │ │ │ │ - 1149 dvvBuffer, dvvDesc, │ │ │ │ │ - 1150 numPatchCoords, patchCoords, │ │ │ │ │ - 1151 patchTable, │ │ │ │ │ - 1152 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1153 } else { │ │ │ │ │ - 1154 // Create an instance on demand (slow) │ │ │ │ │ - 1155 (void)deviceContext; // unused │ │ │ │ │ - 1156 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1157 duDesc, dvDesc, │ │ │ │ │ - 1158 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 1159 deviceContext); │ │ │ │ │ - 1160 if (instance) { │ │ │ │ │ - 1161 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 1162 dstBuffer, dstDesc, │ │ │ │ │ - 1163 duBuffer, duDesc, │ │ │ │ │ - 1164 dvBuffer, dvDesc, │ │ │ │ │ - 1165 duuBuffer, duuDesc, │ │ │ │ │ - 1166 duvBuffer, duvDesc, │ │ │ │ │ - 1167 dvvBuffer, dvvDesc, │ │ │ │ │ - 1168 numPatchCoords, patchCoords, │ │ │ │ │ - 1169 patchTable, │ │ │ │ │ - 1170 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1171 delete instance; │ │ │ │ │ - 1172 return r; │ │ │ │ │ - 1173 } │ │ │ │ │ - 1174 return false; │ │ │ │ │ - 1175 } │ │ │ │ │ - 1176 } │ │ │ │ │ - 1177 │ │ │ │ │ - 1215 template │ │ │ │ │ -1217 bool EvalPatches( │ │ │ │ │ - 1218 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1219 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1220 int numPatchCoords, │ │ │ │ │ - 1221 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1222 PATCH_TABLE *patchTable, │ │ │ │ │ - 1223 unsigned int numStartEvents=0, │ │ │ │ │ - 1224 const cl_event* startEvents=NULL, │ │ │ │ │ - 1225 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1226 │ │ │ │ │ - 1227 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1228 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1229 0, BufferDescriptor(), │ │ │ │ │ - 1230 0, BufferDescriptor(), │ │ │ │ │ - 1231 numPatchCoords, │ │ │ │ │ - 1232 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 1233 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 1234 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1235 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1236 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1237 } │ │ │ │ │ - 1238 │ │ │ │ │ - 1286 template │ │ │ │ │ -1288 bool EvalPatches( │ │ │ │ │ - 1289 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1290 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1291 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1292 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1293 int numPatchCoords, │ │ │ │ │ - 1294 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1295 PATCH_TABLE *patchTable, │ │ │ │ │ - 1296 unsigned int numStartEvents=0, │ │ │ │ │ - 1297 const cl_event* startEvents=NULL, │ │ │ │ │ - 1298 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1299 │ │ │ │ │ - 1300 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1301 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1302 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 1303 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 1304 numPatchCoords, │ │ │ │ │ - 1305 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 1306 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 1307 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1308 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1309 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1310 } │ │ │ │ │ - 1311 │ │ │ │ │ - 1377 template │ │ │ │ │ -1379 bool EvalPatches( │ │ │ │ │ - 1380 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1381 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1382 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1383 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1384 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1385 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1386 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1387 int numPatchCoords, │ │ │ │ │ - 1388 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1389 PATCH_TABLE *patchTable, │ │ │ │ │ - 1390 unsigned int numStartEvents=0, │ │ │ │ │ - 1391 const cl_event* startEvents=NULL, │ │ │ │ │ - 1392 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1393 │ │ │ │ │ - 1394 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1395 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1396 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 1397 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 1398 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ - 1399 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ - 1400 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ - 1401 numPatchCoords, │ │ │ │ │ - 1402 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 1403 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 1404 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1405 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1406 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1407 } │ │ │ │ │ - 1408 │ │ │ │ │ -1409 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1410 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1411 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ - 1412 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1413 int numPatchCoords, │ │ │ │ │ - 1414 cl_mem patchCoordsBuffer, │ │ │ │ │ - 1415 cl_mem patchArrayBuffer, │ │ │ │ │ - 1416 cl_mem patchIndexBuffer, │ │ │ │ │ - 1417 cl_mem patchParamsBuffer, │ │ │ │ │ - 1418 unsigned int numStartEvents=0, │ │ │ │ │ - 1419 const cl_event* startEvents=NULL, │ │ │ │ │ - 1420 cl_event* endEvent=NULL) const; │ │ │ │ │ - 1421 │ │ │ │ │ -1422 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1423 cl_mem dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1424 cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ - 1425 cl_mem dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1426 cl_mem duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1427 cl_mem duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1428 cl_mem dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1429 int numPatchCoords, │ │ │ │ │ - 1430 cl_mem patchCoordsBuffer, │ │ │ │ │ - 1431 cl_mem patchArrayBuffer, │ │ │ │ │ - 1432 cl_mem patchIndexBuffer, │ │ │ │ │ - 1433 cl_mem patchParamsBuffer, │ │ │ │ │ - 1434 unsigned int numStartEvents=0, │ │ │ │ │ - 1435 const cl_event* startEvents=NULL, │ │ │ │ │ - 1436 cl_event* endEvent=NULL) const; │ │ │ │ │ - 1437 │ │ │ │ │ - 1486 template │ │ │ │ │ -1489 static bool EvalPatchesVarying( │ │ │ │ │ - 1490 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1491 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1492 int numPatchCoords, │ │ │ │ │ - 1493 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1494 PATCH_TABLE *patchTable, │ │ │ │ │ - 1495 CLEvaluator const *instance, │ │ │ │ │ - 1496 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 1497 unsigned int numStartEvents=0, │ │ │ │ │ - 1498 const cl_event* startEvents=NULL, │ │ │ │ │ - 1499 cl_event* endEvent=NULL) { │ │ │ │ │ - 1500 │ │ │ │ │ - 1501 if (instance) { │ │ │ │ │ - 1502 return instance->EvalPatchesVarying( │ │ │ │ │ - 1503 srcBuffer, srcDesc, │ │ │ │ │ - 1504 dstBuffer, dstDesc, │ │ │ │ │ - 1505 numPatchCoords, patchCoords, │ │ │ │ │ - 1506 patchTable, │ │ │ │ │ - 1507 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1508 } else { │ │ │ │ │ - 1509 // Create an instance on demand (slow) │ │ │ │ │ - 1510 (void)deviceContext; // unused │ │ │ │ │ - 1511 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1512 BufferDescriptor(), │ │ │ │ │ - 1513 BufferDescriptor(), │ │ │ │ │ - 1514 deviceContext); │ │ │ │ │ - 1515 if (instance) { │ │ │ │ │ - 1516 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1517 srcBuffer, srcDesc, │ │ │ │ │ - 1518 dstBuffer, dstDesc, │ │ │ │ │ + 936 │ │ │ │ │ + 964 template │ │ │ │ │ +966 bool EvalPatches( │ │ │ │ │ + 967 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 968 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 969 int numPatchCoords, │ │ │ │ │ + 970 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 971 PATCH_TABLE *patchTable, │ │ │ │ │ + 972 MTLContext* context) const { │ │ │ │ │ + 973 │ │ │ │ │ + 974 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 975 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 976 0, BufferDescriptor(), │ │ │ │ │ + 977 0, BufferDescriptor(), │ │ │ │ │ + 978 numPatchCoords, │ │ │ │ │ + 979 patchCoords->BindMTLBuffer(context), │ │ │ │ │ + 980 patchTable->GetPatchArrays(), │ │ │ │ │ + 981 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 982 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 983 context); │ │ │ │ │ + 984 } │ │ │ │ │ + 985 │ │ │ │ │ + 1023 template │ │ │ │ │ +1025 bool EvalPatches( │ │ │ │ │ + 1026 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1027 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1028 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1029 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1030 int numPatchCoords, │ │ │ │ │ + 1031 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1032 PATCH_TABLE *patchTable, │ │ │ │ │ + 1033 MTLContext* context) const { │ │ │ │ │ + 1034 │ │ │ │ │ + 1035 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 1036 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 1037 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ + 1038 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ + 1039 numPatchCoords, │ │ │ │ │ + 1040 patchCoords->BindMTLBuffer(context), │ │ │ │ │ + 1041 patchTable->GetPatchArrays(), │ │ │ │ │ + 1042 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1043 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1044 context); │ │ │ │ │ + 1045 } │ │ │ │ │ + 1046 │ │ │ │ │ + 1102 template │ │ │ │ │ +1104 bool EvalPatches( │ │ │ │ │ + 1105 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1106 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1107 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1108 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1109 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1110 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1111 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1112 int numPatchCoords, │ │ │ │ │ + 1113 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1114 PATCH_TABLE *patchTable, │ │ │ │ │ + 1115 MTLContext* context) const { │ │ │ │ │ + 1116 │ │ │ │ │ + 1117 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ + 1118 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ + 1119 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ + 1120 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ + 1121 duuBuffer->BindMTLBuffer(context), duuDesc, │ │ │ │ │ + 1122 duvBuffer->BindMTLBuffer(context), duvDesc, │ │ │ │ │ + 1123 dvvBuffer->BindMTLBuffer(context), dvvDesc, │ │ │ │ │ + 1124 numPatchCoords, │ │ │ │ │ + 1125 patchCoords->BindMTLBuffer(context), │ │ │ │ │ + 1126 patchTable->GetPatchArrays(), │ │ │ │ │ + 1127 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1128 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1129 context); │ │ │ │ │ + 1130 } │ │ │ │ │ + 1131 │ │ │ │ │ +1132 bool EvalPatches(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1133 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1134 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1135 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1136 int numPatchCoords, │ │ │ │ │ + 1137 id patchCoordsBuffer, │ │ │ │ │ + 1138 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1139 id patchIndexBuffer, │ │ │ │ │ + 1140 id patchParamsBuffer, │ │ │ │ │ + 1141 MTLContext* context) const; │ │ │ │ │ + 1142 │ │ │ │ │ +1143 bool EvalPatches(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1144 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1145 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1146 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1147 id duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1148 id duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1149 id dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1150 int numPatchCoords, │ │ │ │ │ + 1151 id patchCoordsBuffer, │ │ │ │ │ + 1152 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1153 id patchIndexBuffer, │ │ │ │ │ + 1154 id patchParamsBuffer, │ │ │ │ │ + 1155 MTLContext* context) const; │ │ │ │ │ + 1156 │ │ │ │ │ + 1190 template │ │ │ │ │ +1192 static bool EvalPatchesVarying( │ │ │ │ │ + 1193 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1194 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1195 int numPatchCoords, │ │ │ │ │ + 1196 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1197 PATCH_TABLE *patchTable, │ │ │ │ │ + 1198 MTLComputeEvaluator const *instance, │ │ │ │ │ + 1199 MTLContext* deviceContext) { │ │ │ │ │ + 1200 │ │ │ │ │ + 1201 if (instance) { │ │ │ │ │ + 1202 return instance->EvalPatchesVarying( │ │ │ │ │ + 1203 srcBuffer, srcDesc, │ │ │ │ │ + 1204 dstBuffer, dstDesc, │ │ │ │ │ + 1205 numPatchCoords, patchCoords, │ │ │ │ │ + 1206 patchTable, │ │ │ │ │ + 1207 deviceContext); │ │ │ │ │ + 1208 } else { │ │ │ │ │ + 1209 // Create an instance on demand (slow) │ │ │ │ │ + 1210 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1211 BufferDescriptor(), │ │ │ │ │ + 1212 BufferDescriptor(), │ │ │ │ │ + 1213 deviceContext); │ │ │ │ │ + 1214 if (instance) { │ │ │ │ │ + 1215 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1216 srcBuffer, srcDesc, │ │ │ │ │ + 1217 dstBuffer, dstDesc, │ │ │ │ │ + 1218 numPatchCoords, patchCoords, │ │ │ │ │ + 1219 patchTable, │ │ │ │ │ + 1220 deviceContext); │ │ │ │ │ + 1221 delete instance; │ │ │ │ │ + 1222 return r; │ │ │ │ │ + 1223 } │ │ │ │ │ + 1224 return false; │ │ │ │ │ + 1225 } │ │ │ │ │ + 1226 } │ │ │ │ │ + 1227 │ │ │ │ │ + 1255 template │ │ │ │ │ +1257 bool EvalPatchesVarying( │ │ │ │ │ + 1258 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1259 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1260 int numPatchCoords, │ │ │ │ │ + 1261 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1262 PATCH_TABLE *patchTable, │ │ │ │ │ + 1263 MTLContext* deviceContext) const { │ │ │ │ │ + 1264 │ │ │ │ │ + 1265 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 1266 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 1267 0, BufferDescriptor(), │ │ │ │ │ + 1268 0, BufferDescriptor(), │ │ │ │ │ + 1269 numPatchCoords, │ │ │ │ │ + 1270 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 1271 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1272 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1273 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1274 deviceContext │ │ │ │ │ + 1275 ); │ │ │ │ │ + 1276 } │ │ │ │ │ + 1277 │ │ │ │ │ + 1323 template │ │ │ │ │ +1325 static bool EvalPatchesVarying( │ │ │ │ │ + 1326 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1327 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1328 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1329 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1330 int numPatchCoords, │ │ │ │ │ + 1331 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1332 PATCH_TABLE *patchTable, │ │ │ │ │ + 1333 MTLComputeEvaluator const *instance, │ │ │ │ │ + 1334 MTLContext* deviceContext) { │ │ │ │ │ + 1335 │ │ │ │ │ + 1336 if (instance) { │ │ │ │ │ + 1337 return instance->EvalPatchesVarying( │ │ │ │ │ + 1338 srcBuffer, srcDesc, │ │ │ │ │ + 1339 dstBuffer, dstDesc, │ │ │ │ │ + 1340 duBuffer, duDesc, │ │ │ │ │ + 1341 dvBuffer, dvDesc, │ │ │ │ │ + 1342 numPatchCoords, patchCoords, │ │ │ │ │ + 1343 patchTable, │ │ │ │ │ + 1344 deviceContext); │ │ │ │ │ + 1345 } else { │ │ │ │ │ + 1346 // Create an instance on demand (slow) │ │ │ │ │ + 1347 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1348 duDesc, dvDesc, │ │ │ │ │ + 1349 deviceContext); │ │ │ │ │ + 1350 if (instance) { │ │ │ │ │ + 1351 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1352 srcBuffer, srcDesc, │ │ │ │ │ + 1353 dstBuffer, dstDesc, │ │ │ │ │ + 1354 duBuffer, duDesc, │ │ │ │ │ + 1355 dvBuffer, dvDesc, │ │ │ │ │ + 1356 numPatchCoords, patchCoords, │ │ │ │ │ + 1357 patchTable, │ │ │ │ │ + 1358 deviceContext); │ │ │ │ │ + 1359 delete instance; │ │ │ │ │ + 1360 return r; │ │ │ │ │ + 1361 } │ │ │ │ │ + 1362 return false; │ │ │ │ │ + 1363 } │ │ │ │ │ + 1364 } │ │ │ │ │ + 1365 │ │ │ │ │ + 1405 template │ │ │ │ │ +1407 bool EvalPatchesVarying( │ │ │ │ │ + 1408 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1409 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1410 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1411 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1412 int numPatchCoords, │ │ │ │ │ + 1413 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1414 PATCH_TABLE *patchTable, │ │ │ │ │ + 1415 MTLContext* deviceContext) const { │ │ │ │ │ + 1416 │ │ │ │ │ + 1417 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 1418 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 1419 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ + 1420 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ + 1421 numPatchCoords, │ │ │ │ │ + 1422 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 1423 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1424 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1425 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1426 deviceContext │ │ │ │ │ + 1427 ); │ │ │ │ │ + 1428 } │ │ │ │ │ + 1429 │ │ │ │ │ + 1430 │ │ │ │ │ + 1494 template │ │ │ │ │ +1496 static bool EvalPatchesVarying( │ │ │ │ │ + 1497 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1498 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1499 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1500 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1501 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1502 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1503 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1504 int numPatchCoords, │ │ │ │ │ + 1505 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1506 PATCH_TABLE *patchTable, │ │ │ │ │ + 1507 MTLComputeEvaluator const *instance, │ │ │ │ │ + 1508 MTLContext* deviceContext) { │ │ │ │ │ + 1509 │ │ │ │ │ + 1510 if (instance) { │ │ │ │ │ + 1511 return instance->EvalPatchesVarying( │ │ │ │ │ + 1512 srcBuffer, srcDesc, │ │ │ │ │ + 1513 dstBuffer, dstDesc, │ │ │ │ │ + 1514 duBuffer, duDesc, │ │ │ │ │ + 1515 dvBuffer, dvDesc, │ │ │ │ │ + 1516 duuBuffer, duuDesc, │ │ │ │ │ + 1517 duvBuffer, duvDesc, │ │ │ │ │ + 1518 dvvBuffer, dvvDesc, │ │ │ │ │ 1519 numPatchCoords, patchCoords, │ │ │ │ │ 1520 patchTable, │ │ │ │ │ - 1521 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1522 delete instance; │ │ │ │ │ - 1523 return r; │ │ │ │ │ - 1524 } │ │ │ │ │ - 1525 return false; │ │ │ │ │ - 1526 } │ │ │ │ │ - 1527 } │ │ │ │ │ - 1528 │ │ │ │ │ - 1566 template │ │ │ │ │ -1568 bool EvalPatchesVarying( │ │ │ │ │ - 1569 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1570 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1571 int numPatchCoords, │ │ │ │ │ - 1572 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1573 PATCH_TABLE *patchTable, │ │ │ │ │ - 1574 unsigned int numStartEvents=0, │ │ │ │ │ - 1575 const cl_event* startEvents=NULL, │ │ │ │ │ - 1576 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1577 │ │ │ │ │ - 1578 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1579 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1580 0, BufferDescriptor(), │ │ │ │ │ - 1581 0, BufferDescriptor(), │ │ │ │ │ - 1582 numPatchCoords, │ │ │ │ │ - 1583 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 1584 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 1585 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1586 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1587 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1588 } │ │ │ │ │ - 1589 │ │ │ │ │ - 1650 template │ │ │ │ │ -1653 static bool EvalPatchesVarying( │ │ │ │ │ - 1654 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1655 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1656 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1657 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1658 int numPatchCoords, │ │ │ │ │ - 1659 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1660 PATCH_TABLE *patchTable, │ │ │ │ │ - 1661 CLEvaluator const *instance, │ │ │ │ │ - 1662 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 1663 unsigned int numStartEvents=0, │ │ │ │ │ - 1664 const cl_event* startEvents=NULL, │ │ │ │ │ - 1665 cl_event* endEvent=NULL) { │ │ │ │ │ - 1666 │ │ │ │ │ - 1667 if (instance) { │ │ │ │ │ - 1668 return instance->EvalPatchesVarying( │ │ │ │ │ - 1669 srcBuffer, srcDesc, │ │ │ │ │ - 1670 dstBuffer, dstDesc, │ │ │ │ │ - 1671 duBuffer, duDesc, │ │ │ │ │ - 1672 dvBuffer, dvDesc, │ │ │ │ │ - 1673 numPatchCoords, patchCoords, │ │ │ │ │ - 1674 patchTable, │ │ │ │ │ - 1675 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1676 } else { │ │ │ │ │ - 1677 // Create an instance on demand (slow) │ │ │ │ │ - 1678 (void)deviceContext; // unused │ │ │ │ │ - 1679 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1680 duDesc, dvDesc, │ │ │ │ │ - 1681 deviceContext); │ │ │ │ │ + 1521 deviceContext); │ │ │ │ │ + 1522 } else { │ │ │ │ │ + 1523 // Create an instance on demand (slow) │ │ │ │ │ + 1524 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1525 duDesc, dvDesc, │ │ │ │ │ + 1526 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 1527 deviceContext); │ │ │ │ │ + 1528 if (instance) { │ │ │ │ │ + 1529 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1530 srcBuffer, srcDesc, │ │ │ │ │ + 1531 dstBuffer, dstDesc, │ │ │ │ │ + 1532 duBuffer, duDesc, │ │ │ │ │ + 1533 dvBuffer, dvDesc, │ │ │ │ │ + 1534 duuBuffer, duuDesc, │ │ │ │ │ + 1535 duvBuffer, duvDesc, │ │ │ │ │ + 1536 dvvBuffer, dvvDesc, │ │ │ │ │ + 1537 numPatchCoords, patchCoords, │ │ │ │ │ + 1538 patchTable, │ │ │ │ │ + 1539 deviceContext); │ │ │ │ │ + 1540 delete instance; │ │ │ │ │ + 1541 return r; │ │ │ │ │ + 1542 } │ │ │ │ │ + 1543 return false; │ │ │ │ │ + 1544 } │ │ │ │ │ + 1545 } │ │ │ │ │ + 1546 │ │ │ │ │ + 1604 template │ │ │ │ │ +1606 bool EvalPatchesVarying( │ │ │ │ │ + 1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1609 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1610 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1611 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1612 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1613 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1614 int numPatchCoords, │ │ │ │ │ + 1615 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1616 PATCH_TABLE *patchTable, │ │ │ │ │ + 1617 MTLContext* deviceContext) const { │ │ │ │ │ + 1618 │ │ │ │ │ + 1619 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 1620 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 1621 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ + 1622 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ + 1623 duuBuffer->BindMTLBuffer(deviceContext), duuDesc, │ │ │ │ │ + 1624 duvBuffer->BindMTLBuffer(deviceContext), duvDesc, │ │ │ │ │ + 1625 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc, │ │ │ │ │ + 1626 numPatchCoords, │ │ │ │ │ + 1627 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 1628 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1629 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1630 patchTable->GetPatchParamBuffer(), │ │ │ │ │ + 1631 deviceContext │ │ │ │ │ + 1632 ); │ │ │ │ │ + 1633 } │ │ │ │ │ + 1634 │ │ │ │ │ + 1670 template │ │ │ │ │ +1672 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1673 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1674 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1675 int numPatchCoords, │ │ │ │ │ + 1676 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1677 PATCH_TABLE *patchTable, │ │ │ │ │ + 1678 int fvarChannel, │ │ │ │ │ + 1679 MTLComputeEvaluator const *instance, │ │ │ │ │ + 1680 MTLContext* deviceContext) { │ │ │ │ │ + 1681 │ │ │ │ │ 1682 if (instance) { │ │ │ │ │ - 1683 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1683 return instance->EvalPatchesFaceVarying( │ │ │ │ │ 1684 srcBuffer, srcDesc, │ │ │ │ │ 1685 dstBuffer, dstDesc, │ │ │ │ │ - 1686 duBuffer, duDesc, │ │ │ │ │ - 1687 dvBuffer, dvDesc, │ │ │ │ │ - 1688 numPatchCoords, patchCoords, │ │ │ │ │ - 1689 patchTable, │ │ │ │ │ - 1690 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1691 delete instance; │ │ │ │ │ - 1692 return r; │ │ │ │ │ - 1693 } │ │ │ │ │ - 1694 return false; │ │ │ │ │ - 1695 } │ │ │ │ │ - 1696 } │ │ │ │ │ - 1697 │ │ │ │ │ - 1747 template │ │ │ │ │ -1749 bool EvalPatchesVarying( │ │ │ │ │ - 1750 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1751 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1752 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1753 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1754 int numPatchCoords, │ │ │ │ │ - 1755 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1756 PATCH_TABLE *patchTable, │ │ │ │ │ - 1757 unsigned int numStartEvents=0, │ │ │ │ │ - 1758 const cl_event* startEvents=NULL, │ │ │ │ │ - 1759 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1760 │ │ │ │ │ - 1761 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1762 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1763 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 1764 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 1765 numPatchCoords, │ │ │ │ │ - 1766 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 1767 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 1768 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1769 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1770 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1771 } │ │ │ │ │ - 1772 │ │ │ │ │ - 1851 template │ │ │ │ │ -1854 static bool EvalPatchesVarying( │ │ │ │ │ - 1855 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1856 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1857 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1858 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1859 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1860 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1861 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1862 int numPatchCoords, │ │ │ │ │ - 1863 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1864 PATCH_TABLE *patchTable, │ │ │ │ │ - 1865 CLEvaluator const *instance, │ │ │ │ │ - 1866 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 1867 unsigned int numStartEvents=0, │ │ │ │ │ - 1868 const cl_event* startEvents=NULL, │ │ │ │ │ - 1869 cl_event* endEvent=NULL) { │ │ │ │ │ - 1870 │ │ │ │ │ - 1871 if (instance) { │ │ │ │ │ - 1872 return instance->EvalPatchesVarying( │ │ │ │ │ - 1873 srcBuffer, srcDesc, │ │ │ │ │ - 1874 dstBuffer, dstDesc, │ │ │ │ │ - 1875 duBuffer, duDesc, │ │ │ │ │ - 1876 dvBuffer, dvDesc, │ │ │ │ │ - 1877 duuBuffer, duuDesc, │ │ │ │ │ - 1878 duvBuffer, duvDesc, │ │ │ │ │ - 1879 dvvBuffer, dvvDesc, │ │ │ │ │ - 1880 numPatchCoords, patchCoords, │ │ │ │ │ - 1881 patchTable, │ │ │ │ │ - 1882 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1883 } else { │ │ │ │ │ - 1884 // Create an instance on demand (slow) │ │ │ │ │ - 1885 (void)deviceContext; // unused │ │ │ │ │ - 1886 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1887 duDesc, dvDesc, │ │ │ │ │ - 1888 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 1889 deviceContext); │ │ │ │ │ - 1890 if (instance) { │ │ │ │ │ - 1891 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1892 srcBuffer, srcDesc, │ │ │ │ │ - 1893 dstBuffer, dstDesc, │ │ │ │ │ - 1894 duBuffer, duDesc, │ │ │ │ │ - 1895 dvBuffer, dvDesc, │ │ │ │ │ - 1896 duuBuffer, duuDesc, │ │ │ │ │ - 1897 duvBuffer, duvDesc, │ │ │ │ │ - 1898 dvvBuffer, dvvDesc, │ │ │ │ │ - 1899 numPatchCoords, patchCoords, │ │ │ │ │ - 1900 patchTable, │ │ │ │ │ - 1901 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 1902 delete instance; │ │ │ │ │ - 1903 return r; │ │ │ │ │ - 1904 } │ │ │ │ │ - 1905 return false; │ │ │ │ │ - 1906 } │ │ │ │ │ - 1907 } │ │ │ │ │ - 1908 │ │ │ │ │ - 1976 template │ │ │ │ │ -1978 bool EvalPatchesVarying( │ │ │ │ │ - 1979 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1980 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1981 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1982 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1983 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1984 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1985 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1986 int numPatchCoords, │ │ │ │ │ - 1987 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1988 PATCH_TABLE *patchTable, │ │ │ │ │ - 1989 unsigned int numStartEvents=0, │ │ │ │ │ - 1990 const cl_event* startEvents=NULL, │ │ │ │ │ - 1991 cl_event* endEvent=NULL) const { │ │ │ │ │ - 1992 │ │ │ │ │ - 1993 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 1994 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 1995 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 1996 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 1997 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ - 1998 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ - 1999 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ - 2000 numPatchCoords, │ │ │ │ │ - 2001 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 2002 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 2003 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 2004 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 2005 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2006 } │ │ │ │ │ - 2007 │ │ │ │ │ - 2058 template │ │ │ │ │ -2061 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 2062 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2063 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2064 int numPatchCoords, │ │ │ │ │ - 2065 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2066 PATCH_TABLE *patchTable, │ │ │ │ │ - 2067 int fvarChannel, │ │ │ │ │ - 2068 CLEvaluator const *instance, │ │ │ │ │ - 2069 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 2070 unsigned int numStartEvents=0, │ │ │ │ │ - 2071 const cl_event* startEvents=NULL, │ │ │ │ │ - 2072 cl_event* endEvent=NULL) { │ │ │ │ │ - 2073 │ │ │ │ │ - 2074 if (instance) { │ │ │ │ │ - 2075 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2076 srcBuffer, srcDesc, │ │ │ │ │ - 2077 dstBuffer, dstDesc, │ │ │ │ │ - 2078 numPatchCoords, patchCoords, │ │ │ │ │ - 2079 patchTable, fvarChannel, │ │ │ │ │ - 2080 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2081 } else { │ │ │ │ │ - 2082 // Create an instance on demand (slow) │ │ │ │ │ - 2083 (void)deviceContext; // unused │ │ │ │ │ - 2084 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 2085 BufferDescriptor(), │ │ │ │ │ - 2086 BufferDescriptor(), │ │ │ │ │ - 2087 deviceContext); │ │ │ │ │ - 2088 if (instance) { │ │ │ │ │ - 2089 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2090 srcBuffer, srcDesc, │ │ │ │ │ - 2091 dstBuffer, dstDesc, │ │ │ │ │ - 2092 numPatchCoords, patchCoords, │ │ │ │ │ - 2093 patchTable, fvarChannel, │ │ │ │ │ - 2094 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2095 delete instance; │ │ │ │ │ - 2096 return r; │ │ │ │ │ - 2097 } │ │ │ │ │ - 2098 return false; │ │ │ │ │ - 2099 } │ │ │ │ │ - 2100 } │ │ │ │ │ - 2101 │ │ │ │ │ - 2141 template │ │ │ │ │ -2143 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2144 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2145 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2146 int numPatchCoords, │ │ │ │ │ - 2147 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2148 PATCH_TABLE *patchTable, │ │ │ │ │ - 2149 int fvarChannel = 0, │ │ │ │ │ - 2150 unsigned int numStartEvents=0, │ │ │ │ │ - 2151 const cl_event* startEvents=NULL, │ │ │ │ │ - 2152 cl_event* endEvent=NULL) const { │ │ │ │ │ - 2153 │ │ │ │ │ - 2154 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 2155 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 2156 0, BufferDescriptor(), │ │ │ │ │ - 2157 0, BufferDescriptor(), │ │ │ │ │ - 2158 numPatchCoords, │ │ │ │ │ - 2159 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 2160 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 2161 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 2162 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 2163 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2164 } │ │ │ │ │ - 2165 │ │ │ │ │ - 2228 template │ │ │ │ │ -2231 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 2232 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2233 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2234 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2235 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2236 int numPatchCoords, │ │ │ │ │ - 2237 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2238 PATCH_TABLE *patchTable, │ │ │ │ │ - 2239 int fvarChannel, │ │ │ │ │ - 2240 CLEvaluator const *instance, │ │ │ │ │ - 2241 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 2242 unsigned int numStartEvents=0, │ │ │ │ │ - 2243 const cl_event* startEvents=NULL, │ │ │ │ │ - 2244 cl_event* endEvent=NULL) { │ │ │ │ │ - 2245 │ │ │ │ │ - 2246 if (instance) { │ │ │ │ │ - 2247 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2248 srcBuffer, srcDesc, │ │ │ │ │ - 2249 dstBuffer, dstDesc, │ │ │ │ │ - 2250 duBuffer, duDesc, │ │ │ │ │ - 2251 dvBuffer, dvDesc, │ │ │ │ │ - 2252 numPatchCoords, patchCoords, │ │ │ │ │ - 2253 patchTable, fvarChannel, │ │ │ │ │ - 2254 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2255 } else { │ │ │ │ │ - 2256 // Create an instance on demand (slow) │ │ │ │ │ - 2257 (void)deviceContext; // unused │ │ │ │ │ - 2258 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 2259 duDesc, dvDesc, deviceContext); │ │ │ │ │ - 2260 if (instance) { │ │ │ │ │ - 2261 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2262 srcBuffer, srcDesc, │ │ │ │ │ - 2263 dstBuffer, dstDesc, │ │ │ │ │ - 2264 duBuffer, duDesc, │ │ │ │ │ - 2265 dvBuffer, dvDesc, │ │ │ │ │ - 2266 numPatchCoords, patchCoords, │ │ │ │ │ - 2267 patchTable, fvarChannel, │ │ │ │ │ - 2268 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2269 delete instance; │ │ │ │ │ - 2270 return r; │ │ │ │ │ - 2271 } │ │ │ │ │ - 2272 return false; │ │ │ │ │ - 2273 } │ │ │ │ │ - 2274 } │ │ │ │ │ - 2275 │ │ │ │ │ - 2327 template │ │ │ │ │ -2329 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2330 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2331 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2332 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2333 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2334 int numPatchCoords, │ │ │ │ │ - 2335 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2336 PATCH_TABLE *patchTable, │ │ │ │ │ - 2337 int fvarChannel = 0, │ │ │ │ │ - 2338 unsigned int numStartEvents=0, │ │ │ │ │ - 2339 const cl_event* startEvents=NULL, │ │ │ │ │ - 2340 cl_event* endEvent=NULL) const { │ │ │ │ │ - 2341 │ │ │ │ │ - 2342 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 2343 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 2344 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 2345 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 2346 numPatchCoords, │ │ │ │ │ - 2347 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 2348 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 2349 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 2350 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 2351 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2352 } │ │ │ │ │ - 2353 │ │ │ │ │ - 2434 template │ │ │ │ │ -2437 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 2438 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2439 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2440 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2441 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2442 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 2443 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 2444 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2445 int numPatchCoords, │ │ │ │ │ - 2446 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2447 PATCH_TABLE *patchTable, │ │ │ │ │ - 2448 int fvarChannel, │ │ │ │ │ - 2449 CLEvaluator const *instance, │ │ │ │ │ - 2450 DEVICE_CONTEXT deviceContext, │ │ │ │ │ - 2451 unsigned int numStartEvents=0, │ │ │ │ │ - 2452 const cl_event* startEvents=NULL, │ │ │ │ │ - 2453 cl_event* endEvent=NULL) { │ │ │ │ │ - 2454 │ │ │ │ │ - 2455 if (instance) { │ │ │ │ │ - 2456 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2457 srcBuffer, srcDesc, │ │ │ │ │ - 2458 dstBuffer, dstDesc, │ │ │ │ │ - 2459 duBuffer, duDesc, │ │ │ │ │ - 2460 dvBuffer, dvDesc, │ │ │ │ │ - 2461 duuBuffer, duuDesc, │ │ │ │ │ - 2462 duvBuffer, duvDesc, │ │ │ │ │ - 2463 dvvBuffer, dvvDesc, │ │ │ │ │ - 2464 numPatchCoords, patchCoords, │ │ │ │ │ - 2465 patchTable, fvarChannel, │ │ │ │ │ - 2466 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2467 } else { │ │ │ │ │ - 2468 // Create an instance on demand (slow) │ │ │ │ │ - 2469 (void)deviceContext; // unused │ │ │ │ │ - 2470 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 2471 duDesc, dvDesc, │ │ │ │ │ - 2472 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 2473 deviceContext); │ │ │ │ │ - 2474 if (instance) { │ │ │ │ │ - 2475 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2476 srcBuffer, srcDesc, │ │ │ │ │ - 2477 dstBuffer, dstDesc, │ │ │ │ │ - 2478 duBuffer, duDesc, │ │ │ │ │ - 2479 dvBuffer, dvDesc, │ │ │ │ │ - 2480 duuBuffer, duuDesc, │ │ │ │ │ - 2481 duvBuffer, duvDesc, │ │ │ │ │ - 2482 dvvBuffer, dvvDesc, │ │ │ │ │ - 2483 numPatchCoords, patchCoords, │ │ │ │ │ - 2484 patchTable, fvarChannel, │ │ │ │ │ - 2485 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2486 delete instance; │ │ │ │ │ - 2487 return r; │ │ │ │ │ - 2488 } │ │ │ │ │ - 2489 return false; │ │ │ │ │ - 2490 } │ │ │ │ │ - 2491 } │ │ │ │ │ - 2492 │ │ │ │ │ - 2562 template │ │ │ │ │ -2564 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2565 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2566 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2567 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2568 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2569 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 2570 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 2571 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2572 int numPatchCoords, │ │ │ │ │ - 2573 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2574 PATCH_TABLE *patchTable, │ │ │ │ │ - 2575 int fvarChannel = 0, │ │ │ │ │ - 2576 unsigned int numStartEvents=0, │ │ │ │ │ - 2577 const cl_event* startEvents=NULL, │ │ │ │ │ - 2578 cl_event* endEvent=NULL) const { │ │ │ │ │ - 2579 │ │ │ │ │ - 2580 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc, │ │ │ │ │ - 2581 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc, │ │ │ │ │ - 2582 duBuffer->BindCLBuffer(_clCommandQueue), duDesc, │ │ │ │ │ - 2583 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc, │ │ │ │ │ - 2584 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc, │ │ │ │ │ - 2585 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc, │ │ │ │ │ - 2586 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc, │ │ │ │ │ - 2587 numPatchCoords, │ │ │ │ │ - 2588 patchCoords->BindCLBuffer(_clCommandQueue), │ │ │ │ │ - 2589 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 2590 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 2591 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 2592 numStartEvents, startEvents, endEvent); │ │ │ │ │ - 2593 } │ │ │ │ │ - 2594 │ │ │ │ │ - 2600 │ │ │ │ │ -2603 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2604 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2605 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ - 2606 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ - 2607 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ - 2608 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ - 2609 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ - 2610 │ │ │ │ │ - 2612 template │ │ │ │ │ -2613 static void Synchronize(DEVICE_CONTEXT deviceContext) { │ │ │ │ │ - 2614 Synchronize(deviceContext->GetCommandQueue()); │ │ │ │ │ - 2615 } │ │ │ │ │ - 2616 │ │ │ │ │ -2617 static void Synchronize(cl_command_queue queue); │ │ │ │ │ - 2618 │ │ │ │ │ - 2619private: │ │ │ │ │ - 2620 cl_context _clContext; │ │ │ │ │ - 2621 cl_command_queue _clCommandQueue; │ │ │ │ │ - 2622 cl_program _program; │ │ │ │ │ - 2623 cl_kernel _stencilKernel; │ │ │ │ │ - 2624 cl_kernel _stencilDerivKernel; │ │ │ │ │ - 2625 cl_kernel _patchKernel; │ │ │ │ │ - 2626}; │ │ │ │ │ - 2627 │ │ │ │ │ - 2628} // end namespace Osd │ │ │ │ │ - 2629 │ │ │ │ │ - 2630} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 2631using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 2632 │ │ │ │ │ - 2633} // end namespace OpenSubdiv │ │ │ │ │ - 2634 │ │ │ │ │ - 2635 │ │ │ │ │ - 2636#endif // OPENSUBDIV3_OSD_CL_EVALUATOR_H │ │ │ │ │ + 1686 numPatchCoords, patchCoords, │ │ │ │ │ + 1687 patchTable, │ │ │ │ │ + 1688 fvarChannel, │ │ │ │ │ + 1689 deviceContext); │ │ │ │ │ + 1690 } else { │ │ │ │ │ + 1691 // Create an instance on demand (slow) │ │ │ │ │ + 1692 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1693 BufferDescriptor(), │ │ │ │ │ + 1694 BufferDescriptor(), │ │ │ │ │ + 1695 deviceContext); │ │ │ │ │ + 1696 if (instance) { │ │ │ │ │ + 1697 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1698 srcBuffer, srcDesc, │ │ │ │ │ + 1699 dstBuffer, dstDesc, │ │ │ │ │ + 1700 numPatchCoords, patchCoords, │ │ │ │ │ + 1701 patchTable, │ │ │ │ │ + 1702 fvarChannel, │ │ │ │ │ + 1703 deviceContext); │ │ │ │ │ + 1704 delete instance; │ │ │ │ │ + 1705 return r; │ │ │ │ │ + 1706 } │ │ │ │ │ + 1707 return false; │ │ │ │ │ + 1708 } │ │ │ │ │ + 1709 } │ │ │ │ │ + 1710 │ │ │ │ │ + 1740 template │ │ │ │ │ +1742 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1745 int numPatchCoords, │ │ │ │ │ + 1746 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1747 PATCH_TABLE *patchTable, │ │ │ │ │ + 1748 int fvarChannel, │ │ │ │ │ + 1749 MTLContext* deviceContext) const { │ │ │ │ │ + 1750 │ │ │ │ │ + 1751 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 1752 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 1753 0, BufferDescriptor(), │ │ │ │ │ + 1754 0, BufferDescriptor(), │ │ │ │ │ + 1755 numPatchCoords, │ │ │ │ │ + 1756 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 1757 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1758 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1759 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 1760 deviceContext │ │ │ │ │ + 1761 ); │ │ │ │ │ + 1762 } │ │ │ │ │ + 1763 │ │ │ │ │ + 1811 template │ │ │ │ │ +1813 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1814 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1815 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1816 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1817 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1818 int numPatchCoords, │ │ │ │ │ + 1819 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1820 PATCH_TABLE *patchTable, │ │ │ │ │ + 1821 int fvarChannel, │ │ │ │ │ + 1822 MTLComputeEvaluator const *instance, │ │ │ │ │ + 1823 MTLContext* deviceContext) { │ │ │ │ │ + 1824 │ │ │ │ │ + 1825 if (instance) { │ │ │ │ │ + 1826 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1827 srcBuffer, srcDesc, │ │ │ │ │ + 1828 dstBuffer, dstDesc, │ │ │ │ │ + 1829 duBuffer, duDesc, │ │ │ │ │ + 1830 dvBuffer, dvDesc, │ │ │ │ │ + 1831 numPatchCoords, patchCoords, │ │ │ │ │ + 1832 patchTable, │ │ │ │ │ + 1833 fvarChannel, │ │ │ │ │ + 1834 deviceContext); │ │ │ │ │ + 1835 } else { │ │ │ │ │ + 1836 // Create an instance on demand (slow) │ │ │ │ │ + 1837 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1838 duDesc, dvDesc, │ │ │ │ │ + 1839 deviceContext); │ │ │ │ │ + 1840 if (instance) { │ │ │ │ │ + 1841 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1842 srcBuffer, srcDesc, │ │ │ │ │ + 1843 dstBuffer, dstDesc, │ │ │ │ │ + 1844 duBuffer, duDesc, │ │ │ │ │ + 1845 dvBuffer, dvDesc, │ │ │ │ │ + 1846 numPatchCoords, patchCoords, │ │ │ │ │ + 1847 patchTable, │ │ │ │ │ + 1848 fvarChannel, │ │ │ │ │ + 1849 deviceContext); │ │ │ │ │ + 1850 delete instance; │ │ │ │ │ + 1851 return r; │ │ │ │ │ + 1852 } │ │ │ │ │ + 1853 return false; │ │ │ │ │ + 1854 } │ │ │ │ │ + 1855 } │ │ │ │ │ + 1856 │ │ │ │ │ + 1898 template │ │ │ │ │ +1900 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1901 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1902 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1903 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1904 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1905 int numPatchCoords, │ │ │ │ │ + 1906 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1907 PATCH_TABLE *patchTable, │ │ │ │ │ + 1908 int fvarChannel, │ │ │ │ │ + 1909 MTLContext* deviceContext) const { │ │ │ │ │ + 1910 │ │ │ │ │ + 1911 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 1912 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 1913 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ + 1914 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ + 1915 numPatchCoords, │ │ │ │ │ + 1916 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 1917 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1918 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1919 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 1920 deviceContext │ │ │ │ │ + 1921 ); │ │ │ │ │ + 1922 } │ │ │ │ │ + 1923 │ │ │ │ │ + 1989 template │ │ │ │ │ +1991 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1992 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1993 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1994 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1995 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1996 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1997 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1998 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1999 int numPatchCoords, │ │ │ │ │ + 2000 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2001 PATCH_TABLE *patchTable, │ │ │ │ │ + 2002 int fvarChannel, │ │ │ │ │ + 2003 MTLComputeEvaluator const *instance, │ │ │ │ │ + 2004 MTLContext* deviceContext) { │ │ │ │ │ + 2005 │ │ │ │ │ + 2006 if (instance) { │ │ │ │ │ + 2007 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2008 srcBuffer, srcDesc, │ │ │ │ │ + 2009 dstBuffer, dstDesc, │ │ │ │ │ + 2010 duBuffer, duDesc, │ │ │ │ │ + 2011 dvBuffer, dvDesc, │ │ │ │ │ + 2012 duuBuffer, duuDesc, │ │ │ │ │ + 2013 duvBuffer, duvDesc, │ │ │ │ │ + 2014 dvvBuffer, dvvDesc, │ │ │ │ │ + 2015 numPatchCoords, patchCoords, │ │ │ │ │ + 2016 patchTable, │ │ │ │ │ + 2017 fvarChannel, │ │ │ │ │ + 2018 deviceContext); │ │ │ │ │ + 2019 } else { │ │ │ │ │ + 2020 // Create an instance on demand (slow) │ │ │ │ │ + 2021 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 2022 duDesc, dvDesc, │ │ │ │ │ + 2023 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 2024 deviceContext); │ │ │ │ │ + 2025 if (instance) { │ │ │ │ │ + 2026 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2027 srcBuffer, srcDesc, │ │ │ │ │ + 2028 dstBuffer, dstDesc, │ │ │ │ │ + 2029 duBuffer, duDesc, │ │ │ │ │ + 2030 dvBuffer, dvDesc, │ │ │ │ │ + 2031 duuBuffer, duuDesc, │ │ │ │ │ + 2032 duvBuffer, duvDesc, │ │ │ │ │ + 2033 dvvBuffer, dvvDesc, │ │ │ │ │ + 2034 numPatchCoords, patchCoords, │ │ │ │ │ + 2035 patchTable, │ │ │ │ │ + 2036 fvarChannel, │ │ │ │ │ + 2037 deviceContext); │ │ │ │ │ + 2038 delete instance; │ │ │ │ │ + 2039 return r; │ │ │ │ │ + 2040 } │ │ │ │ │ + 2041 return false; │ │ │ │ │ + 2042 } │ │ │ │ │ + 2043 } │ │ │ │ │ + 2044 │ │ │ │ │ + 2104 template │ │ │ │ │ +2106 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2107 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2108 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2109 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2110 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2111 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 2112 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 2113 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2114 int numPatchCoords, │ │ │ │ │ + 2115 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2116 PATCH_TABLE *patchTable, │ │ │ │ │ + 2117 int fvarChannel, │ │ │ │ │ + 2118 MTLContext* deviceContext) const { │ │ │ │ │ + 2119 │ │ │ │ │ + 2120 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ + 2121 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ + 2122 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ + 2123 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ + 2124 duuBuffer->BindMTLBuffer(deviceContext), duuDesc, │ │ │ │ │ + 2125 duvBuffer->BindMTLBuffer(deviceContext), duvDesc, │ │ │ │ │ + 2126 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc, │ │ │ │ │ + 2127 numPatchCoords, │ │ │ │ │ + 2128 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ + 2129 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 2130 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 2131 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ + 2132 fvarChannel, │ │ │ │ │ + 2133 deviceContext │ │ │ │ │ + 2134 ); │ │ │ │ │ + 2135 } │ │ │ │ │ + 2136 │ │ │ │ │ +2138 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2139 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2140 BufferDescriptor const &duDesc, │ │ │ │ │ + 2141 BufferDescriptor const &dvDesc, │ │ │ │ │ + 2142 BufferDescriptor const &duuDesc, │ │ │ │ │ + 2143 BufferDescriptor const &duvDesc, │ │ │ │ │ + 2144 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2145 MTLContext* context); │ │ │ │ │ + 2146 │ │ │ │ │ +2148 static void Synchronize(MTLContext* context); │ │ │ │ │ + 2149 │ │ │ │ │ + 2150 private: │ │ │ │ │ + 2151 │ │ │ │ │ + 2152 id _computeLibrary; │ │ │ │ │ + 2153 id _evalStencils; │ │ │ │ │ + 2154 id _evalPatches; │ │ │ │ │ + 2155 id _parameterBuffer; │ │ │ │ │ + 2156 │ │ │ │ │ + 2157 int _workGroupSize; │ │ │ │ │ + 2158}; │ │ │ │ │ + 2159 │ │ │ │ │ + 2160} //end namespace Osd │ │ │ │ │ + 2161 │ │ │ │ │ + 2162} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 2163using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 2164 │ │ │ │ │ + 2165} //end namespace OpenSubdiv │ │ │ │ │ + 2166 │ │ │ │ │ + 2167#endif // OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ Stencil table class wrapping the template for compatibility. │ │ │ │ │ Definition: stencilTable.h:273 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ Definition: stencilTable.h:583 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ data buffers.... │ │ │ │ │ Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable │ │ │ │ │ -OpenCL stencil table. │ │ │ │ │ -Definition: clEvaluator.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvvWeightsBuffer │ │ │ │ │ -cl_mem GetDvvWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:82 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable │ │ │ │ │ -CLStencilTable(Far::StencilTable const *stencilTable, cl_context clContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetOffsetsBuffer │ │ │ │ │ -cl_mem GetOffsetsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create │ │ │ │ │ -static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ -Definition: clEvaluator.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetIndicesBuffer │ │ │ │ │ -cl_mem GetIndicesBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetNumStencils │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ +Definition: mtlCommon.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable │ │ │ │ │ +Definition: mtlComputeEvaluator.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable │ │ │ │ │ +MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext │ │ │ │ │ +*context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetDuWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::~MTLStencilTable │ │ │ │ │ +~MTLStencilTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvvWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetDvvWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable │ │ │ │ │ +MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuuWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetDuuWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuvWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetDuvWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetNumStencils │ │ │ │ │ int GetNumStencils() const │ │ │ │ │ -Definition: clEvaluator.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetSizesBuffer │ │ │ │ │ -cl_mem GetSizesBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuuWeightsBuffer │ │ │ │ │ -cl_mem GetDuuWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvWeightsBuffer │ │ │ │ │ -cl_mem GetDvWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuvWeightsBuffer │ │ │ │ │ -cl_mem GetDuvWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:81 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuWeightsBuffer │ │ │ │ │ -cl_mem GetDuWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::~CLStencilTable │ │ │ │ │ -~CLStencilTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create │ │ │ │ │ -static CLStencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ -Definition: clEvaluator.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable │ │ │ │ │ -CLStencilTable(Far::LimitStencilTable const *limitStencilTable, cl_context │ │ │ │ │ -clContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetWeightsBuffer │ │ │ │ │ -cl_mem GetWeightsBuffer() const │ │ │ │ │ -Definition: clEvaluator.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator │ │ │ │ │ -Definition: clEvaluator.h:100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +Definition: mtlComputeEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetIndicesBuffer │ │ │ │ │ +id< MTLBuffer > GetIndicesBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:67 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetSizesBuffer │ │ │ │ │ +id< MTLBuffer > GetSizesBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetOffsetsBuffer │ │ │ │ │ +id< MTLBuffer > GetOffsetsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::Create │ │ │ │ │ +static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT │ │ │ │ │ +context) │ │ │ │ │ +Definition: mtlComputeEvaluator.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvWeightsBuffer │ │ │ │ │ +id< MTLBuffer > GetDvWeightsBuffer() const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator │ │ │ │ │ +Definition: mtlComputeEvaluator.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ +duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor │ │ │ │ │ +const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< │ │ │ │ │ +MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, id< MTLBuffer > │ │ │ │ │ +sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< │ │ │ │ │ +MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > │ │ │ │ │ +dvWeightsBuffer, id< MTLBuffer > duuWeightsBuffer, id< MTLBuffer > │ │ │ │ │ +duvWeightsBuffer, id< MTLBuffer > dvvWeightsBuffer, int start, int end, │ │ │ │ │ +MTLContext *context) const │ │ │ │ │ +Dispatch the MTL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compile... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, MTLComputeEvaluator *instance, MTLContext *context) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:786 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator │ │ │ │ │ -const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, │ │ │ │ │ -const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: clEvaluator.h:309 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(cl_command_queue queue) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::~CLEvaluator │ │ │ │ │ -~CLEvaluator() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ -BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ -cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem │ │ │ │ │ -indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int │ │ │ │ │ -end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) const │ │ │ │ │ -Dispatch the CL compute kernel asynchronously. returns false if the kernel │ │ │ │ │ -hasn't been compiled yet. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ -unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ Generic static stencil function. This function has a same signature as other │ │ │ │ │ device kernels have so t... │ │ │ │ │ -Definition: clEvaluator.h:219 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ -static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ -const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ -cl_context clContext, cl_command_queue clCommandQueue) │ │ │ │ │ -Definition: clEvaluator.h:116 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +Definition: mtlComputeEvaluator.h:312 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const │ │ │ │ │ -*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1991 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::MTLComputeEvaluator │ │ │ │ │ +MTLComputeEvaluator() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::~MTLComputeEvaluator │ │ │ │ │ +~MTLComputeEvaluator() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator │ │ │ │ │ +const *instance, MTLContext *context) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2231 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ -BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ -cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem │ │ │ │ │ -patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem │ │ │ │ │ -patchParamsBuffer, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ -*startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +Definition: mtlComputeEvaluator.h:705 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Instantiatable │ │ │ │ │ +bool Instantiatable │ │ │ │ │ +Definition: mtlComputeEvaluator.h:94 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1978 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, │ │ │ │ │ -const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: clEvaluator.h:561 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: clEvaluator.h:1379 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Instantiatable │ │ │ │ │ -bool Instantiatable │ │ │ │ │ -Definition: clEvaluator.h:102 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ -static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ -const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ -DEVICE_CONTEXT deviceContext) │ │ │ │ │ -Generic creator template. │ │ │ │ │ -Definition: clEvaluator.h:106 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1606 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:220 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext │ │ │ │ │ +*deviceContext) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1900 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ -unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) │ │ │ │ │ +fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2061 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ -static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ -const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ -BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ -BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext) │ │ │ │ │ -Generic creator template. │ │ │ │ │ -Definition: clEvaluator.h:131 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ -BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ -cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const │ │ │ │ │ -&duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, │ │ │ │ │ -cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, │ │ │ │ │ -unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ -BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, │ │ │ │ │ -cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const │ │ │ │ │ -&duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, │ │ │ │ │ -BufferDescriptor const &dvvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, │ │ │ │ │ -cl_mem weights, cl_mem duWeights, cl_mem dvWeights, cl_mem duuWeights, cl_mem │ │ │ │ │ -duvWeights, cl_mem dvvWeights, int start, int end, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -const │ │ │ │ │ -Dispatch the CL compute kernel asynchronously. returns false if the kernel │ │ │ │ │ -hasn't been compiled yet. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1672 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, │ │ │ │ │ -unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2564 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -const │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator │ │ │ │ │ +const *instance, MTLContext *deviceContext) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1217 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1496 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, unsigned │ │ │ │ │ -int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) const │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ +*stencilTable, MTLContext *context) const │ │ │ │ │ Generic stencil function. │ │ │ │ │ -Definition: clEvaluator.h:646 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:376 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ +duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor │ │ │ │ │ +const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< │ │ │ │ │ +MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, id< │ │ │ │ │ +MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< │ │ │ │ │ +MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext │ │ │ │ │ +*context) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, │ │ │ │ │ -DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ -*startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +MTLContext *deviceContext) const │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1653 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(DEVICE_CONTEXT deviceContext) │ │ │ │ │ -Wait the OpenCL kernels finish. │ │ │ │ │ -Definition: clEvaluator.h:2613 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +Definition: mtlComputeEvaluator.h:2106 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(MTLContext *context) │ │ │ │ │ +Wait for the dispatched kernel to finish. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: mtlComputeEvaluator.h:430 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, │ │ │ │ │ -DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event │ │ │ │ │ -*startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, │ │ │ │ │ +MTLContext *context) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1125 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: clEvaluator.h:421 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, │ │ │ │ │ -BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, │ │ │ │ │ -cl_mem weights, int start, int end, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:889 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, MTLContext *deviceContext) const │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1489 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1742 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2329 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1192 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLContext │ │ │ │ │ +*context) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: mtlComputeEvaluator.h:504 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ +duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > │ │ │ │ │ +offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, │ │ │ │ │ +id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, int start, │ │ │ │ │ +int end, MTLContext *context) const │ │ │ │ │ +Dispatch the MTL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compile... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ +EvalPatchesFaceVarying │ │ │ │ │ static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2437 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create │ │ │ │ │ -static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ -const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ -BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ -BufferDescriptor const &dvvDesc, cl_context clContext, cl_command_queue │ │ │ │ │ -clCommandQueue) │ │ │ │ │ -Definition: clEvaluator.h:145 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, │ │ │ │ │ -unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event │ │ │ │ │ -*endEvent=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1003 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ -cl_event *endEvent=NULL) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1749 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const │ │ │ │ │ -*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator │ │ │ │ │ +const *instance, MTLContext *deviceContext) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:902 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1813 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int │ │ │ │ │ -numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) │ │ │ │ │ const │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1568 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying │ │ │ │ │ +Definition: mtlComputeEvaluator.h:966 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:149 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const │ │ │ │ │ -*instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const │ │ │ │ │ -cl_event *startEvents=NULL, cl_event *endEvent=NULL) │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, │ │ │ │ │ +MTLContext *deviceContext) │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:1854 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ -*stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ -cl_event *endEvent=NULL) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: clEvaluator.h:500 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1325 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1104 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ -cl_event *endEvent=NULL) const │ │ │ │ │ +*patchTable, MTLContext *context) const │ │ │ │ │ Generic limit eval function with derivatives. This function has a same │ │ │ │ │ signature as other device kern... │ │ │ │ │ -Definition: clEvaluator.h:1288 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::CLEvaluator │ │ │ │ │ -CLEvaluator(cl_context context, cl_command_queue queue) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Compile │ │ │ │ │ -bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ -BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ -BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvvDesc=BufferDescriptor()) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, │ │ │ │ │ -cl_event *endEvent=NULL) const │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1025 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, MTLContext *deviceContext) const │ │ │ │ │ Generic limit eval function. This function has a same signature as other device │ │ │ │ │ kernels have so that ... │ │ │ │ │ -Definition: clEvaluator.h:2143 │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1407 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext │ │ │ │ │ +*deviceContext) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: mtlComputeEvaluator.h:1257 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create │ │ │ │ │ +static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create │ │ │ │ │ +static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext │ │ │ │ │ +*context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Compile │ │ │ │ │ +bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ +BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ +BufferDescriptor const &dvvDesc, MTLContext *context) │ │ │ │ │ +Configure compute pipline state. Returns false if it fails to create the │ │ │ │ │ +pipeline state. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ +duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, id< MTLBuffer > │ │ │ │ │ +patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > │ │ │ │ │ +patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * clEvaluator.h │ │ │ │ │ + * mtlComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00806.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlCommon.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,25 +83,25 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
mtlCommon.h File Reference
│ │ │ │ +
mtlVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <cstddef>
│ │ │ │ +#include "../osd/mtlCommon.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  MTLContext
class  CPUMTLVertexBuffer
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -110,13 +110,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,25 +5,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -mtlCommon.h File Reference │ │ │ │ │ +mtlVertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../osd/mtlCommon.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  MTLContext │ │ │ │ │ +class  CPUMTLVertexBuffer │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlCommon.h │ │ │ │ │ + * mtlVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00806.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00806 = [ │ │ │ │ │ - ["MTLContext", "a01277.html", "a01277"] │ │ │ │ │ + ["CPUMTLVertexBuffer", "a01301.html", "a01301"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00806_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlCommon.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mtlVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlCommon.h
│ │ │ │ +
mtlVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,51 +107,89 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <cstddef>
│ │ │ │ -
31
│ │ │ │ -
32@protocol MTLDevice;
│ │ │ │ -
33@protocol MTLCommandQueue;
│ │ │ │ -
34
│ │ │ │ -
35namespace OpenSubdiv {
│ │ │ │ -
36namespace OPENSUBDIV_VERSION {
│ │ │ │ -
37
│ │ │ │ -
38namespace Osd {
│ │ │ │ -
39
│ │ │ │ - │ │ │ │ -
41public:
│ │ │ │ -
42 id<MTLDevice> device = nullptr;
│ │ │ │ -
43 id<MTLCommandQueue> commandQueue = nullptr;
│ │ │ │ -
44};
│ │ │ │ -
45
│ │ │ │ -
46} // end namespace Osd
│ │ │ │ -
47
│ │ │ │ -
48} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
49using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
50
│ │ │ │ -
51} // end namespace OpenSubdiv
│ │ │ │ -
52
│ │ │ │ -
53#endif //OPENSUBDIV3_OSD_MTL_COMMON_H
│ │ │ │ +
29#include "../osd/mtlCommon.h"
│ │ │ │ +
30
│ │ │ │ +
31@protocol MTLDevice;
│ │ │ │ +
32@protocol MTLBuffer;
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Osd {
│ │ │ │ +
38
│ │ │ │ + │ │ │ │ +
40public:
│ │ │ │ +
41 static CPUMTLVertexBuffer* Create(int numElements, int numVertices, MTLContext* context);
│ │ │ │ +
42
│ │ │ │ +
43 void UpdateData(const float* src, int startVertex, int numVertices, MTLContext* context);
│ │ │ │ +
44
│ │ │ │ +
45 int GetNumElements() const
│ │ │ │ +
46 {
│ │ │ │ +
47 return _numElements;
│ │ │ │ +
48 }
│ │ │ │ +
49
│ │ │ │ +
50 int GetNumVertices() const
│ │ │ │ +
51 {
│ │ │ │ +
52 return _numVertices;
│ │ │ │ +
53 }
│ │ │ │ +
54
│ │ │ │ +
55 float* BindCpuBuffer();
│ │ │ │ +
56 id<MTLBuffer> BindMTLBuffer(MTLContext* context);
│ │ │ │ +
57
│ │ │ │ +
58 id<MTLBuffer> BindVBO(MTLContext* context)
│ │ │ │ +
59 {
│ │ │ │ +
60 return BindMTLBuffer(context);
│ │ │ │ +
61 }
│ │ │ │ +
62
│ │ │ │ +
63protected:
│ │ │ │ +
64
│ │ │ │ +
65 CPUMTLVertexBuffer(int numElements, int numVertices);
│ │ │ │ +
66
│ │ │ │ +
67 bool allocate(MTLContext* context);
│ │ │ │ +
68
│ │ │ │ +
69private:
│ │ │ │ +
70 int _numElements;
│ │ │ │ +
71 int _numVertices;
│ │ │ │ +
72 id<MTLBuffer> _buffer;
│ │ │ │ +
73 bool _dirty;
│ │ │ │ +
74};
│ │ │ │ +
75
│ │ │ │ +
76} //end namespace Osd
│ │ │ │ +
77
│ │ │ │ +
78} //end namespace OPENSUBDIV_VERSION
│ │ │ │ +
79 using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
80
│ │ │ │ +
81} //end namespace OpenSubdiv
│ │ │ │ +
82
│ │ │ │ +
83#endif // OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
id< MTLBuffer > BindVBO(MTLContext *context)
│ │ │ │ +
CPUMTLVertexBuffer(int numElements, int numVertices)
│ │ │ │ +
static CPUMTLVertexBuffer * Create(int numElements, int numVertices, MTLContext *context)
│ │ │ │ + │ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, MTLContext *context)
│ │ │ │ + │ │ │ │ +
id< MTLBuffer > BindMTLBuffer(MTLContext *context)
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlCommon.h │ │ │ │ │ +mtlVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,50 +30,101 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31 │ │ │ │ │ - 32@protocol MTLDevice; │ │ │ │ │ - 33@protocol MTLCommandQueue; │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace OpenSubdiv { │ │ │ │ │ - 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 37 │ │ │ │ │ - 38namespace Osd { │ │ │ │ │ - 39 │ │ │ │ │ -40class MTLContext { │ │ │ │ │ - 41public: │ │ │ │ │ -42 id device = nullptr; │ │ │ │ │ -43 id commandQueue = nullptr; │ │ │ │ │ - 44}; │ │ │ │ │ - 45 │ │ │ │ │ - 46} // end namespace Osd │ │ │ │ │ - 47 │ │ │ │ │ - 48} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 49using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 50 │ │ │ │ │ - 51} // end namespace OpenSubdiv │ │ │ │ │ - 52 │ │ │ │ │ - 53#endif //OPENSUBDIV3_OSD_MTL_COMMON_H │ │ │ │ │ + 29#include "../osd/mtlCommon.h" │ │ │ │ │ + 30 │ │ │ │ │ + 31@protocol MTLDevice; │ │ │ │ │ + 32@protocol MTLBuffer; │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Osd { │ │ │ │ │ + 38 │ │ │ │ │ +39class CPUMTLVertexBuffer { │ │ │ │ │ + 40public: │ │ │ │ │ +41 static CPUMTLVertexBuffer* Create(int numElements, int numVertices, │ │ │ │ │ +MTLContext* context); │ │ │ │ │ + 42 │ │ │ │ │ +43 void UpdateData(const float* src, int startVertex, int numVertices, │ │ │ │ │ +MTLContext* context); │ │ │ │ │ + 44 │ │ │ │ │ +45 int GetNumElements() const │ │ │ │ │ + 46 { │ │ │ │ │ + 47 return _numElements; │ │ │ │ │ + 48 } │ │ │ │ │ + 49 │ │ │ │ │ +50 int GetNumVertices() const │ │ │ │ │ + 51 { │ │ │ │ │ + 52 return _numVertices; │ │ │ │ │ + 53 } │ │ │ │ │ + 54 │ │ │ │ │ +55 float* BindCpuBuffer(); │ │ │ │ │ +56 id BindMTLBuffer(MTLContext* context); │ │ │ │ │ + 57 │ │ │ │ │ +58 id BindVBO(MTLContext* context) │ │ │ │ │ + 59 { │ │ │ │ │ + 60 return BindMTLBuffer(context); │ │ │ │ │ + 61 } │ │ │ │ │ + 62 │ │ │ │ │ + 63protected: │ │ │ │ │ + 64 │ │ │ │ │ +65 CPUMTLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ + 66 │ │ │ │ │ +67 bool allocate(MTLContext* context); │ │ │ │ │ + 68 │ │ │ │ │ + 69private: │ │ │ │ │ + 70 int _numElements; │ │ │ │ │ + 71 int _numVertices; │ │ │ │ │ + 72 id _buffer; │ │ │ │ │ + 73 bool _dirty; │ │ │ │ │ + 74}; │ │ │ │ │ + 75 │ │ │ │ │ + 76} //end namespace Osd │ │ │ │ │ + 77 │ │ │ │ │ + 78} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 79 using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 80 │ │ │ │ │ + 81} //end namespace OpenSubdiv │ │ │ │ │ + 82 │ │ │ │ │ + 83#endif // OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ Definition: mtlCommon.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext::commandQueue │ │ │ │ │ -id< MTLCommandQueue > commandQueue │ │ │ │ │ -Definition: mtlCommon.h:43 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext::device │ │ │ │ │ -id< MTLDevice > device │ │ │ │ │ -Definition: mtlCommon.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer │ │ │ │ │ +Definition: mtlVertexBuffer.h:39 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindVBO │ │ │ │ │ +id< MTLBuffer > BindVBO(MTLContext *context) │ │ │ │ │ +Definition: mtlVertexBuffer.h:58 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::CPUMTLVertexBuffer │ │ │ │ │ +CPUMTLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::Create │ │ │ │ │ +static CPUMTLVertexBuffer * Create(int numElements, int numVertices, MTLContext │ │ │ │ │ +*context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Definition: mtlVertexBuffer.h:45 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, MTLContext │ │ │ │ │ +*context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Definition: mtlVertexBuffer.h:50 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindMTLBuffer │ │ │ │ │ +id< MTLBuffer > BindMTLBuffer(MTLContext *context) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindCpuBuffer │ │ │ │ │ +float * BindCpuBuffer() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::allocate │ │ │ │ │ +bool allocate(MTLContext *context) │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlCommon.h │ │ │ │ │ + * mtlVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00809.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlMesh.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/hlslPatchShaderSource.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,43 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Typedefs
│ │ │ │ -
mtlMesh.h File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
hlslPatchShaderSource.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/mesh.h"
│ │ │ │ -#include "../osd/mtlPatchTable.h"
│ │ │ │ +#include <string>
│ │ │ │ +#include "../far/patchDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  HLSLPatchShaderSource
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Typedefs

typedef MeshInterface< MTLPatchTable > MTLMeshInterface
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces | Typedefs │ │ │ │ │ -mtlMesh.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +hlslPatchShaderSource.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/mesh.h" │ │ │ │ │ -#include "../osd/mtlPatchTable.h" │ │ │ │ │ +#include │ │ │ │ │ +#include "../far/patchDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  HLSLPatchShaderSource │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -typedef MeshInterface< MTLPatchTable > MTLMeshInterface │ │ │ │ │ -  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlMesh.h │ │ │ │ │ + * hlslPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00809.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00809 = [ │ │ │ │ │ - ["MTLMeshInterface", "a00809.html#aa41e5b43fe46eeb0f97ff6ebdb1935aa", null] │ │ │ │ │ + ["HLSLPatchShaderSource", "a01257.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00809_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlMesh.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/hlslPatchShaderSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlMesh.h
│ │ │ │ +
hlslPatchShaderSource.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,44 +107,59 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../osd/mesh.h"
│ │ │ │ -
30#include "../osd/mtlPatchTable.h"
│ │ │ │ +
29#include <string>
│ │ │ │ +
30#include "../far/patchDescriptor.h"
│ │ │ │
31
│ │ │ │ -
32
│ │ │ │ -
33namespace OpenSubdiv {
│ │ │ │ -
34namespace OPENSUBDIV_VERSION {
│ │ │ │ -
35
│ │ │ │ -
36namespace Osd {
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
39
│ │ │ │ -
40} // end namespace Osd
│ │ │ │ -
41
│ │ │ │ -
42} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
43using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
34
│ │ │ │ +
35namespace Osd {
│ │ │ │ +
36
│ │ │ │ + │ │ │ │ +
38public:
│ │ │ │ +
39 static std::string GetCommonShaderSource();
│ │ │ │ +
40
│ │ │ │ +
41 static std::string GetPatchBasisShaderSource();
│ │ │ │ +
42
│ │ │ │ + │ │ │ │
44
│ │ │ │ -
45} // end namespace OpenSubdiv
│ │ │ │ + │ │ │ │
46
│ │ │ │ -
47#endif // OPENSUBDIV3_OSD_MTL_MESH_H
│ │ │ │ + │ │ │ │ +
48};
│ │ │ │ +
49
│ │ │ │ +
50} // end namespace Osd
│ │ │ │ +
51
│ │ │ │ +
52} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
53using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
54
│ │ │ │ +
55} // end namespace OpenSubdiv
│ │ │ │ +
56
│ │ │ │ +
57#endif // OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ │ │ │ │ -
MeshInterface< MTLPatchTable > MTLMeshInterface
Definition: mtlMesh.h:38
│ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlMesh.h │ │ │ │ │ +hlslPatchShaderSource.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,41 +30,65 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/mesh.h" │ │ │ │ │ - 30#include "../osd/mtlPatchTable.h" │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include "../far/patchDescriptor.h" │ │ │ │ │ 31 │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace OpenSubdiv { │ │ │ │ │ - 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace Osd { │ │ │ │ │ - 37 │ │ │ │ │ -38typedef MeshInterface MTLMeshInterface; │ │ │ │ │ - 39 │ │ │ │ │ - 40} // end namespace Osd │ │ │ │ │ - 41 │ │ │ │ │ - 42} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 43using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Osd { │ │ │ │ │ + 36 │ │ │ │ │ +37class HLSLPatchShaderSource { │ │ │ │ │ + 38public: │ │ │ │ │ +39 static std::string GetCommonShaderSource(); │ │ │ │ │ + 40 │ │ │ │ │ +41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ + 42 │ │ │ │ │ +43 static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ 44 │ │ │ │ │ - 45} // end namespace OpenSubdiv │ │ │ │ │ +45 static std::string GetHullShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ 46 │ │ │ │ │ - 47#endif // OPENSUBDIV3_OSD_MTL_MESH_H │ │ │ │ │ +47 static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ + 48}; │ │ │ │ │ + 49 │ │ │ │ │ + 50} // end namespace Osd │ │ │ │ │ + 51 │ │ │ │ │ + 52} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 53using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 54 │ │ │ │ │ + 55} // end namespace OpenSubdiv │ │ │ │ │ + 56 │ │ │ │ │ + 57#endif // OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLMeshInterface │ │ │ │ │ -MeshInterface< MTLPatchTable > MTLMeshInterface │ │ │ │ │ -Definition: mtlMesh.h:38 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ -Definition: mesh.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource │ │ │ │ │ +Definition: hlslPatchShaderSource.h:37 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ +GetVertexShaderSource │ │ │ │ │ +static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ +GetDomainShaderSource │ │ │ │ │ +static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource::GetHullShaderSource │ │ │ │ │ +static std::string GetHullShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ +GetPatchBasisShaderSource │ │ │ │ │ +static std::string GetPatchBasisShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ +GetCommonShaderSource │ │ │ │ │ +static std::string GetCommonShaderSource() │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlMesh.h │ │ │ │ │ + * hlslPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00812.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlPatchShaderSource.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11Mesh.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,43 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
mtlPatchShaderSource.h File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs
│ │ │ │ +
d3d11Mesh.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#import "../version.h"
│ │ │ │ -#import "../far/patchDescriptor.h"
│ │ │ │ -#import <string>
│ │ │ │ +
#include "../version.h"
│ │ │ │ +#include "../osd/mesh.h"
│ │ │ │ +#include "../osd/d3d11PatchTable.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  MTLPatchShaderSource
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Typedefs

typedef MeshInterface< D3D11PatchTable > D3D11MeshInterface
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -mtlPatchShaderSource.h File Reference │ │ │ │ │ -#import "../version.h" │ │ │ │ │ -#import "../far/patchDescriptor.h" │ │ │ │ │ -#import │ │ │ │ │ +Namespaces | Typedefs │ │ │ │ │ +d3d11Mesh.h File Reference │ │ │ │ │ +#include "../version.h" │ │ │ │ │ +#include "../osd/mesh.h" │ │ │ │ │ +#include "../osd/d3d11PatchTable.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  MTLPatchShaderSource │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ + Typedefs │ │ │ │ │ +typedef MeshInterface< D3D11PatchTable > D3D11MeshInterface │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlPatchShaderSource.h │ │ │ │ │ + * d3d11Mesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00812.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00812 = [ │ │ │ │ │ - ["MTLPatchShaderSource", "a01293.html", null] │ │ │ │ │ + ["D3D11MeshInterface", "a00812.html#ae5c8e80d05d6eaee105d8eecfa9ab609", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00812_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlPatchShaderSource.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11Mesh.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlPatchShaderSource.h
│ │ │ │ +
d3d11Mesh.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,72 +107,45 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │
27
│ │ │ │ -
28#import "../version.h"
│ │ │ │ -
29#import "../far/patchDescriptor.h"
│ │ │ │ -
30#import <string>
│ │ │ │ -
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ -
34
│ │ │ │ -
35namespace Osd {
│ │ │ │ -
36
│ │ │ │ - │ │ │ │ -
38 public:
│ │ │ │ -
39 static std::string GetCommonShaderSource();
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/mesh.h"
│ │ │ │ +
31#include "../osd/d3d11PatchTable.h"
│ │ │ │ +
32
│ │ │ │ +
33namespace OpenSubdiv {
│ │ │ │ +
34namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35
│ │ │ │ +
36namespace Osd {
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
39
│ │ │ │
40
│ │ │ │ -
41 static std::string GetPatchBasisShaderSource();
│ │ │ │ +
41} // end namespace Osd
│ │ │ │
42
│ │ │ │ - │ │ │ │ -
44
│ │ │ │ - │ │ │ │ -
46
│ │ │ │ - │ │ │ │ -
48
│ │ │ │ -
53 static std::string GetVertexShaderSource(
│ │ │ │ - │ │ │ │ - │ │ │ │ -
56 static std::string GetHullShaderSource(
│ │ │ │ - │ │ │ │ - │ │ │ │ -
59 static std::string GetDomainShaderSource(
│ │ │ │ - │ │ │ │ - │ │ │ │ -
62};
│ │ │ │ -
63
│ │ │ │ -
64} // end namespace Osd
│ │ │ │ -
65
│ │ │ │ -
66} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
67using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
68
│ │ │ │ -
69} // end namespace OpenSubdiv
│ │ │ │ -
70
│ │ │ │ -
71#endif // OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE
│ │ │ │ +
43} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
44using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
45
│ │ │ │ +
46} // end namespace OpenSubdiv
│ │ │ │ +
47
│ │ │ │ +
48#endif // OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ -
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
│ │ │ │ -
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ -
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
Deprecated.
│ │ │ │ -
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
│ │ │ │ -
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ - │ │ │ │ - │ │ │ │ +
MeshInterface< D3D11PatchTable > D3D11MeshInterface
Definition: d3d11Mesh.h:38
│ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlPatchShaderSource.h │ │ │ │ │ +d3d11Mesh.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,87 +30,42 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ 27 │ │ │ │ │ - 28#import "../version.h" │ │ │ │ │ - 29#import "../far/patchDescriptor.h" │ │ │ │ │ - 30#import │ │ │ │ │ - 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace Osd { │ │ │ │ │ - 36 │ │ │ │ │ -37class MTLPatchShaderSource { │ │ │ │ │ - 38 public: │ │ │ │ │ -39 static std::string GetCommonShaderSource(); │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/mesh.h" │ │ │ │ │ + 31#include "../osd/d3d11PatchTable.h" │ │ │ │ │ + 32 │ │ │ │ │ + 33namespace OpenSubdiv { │ │ │ │ │ + 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Osd { │ │ │ │ │ + 37 │ │ │ │ │ +38typedef MeshInterface D3D11MeshInterface; │ │ │ │ │ + 39 │ │ │ │ │ 40 │ │ │ │ │ -41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ + 41} // end namespace Osd │ │ │ │ │ 42 │ │ │ │ │ -43 static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ - 44 │ │ │ │ │ -45 static std::string GetHullShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ - 46 │ │ │ │ │ -47 static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ - 48 │ │ │ │ │ -53 static std::string GetVertexShaderSource( │ │ │ │ │ - 54 Far::PatchDescriptor::Type type, │ │ │ │ │ - 55 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ -56 static std::string GetHullShaderSource( │ │ │ │ │ - 57 Far::PatchDescriptor::Type type, │ │ │ │ │ - 58 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ -59 static std::string GetDomainShaderSource( │ │ │ │ │ - 60 Far::PatchDescriptor::Type type, │ │ │ │ │ - 61 Far::PatchDescriptor::Type fvarType); │ │ │ │ │ - 62}; │ │ │ │ │ - 63 │ │ │ │ │ - 64} // end namespace Osd │ │ │ │ │ - 65 │ │ │ │ │ - 66} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 67using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 68 │ │ │ │ │ - 69} // end namespace OpenSubdiv │ │ │ │ │ - 70 │ │ │ │ │ - 71#endif // OPENSUBDIV3_OSD_MTL_PATCH_SHADER_SOURCE │ │ │ │ │ + 43} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 44using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 45 │ │ │ │ │ + 46} // end namespace OpenSubdiv │ │ │ │ │ + 47 │ │ │ │ │ + 48#endif // OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource │ │ │ │ │ -Definition: mtlPatchShaderSource.h:37 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetVertexShaderSource │ │ │ │ │ -static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource::GetHullShaderSource │ │ │ │ │ -static std::string GetHullShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ -PatchDescriptor::Type fvarType) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetDomainShaderSource │ │ │ │ │ -static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetVertexShaderSource │ │ │ │ │ -static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ -PatchDescriptor::Type fvarType) │ │ │ │ │ -Deprecated. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetDomainShaderSource │ │ │ │ │ -static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type, Far:: │ │ │ │ │ -PatchDescriptor::Type fvarType) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource::GetHullShaderSource │ │ │ │ │ -static std::string GetHullShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetPatchBasisShaderSource │ │ │ │ │ -static std::string GetPatchBasisShaderSource() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchShaderSource:: │ │ │ │ │ -GetCommonShaderSource │ │ │ │ │ -static std::string GetCommonShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11MeshInterface │ │ │ │ │ +MeshInterface< D3D11PatchTable > D3D11MeshInterface │ │ │ │ │ +Definition: d3d11Mesh.h:38 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ +Definition: mesh.h:68 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlPatchShaderSource.h │ │ │ │ │ + * d3d11Mesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00815.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11VertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,45 +83,40 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
mtlPatchTable.h File Reference
│ │ │ │ +
d3d11VertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchDescriptor.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include "../osd/mtlCommon.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  MTLPatchTable
class  D3D11VertexBuffer
 Concrete vertex buffer class for DirectX subdivision and DirectX drawing. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -mtlPatchTable.h File Reference │ │ │ │ │ +d3d11VertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchDescriptor.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include "../osd/mtlCommon.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  MTLPatchTable │ │ │ │ │ +class  D3D11VertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for DirectX subdivision and DirectX │ │ │ │ │ + drawing. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlPatchTable.h │ │ │ │ │ + * d3d11VertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00815.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00815 = [ │ │ │ │ │ - ["MTLPatchTable", "a01297.html", "a01297"] │ │ │ │ │ + ["D3D11VertexBuffer", "a01205.html", "a01205"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00815_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11VertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlPatchTable.h
│ │ │ │ +
d3d11VertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,119 +107,89 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../far/patchDescriptor.h"
│ │ │ │ -
30#include "../osd/nonCopyable.h"
│ │ │ │ -
31#include "../osd/types.h"
│ │ │ │ -
32#include "../osd/mtlCommon.h"
│ │ │ │ -
33
│ │ │ │ -
34@protocol MTLDevice;
│ │ │ │ -
35@protocol MTLBuffer;
│ │ │ │ -
36
│ │ │ │ -
37namespace OpenSubdiv {
│ │ │ │ -
38namespace OPENSUBDIV_VERSION {
│ │ │ │ +
29
│ │ │ │ +
30struct ID3D11Buffer;
│ │ │ │ +
31struct ID3D11Device;
│ │ │ │ +
32struct ID3D11DeviceContext;
│ │ │ │ +
33struct ID3D11UnorderedAccessView;
│ │ │ │ +
34
│ │ │ │ +
35namespace OpenSubdiv {
│ │ │ │ +
36namespace OPENSUBDIV_VERSION {
│ │ │ │ +
37
│ │ │ │ +
38namespace Osd {
│ │ │ │
39
│ │ │ │ -
40namespace Far {
│ │ │ │ -
41 class PatchTable;
│ │ │ │ -
42};
│ │ │ │ -
43
│ │ │ │ -
44namespace Osd {
│ │ │ │ -
45
│ │ │ │ -
46class MTLPatchTable : private NonCopyable<MTLPatchTable> {
│ │ │ │ + │ │ │ │
47public:
│ │ │ │ -
48 typedef id<MTLBuffer> VertexBufferBinding;
│ │ │ │ -
49
│ │ │ │ - │ │ │ │ - │ │ │ │ -
52
│ │ │ │ -
53 template<typename DEVICE_CONTEXT>
│ │ │ │ -
54 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ -
55 {
│ │ │ │ -
56 return Create(farPatchTable, context);
│ │ │ │ -
57 }
│ │ │ │ -
58
│ │ │ │ -
59 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, MTLContext* context);
│ │ │ │ -
60
│ │ │ │ -
61 PatchArrayVector const &GetPatchArrays() const { return _patchArrays; }
│ │ │ │ -
62 id<MTLBuffer> GetPatchIndexBuffer() const { return _indexBuffer; }
│ │ │ │ -
63 id<MTLBuffer> GetPatchParamBuffer() const { return _patchParamBuffer; }
│ │ │ │ -
64
│ │ │ │ - │ │ │ │ -
66 id<MTLBuffer> GetVaryingPatchIndexBuffer() const { return _varyingPatchIndexBuffer; }
│ │ │ │ -
67
│ │ │ │ -
68 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ -
69 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const { return _fvarPatchArrays[fvarChannel]; }
│ │ │ │ -
70 id<MTLBuffer> GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return _fvarIndexBuffers[fvarChannel]; }
│ │ │ │ -
71 id<MTLBuffer> GetFVarPatchParamBuffer(int fvarChannel = 0) const { return _fvarParamBuffers[fvarChannel]; }
│ │ │ │ -
72
│ │ │ │ -
73protected:
│ │ │ │ -
74 bool allocate(Far::PatchTable const *farPatchTable, MTLContext* context);
│ │ │ │ -
75
│ │ │ │ - │ │ │ │ -
77
│ │ │ │ -
78 id<MTLBuffer> _indexBuffer;
│ │ │ │ -
79 id<MTLBuffer> _patchParamBuffer;
│ │ │ │ +
49 static D3D11VertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
50 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
51
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
57 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
58 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
59
│ │ │ │ +
61 int GetNumElements() const;
│ │ │ │ +
62
│ │ │ │ +
64 int GetNumVertices() const;
│ │ │ │ +
65
│ │ │ │ +
67 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext);
│ │ │ │ +
68
│ │ │ │ +
70 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) {
│ │ │ │ +
71 return BindD3D11Buffer(deviceContext);
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ +
75 ID3D11UnorderedAccessView *BindD3D11UAV(ID3D11DeviceContext *deviceContext);
│ │ │ │ +
76
│ │ │ │ +
77protected:
│ │ │ │ +
79 D3D11VertexBuffer(int numElements, int numVertices);
│ │ │ │
80
│ │ │ │ - │ │ │ │ -
82
│ │ │ │ - │ │ │ │ -
84
│ │ │ │ -
85 std::vector<PatchArrayVector> _fvarPatchArrays;
│ │ │ │ -
86 std::vector<id<MTLBuffer>> _fvarIndexBuffers;
│ │ │ │ -
87 std::vector<id<MTLBuffer>> _fvarParamBuffers;
│ │ │ │ -
88};
│ │ │ │ -
89
│ │ │ │ -
90} // end namespace Osd
│ │ │ │ +
81 // Allocates D3D11 buffer
│ │ │ │ +
82 bool allocate(ID3D11Device *device);
│ │ │ │ +
83
│ │ │ │ +
84private:
│ │ │ │ +
85 int _numElements;
│ │ │ │ +
86 int _numVertices;
│ │ │ │ +
87 ID3D11Buffer *_buffer;
│ │ │ │ +
88 ID3D11Buffer *_uploadBuffer;
│ │ │ │ +
89 ID3D11UnorderedAccessView *_uav;
│ │ │ │ +
90};
│ │ │ │
91
│ │ │ │ -
92} //end namespace OPENSUBDIV_VERSION
│ │ │ │ -
93using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
94
│ │ │ │ -
95} //end namespace OpenSubdiv
│ │ │ │ +
92} // end namespace Osd
│ │ │ │ +
93
│ │ │ │ +
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
95using namespace OPENSUBDIV_VERSION;
│ │ │ │
96
│ │ │ │ -
97#endif //end OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H
│ │ │ │ +
97} // end namespace OpenSubdiv
│ │ │ │ +
98
│ │ │ │ +
99#endif // OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ - │ │ │ │ -
PatchArrayVector const & GetPatchArrays() const
Definition: mtlPatchTable.h:61
│ │ │ │ -
bool allocate(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ -
static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ - │ │ │ │ -
std::vector< id< MTLBuffer > > _fvarIndexBuffers
Definition: mtlPatchTable.h:86
│ │ │ │ -
id< MTLBuffer > GetFVarPatchParamBuffer(int fvarChannel=0) const
Definition: mtlPatchTable.h:71
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const
Definition: mtlPatchTable.h:69
│ │ │ │ - │ │ │ │ -
std::vector< id< MTLBuffer > > _fvarParamBuffers
Definition: mtlPatchTable.h:87
│ │ │ │ -
std::vector< PatchArrayVector > _fvarPatchArrays
Definition: mtlPatchTable.h:85
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
Definition: mtlPatchTable.h:54
│ │ │ │ - │ │ │ │ -
id< MTLBuffer > GetFVarPatchIndexBuffer(int fvarChannel=0) const
Definition: mtlPatchTable.h:70
│ │ │ │ -
PatchArrayVector const & GetVaryingPatchArrays() const
Definition: mtlPatchTable.h:65
│ │ │ │ - │ │ │ │ +
Concrete vertex buffer class for DirectX subdivision and DirectX drawing.
│ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, ID3D11DeviceContext *deviceContext)
│ │ │ │ +
static D3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
│ │ │ │ +
D3D11VertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
│ │ │ │ + │ │ │ │ +
ID3D11UnorderedAccessView * BindD3D11UAV(ID3D11DeviceContext *deviceContext)
Returns the D3D11 UAV.
│ │ │ │ + │ │ │ │ +
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlPatchTable.h │ │ │ │ │ +d3d11VertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,170 +30,106 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../far/patchDescriptor.h" │ │ │ │ │ - 30#include "../osd/nonCopyable.h" │ │ │ │ │ - 31#include "../osd/types.h" │ │ │ │ │ - 32#include "../osd/mtlCommon.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34@protocol MTLDevice; │ │ │ │ │ - 35@protocol MTLBuffer; │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace OpenSubdiv { │ │ │ │ │ - 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 29 │ │ │ │ │ + 30struct ID3D11Buffer; │ │ │ │ │ + 31struct ID3D11Device; │ │ │ │ │ + 32struct ID3D11DeviceContext; │ │ │ │ │ + 33struct ID3D11UnorderedAccessView; │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace OpenSubdiv { │ │ │ │ │ + 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace Osd { │ │ │ │ │ 39 │ │ │ │ │ - 40namespace Far { │ │ │ │ │ - 41 class PatchTable; │ │ │ │ │ - 42}; │ │ │ │ │ - 43 │ │ │ │ │ - 44namespace Osd { │ │ │ │ │ - 45 │ │ │ │ │ -46class MTLPatchTable : private NonCopyable { │ │ │ │ │ +46class D3D11VertexBuffer { │ │ │ │ │ 47public: │ │ │ │ │ -48 typedef id VertexBufferBinding; │ │ │ │ │ - 49 │ │ │ │ │ -50 MTLPatchTable(); │ │ │ │ │ -51 ~MTLPatchTable(); │ │ │ │ │ - 52 │ │ │ │ │ - 53 template │ │ │ │ │ -54 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ - 55 { │ │ │ │ │ - 56 return Create(farPatchTable, context); │ │ │ │ │ - 57 } │ │ │ │ │ - 58 │ │ │ │ │ -59 static MTLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ -MTLContext* context); │ │ │ │ │ - 60 │ │ │ │ │ -61 PatchArrayVector const &GetPatchArrays() const { return _patchArrays; } │ │ │ │ │ -62 id GetPatchIndexBuffer() const { return _indexBuffer; } │ │ │ │ │ -63 id GetPatchParamBuffer() const { return _patchParamBuffer; } │ │ │ │ │ - 64 │ │ │ │ │ -65 PatchArrayVector const &GetVaryingPatchArrays() const { return │ │ │ │ │ -_varyingPatchArrays; } │ │ │ │ │ -66 id GetVaryingPatchIndexBuffer() const { return │ │ │ │ │ -_varyingPatchIndexBuffer; } │ │ │ │ │ - 67 │ │ │ │ │ -68 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ -69 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const │ │ │ │ │ -{ return _fvarPatchArrays[fvarChannel]; } │ │ │ │ │ -70 id GetFVarPatchIndexBuffer(int fvarChannel = 0) const { return │ │ │ │ │ -_fvarIndexBuffers[fvarChannel]; } │ │ │ │ │ -71 id GetFVarPatchParamBuffer(int fvarChannel = 0) const { return │ │ │ │ │ -_fvarParamBuffers[fvarChannel]; } │ │ │ │ │ - 72 │ │ │ │ │ - 73protected: │ │ │ │ │ -74 bool allocate(Far::PatchTable const *farPatchTable, MTLContext* context); │ │ │ │ │ - 75 │ │ │ │ │ -76 PatchArrayVector _patchArrays; │ │ │ │ │ - 77 │ │ │ │ │ -78 id _indexBuffer; │ │ │ │ │ -79 id _patchParamBuffer; │ │ │ │ │ +49 static D3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 50 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 51 │ │ │ │ │ +53 virtual ~D3D11VertexBuffer(); │ │ │ │ │ + 54 │ │ │ │ │ +57 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 58 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 59 │ │ │ │ │ +61 int GetNumElements() const; │ │ │ │ │ + 62 │ │ │ │ │ +64 int GetNumVertices() const; │ │ │ │ │ + 65 │ │ │ │ │ +67 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 68 │ │ │ │ │ +70 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) { │ │ │ │ │ + 71 return BindD3D11Buffer(deviceContext); │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ +75 ID3D11UnorderedAccessView *BindD3D11UAV(ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 76 │ │ │ │ │ + 77protected: │ │ │ │ │ +79 D3D11VertexBuffer(int numElements, int numVertices); │ │ │ │ │ 80 │ │ │ │ │ -81 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ - 82 │ │ │ │ │ -83 id _varyingPatchIndexBuffer; │ │ │ │ │ - 84 │ │ │ │ │ -85 std::vector _fvarPatchArrays; │ │ │ │ │ -86 std::vector> _fvarIndexBuffers; │ │ │ │ │ -87 std::vector> _fvarParamBuffers; │ │ │ │ │ - 88}; │ │ │ │ │ - 89 │ │ │ │ │ - 90} // end namespace Osd │ │ │ │ │ + 81 // Allocates D3D11 buffer │ │ │ │ │ +82 bool allocate(ID3D11Device *device); │ │ │ │ │ + 83 │ │ │ │ │ + 84private: │ │ │ │ │ + 85 int _numElements; │ │ │ │ │ + 86 int _numVertices; │ │ │ │ │ + 87 ID3D11Buffer *_buffer; │ │ │ │ │ + 88 ID3D11Buffer *_uploadBuffer; │ │ │ │ │ + 89 ID3D11UnorderedAccessView *_uav; │ │ │ │ │ + 90}; │ │ │ │ │ 91 │ │ │ │ │ - 92} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 93using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 94 │ │ │ │ │ - 95} //end namespace OpenSubdiv │ │ │ │ │ + 92} // end namespace Osd │ │ │ │ │ + 93 │ │ │ │ │ + 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ 96 │ │ │ │ │ - 97#endif //end OPENSUBDIV3_OSD_MTL_PATCH_TABLE_H │ │ │ │ │ + 97} // end namespace OpenSubdiv │ │ │ │ │ + 98 │ │ │ │ │ + 99#endif // OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ -Definition: mtlCommon.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable │ │ │ │ │ -Definition: mtlPatchTable.h:46 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchArrays │ │ │ │ │ -PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ -Definition: mtlPatchTable.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::allocate │ │ │ │ │ -bool allocate(Far::PatchTable const *farPatchTable, MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::Create │ │ │ │ │ -static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext │ │ │ │ │ -*context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ -id< MTLBuffer > GetVaryingPatchIndexBuffer() const │ │ │ │ │ -Definition: mtlPatchTable.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarIndexBuffers │ │ │ │ │ -std::vector< id< MTLBuffer > > _fvarIndexBuffers │ │ │ │ │ -Definition: mtlPatchTable.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ -id< MTLBuffer > GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ -Definition: mtlPatchTable.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::MTLPatchTable │ │ │ │ │ -MTLPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchParamBuffer │ │ │ │ │ -id< MTLBuffer > GetPatchParamBuffer() const │ │ │ │ │ -Definition: mtlPatchTable.h:63 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetPatchIndexBuffer │ │ │ │ │ -id< MTLBuffer > GetPatchIndexBuffer() const │ │ │ │ │ -Definition: mtlPatchTable.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_patchArrays │ │ │ │ │ -PatchArrayVector _patchArrays │ │ │ │ │ -Definition: mtlPatchTable.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::VertexBufferBinding │ │ │ │ │ -id< MTLBuffer > VertexBufferBinding │ │ │ │ │ -Definition: mtlPatchTable.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Definition: mtlPatchTable.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchArrays │ │ │ │ │ -PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const │ │ │ │ │ -Definition: mtlPatchTable.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_varyingPatchIndexBuffer │ │ │ │ │ -id< MTLBuffer > _varyingPatchIndexBuffer │ │ │ │ │ -Definition: mtlPatchTable.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarParamBuffers │ │ │ │ │ -std::vector< id< MTLBuffer > > _fvarParamBuffers │ │ │ │ │ -Definition: mtlPatchTable.h:87 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_fvarPatchArrays │ │ │ │ │ -std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ -Definition: mtlPatchTable.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_patchParamBuffer │ │ │ │ │ -id< MTLBuffer > _patchParamBuffer │ │ │ │ │ -Definition: mtlPatchTable.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_varyingPatchArrays │ │ │ │ │ -PatchArrayVector _varyingPatchArrays │ │ │ │ │ -Definition: mtlPatchTable.h:81 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::Create │ │ │ │ │ -static MTLPatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ -Definition: mtlPatchTable.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::~MTLPatchTable │ │ │ │ │ -~MTLPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ -id< MTLBuffer > GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ -Definition: mtlPatchTable.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::GetVaryingPatchArrays │ │ │ │ │ -PatchArrayVector const & GetVaryingPatchArrays() const │ │ │ │ │ -Definition: mtlPatchTable.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLPatchTable::_indexBuffer │ │ │ │ │ -id< MTLBuffer > _indexBuffer │ │ │ │ │ -Definition: mtlPatchTable.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer │ │ │ │ │ +Concrete vertex buffer class for DirectX subdivision and DirectX drawing. │ │ │ │ │ +Definition: d3d11VertexBuffer.h:46 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::Create │ │ │ │ │ +static D3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::D3D11VertexBuffer │ │ │ │ │ +D3D11VertexBuffer(int numElements, int numVertices) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindD3D11Buffer │ │ │ │ │ +ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Returns the D3D11 buffer object. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::~D3D11VertexBuffer │ │ │ │ │ +virtual ~D3D11VertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindD3D11UAV │ │ │ │ │ +ID3D11UnorderedAccessView * BindD3D11UAV(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Returns the D3D11 UAV. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::allocate │ │ │ │ │ +bool allocate(ID3D11Device *device) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindVBO │ │ │ │ │ +ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Returns the D3D11 buffer object (for Osd::Mesh interface) │ │ │ │ │ +Definition: d3d11VertexBuffer.h:70 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlPatchTable.h │ │ │ │ │ + * d3d11VertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00818.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlLegacyGregoryPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11PatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,42 +83,45 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
mtlLegacyGregoryPatchTable.h File Reference
│ │ │ │ +
d3d11PatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ +#include <vector>
│ │ │ │ +#include "../far/patchDescriptor.h"
│ │ │ │ #include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/mtlCommon.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  MTLLegacyGregoryPatchTable
class  D3D11PatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -mtlLegacyGregoryPatchTable.h File Reference │ │ │ │ │ +d3d11PatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchTable.h" │ │ │ │ │ +#include │ │ │ │ │ +#include "../far/patchDescriptor.h" │ │ │ │ │ #include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/mtlCommon.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  MTLLegacyGregoryPatchTable │ │ │ │ │ +class  D3D11PatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlLegacyGregoryPatchTable.h │ │ │ │ │ + * d3d11PatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00818.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00818 = [ │ │ │ │ │ - ["MTLLegacyGregoryPatchTable", "a01289.html", "a01289"] │ │ │ │ │ + ["D3D11PatchTable", "a01201.html", "a01201"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00818_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlLegacyGregoryPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11PatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlLegacyGregoryPatchTable.h
│ │ │ │ +
d3d11PatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,100 +107,108 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../far/patchTable.h"
│ │ │ │ -
30#include "../osd/nonCopyable.h"
│ │ │ │ -
31#include "../osd/mtlCommon.h"
│ │ │ │ -
32
│ │ │ │ -
33@protocol MTLDevice;
│ │ │ │ -
34@protocol MTLBuffer;
│ │ │ │ -
35
│ │ │ │ -
36namespace OpenSubdiv {
│ │ │ │ -
37namespace OPENSUBDIV_VERSION {
│ │ │ │ -
38
│ │ │ │ -
39namespace Osd {
│ │ │ │ -
40
│ │ │ │ - │ │ │ │ -
42: private NonCopyable<MTLLegacyGregoryPatchTable>
│ │ │ │ -
43{
│ │ │ │ -
44public:
│ │ │ │ - │ │ │ │ +
29
│ │ │ │ +
30#include <vector>
│ │ │ │ +
31#include "../far/patchDescriptor.h"
│ │ │ │ +
32#include "../osd/nonCopyable.h"
│ │ │ │ +
33#include "../osd/types.h"
│ │ │ │ +
34
│ │ │ │ +
35struct ID3D11Buffer;
│ │ │ │ +
36struct ID3D11ShaderResourceView;
│ │ │ │ +
37struct ID3D11Device;
│ │ │ │ +
38struct ID3D11DeviceContext;
│ │ │ │ +
39
│ │ │ │ +
40namespace OpenSubdiv {
│ │ │ │ +
41namespace OPENSUBDIV_VERSION {
│ │ │ │ +
42
│ │ │ │ +
43namespace Far{
│ │ │ │ +
44 class PatchTable;
│ │ │ │ +
45};
│ │ │ │
46
│ │ │ │ -
47 template<typename DEVICE_CONTEXT>
│ │ │ │ -
48 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* farPatchTable, DEVICE_CONTEXT context) {
│ │ │ │ -
49 return Create(farPatchTable, context);
│ │ │ │ -
50 }
│ │ │ │ -
51
│ │ │ │ -
52 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* farPatchTable, MTLContext* context);
│ │ │ │ -
53
│ │ │ │ -
54 void UpdateVertexBuffer(id<MTLBuffer> vbo, int numVertices, int numVertexElements, MTLContext* context);
│ │ │ │ +
47namespace Osd {
│ │ │ │ +
48
│ │ │ │ +
49class D3D11PatchTable : private NonCopyable<D3D11PatchTable> {
│ │ │ │ +
50public:
│ │ │ │ +
51 typedef ID3D11Buffer * VertexBufferBinding;
│ │ │ │ +
52
│ │ │ │ + │ │ │ │ + │ │ │ │
55
│ │ │ │ -
56 id<MTLBuffer> GetVertexBuffer() const
│ │ │ │ -
57 {
│ │ │ │ -
58 return _vertexBuffer;
│ │ │ │ -
59 }
│ │ │ │ -
60
│ │ │ │ -
61 id<MTLBuffer> GetVertexValenceBuffer() const
│ │ │ │ -
62 {
│ │ │ │ -
63 return _vertexValenceBuffer;
│ │ │ │ -
64 }
│ │ │ │ -
65
│ │ │ │ -
66 id<MTLBuffer> GetQuadOffsetsBuffer() const
│ │ │ │ -
67 {
│ │ │ │ -
68 return _quadOffsetsBuffer;
│ │ │ │ -
69 }
│ │ │ │ -
70
│ │ │ │ - │ │ │ │ -
72 {
│ │ │ │ - │ │ │ │ -
74 return _quadOffsetsBase[1];
│ │ │ │ -
75 return _quadOffsetsBase[0];
│ │ │ │ -
76 }
│ │ │ │ -
77
│ │ │ │ -
78private:
│ │ │ │ -
79 id<MTLBuffer> _vertexBuffer;
│ │ │ │ -
80 id<MTLBuffer> _vertexValenceBuffer;
│ │ │ │ -
81 id<MTLBuffer> _quadOffsetsBuffer;
│ │ │ │ -
82 int _quadOffsetsBase[2];
│ │ │ │ -
83};
│ │ │ │ -
84
│ │ │ │ -
85} //end namespace Osd
│ │ │ │ -
86
│ │ │ │ -
87} //end namespace OPENSUBDIV_VERSION
│ │ │ │ -
88using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
89
│ │ │ │ -
90} //end namespace OpenSuddiv
│ │ │ │ +
56 template<typename DEVICE_CONTEXT>
│ │ │ │ +
57 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ +
58 DEVICE_CONTEXT context) {
│ │ │ │ +
59 return Create(farPatchTable, context->GetDeviceContext());
│ │ │ │ +
60 }
│ │ │ │ +
61
│ │ │ │ +
62 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ +
63 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
64
│ │ │ │ + │ │ │ │ +
66 return _patchArrays;
│ │ │ │ +
67 }
│ │ │ │ +
68
│ │ │ │ +
70 ID3D11Buffer* GetPatchIndexBuffer() const {
│ │ │ │ +
71 return _indexBuffer;
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ +
75 ID3D11ShaderResourceView* GetPatchParamSRV() const {
│ │ │ │ + │ │ │ │ +
77 }
│ │ │ │ +
78
│ │ │ │ +
79protected:
│ │ │ │ +
80 // allocate buffers from patchTable
│ │ │ │ +
81 bool allocate(Far::PatchTable const *farPatchTable,
│ │ │ │ +
82 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
83
│ │ │ │ + │ │ │ │ +
85
│ │ │ │ +
86 ID3D11Buffer *_indexBuffer;
│ │ │ │ +
87 ID3D11Buffer *_patchParamBuffer;
│ │ │ │ +
88 ID3D11ShaderResourceView *_patchParamBufferSRV;
│ │ │ │ +
89};
│ │ │ │ +
90
│ │ │ │
91
│ │ │ │ -
92#endif // OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
92} // end namespace Osd
│ │ │ │ +
93
│ │ │ │ +
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
96
│ │ │ │ +
97} // end namespace OpenSubdiv
│ │ │ │ +
98
│ │ │ │ +
99#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, MTLContext *context)
│ │ │ │ -
void UpdateVertexBuffer(id< MTLBuffer > vbo, int numVertices, int numVertexElements, MTLContext *context)
│ │ │ │ - │ │ │ │ - │ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ +
static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ +
PatchArrayVector const & GetPatchArrays() const
│ │ │ │ +
bool allocate(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
ID3D11Buffer * GetPatchIndexBuffer() const
Returns the index buffer containing the patch control vertices.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
ID3D11ShaderResourceView * GetPatchParamSRV() const
Returns the SRV containing the patch parameter.
│ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlLegacyGregoryPatchTable.h │ │ │ │ │ +d3d11PatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,127 +30,134 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../far/patchTable.h" │ │ │ │ │ - 30#include "../osd/nonCopyable.h" │ │ │ │ │ - 31#include "../osd/mtlCommon.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33@protocol MTLDevice; │ │ │ │ │ - 34@protocol MTLBuffer; │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace OpenSubdiv { │ │ │ │ │ - 37namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 38 │ │ │ │ │ - 39namespace Osd { │ │ │ │ │ - 40 │ │ │ │ │ -41class MTLLegacyGregoryPatchTable │ │ │ │ │ - 42: private NonCopyable │ │ │ │ │ - 43{ │ │ │ │ │ - 44public: │ │ │ │ │ -45 ~MTLLegacyGregoryPatchTable(); │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include "../far/patchDescriptor.h" │ │ │ │ │ + 32#include "../osd/nonCopyable.h" │ │ │ │ │ + 33#include "../osd/types.h" │ │ │ │ │ + 34 │ │ │ │ │ + 35struct ID3D11Buffer; │ │ │ │ │ + 36struct ID3D11ShaderResourceView; │ │ │ │ │ + 37struct ID3D11Device; │ │ │ │ │ + 38struct ID3D11DeviceContext; │ │ │ │ │ + 39 │ │ │ │ │ + 40namespace OpenSubdiv { │ │ │ │ │ + 41namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 42 │ │ │ │ │ + 43namespace Far{ │ │ │ │ │ + 44 class PatchTable; │ │ │ │ │ + 45}; │ │ │ │ │ 46 │ │ │ │ │ - 47 template │ │ │ │ │ -48 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* │ │ │ │ │ -farPatchTable, DEVICE_CONTEXT context) { │ │ │ │ │ - 49 return Create(farPatchTable, context); │ │ │ │ │ - 50 } │ │ │ │ │ - 51 │ │ │ │ │ -52 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable const* │ │ │ │ │ -farPatchTable, MTLContext* context); │ │ │ │ │ - 53 │ │ │ │ │ -54 void UpdateVertexBuffer(id vbo, int numVertices, int │ │ │ │ │ -numVertexElements, MTLContext* context); │ │ │ │ │ + 47namespace Osd { │ │ │ │ │ + 48 │ │ │ │ │ +49class D3D11PatchTable : private NonCopyable { │ │ │ │ │ + 50public: │ │ │ │ │ +51 typedef ID3D11Buffer * VertexBufferBinding; │ │ │ │ │ + 52 │ │ │ │ │ +53 D3D11PatchTable(); │ │ │ │ │ +54 ~D3D11PatchTable(); │ │ │ │ │ 55 │ │ │ │ │ -56 id GetVertexBuffer() const │ │ │ │ │ - 57 { │ │ │ │ │ - 58 return _vertexBuffer; │ │ │ │ │ - 59 } │ │ │ │ │ - 60 │ │ │ │ │ -61 id GetVertexValenceBuffer() const │ │ │ │ │ - 62 { │ │ │ │ │ - 63 return _vertexValenceBuffer; │ │ │ │ │ - 64 } │ │ │ │ │ - 65 │ │ │ │ │ -66 id GetQuadOffsetsBuffer() const │ │ │ │ │ - 67 { │ │ │ │ │ - 68 return _quadOffsetsBuffer; │ │ │ │ │ - 69 } │ │ │ │ │ - 70 │ │ │ │ │ -71 int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ - 72 { │ │ │ │ │ - 73 if(type == Far::PatchDescriptor::GREGORY_BOUNDARY) │ │ │ │ │ - 74 return _quadOffsetsBase[1]; │ │ │ │ │ - 75 return _quadOffsetsBase[0]; │ │ │ │ │ - 76 } │ │ │ │ │ - 77 │ │ │ │ │ - 78private: │ │ │ │ │ - 79 id _vertexBuffer; │ │ │ │ │ - 80 id _vertexValenceBuffer; │ │ │ │ │ - 81 id _quadOffsetsBuffer; │ │ │ │ │ - 82 int _quadOffsetsBase[2]; │ │ │ │ │ - 83}; │ │ │ │ │ - 84 │ │ │ │ │ - 85} //end namespace Osd │ │ │ │ │ - 86 │ │ │ │ │ - 87} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 88using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 89 │ │ │ │ │ - 90} //end namespace OpenSuddiv │ │ │ │ │ + 56 template │ │ │ │ │ +57 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ + 58 DEVICE_CONTEXT context) { │ │ │ │ │ + 59 return Create(farPatchTable, context->GetDeviceContext()); │ │ │ │ │ + 60 } │ │ │ │ │ + 61 │ │ │ │ │ +62 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ + 63 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 64 │ │ │ │ │ +65 PatchArrayVector const &GetPatchArrays() const { │ │ │ │ │ + 66 return _patchArrays; │ │ │ │ │ + 67 } │ │ │ │ │ + 68 │ │ │ │ │ +70 ID3D11Buffer* GetPatchIndexBuffer() const { │ │ │ │ │ + 71 return _indexBuffer; │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ +75 ID3D11ShaderResourceView* GetPatchParamSRV() const { │ │ │ │ │ + 76 return _patchParamBufferSRV; │ │ │ │ │ + 77 } │ │ │ │ │ + 78 │ │ │ │ │ + 79protected: │ │ │ │ │ + 80 // allocate buffers from patchTable │ │ │ │ │ +81 bool allocate(Far::PatchTable const *farPatchTable, │ │ │ │ │ + 82 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 83 │ │ │ │ │ +84 PatchArrayVector _patchArrays; │ │ │ │ │ + 85 │ │ │ │ │ +86 ID3D11Buffer *_indexBuffer; │ │ │ │ │ +87 ID3D11Buffer *_patchParamBuffer; │ │ │ │ │ +88 ID3D11ShaderResourceView *_patchParamBufferSRV; │ │ │ │ │ + 89}; │ │ │ │ │ + 90 │ │ │ │ │ 91 │ │ │ │ │ - 92#endif // OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 92} // end namespace Osd │ │ │ │ │ + 93 │ │ │ │ │ + 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 96 │ │ │ │ │ + 97} // end namespace OpenSubdiv │ │ │ │ │ + 98 │ │ │ │ │ + 99#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ -@ GREGORY_BOUNDARY │ │ │ │ │ -Definition: patchDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ Container for arrays of parametric patches. │ │ │ │ │ Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ -Definition: mtlCommon.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:43 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsBase │ │ │ │ │ -int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable::Create │ │ │ │ │ -static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ -*farPatchTable, DEVICE_CONTEXT context) │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -GetVertexValenceBuffer │ │ │ │ │ -id< MTLBuffer > GetVertexValenceBuffer() const │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsBuffer │ │ │ │ │ -id< MTLBuffer > GetQuadOffsetsBuffer() const │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable::Create │ │ │ │ │ -static MTLLegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ -*farPatchTable, MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -UpdateVertexBuffer │ │ │ │ │ -void UpdateVertexBuffer(id< MTLBuffer > vbo, int numVertices, int │ │ │ │ │ -numVertexElements, MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -~MTLLegacyGregoryPatchTable │ │ │ │ │ -~MTLLegacyGregoryPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLLegacyGregoryPatchTable:: │ │ │ │ │ -GetVertexBuffer │ │ │ │ │ -id< MTLBuffer > GetVertexBuffer() const │ │ │ │ │ -Definition: mtlLegacyGregoryPatchTable.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable │ │ │ │ │ +Definition: d3d11PatchTable.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::Create │ │ │ │ │ +static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ +Definition: d3d11PatchTable.h:57 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchArrays │ │ │ │ │ +PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ +Definition: d3d11PatchTable.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::allocate │ │ │ │ │ +bool allocate(Far::PatchTable const *farPatchTable, ID3D11DeviceContext │ │ │ │ │ +*deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::VertexBufferBinding │ │ │ │ │ +ID3D11Buffer * VertexBufferBinding │ │ │ │ │ +Definition: d3d11PatchTable.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::~D3D11PatchTable │ │ │ │ │ +~D3D11PatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchIndexBuffer │ │ │ │ │ +ID3D11Buffer * GetPatchIndexBuffer() const │ │ │ │ │ +Returns the index buffer containing the patch control vertices. │ │ │ │ │ +Definition: d3d11PatchTable.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchArrays │ │ │ │ │ +PatchArrayVector _patchArrays │ │ │ │ │ +Definition: d3d11PatchTable.h:84 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_indexBuffer │ │ │ │ │ +ID3D11Buffer * _indexBuffer │ │ │ │ │ +Definition: d3d11PatchTable.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::Create │ │ │ │ │ +static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchParamBufferSRV │ │ │ │ │ +ID3D11ShaderResourceView * _patchParamBufferSRV │ │ │ │ │ +Definition: d3d11PatchTable.h:88 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchParamBuffer │ │ │ │ │ +ID3D11Buffer * _patchParamBuffer │ │ │ │ │ +Definition: d3d11PatchTable.h:87 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchParamSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetPatchParamSRV() const │ │ │ │ │ +Returns the SRV containing the patch parameter. │ │ │ │ │ +Definition: d3d11PatchTable.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::D3D11PatchTable │ │ │ │ │ +D3D11PatchTable() │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlLegacyGregoryPatchTable.h │ │ │ │ │ + * d3d11PatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00821.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlComputeEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11LegacyGregoryPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,46 +83,41 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
mtlComputeEvaluator.h File Reference
│ │ │ │ +
d3d11LegacyGregoryPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ -#include "../osd/mtlCommon.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  MTLStencilTable
 
class  MTLComputeEvaluator
class  D3D11LegacyGregoryPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,31 +5,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -mtlComputeEvaluator.h File Reference │ │ │ │ │ +d3d11LegacyGregoryPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ -#include "../osd/mtlCommon.h" │ │ │ │ │ +#include "../far/patchTable.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  MTLStencilTable │ │ │ │ │ -  │ │ │ │ │ -class  MTLComputeEvaluator │ │ │ │ │ +class  D3D11LegacyGregoryPatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlComputeEvaluator.h │ │ │ │ │ + * d3d11LegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00821.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00821 = [ │ │ │ │ │ - ["MTLStencilTable", "a01281.html", "a01281"], │ │ │ │ │ - ["MTLComputeEvaluator", "a01285.html", "a01285"] │ │ │ │ │ + ["D3D11LegacyGregoryPatchTable", "a01197.html", "a01197"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00821_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlComputeEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11LegacyGregoryPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlComputeEvaluator.h
│ │ │ │ +
d3d11LegacyGregoryPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,1084 +107,110 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/types.h"
│ │ │ │ -
31#include "../osd/bufferDescriptor.h"
│ │ │ │ -
32#include "../osd/mtlCommon.h"
│ │ │ │ -
33
│ │ │ │ -
34@protocol MTLDevice;
│ │ │ │ -
35@protocol MTLBuffer;
│ │ │ │ -
36@protocol MTLLibrary;
│ │ │ │ -
37@protocol MTLComputePipelineState;
│ │ │ │ -
38
│ │ │ │ -
39namespace OpenSubdiv {
│ │ │ │ -
40namespace OPENSUBDIV_VERSION {
│ │ │ │ -
41
│ │ │ │ -
42namespace Far {
│ │ │ │ -
43 class PatchTable;
│ │ │ │ -
44 class StencilTable;
│ │ │ │ -
45 class LimitStencilTable;
│ │ │ │ -
46}
│ │ │ │ +
30#include "../far/patchTable.h"
│ │ │ │ +
31#include "../osd/nonCopyable.h"
│ │ │ │ +
32
│ │ │ │ +
33struct ID3D11Buffer;
│ │ │ │ +
34struct ID3D11ShaderResourceView;
│ │ │ │ +
35struct ID3D11Device;
│ │ │ │ +
36struct ID3D11DeviceContext;
│ │ │ │ +
37
│ │ │ │ +
38namespace OpenSubdiv {
│ │ │ │ +
39namespace OPENSUBDIV_VERSION {
│ │ │ │ +
40
│ │ │ │ +
41namespace Osd {
│ │ │ │ +
42
│ │ │ │ + │ │ │ │ +
44 : private NonCopyable<D3D11LegacyGregoryPatchTable> {
│ │ │ │ +
45public:
│ │ │ │ + │ │ │ │
47
│ │ │ │ -
48namespace Osd {
│ │ │ │ -
49
│ │ │ │ - │ │ │ │ -
51{
│ │ │ │ -
52public:
│ │ │ │ -
53 template<typename STENCIL_TABLE, typename DEVICE_CONTEXT>
│ │ │ │ -
54 static MTLStencilTable* Create(STENCIL_TABLE* stencilTable,
│ │ │ │ -
55 DEVICE_CONTEXT context)
│ │ │ │ -
56 {
│ │ │ │ -
57 return new MTLStencilTable(stencilTable, context);
│ │ │ │ -
58 }
│ │ │ │ -
59
│ │ │ │ -
60
│ │ │ │ -
61 MTLStencilTable(Far::StencilTable const* stencilTable, MTLContext* context);
│ │ │ │ -
62 MTLStencilTable(Far::LimitStencilTable const* stencilTable, MTLContext* context);
│ │ │ │ - │ │ │ │ -
64
│ │ │ │ -
65 id<MTLBuffer> GetSizesBuffer() const { return _sizesBuffer; }
│ │ │ │ -
66 id<MTLBuffer> GetOffsetsBuffer() const { return _offsetsBuffer; }
│ │ │ │ -
67 id<MTLBuffer> GetIndicesBuffer() const { return _indicesBuffer; }
│ │ │ │ -
68 id<MTLBuffer> GetWeightsBuffer() const { return _weightsBuffer; }
│ │ │ │ -
69 id<MTLBuffer> GetDuWeightsBuffer() const { return _duWeightsBuffer; }
│ │ │ │ -
70 id<MTLBuffer> GetDvWeightsBuffer() const { return _dvWeightsBuffer; }
│ │ │ │ -
71 id<MTLBuffer> GetDuuWeightsBuffer() const { return _duuWeightsBuffer; }
│ │ │ │ -
72 id<MTLBuffer> GetDuvWeightsBuffer() const { return _duvWeightsBuffer; }
│ │ │ │ -
73 id<MTLBuffer> GetDvvWeightsBuffer() const { return _dvvWeightsBuffer; }
│ │ │ │ -
74
│ │ │ │ -
75 int GetNumStencils() const { return _numStencils; }
│ │ │ │ -
76
│ │ │ │ -
77private:
│ │ │ │ -
78 id<MTLBuffer> _sizesBuffer;
│ │ │ │ -
79 id<MTLBuffer> _offsetsBuffer;
│ │ │ │ -
80 id<MTLBuffer> _indicesBuffer;
│ │ │ │ -
81 id<MTLBuffer> _weightsBuffer;
│ │ │ │ -
82 id<MTLBuffer> _duWeightsBuffer;
│ │ │ │ -
83 id<MTLBuffer> _dvWeightsBuffer;
│ │ │ │ -
84 id<MTLBuffer> _duuWeightsBuffer;
│ │ │ │ -
85 id<MTLBuffer> _duvWeightsBuffer;
│ │ │ │ -
86 id<MTLBuffer> _dvvWeightsBuffer;
│ │ │ │ -
87
│ │ │ │ -
88 int _numStencils;
│ │ │ │ -
89};
│ │ │ │ -
90
│ │ │ │ - │ │ │ │ -
92{
│ │ │ │ -
93public:
│ │ │ │ -
94 typedef bool Instantiatable;
│ │ │ │ -
95
│ │ │ │ - │ │ │ │ -
97 BufferDescriptor const &dstDesc,
│ │ │ │ -
98 BufferDescriptor const &duDesc,
│ │ │ │ -
99 BufferDescriptor const &dvDesc,
│ │ │ │ -
100 MTLContext* context);
│ │ │ │ +
48 template<typename DEVICE_CONTEXT>
│ │ │ │ + │ │ │ │ +
50 Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context) {
│ │ │ │ +
51 return Create(farPatchTable, context->GetDeviceContext());
│ │ │ │ +
52 }
│ │ │ │ +
53
│ │ │ │ + │ │ │ │ +
55 Far::PatchTable const *farPatchTable,
│ │ │ │ +
56 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
57
│ │ │ │ +
58 void UpdateVertexBuffer(ID3D11Buffer *vbo,
│ │ │ │ +
59 int numVertices, int numVertexElements,
│ │ │ │ +
60 ID3D11DeviceContext *pd3d11DeviceContext);
│ │ │ │ +
61
│ │ │ │ +
62 ID3D11ShaderResourceView* GetVertexSRV() const {
│ │ │ │ +
63 return _vertexSRV;
│ │ │ │ +
64 }
│ │ │ │ +
65
│ │ │ │ +
66 ID3D11ShaderResourceView* GetVertexValenceSRV() const {
│ │ │ │ +
67 return _vertexValenceSRV;
│ │ │ │ +
68 }
│ │ │ │ +
69
│ │ │ │ +
70 ID3D11ShaderResourceView* GetQuadOffsetsSRV() const {
│ │ │ │ +
71 return _quadOffsetsSRV;
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ + │ │ │ │ + │ │ │ │ +
76 return _quadOffsetsBase[1];
│ │ │ │ +
77 }
│ │ │ │ +
78 return _quadOffsetsBase[0];
│ │ │ │ +
79 }
│ │ │ │ +
80
│ │ │ │ +
81protected:
│ │ │ │ + │ │ │ │ +
83
│ │ │ │ +
84private:
│ │ │ │ +
85 ID3D11Buffer* _vertexValenceBuffer;
│ │ │ │ +
86 ID3D11Buffer* _quadOffsetsBuffer;
│ │ │ │ +
87 ID3D11ShaderResourceView* _vertexSRV;
│ │ │ │ +
88 ID3D11ShaderResourceView* _vertexValenceSRV;
│ │ │ │ +
89 ID3D11ShaderResourceView* _quadOffsetsSRV;
│ │ │ │ +
90 int _quadOffsetsBase[2]; // gregory, boundaryGregory
│ │ │ │ +
91};
│ │ │ │ +
92
│ │ │ │ +
93
│ │ │ │ +
94
│ │ │ │ +
95} // end namespace Osd
│ │ │ │ +
96
│ │ │ │ +
97} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
98using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
99
│ │ │ │ +
100} // end namespace OpenSubdiv
│ │ │ │
101
│ │ │ │ - │ │ │ │ -
103 BufferDescriptor const &dstDesc,
│ │ │ │ -
104 BufferDescriptor const &duDesc,
│ │ │ │ -
105 BufferDescriptor const &dvDesc,
│ │ │ │ -
106 BufferDescriptor const &duuDesc,
│ │ │ │ -
107 BufferDescriptor const &duvDesc,
│ │ │ │ -
108 BufferDescriptor const &dvvDesc,
│ │ │ │ -
109 MTLContext* context);
│ │ │ │ -
110
│ │ │ │ - │ │ │ │ - │ │ │ │ -
113
│ │ │ │ -
119
│ │ │ │ -
148 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
149 static bool EvalStencils(
│ │ │ │ -
150 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
151 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
152 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
153 MTLComputeEvaluator const *instance,
│ │ │ │ -
154 MTLContext* context)
│ │ │ │ -
155 {
│ │ │ │ -
156 if (instance) {
│ │ │ │ -
157 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
158 dstBuffer, dstDesc,
│ │ │ │ -
159 stencilTable,
│ │ │ │ -
160 context);
│ │ │ │ -
161 } else {
│ │ │ │ -
162 // Create an instance on demand (slow)
│ │ │ │ -
163 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
166 context);
│ │ │ │ -
167 if (instance) {
│ │ │ │ -
168 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
169 dstBuffer, dstDesc,
│ │ │ │ -
170 stencilTable,
│ │ │ │ -
171 context);
│ │ │ │ -
172 delete instance;
│ │ │ │ -
173 return r;
│ │ │ │ -
174 }
│ │ │ │ -
175 return false;
│ │ │ │ -
176 }
│ │ │ │ -
177 }
│ │ │ │ -
178
│ │ │ │ -
219 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
220 static bool EvalStencils(
│ │ │ │ -
221 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
222 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
223 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
224 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
225 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
226 MTLComputeEvaluator const *instance,
│ │ │ │ -
227 MTLContext* context) {
│ │ │ │ -
228
│ │ │ │ -
229 if (instance) {
│ │ │ │ -
230 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
231 dstBuffer, dstDesc,
│ │ │ │ -
232 duBuffer, duDesc,
│ │ │ │ -
233 dvBuffer, dvDesc,
│ │ │ │ -
234 stencilTable,
│ │ │ │ -
235 context);
│ │ │ │ -
236 } else {
│ │ │ │ -
237 // Create an instance on demand (slow)
│ │ │ │ -
238 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context);
│ │ │ │ -
239 if (instance) {
│ │ │ │ -
240 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
241 dstBuffer, dstDesc,
│ │ │ │ -
242 duBuffer, duDesc,
│ │ │ │ -
243 dvBuffer, dvDesc,
│ │ │ │ -
244 stencilTable,
│ │ │ │ -
245 context);
│ │ │ │ -
246 delete instance;
│ │ │ │ -
247 return r;
│ │ │ │ -
248 }
│ │ │ │ -
249 return false;
│ │ │ │ -
250 }
│ │ │ │ -
251 }
│ │ │ │ -
252
│ │ │ │ -
311 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
312 static bool EvalStencils(
│ │ │ │ -
313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
317 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
318 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
319 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
320 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
321 MTLComputeEvaluator const *instance,
│ │ │ │ -
322 MTLContext* context) {
│ │ │ │ -
323
│ │ │ │ -
324 if (instance) {
│ │ │ │ -
325 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
326 dstBuffer, dstDesc,
│ │ │ │ -
327 duBuffer, duDesc,
│ │ │ │ -
328 dvBuffer, dvDesc,
│ │ │ │ -
329 duuBuffer, duuDesc,
│ │ │ │ -
330 duvBuffer, duvDesc,
│ │ │ │ -
331 dvvBuffer, dvvDesc,
│ │ │ │ -
332 stencilTable,
│ │ │ │ -
333 context);
│ │ │ │ -
334 } else {
│ │ │ │ -
335 // Create an instance on demand (slow)
│ │ │ │ -
336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
337 duuDesc, duvDesc, dvvDesc, context);
│ │ │ │ -
338 if (instance) {
│ │ │ │ -
339 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
340 dstBuffer, dstDesc,
│ │ │ │ -
341 duBuffer, duDesc,
│ │ │ │ -
342 dvBuffer, dvDesc,
│ │ │ │ -
343 duuBuffer, duuDesc,
│ │ │ │ -
344 duvBuffer, duvDesc,
│ │ │ │ -
345 dvvBuffer, dvvDesc,
│ │ │ │ -
346 stencilTable,
│ │ │ │ -
347 context);
│ │ │ │ -
348 delete instance;
│ │ │ │ -
349 return r;
│ │ │ │ -
350 }
│ │ │ │ -
351 return false;
│ │ │ │ -
352 }
│ │ │ │ -
353 }
│ │ │ │ -
354
│ │ │ │ -
375 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
377 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
378 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
379 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
380 MTLContext* context) const
│ │ │ │ -
381 {
│ │ │ │ -
382 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
383 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
384 0, BufferDescriptor(),
│ │ │ │ -
385 0, BufferDescriptor(),
│ │ │ │ -
386 stencilTable->GetSizesBuffer(),
│ │ │ │ -
387 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
388 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
389 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
390 0,
│ │ │ │ -
391 0,
│ │ │ │ -
392 /* start = */ 0,
│ │ │ │ -
393 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ -
394 context);
│ │ │ │ -
395 }
│ │ │ │ -
396
│ │ │ │ -
429 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
431 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
432 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
433 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
434 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
435 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
436 MTLContext* context) const
│ │ │ │ -
437 {
│ │ │ │ -
438 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
439 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
440 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ -
441 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ -
442 stencilTable->GetSizesBuffer(),
│ │ │ │ -
443 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
444 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
445 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
446 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
447 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
448 /* start = */ 0,
│ │ │ │ -
449 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ -
450 context);
│ │ │ │ -
451 }
│ │ │ │ -
452
│ │ │ │ -
503 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
507 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
508 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
509 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
510 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
511 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
512 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
513 MTLContext* context) const
│ │ │ │ -
514 {
│ │ │ │ -
515 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
516 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
517 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ -
518 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ -
519 duuBuffer->BindMTLBuffer(context), duuDesc,
│ │ │ │ -
520 duvBuffer->BindMTLBuffer(context), duvDesc,
│ │ │ │ -
521 dvvBuffer->BindMTLBuffer(context), dvvDesc,
│ │ │ │ -
522 stencilTable->GetSizesBuffer(),
│ │ │ │ -
523 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
524 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
525 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
526 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
527 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
528 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ -
529 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ -
530 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ -
531 /* start = */ 0,
│ │ │ │ -
532 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ -
533 context);
│ │ │ │ -
534 }
│ │ │ │ -
535
│ │ │ │ -
574 bool EvalStencils(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
575 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
576 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
577 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
578 id<MTLBuffer> sizesBuffer,
│ │ │ │ -
579 id<MTLBuffer> offsetsBuffer,
│ │ │ │ -
580 id<MTLBuffer> indicesBuffer,
│ │ │ │ -
581 id<MTLBuffer> weightsBuffer,
│ │ │ │ -
582 id<MTLBuffer> duWeightsBuffer,
│ │ │ │ -
583 id<MTLBuffer> dvWeightsBuffer,
│ │ │ │ -
584 int start,
│ │ │ │ -
585 int end,
│ │ │ │ -
586 MTLContext* context) const;
│ │ │ │ -
587
│ │ │ │ -
644 bool EvalStencils(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
645 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
646 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
647 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
648 id<MTLBuffer> duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
649 id<MTLBuffer> duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
650 id<MTLBuffer> dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
651 id<MTLBuffer> sizesBuffer,
│ │ │ │ -
652 id<MTLBuffer> offsetsBuffer,
│ │ │ │ -
653 id<MTLBuffer> indicesBuffer,
│ │ │ │ -
654 id<MTLBuffer> weightsBuffer,
│ │ │ │ -
655 id<MTLBuffer> duWeightsBuffer,
│ │ │ │ -
656 id<MTLBuffer> dvWeightsBuffer,
│ │ │ │ -
657 id<MTLBuffer> duuWeightsBuffer,
│ │ │ │ -
658 id<MTLBuffer> duvWeightsBuffer,
│ │ │ │ -
659 id<MTLBuffer> dvvWeightsBuffer,
│ │ │ │ -
660 int start,
│ │ │ │ -
661 int end,
│ │ │ │ -
662 MTLContext* context) const;
│ │ │ │ -
663
│ │ │ │ -
669
│ │ │ │ -
703 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
704 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
705 static bool EvalPatches(
│ │ │ │ -
706 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
707 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
708 int numPatchCoords,
│ │ │ │ -
709 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
710 PATCH_TABLE *patchTable,
│ │ │ │ -
711 MTLComputeEvaluator const *instance,
│ │ │ │ -
712 MTLContext* context) {
│ │ │ │ -
713
│ │ │ │ -
714 if (instance) {
│ │ │ │ -
715 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
716 dstBuffer, dstDesc,
│ │ │ │ -
717 numPatchCoords, patchCoords,
│ │ │ │ -
718 patchTable,
│ │ │ │ -
719 context);
│ │ │ │ -
720 } else {
│ │ │ │ -
721 // Create an instance on demand (slow)
│ │ │ │ -
722 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
725 context);
│ │ │ │ -
726 if (instance) {
│ │ │ │ -
727 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
728 dstBuffer, dstDesc,
│ │ │ │ -
729 numPatchCoords, patchCoords,
│ │ │ │ -
730 patchTable,
│ │ │ │ -
731 context);
│ │ │ │ -
732 delete instance;
│ │ │ │ -
733 return r;
│ │ │ │ -
734 }
│ │ │ │ -
735 return false;
│ │ │ │ -
736 }
│ │ │ │ -
737 }
│ │ │ │ -
738
│ │ │ │ -
784 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
785 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
786 static bool EvalPatches(
│ │ │ │ -
787 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
788 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
789 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
790 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
791 int numPatchCoords,
│ │ │ │ -
792 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
793 PATCH_TABLE *patchTable,
│ │ │ │ -
794 MTLComputeEvaluator* instance,
│ │ │ │ -
795 MTLContext* context) {
│ │ │ │ -
796
│ │ │ │ -
797 if (instance) {
│ │ │ │ -
798 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
799 dstBuffer, dstDesc,
│ │ │ │ -
800 duBuffer, duDesc,
│ │ │ │ -
801 dvBuffer, dvDesc,
│ │ │ │ -
802 numPatchCoords, patchCoords,
│ │ │ │ -
803 patchTable,
│ │ │ │ -
804 context);
│ │ │ │ -
805 } else {
│ │ │ │ -
806 // Create an instance on demand (slow)
│ │ │ │ -
807 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
808 duDesc, dvDesc, context);
│ │ │ │ -
809 if (instance) {
│ │ │ │ -
810 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
811 dstBuffer, dstDesc,
│ │ │ │ -
812 duBuffer, duDesc,
│ │ │ │ -
813 dvBuffer, dvDesc,
│ │ │ │ -
814 numPatchCoords, patchCoords,
│ │ │ │ -
815 patchTable,
│ │ │ │ -
816 context);
│ │ │ │ -
817 delete instance;
│ │ │ │ -
818 return r;
│ │ │ │ -
819 }
│ │ │ │ -
820 return false;
│ │ │ │ -
821 }
│ │ │ │ -
822 }
│ │ │ │ -
823
│ │ │ │ -
887 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
888 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
889 static bool EvalPatches(
│ │ │ │ -
890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
894 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
895 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
896 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
897 int numPatchCoords,
│ │ │ │ -
898 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
899 PATCH_TABLE *patchTable,
│ │ │ │ -
900 MTLComputeEvaluator* instance,
│ │ │ │ -
901 MTLContext* context) {
│ │ │ │ -
902
│ │ │ │ -
903 if (instance) {
│ │ │ │ -
904 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
905 dstBuffer, dstDesc,
│ │ │ │ -
906 duBuffer, duDesc,
│ │ │ │ -
907 dvBuffer, dvDesc,
│ │ │ │ -
908 duuBuffer, duuDesc,
│ │ │ │ -
909 duvBuffer, duvDesc,
│ │ │ │ -
910 dvvBuffer, dvvDesc,
│ │ │ │ -
911 numPatchCoords, patchCoords,
│ │ │ │ -
912 patchTable,
│ │ │ │ -
913 context);
│ │ │ │ -
914 } else {
│ │ │ │ -
915 // Create an instance on demand (slow)
│ │ │ │ -
916 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
917 duDesc, dvDesc,
│ │ │ │ -
918 duuDesc, duvDesc, dvvDesc, context);
│ │ │ │ -
919 if (instance) {
│ │ │ │ -
920 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
921 dstBuffer, dstDesc,
│ │ │ │ -
922 duBuffer, duDesc,
│ │ │ │ -
923 dvBuffer, dvDesc,
│ │ │ │ -
924 duuBuffer, duuDesc,
│ │ │ │ -
925 duvBuffer, duvDesc,
│ │ │ │ -
926 dvvBuffer, dvvDesc,
│ │ │ │ -
927 numPatchCoords, patchCoords,
│ │ │ │ -
928 patchTable,
│ │ │ │ -
929 context);
│ │ │ │ -
930 delete instance;
│ │ │ │ -
931 return r;
│ │ │ │ -
932 }
│ │ │ │ -
933 return false;
│ │ │ │ -
934 }
│ │ │ │ -
935 }
│ │ │ │ -
936
│ │ │ │ -
964 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
965 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
967 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
968 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
969 int numPatchCoords,
│ │ │ │ -
970 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
971 PATCH_TABLE *patchTable,
│ │ │ │ -
972 MTLContext* context) const {
│ │ │ │ -
973
│ │ │ │ -
974 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
975 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
976 0, BufferDescriptor(),
│ │ │ │ -
977 0, BufferDescriptor(),
│ │ │ │ -
978 numPatchCoords,
│ │ │ │ -
979 patchCoords->BindMTLBuffer(context),
│ │ │ │ -
980 patchTable->GetPatchArrays(),
│ │ │ │ -
981 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
982 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
983 context);
│ │ │ │ -
984 }
│ │ │ │ -
985
│ │ │ │ -
1023 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1024 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1026 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1027 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1028 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1029 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1030 int numPatchCoords,
│ │ │ │ -
1031 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1032 PATCH_TABLE *patchTable,
│ │ │ │ -
1033 MTLContext* context) const {
│ │ │ │ -
1034
│ │ │ │ -
1035 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
1036 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
1037 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ -
1038 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ -
1039 numPatchCoords,
│ │ │ │ -
1040 patchCoords->BindMTLBuffer(context),
│ │ │ │ -
1041 patchTable->GetPatchArrays(),
│ │ │ │ -
1042 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1043 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1044 context);
│ │ │ │ -
1045 }
│ │ │ │ -
1046
│ │ │ │ -
1102 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1103 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1105 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1106 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1107 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1108 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1109 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1110 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1111 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1112 int numPatchCoords,
│ │ │ │ -
1113 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1114 PATCH_TABLE *patchTable,
│ │ │ │ -
1115 MTLContext* context) const {
│ │ │ │ -
1116
│ │ │ │ -
1117 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
│ │ │ │ -
1118 dstBuffer->BindMTLBuffer(context), dstDesc,
│ │ │ │ -
1119 duBuffer->BindMTLBuffer(context), duDesc,
│ │ │ │ -
1120 dvBuffer->BindMTLBuffer(context), dvDesc,
│ │ │ │ -
1121 duuBuffer->BindMTLBuffer(context), duuDesc,
│ │ │ │ -
1122 duvBuffer->BindMTLBuffer(context), duvDesc,
│ │ │ │ -
1123 dvvBuffer->BindMTLBuffer(context), dvvDesc,
│ │ │ │ -
1124 numPatchCoords,
│ │ │ │ -
1125 patchCoords->BindMTLBuffer(context),
│ │ │ │ -
1126 patchTable->GetPatchArrays(),
│ │ │ │ -
1127 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1128 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1129 context);
│ │ │ │ -
1130 }
│ │ │ │ -
1131
│ │ │ │ -
1132 bool EvalPatches(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1133 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1134 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1135 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1136 int numPatchCoords,
│ │ │ │ -
1137 id<MTLBuffer> patchCoordsBuffer,
│ │ │ │ -
1138 const PatchArrayVector &patchArrays,
│ │ │ │ -
1139 id<MTLBuffer> patchIndexBuffer,
│ │ │ │ -
1140 id<MTLBuffer> patchParamsBuffer,
│ │ │ │ -
1141 MTLContext* context) const;
│ │ │ │ -
1142
│ │ │ │ -
1143 bool EvalPatches(id<MTLBuffer> srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1144 id<MTLBuffer> dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1145 id<MTLBuffer> duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1146 id<MTLBuffer> dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1147 id<MTLBuffer> duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1148 id<MTLBuffer> duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1149 id<MTLBuffer> dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1150 int numPatchCoords,
│ │ │ │ -
1151 id<MTLBuffer> patchCoordsBuffer,
│ │ │ │ -
1152 const PatchArrayVector &patchArrays,
│ │ │ │ -
1153 id<MTLBuffer> patchIndexBuffer,
│ │ │ │ -
1154 id<MTLBuffer> patchParamsBuffer,
│ │ │ │ -
1155 MTLContext* context) const;
│ │ │ │ -
1156
│ │ │ │ -
1190 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1191 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1193 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1194 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1195 int numPatchCoords,
│ │ │ │ -
1196 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1197 PATCH_TABLE *patchTable,
│ │ │ │ -
1198 MTLComputeEvaluator const *instance,
│ │ │ │ -
1199 MTLContext* deviceContext) {
│ │ │ │ -
1200
│ │ │ │ -
1201 if (instance) {
│ │ │ │ -
1202 return instance->EvalPatchesVarying(
│ │ │ │ -
1203 srcBuffer, srcDesc,
│ │ │ │ -
1204 dstBuffer, dstDesc,
│ │ │ │ -
1205 numPatchCoords, patchCoords,
│ │ │ │ -
1206 patchTable,
│ │ │ │ -
1207 deviceContext);
│ │ │ │ -
1208 } else {
│ │ │ │ -
1209 // Create an instance on demand (slow)
│ │ │ │ -
1210 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1213 deviceContext);
│ │ │ │ -
1214 if (instance) {
│ │ │ │ -
1215 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1216 srcBuffer, srcDesc,
│ │ │ │ -
1217 dstBuffer, dstDesc,
│ │ │ │ -
1218 numPatchCoords, patchCoords,
│ │ │ │ -
1219 patchTable,
│ │ │ │ -
1220 deviceContext);
│ │ │ │ -
1221 delete instance;
│ │ │ │ -
1222 return r;
│ │ │ │ -
1223 }
│ │ │ │ -
1224 return false;
│ │ │ │ -
1225 }
│ │ │ │ -
1226 }
│ │ │ │ -
1227
│ │ │ │ -
1255 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1256 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1258 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1259 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1260 int numPatchCoords,
│ │ │ │ -
1261 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1262 PATCH_TABLE *patchTable,
│ │ │ │ -
1263 MTLContext* deviceContext) const {
│ │ │ │ -
1264
│ │ │ │ -
1265 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
1266 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
1267 0, BufferDescriptor(),
│ │ │ │ -
1268 0, BufferDescriptor(),
│ │ │ │ -
1269 numPatchCoords,
│ │ │ │ -
1270 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
1271 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1272 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1273 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1274 deviceContext
│ │ │ │ -
1275 );
│ │ │ │ -
1276 }
│ │ │ │ -
1277
│ │ │ │ -
1323 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1324 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1326 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1327 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1328 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1329 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1330 int numPatchCoords,
│ │ │ │ -
1331 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1332 PATCH_TABLE *patchTable,
│ │ │ │ -
1333 MTLComputeEvaluator const *instance,
│ │ │ │ -
1334 MTLContext* deviceContext) {
│ │ │ │ -
1335
│ │ │ │ -
1336 if (instance) {
│ │ │ │ -
1337 return instance->EvalPatchesVarying(
│ │ │ │ -
1338 srcBuffer, srcDesc,
│ │ │ │ -
1339 dstBuffer, dstDesc,
│ │ │ │ -
1340 duBuffer, duDesc,
│ │ │ │ -
1341 dvBuffer, dvDesc,
│ │ │ │ -
1342 numPatchCoords, patchCoords,
│ │ │ │ -
1343 patchTable,
│ │ │ │ -
1344 deviceContext);
│ │ │ │ -
1345 } else {
│ │ │ │ -
1346 // Create an instance on demand (slow)
│ │ │ │ -
1347 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1348 duDesc, dvDesc,
│ │ │ │ -
1349 deviceContext);
│ │ │ │ -
1350 if (instance) {
│ │ │ │ -
1351 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1352 srcBuffer, srcDesc,
│ │ │ │ -
1353 dstBuffer, dstDesc,
│ │ │ │ -
1354 duBuffer, duDesc,
│ │ │ │ -
1355 dvBuffer, dvDesc,
│ │ │ │ -
1356 numPatchCoords, patchCoords,
│ │ │ │ -
1357 patchTable,
│ │ │ │ -
1358 deviceContext);
│ │ │ │ -
1359 delete instance;
│ │ │ │ -
1360 return r;
│ │ │ │ -
1361 }
│ │ │ │ -
1362 return false;
│ │ │ │ -
1363 }
│ │ │ │ -
1364 }
│ │ │ │ -
1365
│ │ │ │ -
1405 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1406 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1408 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1409 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1410 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1411 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1412 int numPatchCoords,
│ │ │ │ -
1413 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1414 PATCH_TABLE *patchTable,
│ │ │ │ -
1415 MTLContext* deviceContext) const {
│ │ │ │ -
1416
│ │ │ │ -
1417 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
1418 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
1419 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ -
1420 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ -
1421 numPatchCoords,
│ │ │ │ -
1422 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
1423 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1424 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1425 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1426 deviceContext
│ │ │ │ -
1427 );
│ │ │ │ -
1428 }
│ │ │ │ -
1429
│ │ │ │ -
1430
│ │ │ │ -
1494 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1495 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1497 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1498 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1499 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1500 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1501 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1502 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1503 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1504 int numPatchCoords,
│ │ │ │ -
1505 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1506 PATCH_TABLE *patchTable,
│ │ │ │ -
1507 MTLComputeEvaluator const *instance,
│ │ │ │ -
1508 MTLContext* deviceContext) {
│ │ │ │ -
1509
│ │ │ │ -
1510 if (instance) {
│ │ │ │ -
1511 return instance->EvalPatchesVarying(
│ │ │ │ -
1512 srcBuffer, srcDesc,
│ │ │ │ -
1513 dstBuffer, dstDesc,
│ │ │ │ -
1514 duBuffer, duDesc,
│ │ │ │ -
1515 dvBuffer, dvDesc,
│ │ │ │ -
1516 duuBuffer, duuDesc,
│ │ │ │ -
1517 duvBuffer, duvDesc,
│ │ │ │ -
1518 dvvBuffer, dvvDesc,
│ │ │ │ -
1519 numPatchCoords, patchCoords,
│ │ │ │ -
1520 patchTable,
│ │ │ │ -
1521 deviceContext);
│ │ │ │ -
1522 } else {
│ │ │ │ -
1523 // Create an instance on demand (slow)
│ │ │ │ -
1524 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1525 duDesc, dvDesc,
│ │ │ │ -
1526 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
1527 deviceContext);
│ │ │ │ -
1528 if (instance) {
│ │ │ │ -
1529 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1530 srcBuffer, srcDesc,
│ │ │ │ -
1531 dstBuffer, dstDesc,
│ │ │ │ -
1532 duBuffer, duDesc,
│ │ │ │ -
1533 dvBuffer, dvDesc,
│ │ │ │ -
1534 duuBuffer, duuDesc,
│ │ │ │ -
1535 duvBuffer, duvDesc,
│ │ │ │ -
1536 dvvBuffer, dvvDesc,
│ │ │ │ -
1537 numPatchCoords, patchCoords,
│ │ │ │ -
1538 patchTable,
│ │ │ │ -
1539 deviceContext);
│ │ │ │ -
1540 delete instance;
│ │ │ │ -
1541 return r;
│ │ │ │ -
1542 }
│ │ │ │ -
1543 return false;
│ │ │ │ -
1544 }
│ │ │ │ -
1545 }
│ │ │ │ -
1546
│ │ │ │ -
1604 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1605 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1609 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1610 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1611 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1612 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1613 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1614 int numPatchCoords,
│ │ │ │ -
1615 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1616 PATCH_TABLE *patchTable,
│ │ │ │ -
1617 MTLContext* deviceContext) const {
│ │ │ │ -
1618
│ │ │ │ -
1619 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
1620 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
1621 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ -
1622 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ -
1623 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
│ │ │ │ -
1624 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
│ │ │ │ -
1625 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
│ │ │ │ -
1626 numPatchCoords,
│ │ │ │ -
1627 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
1628 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1629 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1630 patchTable->GetPatchParamBuffer(),
│ │ │ │ -
1631 deviceContext
│ │ │ │ -
1632 );
│ │ │ │ -
1633 }
│ │ │ │ -
1634
│ │ │ │ -
1670 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1671 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1673 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1674 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1675 int numPatchCoords,
│ │ │ │ -
1676 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1677 PATCH_TABLE *patchTable,
│ │ │ │ -
1678 int fvarChannel,
│ │ │ │ -
1679 MTLComputeEvaluator const *instance,
│ │ │ │ -
1680 MTLContext* deviceContext) {
│ │ │ │ -
1681
│ │ │ │ -
1682 if (instance) {
│ │ │ │ -
1683 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1684 srcBuffer, srcDesc,
│ │ │ │ -
1685 dstBuffer, dstDesc,
│ │ │ │ -
1686 numPatchCoords, patchCoords,
│ │ │ │ -
1687 patchTable,
│ │ │ │ -
1688 fvarChannel,
│ │ │ │ -
1689 deviceContext);
│ │ │ │ -
1690 } else {
│ │ │ │ -
1691 // Create an instance on demand (slow)
│ │ │ │ -
1692 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1695 deviceContext);
│ │ │ │ -
1696 if (instance) {
│ │ │ │ -
1697 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1698 srcBuffer, srcDesc,
│ │ │ │ -
1699 dstBuffer, dstDesc,
│ │ │ │ -
1700 numPatchCoords, patchCoords,
│ │ │ │ -
1701 patchTable,
│ │ │ │ -
1702 fvarChannel,
│ │ │ │ -
1703 deviceContext);
│ │ │ │ -
1704 delete instance;
│ │ │ │ -
1705 return r;
│ │ │ │ -
1706 }
│ │ │ │ -
1707 return false;
│ │ │ │ -
1708 }
│ │ │ │ -
1709 }
│ │ │ │ -
1710
│ │ │ │ -
1740 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1741 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1745 int numPatchCoords,
│ │ │ │ -
1746 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1747 PATCH_TABLE *patchTable,
│ │ │ │ -
1748 int fvarChannel,
│ │ │ │ -
1749 MTLContext* deviceContext) const {
│ │ │ │ -
1750
│ │ │ │ -
1751 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
1752 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
1753 0, BufferDescriptor(),
│ │ │ │ -
1754 0, BufferDescriptor(),
│ │ │ │ -
1755 numPatchCoords,
│ │ │ │ -
1756 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
1757 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1758 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1759 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
1760 deviceContext
│ │ │ │ -
1761 );
│ │ │ │ -
1762 }
│ │ │ │ -
1763
│ │ │ │ -
1811 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1812 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1814 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1815 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1816 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1817 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1818 int numPatchCoords,
│ │ │ │ -
1819 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1820 PATCH_TABLE *patchTable,
│ │ │ │ -
1821 int fvarChannel,
│ │ │ │ -
1822 MTLComputeEvaluator const *instance,
│ │ │ │ -
1823 MTLContext* deviceContext) {
│ │ │ │ -
1824
│ │ │ │ -
1825 if (instance) {
│ │ │ │ -
1826 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1827 srcBuffer, srcDesc,
│ │ │ │ -
1828 dstBuffer, dstDesc,
│ │ │ │ -
1829 duBuffer, duDesc,
│ │ │ │ -
1830 dvBuffer, dvDesc,
│ │ │ │ -
1831 numPatchCoords, patchCoords,
│ │ │ │ -
1832 patchTable,
│ │ │ │ -
1833 fvarChannel,
│ │ │ │ -
1834 deviceContext);
│ │ │ │ -
1835 } else {
│ │ │ │ -
1836 // Create an instance on demand (slow)
│ │ │ │ -
1837 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1838 duDesc, dvDesc,
│ │ │ │ -
1839 deviceContext);
│ │ │ │ -
1840 if (instance) {
│ │ │ │ -
1841 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1842 srcBuffer, srcDesc,
│ │ │ │ -
1843 dstBuffer, dstDesc,
│ │ │ │ -
1844 duBuffer, duDesc,
│ │ │ │ -
1845 dvBuffer, dvDesc,
│ │ │ │ -
1846 numPatchCoords, patchCoords,
│ │ │ │ -
1847 patchTable,
│ │ │ │ -
1848 fvarChannel,
│ │ │ │ -
1849 deviceContext);
│ │ │ │ -
1850 delete instance;
│ │ │ │ -
1851 return r;
│ │ │ │ -
1852 }
│ │ │ │ -
1853 return false;
│ │ │ │ -
1854 }
│ │ │ │ -
1855 }
│ │ │ │ -
1856
│ │ │ │ -
1898 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1899 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1901 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1902 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1903 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1904 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1905 int numPatchCoords,
│ │ │ │ -
1906 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1907 PATCH_TABLE *patchTable,
│ │ │ │ -
1908 int fvarChannel,
│ │ │ │ -
1909 MTLContext* deviceContext) const {
│ │ │ │ -
1910
│ │ │ │ -
1911 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
1912 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
1913 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ -
1914 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ -
1915 numPatchCoords,
│ │ │ │ -
1916 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
1917 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1918 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1919 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
1920 deviceContext
│ │ │ │ -
1921 );
│ │ │ │ -
1922 }
│ │ │ │ -
1923
│ │ │ │ -
1989 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1990 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1992 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1993 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1994 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1995 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1996 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1997 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1998 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1999 int numPatchCoords,
│ │ │ │ -
2000 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2001 PATCH_TABLE *patchTable,
│ │ │ │ -
2002 int fvarChannel,
│ │ │ │ -
2003 MTLComputeEvaluator const *instance,
│ │ │ │ -
2004 MTLContext* deviceContext) {
│ │ │ │ -
2005
│ │ │ │ -
2006 if (instance) {
│ │ │ │ -
2007 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
2008 srcBuffer, srcDesc,
│ │ │ │ -
2009 dstBuffer, dstDesc,
│ │ │ │ -
2010 duBuffer, duDesc,
│ │ │ │ -
2011 dvBuffer, dvDesc,
│ │ │ │ -
2012 duuBuffer, duuDesc,
│ │ │ │ -
2013 duvBuffer, duvDesc,
│ │ │ │ -
2014 dvvBuffer, dvvDesc,
│ │ │ │ -
2015 numPatchCoords, patchCoords,
│ │ │ │ -
2016 patchTable,
│ │ │ │ -
2017 fvarChannel,
│ │ │ │ -
2018 deviceContext);
│ │ │ │ -
2019 } else {
│ │ │ │ -
2020 // Create an instance on demand (slow)
│ │ │ │ -
2021 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
2022 duDesc, dvDesc,
│ │ │ │ -
2023 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
2024 deviceContext);
│ │ │ │ -
2025 if (instance) {
│ │ │ │ -
2026 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
2027 srcBuffer, srcDesc,
│ │ │ │ -
2028 dstBuffer, dstDesc,
│ │ │ │ -
2029 duBuffer, duDesc,
│ │ │ │ -
2030 dvBuffer, dvDesc,
│ │ │ │ -
2031 duuBuffer, duuDesc,
│ │ │ │ -
2032 duvBuffer, duvDesc,
│ │ │ │ -
2033 dvvBuffer, dvvDesc,
│ │ │ │ -
2034 numPatchCoords, patchCoords,
│ │ │ │ -
2035 patchTable,
│ │ │ │ -
2036 fvarChannel,
│ │ │ │ -
2037 deviceContext);
│ │ │ │ -
2038 delete instance;
│ │ │ │ -
2039 return r;
│ │ │ │ -
2040 }
│ │ │ │ -
2041 return false;
│ │ │ │ -
2042 }
│ │ │ │ -
2043 }
│ │ │ │ -
2044
│ │ │ │ -
2104 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2105 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2107 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2108 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2109 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2110 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2111 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
2112 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
2113 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
2114 int numPatchCoords,
│ │ │ │ -
2115 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2116 PATCH_TABLE *patchTable,
│ │ │ │ -
2117 int fvarChannel,
│ │ │ │ -
2118 MTLContext* deviceContext) const {
│ │ │ │ -
2119
│ │ │ │ -
2120 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
│ │ │ │ -
2121 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
│ │ │ │ -
2122 duBuffer->BindMTLBuffer(deviceContext), duDesc,
│ │ │ │ -
2123 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
│ │ │ │ -
2124 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
│ │ │ │ -
2125 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
│ │ │ │ -
2126 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
│ │ │ │ -
2127 numPatchCoords,
│ │ │ │ -
2128 patchCoords->BindMTLBuffer(deviceContext),
│ │ │ │ -
2129 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
2130 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
2131 patchTable->GetFVarPatchParamBuffer(fvarChannel),
│ │ │ │ -
2132 fvarChannel,
│ │ │ │ -
2133 deviceContext
│ │ │ │ -
2134 );
│ │ │ │ -
2135 }
│ │ │ │ -
2136
│ │ │ │ -
2138 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2139 BufferDescriptor const &dstDesc,
│ │ │ │ -
2140 BufferDescriptor const &duDesc,
│ │ │ │ -
2141 BufferDescriptor const &dvDesc,
│ │ │ │ -
2142 BufferDescriptor const &duuDesc,
│ │ │ │ -
2143 BufferDescriptor const &duvDesc,
│ │ │ │ -
2144 BufferDescriptor const &dvvDesc,
│ │ │ │ -
2145 MTLContext* context);
│ │ │ │ -
2146
│ │ │ │ -
2148 static void Synchronize(MTLContext* context);
│ │ │ │ -
2149
│ │ │ │ -
2150 private:
│ │ │ │ -
2151
│ │ │ │ -
2152 id<MTLLibrary> _computeLibrary;
│ │ │ │ -
2153 id<MTLComputePipelineState> _evalStencils;
│ │ │ │ -
2154 id<MTLComputePipelineState> _evalPatches;
│ │ │ │ -
2155 id<MTLBuffer> _parameterBuffer;
│ │ │ │ -
2156
│ │ │ │ -
2157 int _workGroupSize;
│ │ │ │ -
2158};
│ │ │ │ -
2159
│ │ │ │ -
2160} //end namespace Osd
│ │ │ │ -
2161
│ │ │ │ -
2162} //end namespace OPENSUBDIV_VERSION
│ │ │ │ -
2163using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
2164
│ │ │ │ -
2165} //end namespace OpenSubdiv
│ │ │ │ -
2166
│ │ │ │ -
2167#endif // OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
│ │ │ │ +
102#endif // OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ -
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ - │ │ │ │ -
MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext *context)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT context)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, id< MTLBuffer > duuWeightsBuffer, id< MTLBuffer > duvWeightsBuffer, id< MTLBuffer > dvvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ - │ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ -
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static void Synchronize(MTLContext *context)
Wait for the dispatched kernel to finish.
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
│ │ │ │ -
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, MTLContext *context)
│ │ │ │ -
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
│ │ │ │ -
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
Configure compute pipline state. Returns false if it fails to create the pipeline state.
│ │ │ │ -
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ +
void UpdateVertexBuffer(ID3D11Buffer *vbo, int numVertices, int numVertexElements, ID3D11DeviceContext *pd3d11DeviceContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ + │ │ │ │ +
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlComputeEvaluator.h │ │ │ │ │ +d3d11LegacyGregoryPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,1388 +30,134 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/types.h" │ │ │ │ │ - 31#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 32#include "../osd/mtlCommon.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34@protocol MTLDevice; │ │ │ │ │ - 35@protocol MTLBuffer; │ │ │ │ │ - 36@protocol MTLLibrary; │ │ │ │ │ - 37@protocol MTLComputePipelineState; │ │ │ │ │ - 38 │ │ │ │ │ - 39namespace OpenSubdiv { │ │ │ │ │ - 40namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 41 │ │ │ │ │ - 42namespace Far { │ │ │ │ │ - 43 class PatchTable; │ │ │ │ │ - 44 class StencilTable; │ │ │ │ │ - 45 class LimitStencilTable; │ │ │ │ │ - 46} │ │ │ │ │ + 30#include "../far/patchTable.h" │ │ │ │ │ + 31#include "../osd/nonCopyable.h" │ │ │ │ │ + 32 │ │ │ │ │ + 33struct ID3D11Buffer; │ │ │ │ │ + 34struct ID3D11ShaderResourceView; │ │ │ │ │ + 35struct ID3D11Device; │ │ │ │ │ + 36struct ID3D11DeviceContext; │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace OpenSubdiv { │ │ │ │ │ + 39namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 40 │ │ │ │ │ + 41namespace Osd { │ │ │ │ │ + 42 │ │ │ │ │ +43class D3D11LegacyGregoryPatchTable │ │ │ │ │ + 44 : private NonCopyable { │ │ │ │ │ + 45public: │ │ │ │ │ +46 ~D3D11LegacyGregoryPatchTable(); │ │ │ │ │ 47 │ │ │ │ │ - 48namespace Osd { │ │ │ │ │ - 49 │ │ │ │ │ -50class MTLStencilTable │ │ │ │ │ - 51{ │ │ │ │ │ - 52public: │ │ │ │ │ - 53 template │ │ │ │ │ -54 static MTLStencilTable* Create(STENCIL_TABLE* stencilTable, │ │ │ │ │ - 55 DEVICE_CONTEXT context) │ │ │ │ │ - 56 { │ │ │ │ │ - 57 return new MTLStencilTable(stencilTable, context); │ │ │ │ │ - 58 } │ │ │ │ │ - 59 │ │ │ │ │ - 60 │ │ │ │ │ -61 MTLStencilTable(Far::StencilTable const* stencilTable, MTLContext* context); │ │ │ │ │ -62 MTLStencilTable(Far::LimitStencilTable const* stencilTable, MTLContext* │ │ │ │ │ -context); │ │ │ │ │ -63 ~MTLStencilTable(); │ │ │ │ │ - 64 │ │ │ │ │ -65 id GetSizesBuffer() const { return _sizesBuffer; } │ │ │ │ │ -66 id GetOffsetsBuffer() const { return _offsetsBuffer; } │ │ │ │ │ -67 id GetIndicesBuffer() const { return _indicesBuffer; } │ │ │ │ │ -68 id GetWeightsBuffer() const { return _weightsBuffer; } │ │ │ │ │ -69 id GetDuWeightsBuffer() const { return _duWeightsBuffer; } │ │ │ │ │ -70 id GetDvWeightsBuffer() const { return _dvWeightsBuffer; } │ │ │ │ │ -71 id GetDuuWeightsBuffer() const { return _duuWeightsBuffer; } │ │ │ │ │ -72 id GetDuvWeightsBuffer() const { return _duvWeightsBuffer; } │ │ │ │ │ -73 id GetDvvWeightsBuffer() const { return _dvvWeightsBuffer; } │ │ │ │ │ - 74 │ │ │ │ │ -75 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ - 76 │ │ │ │ │ - 77private: │ │ │ │ │ - 78 id _sizesBuffer; │ │ │ │ │ - 79 id _offsetsBuffer; │ │ │ │ │ - 80 id _indicesBuffer; │ │ │ │ │ - 81 id _weightsBuffer; │ │ │ │ │ - 82 id _duWeightsBuffer; │ │ │ │ │ - 83 id _dvWeightsBuffer; │ │ │ │ │ - 84 id _duuWeightsBuffer; │ │ │ │ │ - 85 id _duvWeightsBuffer; │ │ │ │ │ - 86 id _dvvWeightsBuffer; │ │ │ │ │ - 87 │ │ │ │ │ - 88 int _numStencils; │ │ │ │ │ - 89}; │ │ │ │ │ - 90 │ │ │ │ │ -91class MTLComputeEvaluator │ │ │ │ │ - 92{ │ │ │ │ │ - 93public: │ │ │ │ │ -94 typedef bool Instantiatable; │ │ │ │ │ - 95 │ │ │ │ │ -96 static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 97 BufferDescriptor const &dstDesc, │ │ │ │ │ - 98 BufferDescriptor const &duDesc, │ │ │ │ │ - 99 BufferDescriptor const &dvDesc, │ │ │ │ │ - 100 MTLContext* context); │ │ │ │ │ + 48 template │ │ │ │ │ +49 static D3D11LegacyGregoryPatchTable *Create( │ │ │ │ │ + 50 Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context) { │ │ │ │ │ + 51 return Create(farPatchTable, context->GetDeviceContext()); │ │ │ │ │ + 52 } │ │ │ │ │ + 53 │ │ │ │ │ +54 static D3D11LegacyGregoryPatchTable *Create( │ │ │ │ │ + 55 Far::PatchTable const *farPatchTable, │ │ │ │ │ + 56 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 57 │ │ │ │ │ +58 void UpdateVertexBuffer(ID3D11Buffer *vbo, │ │ │ │ │ + 59 int numVertices, int numVertexElements, │ │ │ │ │ + 60 ID3D11DeviceContext *pd3d11DeviceContext); │ │ │ │ │ + 61 │ │ │ │ │ +62 ID3D11ShaderResourceView* GetVertexSRV() const { │ │ │ │ │ + 63 return _vertexSRV; │ │ │ │ │ + 64 } │ │ │ │ │ + 65 │ │ │ │ │ +66 ID3D11ShaderResourceView* GetVertexValenceSRV() const { │ │ │ │ │ + 67 return _vertexValenceSRV; │ │ │ │ │ + 68 } │ │ │ │ │ + 69 │ │ │ │ │ +70 ID3D11ShaderResourceView* GetQuadOffsetsSRV() const { │ │ │ │ │ + 71 return _quadOffsetsSRV; │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ +74 int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) { │ │ │ │ │ + 75 if (type == Far::PatchDescriptor::GREGORY_BOUNDARY) { │ │ │ │ │ + 76 return _quadOffsetsBase[1]; │ │ │ │ │ + 77 } │ │ │ │ │ + 78 return _quadOffsetsBase[0]; │ │ │ │ │ + 79 } │ │ │ │ │ + 80 │ │ │ │ │ + 81protected: │ │ │ │ │ +82 D3D11LegacyGregoryPatchTable(); │ │ │ │ │ + 83 │ │ │ │ │ + 84private: │ │ │ │ │ + 85 ID3D11Buffer* _vertexValenceBuffer; │ │ │ │ │ + 86 ID3D11Buffer* _quadOffsetsBuffer; │ │ │ │ │ + 87 ID3D11ShaderResourceView* _vertexSRV; │ │ │ │ │ + 88 ID3D11ShaderResourceView* _vertexValenceSRV; │ │ │ │ │ + 89 ID3D11ShaderResourceView* _quadOffsetsSRV; │ │ │ │ │ + 90 int _quadOffsetsBase[2]; // gregory, boundaryGregory │ │ │ │ │ + 91}; │ │ │ │ │ + 92 │ │ │ │ │ + 93 │ │ │ │ │ + 94 │ │ │ │ │ + 95} // end namespace Osd │ │ │ │ │ + 96 │ │ │ │ │ + 97} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 98using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 99 │ │ │ │ │ + 100} // end namespace OpenSubdiv │ │ │ │ │ 101 │ │ │ │ │ -102 static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 103 BufferDescriptor const &dstDesc, │ │ │ │ │ - 104 BufferDescriptor const &duDesc, │ │ │ │ │ - 105 BufferDescriptor const &dvDesc, │ │ │ │ │ - 106 BufferDescriptor const &duuDesc, │ │ │ │ │ - 107 BufferDescriptor const &duvDesc, │ │ │ │ │ - 108 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 109 MTLContext* context); │ │ │ │ │ - 110 │ │ │ │ │ -111 MTLComputeEvaluator(); │ │ │ │ │ -112 ~MTLComputeEvaluator(); │ │ │ │ │ - 113 │ │ │ │ │ - 119 │ │ │ │ │ - 148 template │ │ │ │ │ -149 static bool EvalStencils( │ │ │ │ │ - 150 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 151 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 152 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 153 MTLComputeEvaluator const *instance, │ │ │ │ │ - 154 MTLContext* context) │ │ │ │ │ - 155 { │ │ │ │ │ - 156 if (instance) { │ │ │ │ │ - 157 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 158 dstBuffer, dstDesc, │ │ │ │ │ - 159 stencilTable, │ │ │ │ │ - 160 context); │ │ │ │ │ - 161 } else { │ │ │ │ │ - 162 // Create an instance on demand (slow) │ │ │ │ │ - 163 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 164 BufferDescriptor(), │ │ │ │ │ - 165 BufferDescriptor(), │ │ │ │ │ - 166 context); │ │ │ │ │ - 167 if (instance) { │ │ │ │ │ - 168 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 169 dstBuffer, dstDesc, │ │ │ │ │ - 170 stencilTable, │ │ │ │ │ - 171 context); │ │ │ │ │ - 172 delete instance; │ │ │ │ │ - 173 return r; │ │ │ │ │ - 174 } │ │ │ │ │ - 175 return false; │ │ │ │ │ - 176 } │ │ │ │ │ - 177 } │ │ │ │ │ - 178 │ │ │ │ │ - 219 template │ │ │ │ │ -220 static bool EvalStencils( │ │ │ │ │ - 221 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 222 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 223 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 224 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 225 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 226 MTLComputeEvaluator const *instance, │ │ │ │ │ - 227 MTLContext* context) { │ │ │ │ │ - 228 │ │ │ │ │ - 229 if (instance) { │ │ │ │ │ - 230 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 231 dstBuffer, dstDesc, │ │ │ │ │ - 232 duBuffer, duDesc, │ │ │ │ │ - 233 dvBuffer, dvDesc, │ │ │ │ │ - 234 stencilTable, │ │ │ │ │ - 235 context); │ │ │ │ │ - 236 } else { │ │ │ │ │ - 237 // Create an instance on demand (slow) │ │ │ │ │ - 238 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context); │ │ │ │ │ - 239 if (instance) { │ │ │ │ │ - 240 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 241 dstBuffer, dstDesc, │ │ │ │ │ - 242 duBuffer, duDesc, │ │ │ │ │ - 243 dvBuffer, dvDesc, │ │ │ │ │ - 244 stencilTable, │ │ │ │ │ - 245 context); │ │ │ │ │ - 246 delete instance; │ │ │ │ │ - 247 return r; │ │ │ │ │ - 248 } │ │ │ │ │ - 249 return false; │ │ │ │ │ - 250 } │ │ │ │ │ - 251 } │ │ │ │ │ - 252 │ │ │ │ │ - 311 template │ │ │ │ │ -312 static bool EvalStencils( │ │ │ │ │ - 313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 317 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 318 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 319 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 320 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 321 MTLComputeEvaluator const *instance, │ │ │ │ │ - 322 MTLContext* context) { │ │ │ │ │ - 323 │ │ │ │ │ - 324 if (instance) { │ │ │ │ │ - 325 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 326 dstBuffer, dstDesc, │ │ │ │ │ - 327 duBuffer, duDesc, │ │ │ │ │ - 328 dvBuffer, dvDesc, │ │ │ │ │ - 329 duuBuffer, duuDesc, │ │ │ │ │ - 330 duvBuffer, duvDesc, │ │ │ │ │ - 331 dvvBuffer, dvvDesc, │ │ │ │ │ - 332 stencilTable, │ │ │ │ │ - 333 context); │ │ │ │ │ - 334 } else { │ │ │ │ │ - 335 // Create an instance on demand (slow) │ │ │ │ │ - 336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 337 duuDesc, duvDesc, dvvDesc, context); │ │ │ │ │ - 338 if (instance) { │ │ │ │ │ - 339 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 340 dstBuffer, dstDesc, │ │ │ │ │ - 341 duBuffer, duDesc, │ │ │ │ │ - 342 dvBuffer, dvDesc, │ │ │ │ │ - 343 duuBuffer, duuDesc, │ │ │ │ │ - 344 duvBuffer, duvDesc, │ │ │ │ │ - 345 dvvBuffer, dvvDesc, │ │ │ │ │ - 346 stencilTable, │ │ │ │ │ - 347 context); │ │ │ │ │ - 348 delete instance; │ │ │ │ │ - 349 return r; │ │ │ │ │ - 350 } │ │ │ │ │ - 351 return false; │ │ │ │ │ - 352 } │ │ │ │ │ - 353 } │ │ │ │ │ - 354 │ │ │ │ │ - 375 template │ │ │ │ │ -376 bool EvalStencils( │ │ │ │ │ - 377 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 378 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 379 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 380 MTLContext* context) const │ │ │ │ │ - 381 { │ │ │ │ │ - 382 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 383 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 384 0, BufferDescriptor(), │ │ │ │ │ - 385 0, BufferDescriptor(), │ │ │ │ │ - 386 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 387 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 388 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 389 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 390 0, │ │ │ │ │ - 391 0, │ │ │ │ │ - 392 /* start = */ 0, │ │ │ │ │ - 393 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ - 394 context); │ │ │ │ │ - 395 } │ │ │ │ │ - 396 │ │ │ │ │ - 429 template │ │ │ │ │ -430 bool EvalStencils( │ │ │ │ │ - 431 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 432 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 433 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 434 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 435 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 436 MTLContext* context) const │ │ │ │ │ - 437 { │ │ │ │ │ - 438 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 439 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 440 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ - 441 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ - 442 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 443 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 444 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 445 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 446 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 447 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 448 /* start = */ 0, │ │ │ │ │ - 449 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ - 450 context); │ │ │ │ │ - 451 } │ │ │ │ │ - 452 │ │ │ │ │ - 503 template │ │ │ │ │ -504 bool EvalStencils( │ │ │ │ │ - 505 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 506 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 507 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 508 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 509 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 510 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 511 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 512 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 513 MTLContext* context) const │ │ │ │ │ - 514 { │ │ │ │ │ - 515 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 516 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 517 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ - 518 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ - 519 duuBuffer->BindMTLBuffer(context), duuDesc, │ │ │ │ │ - 520 duvBuffer->BindMTLBuffer(context), duvDesc, │ │ │ │ │ - 521 dvvBuffer->BindMTLBuffer(context), dvvDesc, │ │ │ │ │ - 522 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 523 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 524 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 525 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 526 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 527 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 528 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ - 529 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ - 530 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ - 531 /* start = */ 0, │ │ │ │ │ - 532 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ - 533 context); │ │ │ │ │ - 534 } │ │ │ │ │ - 535 │ │ │ │ │ -574 bool EvalStencils(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 575 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 576 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 577 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 578 id sizesBuffer, │ │ │ │ │ - 579 id offsetsBuffer, │ │ │ │ │ - 580 id indicesBuffer, │ │ │ │ │ - 581 id weightsBuffer, │ │ │ │ │ - 582 id duWeightsBuffer, │ │ │ │ │ - 583 id dvWeightsBuffer, │ │ │ │ │ - 584 int start, │ │ │ │ │ - 585 int end, │ │ │ │ │ - 586 MTLContext* context) const; │ │ │ │ │ - 587 │ │ │ │ │ -644 bool EvalStencils(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 645 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 646 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 647 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 648 id duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 649 id duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 650 id dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 651 id sizesBuffer, │ │ │ │ │ - 652 id offsetsBuffer, │ │ │ │ │ - 653 id indicesBuffer, │ │ │ │ │ - 654 id weightsBuffer, │ │ │ │ │ - 655 id duWeightsBuffer, │ │ │ │ │ - 656 id dvWeightsBuffer, │ │ │ │ │ - 657 id duuWeightsBuffer, │ │ │ │ │ - 658 id duvWeightsBuffer, │ │ │ │ │ - 659 id dvvWeightsBuffer, │ │ │ │ │ - 660 int start, │ │ │ │ │ - 661 int end, │ │ │ │ │ - 662 MTLContext* context) const; │ │ │ │ │ - 663 │ │ │ │ │ - 669 │ │ │ │ │ - 703 template │ │ │ │ │ -705 static bool EvalPatches( │ │ │ │ │ - 706 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 707 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 708 int numPatchCoords, │ │ │ │ │ - 709 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 710 PATCH_TABLE *patchTable, │ │ │ │ │ - 711 MTLComputeEvaluator const *instance, │ │ │ │ │ - 712 MTLContext* context) { │ │ │ │ │ - 713 │ │ │ │ │ - 714 if (instance) { │ │ │ │ │ - 715 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 716 dstBuffer, dstDesc, │ │ │ │ │ - 717 numPatchCoords, patchCoords, │ │ │ │ │ - 718 patchTable, │ │ │ │ │ - 719 context); │ │ │ │ │ - 720 } else { │ │ │ │ │ - 721 // Create an instance on demand (slow) │ │ │ │ │ - 722 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 723 BufferDescriptor(), │ │ │ │ │ - 724 BufferDescriptor(), │ │ │ │ │ - 725 context); │ │ │ │ │ - 726 if (instance) { │ │ │ │ │ - 727 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 728 dstBuffer, dstDesc, │ │ │ │ │ - 729 numPatchCoords, patchCoords, │ │ │ │ │ - 730 patchTable, │ │ │ │ │ - 731 context); │ │ │ │ │ - 732 delete instance; │ │ │ │ │ - 733 return r; │ │ │ │ │ - 734 } │ │ │ │ │ - 735 return false; │ │ │ │ │ - 736 } │ │ │ │ │ - 737 } │ │ │ │ │ - 738 │ │ │ │ │ - 784 template │ │ │ │ │ -786 static bool EvalPatches( │ │ │ │ │ - 787 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 788 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 789 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 790 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 791 int numPatchCoords, │ │ │ │ │ - 792 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 793 PATCH_TABLE *patchTable, │ │ │ │ │ - 794 MTLComputeEvaluator* instance, │ │ │ │ │ - 795 MTLContext* context) { │ │ │ │ │ - 796 │ │ │ │ │ - 797 if (instance) { │ │ │ │ │ - 798 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 799 dstBuffer, dstDesc, │ │ │ │ │ - 800 duBuffer, duDesc, │ │ │ │ │ - 801 dvBuffer, dvDesc, │ │ │ │ │ - 802 numPatchCoords, patchCoords, │ │ │ │ │ - 803 patchTable, │ │ │ │ │ - 804 context); │ │ │ │ │ - 805 } else { │ │ │ │ │ - 806 // Create an instance on demand (slow) │ │ │ │ │ - 807 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 808 duDesc, dvDesc, context); │ │ │ │ │ - 809 if (instance) { │ │ │ │ │ - 810 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 811 dstBuffer, dstDesc, │ │ │ │ │ - 812 duBuffer, duDesc, │ │ │ │ │ - 813 dvBuffer, dvDesc, │ │ │ │ │ - 814 numPatchCoords, patchCoords, │ │ │ │ │ - 815 patchTable, │ │ │ │ │ - 816 context); │ │ │ │ │ - 817 delete instance; │ │ │ │ │ - 818 return r; │ │ │ │ │ - 819 } │ │ │ │ │ - 820 return false; │ │ │ │ │ - 821 } │ │ │ │ │ - 822 } │ │ │ │ │ - 823 │ │ │ │ │ - 887 template │ │ │ │ │ -889 static bool EvalPatches( │ │ │ │ │ - 890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 894 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 895 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 896 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 897 int numPatchCoords, │ │ │ │ │ - 898 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 899 PATCH_TABLE *patchTable, │ │ │ │ │ - 900 MTLComputeEvaluator* instance, │ │ │ │ │ - 901 MTLContext* context) { │ │ │ │ │ - 902 │ │ │ │ │ - 903 if (instance) { │ │ │ │ │ - 904 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 905 dstBuffer, dstDesc, │ │ │ │ │ - 906 duBuffer, duDesc, │ │ │ │ │ - 907 dvBuffer, dvDesc, │ │ │ │ │ - 908 duuBuffer, duuDesc, │ │ │ │ │ - 909 duvBuffer, duvDesc, │ │ │ │ │ - 910 dvvBuffer, dvvDesc, │ │ │ │ │ - 911 numPatchCoords, patchCoords, │ │ │ │ │ - 912 patchTable, │ │ │ │ │ - 913 context); │ │ │ │ │ - 914 } else { │ │ │ │ │ - 915 // Create an instance on demand (slow) │ │ │ │ │ - 916 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 917 duDesc, dvDesc, │ │ │ │ │ - 918 duuDesc, duvDesc, dvvDesc, context); │ │ │ │ │ - 919 if (instance) { │ │ │ │ │ - 920 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 921 dstBuffer, dstDesc, │ │ │ │ │ - 922 duBuffer, duDesc, │ │ │ │ │ - 923 dvBuffer, dvDesc, │ │ │ │ │ - 924 duuBuffer, duuDesc, │ │ │ │ │ - 925 duvBuffer, duvDesc, │ │ │ │ │ - 926 dvvBuffer, dvvDesc, │ │ │ │ │ - 927 numPatchCoords, patchCoords, │ │ │ │ │ - 928 patchTable, │ │ │ │ │ - 929 context); │ │ │ │ │ - 930 delete instance; │ │ │ │ │ - 931 return r; │ │ │ │ │ - 932 } │ │ │ │ │ - 933 return false; │ │ │ │ │ - 934 } │ │ │ │ │ - 935 } │ │ │ │ │ - 936 │ │ │ │ │ - 964 template │ │ │ │ │ -966 bool EvalPatches( │ │ │ │ │ - 967 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 968 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 969 int numPatchCoords, │ │ │ │ │ - 970 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 971 PATCH_TABLE *patchTable, │ │ │ │ │ - 972 MTLContext* context) const { │ │ │ │ │ - 973 │ │ │ │ │ - 974 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 975 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 976 0, BufferDescriptor(), │ │ │ │ │ - 977 0, BufferDescriptor(), │ │ │ │ │ - 978 numPatchCoords, │ │ │ │ │ - 979 patchCoords->BindMTLBuffer(context), │ │ │ │ │ - 980 patchTable->GetPatchArrays(), │ │ │ │ │ - 981 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 982 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 983 context); │ │ │ │ │ - 984 } │ │ │ │ │ - 985 │ │ │ │ │ - 1023 template │ │ │ │ │ -1025 bool EvalPatches( │ │ │ │ │ - 1026 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1027 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1028 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1029 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1030 int numPatchCoords, │ │ │ │ │ - 1031 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1032 PATCH_TABLE *patchTable, │ │ │ │ │ - 1033 MTLContext* context) const { │ │ │ │ │ - 1034 │ │ │ │ │ - 1035 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 1036 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 1037 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ - 1038 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ - 1039 numPatchCoords, │ │ │ │ │ - 1040 patchCoords->BindMTLBuffer(context), │ │ │ │ │ - 1041 patchTable->GetPatchArrays(), │ │ │ │ │ - 1042 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1043 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1044 context); │ │ │ │ │ - 1045 } │ │ │ │ │ - 1046 │ │ │ │ │ - 1102 template │ │ │ │ │ -1104 bool EvalPatches( │ │ │ │ │ - 1105 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1106 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1107 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1108 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1109 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1110 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1111 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1112 int numPatchCoords, │ │ │ │ │ - 1113 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1114 PATCH_TABLE *patchTable, │ │ │ │ │ - 1115 MTLContext* context) const { │ │ │ │ │ - 1116 │ │ │ │ │ - 1117 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc, │ │ │ │ │ - 1118 dstBuffer->BindMTLBuffer(context), dstDesc, │ │ │ │ │ - 1119 duBuffer->BindMTLBuffer(context), duDesc, │ │ │ │ │ - 1120 dvBuffer->BindMTLBuffer(context), dvDesc, │ │ │ │ │ - 1121 duuBuffer->BindMTLBuffer(context), duuDesc, │ │ │ │ │ - 1122 duvBuffer->BindMTLBuffer(context), duvDesc, │ │ │ │ │ - 1123 dvvBuffer->BindMTLBuffer(context), dvvDesc, │ │ │ │ │ - 1124 numPatchCoords, │ │ │ │ │ - 1125 patchCoords->BindMTLBuffer(context), │ │ │ │ │ - 1126 patchTable->GetPatchArrays(), │ │ │ │ │ - 1127 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1128 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1129 context); │ │ │ │ │ - 1130 } │ │ │ │ │ - 1131 │ │ │ │ │ -1132 bool EvalPatches(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1133 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1134 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1135 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1136 int numPatchCoords, │ │ │ │ │ - 1137 id patchCoordsBuffer, │ │ │ │ │ - 1138 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1139 id patchIndexBuffer, │ │ │ │ │ - 1140 id patchParamsBuffer, │ │ │ │ │ - 1141 MTLContext* context) const; │ │ │ │ │ - 1142 │ │ │ │ │ -1143 bool EvalPatches(id srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1144 id dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1145 id duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1146 id dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1147 id duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1148 id duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1149 id dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1150 int numPatchCoords, │ │ │ │ │ - 1151 id patchCoordsBuffer, │ │ │ │ │ - 1152 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1153 id patchIndexBuffer, │ │ │ │ │ - 1154 id patchParamsBuffer, │ │ │ │ │ - 1155 MTLContext* context) const; │ │ │ │ │ - 1156 │ │ │ │ │ - 1190 template │ │ │ │ │ -1192 static bool EvalPatchesVarying( │ │ │ │ │ - 1193 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1194 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1195 int numPatchCoords, │ │ │ │ │ - 1196 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1197 PATCH_TABLE *patchTable, │ │ │ │ │ - 1198 MTLComputeEvaluator const *instance, │ │ │ │ │ - 1199 MTLContext* deviceContext) { │ │ │ │ │ - 1200 │ │ │ │ │ - 1201 if (instance) { │ │ │ │ │ - 1202 return instance->EvalPatchesVarying( │ │ │ │ │ - 1203 srcBuffer, srcDesc, │ │ │ │ │ - 1204 dstBuffer, dstDesc, │ │ │ │ │ - 1205 numPatchCoords, patchCoords, │ │ │ │ │ - 1206 patchTable, │ │ │ │ │ - 1207 deviceContext); │ │ │ │ │ - 1208 } else { │ │ │ │ │ - 1209 // Create an instance on demand (slow) │ │ │ │ │ - 1210 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1211 BufferDescriptor(), │ │ │ │ │ - 1212 BufferDescriptor(), │ │ │ │ │ - 1213 deviceContext); │ │ │ │ │ - 1214 if (instance) { │ │ │ │ │ - 1215 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1216 srcBuffer, srcDesc, │ │ │ │ │ - 1217 dstBuffer, dstDesc, │ │ │ │ │ - 1218 numPatchCoords, patchCoords, │ │ │ │ │ - 1219 patchTable, │ │ │ │ │ - 1220 deviceContext); │ │ │ │ │ - 1221 delete instance; │ │ │ │ │ - 1222 return r; │ │ │ │ │ - 1223 } │ │ │ │ │ - 1224 return false; │ │ │ │ │ - 1225 } │ │ │ │ │ - 1226 } │ │ │ │ │ - 1227 │ │ │ │ │ - 1255 template │ │ │ │ │ -1257 bool EvalPatchesVarying( │ │ │ │ │ - 1258 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1259 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1260 int numPatchCoords, │ │ │ │ │ - 1261 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1262 PATCH_TABLE *patchTable, │ │ │ │ │ - 1263 MTLContext* deviceContext) const { │ │ │ │ │ - 1264 │ │ │ │ │ - 1265 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 1266 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 1267 0, BufferDescriptor(), │ │ │ │ │ - 1268 0, BufferDescriptor(), │ │ │ │ │ - 1269 numPatchCoords, │ │ │ │ │ - 1270 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 1271 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1272 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1273 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1274 deviceContext │ │ │ │ │ - 1275 ); │ │ │ │ │ - 1276 } │ │ │ │ │ - 1277 │ │ │ │ │ - 1323 template │ │ │ │ │ -1325 static bool EvalPatchesVarying( │ │ │ │ │ - 1326 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1327 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1328 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1329 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1330 int numPatchCoords, │ │ │ │ │ - 1331 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1332 PATCH_TABLE *patchTable, │ │ │ │ │ - 1333 MTLComputeEvaluator const *instance, │ │ │ │ │ - 1334 MTLContext* deviceContext) { │ │ │ │ │ - 1335 │ │ │ │ │ - 1336 if (instance) { │ │ │ │ │ - 1337 return instance->EvalPatchesVarying( │ │ │ │ │ - 1338 srcBuffer, srcDesc, │ │ │ │ │ - 1339 dstBuffer, dstDesc, │ │ │ │ │ - 1340 duBuffer, duDesc, │ │ │ │ │ - 1341 dvBuffer, dvDesc, │ │ │ │ │ - 1342 numPatchCoords, patchCoords, │ │ │ │ │ - 1343 patchTable, │ │ │ │ │ - 1344 deviceContext); │ │ │ │ │ - 1345 } else { │ │ │ │ │ - 1346 // Create an instance on demand (slow) │ │ │ │ │ - 1347 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1348 duDesc, dvDesc, │ │ │ │ │ - 1349 deviceContext); │ │ │ │ │ - 1350 if (instance) { │ │ │ │ │ - 1351 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1352 srcBuffer, srcDesc, │ │ │ │ │ - 1353 dstBuffer, dstDesc, │ │ │ │ │ - 1354 duBuffer, duDesc, │ │ │ │ │ - 1355 dvBuffer, dvDesc, │ │ │ │ │ - 1356 numPatchCoords, patchCoords, │ │ │ │ │ - 1357 patchTable, │ │ │ │ │ - 1358 deviceContext); │ │ │ │ │ - 1359 delete instance; │ │ │ │ │ - 1360 return r; │ │ │ │ │ - 1361 } │ │ │ │ │ - 1362 return false; │ │ │ │ │ - 1363 } │ │ │ │ │ - 1364 } │ │ │ │ │ - 1365 │ │ │ │ │ - 1405 template │ │ │ │ │ -1407 bool EvalPatchesVarying( │ │ │ │ │ - 1408 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1409 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1410 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1411 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1412 int numPatchCoords, │ │ │ │ │ - 1413 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1414 PATCH_TABLE *patchTable, │ │ │ │ │ - 1415 MTLContext* deviceContext) const { │ │ │ │ │ - 1416 │ │ │ │ │ - 1417 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 1418 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 1419 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ - 1420 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ - 1421 numPatchCoords, │ │ │ │ │ - 1422 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 1423 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1424 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1425 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1426 deviceContext │ │ │ │ │ - 1427 ); │ │ │ │ │ - 1428 } │ │ │ │ │ - 1429 │ │ │ │ │ - 1430 │ │ │ │ │ - 1494 template │ │ │ │ │ -1496 static bool EvalPatchesVarying( │ │ │ │ │ - 1497 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1498 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1499 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1500 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1501 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1502 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1503 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1504 int numPatchCoords, │ │ │ │ │ - 1505 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1506 PATCH_TABLE *patchTable, │ │ │ │ │ - 1507 MTLComputeEvaluator const *instance, │ │ │ │ │ - 1508 MTLContext* deviceContext) { │ │ │ │ │ - 1509 │ │ │ │ │ - 1510 if (instance) { │ │ │ │ │ - 1511 return instance->EvalPatchesVarying( │ │ │ │ │ - 1512 srcBuffer, srcDesc, │ │ │ │ │ - 1513 dstBuffer, dstDesc, │ │ │ │ │ - 1514 duBuffer, duDesc, │ │ │ │ │ - 1515 dvBuffer, dvDesc, │ │ │ │ │ - 1516 duuBuffer, duuDesc, │ │ │ │ │ - 1517 duvBuffer, duvDesc, │ │ │ │ │ - 1518 dvvBuffer, dvvDesc, │ │ │ │ │ - 1519 numPatchCoords, patchCoords, │ │ │ │ │ - 1520 patchTable, │ │ │ │ │ - 1521 deviceContext); │ │ │ │ │ - 1522 } else { │ │ │ │ │ - 1523 // Create an instance on demand (slow) │ │ │ │ │ - 1524 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1525 duDesc, dvDesc, │ │ │ │ │ - 1526 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 1527 deviceContext); │ │ │ │ │ - 1528 if (instance) { │ │ │ │ │ - 1529 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1530 srcBuffer, srcDesc, │ │ │ │ │ - 1531 dstBuffer, dstDesc, │ │ │ │ │ - 1532 duBuffer, duDesc, │ │ │ │ │ - 1533 dvBuffer, dvDesc, │ │ │ │ │ - 1534 duuBuffer, duuDesc, │ │ │ │ │ - 1535 duvBuffer, duvDesc, │ │ │ │ │ - 1536 dvvBuffer, dvvDesc, │ │ │ │ │ - 1537 numPatchCoords, patchCoords, │ │ │ │ │ - 1538 patchTable, │ │ │ │ │ - 1539 deviceContext); │ │ │ │ │ - 1540 delete instance; │ │ │ │ │ - 1541 return r; │ │ │ │ │ - 1542 } │ │ │ │ │ - 1543 return false; │ │ │ │ │ - 1544 } │ │ │ │ │ - 1545 } │ │ │ │ │ - 1546 │ │ │ │ │ - 1604 template │ │ │ │ │ -1606 bool EvalPatchesVarying( │ │ │ │ │ - 1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1609 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1610 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1611 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1612 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1613 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1614 int numPatchCoords, │ │ │ │ │ - 1615 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1616 PATCH_TABLE *patchTable, │ │ │ │ │ - 1617 MTLContext* deviceContext) const { │ │ │ │ │ - 1618 │ │ │ │ │ - 1619 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 1620 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 1621 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ - 1622 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ - 1623 duuBuffer->BindMTLBuffer(deviceContext), duuDesc, │ │ │ │ │ - 1624 duvBuffer->BindMTLBuffer(deviceContext), duvDesc, │ │ │ │ │ - 1625 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc, │ │ │ │ │ - 1626 numPatchCoords, │ │ │ │ │ - 1627 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 1628 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1629 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1630 patchTable->GetPatchParamBuffer(), │ │ │ │ │ - 1631 deviceContext │ │ │ │ │ - 1632 ); │ │ │ │ │ - 1633 } │ │ │ │ │ - 1634 │ │ │ │ │ - 1670 template │ │ │ │ │ -1672 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1673 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1674 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1675 int numPatchCoords, │ │ │ │ │ - 1676 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1677 PATCH_TABLE *patchTable, │ │ │ │ │ - 1678 int fvarChannel, │ │ │ │ │ - 1679 MTLComputeEvaluator const *instance, │ │ │ │ │ - 1680 MTLContext* deviceContext) { │ │ │ │ │ - 1681 │ │ │ │ │ - 1682 if (instance) { │ │ │ │ │ - 1683 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1684 srcBuffer, srcDesc, │ │ │ │ │ - 1685 dstBuffer, dstDesc, │ │ │ │ │ - 1686 numPatchCoords, patchCoords, │ │ │ │ │ - 1687 patchTable, │ │ │ │ │ - 1688 fvarChannel, │ │ │ │ │ - 1689 deviceContext); │ │ │ │ │ - 1690 } else { │ │ │ │ │ - 1691 // Create an instance on demand (slow) │ │ │ │ │ - 1692 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1693 BufferDescriptor(), │ │ │ │ │ - 1694 BufferDescriptor(), │ │ │ │ │ - 1695 deviceContext); │ │ │ │ │ - 1696 if (instance) { │ │ │ │ │ - 1697 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1698 srcBuffer, srcDesc, │ │ │ │ │ - 1699 dstBuffer, dstDesc, │ │ │ │ │ - 1700 numPatchCoords, patchCoords, │ │ │ │ │ - 1701 patchTable, │ │ │ │ │ - 1702 fvarChannel, │ │ │ │ │ - 1703 deviceContext); │ │ │ │ │ - 1704 delete instance; │ │ │ │ │ - 1705 return r; │ │ │ │ │ - 1706 } │ │ │ │ │ - 1707 return false; │ │ │ │ │ - 1708 } │ │ │ │ │ - 1709 } │ │ │ │ │ - 1710 │ │ │ │ │ - 1740 template │ │ │ │ │ -1742 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1745 int numPatchCoords, │ │ │ │ │ - 1746 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1747 PATCH_TABLE *patchTable, │ │ │ │ │ - 1748 int fvarChannel, │ │ │ │ │ - 1749 MTLContext* deviceContext) const { │ │ │ │ │ - 1750 │ │ │ │ │ - 1751 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 1752 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 1753 0, BufferDescriptor(), │ │ │ │ │ - 1754 0, BufferDescriptor(), │ │ │ │ │ - 1755 numPatchCoords, │ │ │ │ │ - 1756 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 1757 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1758 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1759 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 1760 deviceContext │ │ │ │ │ - 1761 ); │ │ │ │ │ - 1762 } │ │ │ │ │ - 1763 │ │ │ │ │ - 1811 template │ │ │ │ │ -1813 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1814 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1815 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1816 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1817 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1818 int numPatchCoords, │ │ │ │ │ - 1819 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1820 PATCH_TABLE *patchTable, │ │ │ │ │ - 1821 int fvarChannel, │ │ │ │ │ - 1822 MTLComputeEvaluator const *instance, │ │ │ │ │ - 1823 MTLContext* deviceContext) { │ │ │ │ │ - 1824 │ │ │ │ │ - 1825 if (instance) { │ │ │ │ │ - 1826 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1827 srcBuffer, srcDesc, │ │ │ │ │ - 1828 dstBuffer, dstDesc, │ │ │ │ │ - 1829 duBuffer, duDesc, │ │ │ │ │ - 1830 dvBuffer, dvDesc, │ │ │ │ │ - 1831 numPatchCoords, patchCoords, │ │ │ │ │ - 1832 patchTable, │ │ │ │ │ - 1833 fvarChannel, │ │ │ │ │ - 1834 deviceContext); │ │ │ │ │ - 1835 } else { │ │ │ │ │ - 1836 // Create an instance on demand (slow) │ │ │ │ │ - 1837 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1838 duDesc, dvDesc, │ │ │ │ │ - 1839 deviceContext); │ │ │ │ │ - 1840 if (instance) { │ │ │ │ │ - 1841 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1842 srcBuffer, srcDesc, │ │ │ │ │ - 1843 dstBuffer, dstDesc, │ │ │ │ │ - 1844 duBuffer, duDesc, │ │ │ │ │ - 1845 dvBuffer, dvDesc, │ │ │ │ │ - 1846 numPatchCoords, patchCoords, │ │ │ │ │ - 1847 patchTable, │ │ │ │ │ - 1848 fvarChannel, │ │ │ │ │ - 1849 deviceContext); │ │ │ │ │ - 1850 delete instance; │ │ │ │ │ - 1851 return r; │ │ │ │ │ - 1852 } │ │ │ │ │ - 1853 return false; │ │ │ │ │ - 1854 } │ │ │ │ │ - 1855 } │ │ │ │ │ - 1856 │ │ │ │ │ - 1898 template │ │ │ │ │ -1900 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1901 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1902 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1903 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1904 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1905 int numPatchCoords, │ │ │ │ │ - 1906 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1907 PATCH_TABLE *patchTable, │ │ │ │ │ - 1908 int fvarChannel, │ │ │ │ │ - 1909 MTLContext* deviceContext) const { │ │ │ │ │ - 1910 │ │ │ │ │ - 1911 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 1912 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 1913 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ - 1914 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ - 1915 numPatchCoords, │ │ │ │ │ - 1916 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 1917 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1918 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1919 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 1920 deviceContext │ │ │ │ │ - 1921 ); │ │ │ │ │ - 1922 } │ │ │ │ │ - 1923 │ │ │ │ │ - 1989 template │ │ │ │ │ -1991 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1992 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1993 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1994 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1995 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1996 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1997 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1998 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1999 int numPatchCoords, │ │ │ │ │ - 2000 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2001 PATCH_TABLE *patchTable, │ │ │ │ │ - 2002 int fvarChannel, │ │ │ │ │ - 2003 MTLComputeEvaluator const *instance, │ │ │ │ │ - 2004 MTLContext* deviceContext) { │ │ │ │ │ - 2005 │ │ │ │ │ - 2006 if (instance) { │ │ │ │ │ - 2007 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2008 srcBuffer, srcDesc, │ │ │ │ │ - 2009 dstBuffer, dstDesc, │ │ │ │ │ - 2010 duBuffer, duDesc, │ │ │ │ │ - 2011 dvBuffer, dvDesc, │ │ │ │ │ - 2012 duuBuffer, duuDesc, │ │ │ │ │ - 2013 duvBuffer, duvDesc, │ │ │ │ │ - 2014 dvvBuffer, dvvDesc, │ │ │ │ │ - 2015 numPatchCoords, patchCoords, │ │ │ │ │ - 2016 patchTable, │ │ │ │ │ - 2017 fvarChannel, │ │ │ │ │ - 2018 deviceContext); │ │ │ │ │ - 2019 } else { │ │ │ │ │ - 2020 // Create an instance on demand (slow) │ │ │ │ │ - 2021 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 2022 duDesc, dvDesc, │ │ │ │ │ - 2023 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 2024 deviceContext); │ │ │ │ │ - 2025 if (instance) { │ │ │ │ │ - 2026 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2027 srcBuffer, srcDesc, │ │ │ │ │ - 2028 dstBuffer, dstDesc, │ │ │ │ │ - 2029 duBuffer, duDesc, │ │ │ │ │ - 2030 dvBuffer, dvDesc, │ │ │ │ │ - 2031 duuBuffer, duuDesc, │ │ │ │ │ - 2032 duvBuffer, duvDesc, │ │ │ │ │ - 2033 dvvBuffer, dvvDesc, │ │ │ │ │ - 2034 numPatchCoords, patchCoords, │ │ │ │ │ - 2035 patchTable, │ │ │ │ │ - 2036 fvarChannel, │ │ │ │ │ - 2037 deviceContext); │ │ │ │ │ - 2038 delete instance; │ │ │ │ │ - 2039 return r; │ │ │ │ │ - 2040 } │ │ │ │ │ - 2041 return false; │ │ │ │ │ - 2042 } │ │ │ │ │ - 2043 } │ │ │ │ │ - 2044 │ │ │ │ │ - 2104 template │ │ │ │ │ -2106 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2107 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2108 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2109 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2110 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2111 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 2112 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 2113 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2114 int numPatchCoords, │ │ │ │ │ - 2115 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2116 PATCH_TABLE *patchTable, │ │ │ │ │ - 2117 int fvarChannel, │ │ │ │ │ - 2118 MTLContext* deviceContext) const { │ │ │ │ │ - 2119 │ │ │ │ │ - 2120 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc, │ │ │ │ │ - 2121 dstBuffer->BindMTLBuffer(deviceContext), dstDesc, │ │ │ │ │ - 2122 duBuffer->BindMTLBuffer(deviceContext), duDesc, │ │ │ │ │ - 2123 dvBuffer->BindMTLBuffer(deviceContext), dvDesc, │ │ │ │ │ - 2124 duuBuffer->BindMTLBuffer(deviceContext), duuDesc, │ │ │ │ │ - 2125 duvBuffer->BindMTLBuffer(deviceContext), duvDesc, │ │ │ │ │ - 2126 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc, │ │ │ │ │ - 2127 numPatchCoords, │ │ │ │ │ - 2128 patchCoords->BindMTLBuffer(deviceContext), │ │ │ │ │ - 2129 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 2130 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 2131 patchTable->GetFVarPatchParamBuffer(fvarChannel), │ │ │ │ │ - 2132 fvarChannel, │ │ │ │ │ - 2133 deviceContext │ │ │ │ │ - 2134 ); │ │ │ │ │ - 2135 } │ │ │ │ │ - 2136 │ │ │ │ │ -2138 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2139 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2140 BufferDescriptor const &duDesc, │ │ │ │ │ - 2141 BufferDescriptor const &dvDesc, │ │ │ │ │ - 2142 BufferDescriptor const &duuDesc, │ │ │ │ │ - 2143 BufferDescriptor const &duvDesc, │ │ │ │ │ - 2144 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2145 MTLContext* context); │ │ │ │ │ - 2146 │ │ │ │ │ -2148 static void Synchronize(MTLContext* context); │ │ │ │ │ - 2149 │ │ │ │ │ - 2150 private: │ │ │ │ │ - 2151 │ │ │ │ │ - 2152 id _computeLibrary; │ │ │ │ │ - 2153 id _evalStencils; │ │ │ │ │ - 2154 id _evalPatches; │ │ │ │ │ - 2155 id _parameterBuffer; │ │ │ │ │ - 2156 │ │ │ │ │ - 2157 int _workGroupSize; │ │ │ │ │ - 2158}; │ │ │ │ │ - 2159 │ │ │ │ │ - 2160} //end namespace Osd │ │ │ │ │ - 2161 │ │ │ │ │ - 2162} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 2163using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 2164 │ │ │ │ │ - 2165} //end namespace OpenSubdiv │ │ │ │ │ - 2166 │ │ │ │ │ - 2167#endif // OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 102#endif // OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ -Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:583 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ -Definition: mtlCommon.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable │ │ │ │ │ -Definition: mtlComputeEvaluator.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable │ │ │ │ │ -MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext │ │ │ │ │ -*context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetDuWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:69 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::~MTLStencilTable │ │ │ │ │ -~MTLStencilTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvvWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetDvvWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable │ │ │ │ │ -MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuuWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetDuuWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuvWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetDuvWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetNumStencils │ │ │ │ │ -int GetNumStencils() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetIndicesBuffer │ │ │ │ │ -id< MTLBuffer > GetIndicesBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:67 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetSizesBuffer │ │ │ │ │ -id< MTLBuffer > GetSizesBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetOffsetsBuffer │ │ │ │ │ -id< MTLBuffer > GetOffsetsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::Create │ │ │ │ │ -static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT │ │ │ │ │ -context) │ │ │ │ │ -Definition: mtlComputeEvaluator.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvWeightsBuffer │ │ │ │ │ -id< MTLBuffer > GetDvWeightsBuffer() const │ │ │ │ │ -Definition: mtlComputeEvaluator.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator │ │ │ │ │ -Definition: mtlComputeEvaluator.h:92 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ -duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor │ │ │ │ │ -const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< │ │ │ │ │ -MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, id< MTLBuffer > │ │ │ │ │ -sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< │ │ │ │ │ -MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > │ │ │ │ │ -dvWeightsBuffer, id< MTLBuffer > duuWeightsBuffer, id< MTLBuffer > │ │ │ │ │ -duvWeightsBuffer, id< MTLBuffer > dvvWeightsBuffer, int start, int end, │ │ │ │ │ -MTLContext *context) const │ │ │ │ │ -Dispatch the MTL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compile... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, MTLComputeEvaluator *instance, MTLContext *context) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:786 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:312 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1991 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::MTLComputeEvaluator │ │ │ │ │ -MTLComputeEvaluator() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::~MTLComputeEvaluator │ │ │ │ │ -~MTLComputeEvaluator() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator │ │ │ │ │ -const *instance, MTLContext *context) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:705 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Instantiatable │ │ │ │ │ -bool Instantiatable │ │ │ │ │ -Definition: mtlComputeEvaluator.h:94 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1606 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:220 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext │ │ │ │ │ -*deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1900 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1672 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator │ │ │ │ │ -const *instance, MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1496 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ -*stencilTable, MTLContext *context) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: mtlComputeEvaluator.h:376 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ -duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor │ │ │ │ │ -const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< │ │ │ │ │ -MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, id< │ │ │ │ │ -MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< │ │ │ │ │ -MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext │ │ │ │ │ -*context) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -MTLContext *deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:2106 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(MTLContext *context) │ │ │ │ │ -Wait for the dispatched kernel to finish. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: mtlComputeEvaluator.h:430 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator *instance, │ │ │ │ │ -MTLContext *context) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:889 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, MTLContext *deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1742 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -MTLComputeEvaluator const *instance, MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1192 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, MTLContext │ │ │ │ │ -*context) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: mtlComputeEvaluator.h:504 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ -duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > │ │ │ │ │ -offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, │ │ │ │ │ -id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, int start, │ │ │ │ │ -int end, MTLContext *context) const │ │ │ │ │ -Dispatch the MTL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compile... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator:: │ │ │ │ │ -EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLComputeEvaluator │ │ │ │ │ -const *instance, MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1813 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) │ │ │ │ │ -const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:966 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:149 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, │ │ │ │ │ -MTLContext *deviceContext) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1325 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1104 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, MTLContext *context) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1025 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, MTLContext *deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1407 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext │ │ │ │ │ -*deviceContext) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: mtlComputeEvaluator.h:1257 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create │ │ │ │ │ -static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create │ │ │ │ │ -static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext │ │ │ │ │ -*context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Compile │ │ │ │ │ -bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ -BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ -BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ -BufferDescriptor const &dvvDesc, MTLContext *context) │ │ │ │ │ -Configure compute pipline state. Returns false if it fails to create the │ │ │ │ │ -pipeline state. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > │ │ │ │ │ -duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, id< MTLBuffer > │ │ │ │ │ -patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > │ │ │ │ │ -patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ +@ GREGORY_BOUNDARY │ │ │ │ │ +Definition: patchDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:44 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +UpdateVertexBuffer │ │ │ │ │ +void UpdateVertexBuffer(ID3D11Buffer *vbo, int numVertices, int │ │ │ │ │ +numVertexElements, ID3D11DeviceContext *pd3d11DeviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsBase │ │ │ │ │ +int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +~D3D11LegacyGregoryPatchTable │ │ │ │ │ +~D3D11LegacyGregoryPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::Create │ │ │ │ │ +static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ +*farPatchTable, ID3D11DeviceContext *deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::GetVertexSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetVertexSRV() const │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::Create │ │ │ │ │ +static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ +*farPatchTable, DEVICE_CONTEXT context) │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +GetVertexValenceSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetVertexValenceSRV() const │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetQuadOffsetsSRV() const │ │ │ │ │ +Definition: d3d11LegacyGregoryPatchTable.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ +D3D11LegacyGregoryPatchTable │ │ │ │ │ +D3D11LegacyGregoryPatchTable() │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlComputeEvaluator.h │ │ │ │ │ + * d3d11LegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00824.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlVertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuD3D11VertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,25 +83,26 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
mtlVertexBuffer.h File Reference
│ │ │ │ +
cpuD3D11VertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/mtlCommon.h"
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CPUMTLVertexBuffer
class  CpuD3D11VertexBuffer
 Concrete vertex buffer class for Cpu subdivision and DirectX drawing. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -110,13 +111,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,25 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -mtlVertexBuffer.h File Reference │ │ │ │ │ +cpuD3D11VertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/mtlCommon.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CPUMTLVertexBuffer │ │ │ │ │ +class  CpuD3D11VertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for Cpu subdivision and DirectX drawing. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlVertexBuffer.h │ │ │ │ │ + * cpuD3D11VertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00824.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00824 = [ │ │ │ │ │ - ["CPUMTLVertexBuffer", "a01301.html", "a01301"] │ │ │ │ │ + ["CpuD3D11VertexBuffer", "a01153.html", "a01153"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00824_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mtlVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuD3D11VertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
mtlVertexBuffer.h
│ │ │ │ +
cpuD3D11VertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,89 +107,87 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../osd/mtlCommon.h"
│ │ │ │ +
29#include <cstddef>
│ │ │ │
30
│ │ │ │ -
31@protocol MTLDevice;
│ │ │ │ -
32@protocol MTLBuffer;
│ │ │ │ -
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Osd {
│ │ │ │ -
38
│ │ │ │ - │ │ │ │ -
40public:
│ │ │ │ -
41 static CPUMTLVertexBuffer* Create(int numElements, int numVertices, MTLContext* context);
│ │ │ │ -
42
│ │ │ │ -
43 void UpdateData(const float* src, int startVertex, int numVertices, MTLContext* context);
│ │ │ │ -
44
│ │ │ │ -
45 int GetNumElements() const
│ │ │ │ -
46 {
│ │ │ │ -
47 return _numElements;
│ │ │ │ -
48 }
│ │ │ │ -
49
│ │ │ │ -
50 int GetNumVertices() const
│ │ │ │ -
51 {
│ │ │ │ -
52 return _numVertices;
│ │ │ │ -
53 }
│ │ │ │ -
54
│ │ │ │ -
55 float* BindCpuBuffer();
│ │ │ │ -
56 id<MTLBuffer> BindMTLBuffer(MTLContext* context);
│ │ │ │ -
57
│ │ │ │ -
58 id<MTLBuffer> BindVBO(MTLContext* context)
│ │ │ │ -
59 {
│ │ │ │ -
60 return BindMTLBuffer(context);
│ │ │ │ -
61 }
│ │ │ │ -
62
│ │ │ │ -
63protected:
│ │ │ │ +
31struct ID3D11Buffer;
│ │ │ │ +
32struct ID3D11Device;
│ │ │ │ +
33struct ID3D11DeviceContext;
│ │ │ │ +
34
│ │ │ │ +
35namespace OpenSubdiv {
│ │ │ │ +
36namespace OPENSUBDIV_VERSION {
│ │ │ │ +
37
│ │ │ │ +
38namespace Osd {
│ │ │ │ +
39
│ │ │ │ + │ │ │ │ +
49public:
│ │ │ │ +
51 static CpuD3D11VertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
52 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
53
│ │ │ │ + │ │ │ │ +
56
│ │ │ │ +
59 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
60 void *deviceContext = NULL);
│ │ │ │ +
61
│ │ │ │ +
63 int GetNumElements() const;
│ │ │ │
64
│ │ │ │ -
65 CPUMTLVertexBuffer(int numElements, int numVertices);
│ │ │ │ -
66
│ │ │ │ -
67 bool allocate(MTLContext* context);
│ │ │ │ -
68
│ │ │ │ -
69private:
│ │ │ │ -
70 int _numElements;
│ │ │ │ -
71 int _numVertices;
│ │ │ │ -
72 id<MTLBuffer> _buffer;
│ │ │ │ -
73 bool _dirty;
│ │ │ │ -
74};
│ │ │ │ -
75
│ │ │ │ -
76} //end namespace Osd
│ │ │ │ -
77
│ │ │ │ -
78} //end namespace OPENSUBDIV_VERSION
│ │ │ │ -
79 using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
80
│ │ │ │ -
81} //end namespace OpenSubdiv
│ │ │ │ +
66 int GetNumVertices() const;
│ │ │ │ +
67
│ │ │ │ +
69 float * BindCpuBuffer();
│ │ │ │ +
70
│ │ │ │ +
72 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext);
│ │ │ │ +
73
│ │ │ │ +
75 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) {
│ │ │ │ +
76 return BindD3D11Buffer(deviceContext);
│ │ │ │ +
77 }
│ │ │ │ +
78
│ │ │ │ +
79protected:
│ │ │ │ +
81 CpuD3D11VertexBuffer(int numElements, int numVertices);
│ │ │ │
82
│ │ │ │ -
83#endif // OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H
│ │ │ │ +
83 bool allocate(ID3D11Device *device);
│ │ │ │ +
84
│ │ │ │ +
85private:
│ │ │ │ +
86 int _numElements;
│ │ │ │ +
87 int _numVertices;
│ │ │ │ +
88 ID3D11Buffer *_d3d11Buffer;
│ │ │ │ +
89 float *_cpuBuffer;
│ │ │ │ +
90};
│ │ │ │ +
91
│ │ │ │ +
92} // end namespace Osd
│ │ │ │ +
93
│ │ │ │ +
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
96
│ │ │ │ +
97} // end namespace OpenSubdiv
│ │ │ │ +
98
│ │ │ │ +
99#endif // OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
id< MTLBuffer > BindVBO(MTLContext *context)
│ │ │ │ -
CPUMTLVertexBuffer(int numElements, int numVertices)
│ │ │ │ -
static CPUMTLVertexBuffer * Create(int numElements, int numVertices, MTLContext *context)
│ │ │ │ - │ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, MTLContext *context)
│ │ │ │ - │ │ │ │ -
id< MTLBuffer > BindMTLBuffer(MTLContext *context)
│ │ │ │ - │ │ │ │ - │ │ │ │ +
Concrete vertex buffer class for Cpu subdivision and DirectX drawing.
│ │ │ │ +
static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
│ │ │ │ +
CpuD3D11VertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
│ │ │ │ +
float * BindCpuBuffer()
Returns the address of CPU buffer.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -mtlVertexBuffer.h │ │ │ │ │ +cpuD3D11VertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,101 +30,105 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/mtlCommon.h" │ │ │ │ │ + 29#include │ │ │ │ │ 30 │ │ │ │ │ - 31@protocol MTLDevice; │ │ │ │ │ - 32@protocol MTLBuffer; │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Osd { │ │ │ │ │ - 38 │ │ │ │ │ -39class CPUMTLVertexBuffer { │ │ │ │ │ - 40public: │ │ │ │ │ -41 static CPUMTLVertexBuffer* Create(int numElements, int numVertices, │ │ │ │ │ -MTLContext* context); │ │ │ │ │ - 42 │ │ │ │ │ -43 void UpdateData(const float* src, int startVertex, int numVertices, │ │ │ │ │ -MTLContext* context); │ │ │ │ │ - 44 │ │ │ │ │ -45 int GetNumElements() const │ │ │ │ │ - 46 { │ │ │ │ │ - 47 return _numElements; │ │ │ │ │ - 48 } │ │ │ │ │ - 49 │ │ │ │ │ -50 int GetNumVertices() const │ │ │ │ │ - 51 { │ │ │ │ │ - 52 return _numVertices; │ │ │ │ │ - 53 } │ │ │ │ │ - 54 │ │ │ │ │ -55 float* BindCpuBuffer(); │ │ │ │ │ -56 id BindMTLBuffer(MTLContext* context); │ │ │ │ │ - 57 │ │ │ │ │ -58 id BindVBO(MTLContext* context) │ │ │ │ │ - 59 { │ │ │ │ │ - 60 return BindMTLBuffer(context); │ │ │ │ │ - 61 } │ │ │ │ │ - 62 │ │ │ │ │ - 63protected: │ │ │ │ │ + 31struct ID3D11Buffer; │ │ │ │ │ + 32struct ID3D11Device; │ │ │ │ │ + 33struct ID3D11DeviceContext; │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace OpenSubdiv { │ │ │ │ │ + 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 37 │ │ │ │ │ + 38namespace Osd { │ │ │ │ │ + 39 │ │ │ │ │ +48class CpuD3D11VertexBuffer { │ │ │ │ │ + 49public: │ │ │ │ │ +51 static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 52 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 53 │ │ │ │ │ +55 virtual ~CpuD3D11VertexBuffer(); │ │ │ │ │ + 56 │ │ │ │ │ +59 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 60 void *deviceContext = NULL); │ │ │ │ │ + 61 │ │ │ │ │ +63 int GetNumElements() const; │ │ │ │ │ 64 │ │ │ │ │ -65 CPUMTLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ - 66 │ │ │ │ │ -67 bool allocate(MTLContext* context); │ │ │ │ │ - 68 │ │ │ │ │ - 69private: │ │ │ │ │ - 70 int _numElements; │ │ │ │ │ - 71 int _numVertices; │ │ │ │ │ - 72 id _buffer; │ │ │ │ │ - 73 bool _dirty; │ │ │ │ │ - 74}; │ │ │ │ │ - 75 │ │ │ │ │ - 76} //end namespace Osd │ │ │ │ │ - 77 │ │ │ │ │ - 78} //end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 79 using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 80 │ │ │ │ │ - 81} //end namespace OpenSubdiv │ │ │ │ │ +66 int GetNumVertices() const; │ │ │ │ │ + 67 │ │ │ │ │ +69 float * BindCpuBuffer(); │ │ │ │ │ + 70 │ │ │ │ │ +72 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 73 │ │ │ │ │ +75 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) { │ │ │ │ │ + 76 return BindD3D11Buffer(deviceContext); │ │ │ │ │ + 77 } │ │ │ │ │ + 78 │ │ │ │ │ + 79protected: │ │ │ │ │ +81 CpuD3D11VertexBuffer(int numElements, int numVertices); │ │ │ │ │ 82 │ │ │ │ │ - 83#endif // OPENSUBDIV3_OSD_MTL_VERTEX_BUFFER_H │ │ │ │ │ +83 bool allocate(ID3D11Device *device); │ │ │ │ │ + 84 │ │ │ │ │ + 85private: │ │ │ │ │ + 86 int _numElements; │ │ │ │ │ + 87 int _numVertices; │ │ │ │ │ + 88 ID3D11Buffer *_d3d11Buffer; │ │ │ │ │ + 89 float *_cpuBuffer; │ │ │ │ │ + 90}; │ │ │ │ │ + 91 │ │ │ │ │ + 92} // end namespace Osd │ │ │ │ │ + 93 │ │ │ │ │ + 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 96 │ │ │ │ │ + 97} // end namespace OpenSubdiv │ │ │ │ │ + 98 │ │ │ │ │ + 99#endif // OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext │ │ │ │ │ -Definition: mtlCommon.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer │ │ │ │ │ -Definition: mtlVertexBuffer.h:39 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindVBO │ │ │ │ │ -id< MTLBuffer > BindVBO(MTLContext *context) │ │ │ │ │ -Definition: mtlVertexBuffer.h:58 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::CPUMTLVertexBuffer │ │ │ │ │ -CPUMTLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::Create │ │ │ │ │ -static CPUMTLVertexBuffer * Create(int numElements, int numVertices, MTLContext │ │ │ │ │ -*context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::GetNumElements │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer │ │ │ │ │ +Concrete vertex buffer class for Cpu subdivision and DirectX drawing. │ │ │ │ │ +Definition: cpuD3D11VertexBuffer.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::Create │ │ │ │ │ +static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::CpuD3D11VertexBuffer │ │ │ │ │ +CpuD3D11VertexBuffer(int numElements, int numVertices) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::GetNumElements │ │ │ │ │ int GetNumElements() const │ │ │ │ │ -Definition: mtlVertexBuffer.h:45 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, MTLContext │ │ │ │ │ -*context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::GetNumVertices │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::GetNumVertices │ │ │ │ │ int GetNumVertices() const │ │ │ │ │ -Definition: mtlVertexBuffer.h:50 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindMTLBuffer │ │ │ │ │ -id< MTLBuffer > BindMTLBuffer(MTLContext *context) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::BindCpuBuffer │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindD3D11Buffer │ │ │ │ │ +ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Returns the D3D11 buffer object. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindCpuBuffer │ │ │ │ │ float * BindCpuBuffer() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CPUMTLVertexBuffer::allocate │ │ │ │ │ -bool allocate(MTLContext *context) │ │ │ │ │ +Returns the address of CPU buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::allocate │ │ │ │ │ +bool allocate(ID3D11Device *device) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer:: │ │ │ │ │ +~CpuD3D11VertexBuffer │ │ │ │ │ +virtual ~CpuD3D11VertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindVBO │ │ │ │ │ +ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Returns the D3D11 buffer object (for Osd::Mesh interface) │ │ │ │ │ +Definition: cpuD3D11VertexBuffer.h:75 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * mtlVertexBuffer.h │ │ │ │ │ + * cpuD3D11VertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00827.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11Mesh.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11ComputeEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,47 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Typedefs
│ │ │ │ -
d3d11Mesh.h File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
d3d11ComputeEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/mesh.h"
│ │ │ │ -#include "../osd/d3d11PatchTable.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  D3D11StencilTable
 D3D11 stencil table. More...
 
class  D3D11ComputeEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Typedefs

typedef MeshInterface< D3D11PatchTable > D3D11MeshInterface
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces | Typedefs │ │ │ │ │ -d3d11Mesh.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +d3d11ComputeEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/mesh.h" │ │ │ │ │ -#include "../osd/d3d11PatchTable.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  D3D11StencilTable │ │ │ │ │ +  D3D11 stencil table. More... │ │ │ │ │ +  │ │ │ │ │ +class  D3D11ComputeEvaluator │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -typedef MeshInterface< D3D11PatchTable > D3D11MeshInterface │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11Mesh.h │ │ │ │ │ + * d3d11ComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00827.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ │ var a00827 = [ │ │ │ │ │ - ["D3D11MeshInterface", "a00827.html#ae5c8e80d05d6eaee105d8eecfa9ab609", null] │ │ │ │ │ + ["D3D11StencilTable", "a01189.html", "a01189"], │ │ │ │ │ + ["D3D11ComputeEvaluator", "a01193.html", "a01193"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00827_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11Mesh.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/d3d11ComputeEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
d3d11Mesh.h
│ │ │ │ +
d3d11ComputeEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,45 +107,213 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/mesh.h"
│ │ │ │ -
31#include "../osd/d3d11PatchTable.h"
│ │ │ │ -
32
│ │ │ │ -
33namespace OpenSubdiv {
│ │ │ │ -
34namespace OPENSUBDIV_VERSION {
│ │ │ │ -
35
│ │ │ │ -
36namespace Osd {
│ │ │ │ +
30struct ID3D11DeviceContext;
│ │ │ │ +
31struct ID3D11Buffer;
│ │ │ │ +
32struct ID3D11ComputeShader;
│ │ │ │ +
33struct ID3D11ClassLinkage;
│ │ │ │ +
34struct ID3D11ClassInstance;
│ │ │ │ +
35struct ID3D11ShaderResourceView;
│ │ │ │ +
36struct ID3D11UnorderedAccessView;
│ │ │ │
37
│ │ │ │ - │ │ │ │ +
38#include "../osd/bufferDescriptor.h"
│ │ │ │
39
│ │ │ │ -
40
│ │ │ │ -
41} // end namespace Osd
│ │ │ │ +
40namespace OpenSubdiv {
│ │ │ │ +
41namespace OPENSUBDIV_VERSION {
│ │ │ │
42
│ │ │ │ -
43} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
44using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
45
│ │ │ │ -
46} // end namespace OpenSubdiv
│ │ │ │ -
47
│ │ │ │ -
48#endif // OPENSUBDIV3_OSD_D3D11MESH_H
│ │ │ │ +
43namespace Far {
│ │ │ │ +
44 class StencilTable;
│ │ │ │ +
45}
│ │ │ │ +
46
│ │ │ │ +
47namespace Osd {
│ │ │ │ +
48
│ │ │ │ + │ │ │ │ +
57public:
│ │ │ │ +
58 template <typename DEVICE_CONTEXT>
│ │ │ │ +
59 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ +
60 DEVICE_CONTEXT context) {
│ │ │ │ +
61 return new D3D11StencilTable(stencilTable, context->GetDeviceContext());
│ │ │ │ +
62 }
│ │ │ │ +
63
│ │ │ │ +
64 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ +
65 ID3D11DeviceContext *deviceContext) {
│ │ │ │ +
66 return new D3D11StencilTable(stencilTable, deviceContext);
│ │ │ │ +
67 }
│ │ │ │ +
68
│ │ │ │ + │ │ │ │ +
70 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
71
│ │ │ │ + │ │ │ │ +
73
│ │ │ │ +
74 // interfaces needed for D3D11ComputeEvaluator
│ │ │ │ +
75 ID3D11ShaderResourceView *GetSizesSRV() const { return _sizes; }
│ │ │ │ +
76 ID3D11ShaderResourceView *GetOffsetsSRV() const { return _offsets; }
│ │ │ │ +
77 ID3D11ShaderResourceView *GetIndicesSRV() const { return _indices; }
│ │ │ │ +
78 ID3D11ShaderResourceView *GetWeightsSRV() const { return _weights; }
│ │ │ │ +
79 int GetNumStencils() const { return _numStencils; }
│ │ │ │ +
80
│ │ │ │ +
81private:
│ │ │ │ +
82 ID3D11ShaderResourceView *_sizes;
│ │ │ │ +
83 ID3D11ShaderResourceView *_offsets;
│ │ │ │ +
84 ID3D11ShaderResourceView *_indices;
│ │ │ │ +
85 ID3D11ShaderResourceView *_weights;
│ │ │ │ +
86 ID3D11Buffer *_sizesBuffer;
│ │ │ │ +
87 ID3D11Buffer *_offsetsBuffer;
│ │ │ │ +
88 ID3D11Buffer *_indicesBuffer;
│ │ │ │ +
89 ID3D11Buffer *_weightsBuffer;
│ │ │ │ +
90
│ │ │ │ +
91 int _numStencils;
│ │ │ │ +
92};
│ │ │ │ +
93
│ │ │ │ +
94// ---------------------------------------------------------------------------
│ │ │ │ +
95
│ │ │ │ + │ │ │ │ +
97public:
│ │ │ │ +
98 typedef bool Instantiatable;
│ │ │ │ + │ │ │ │ +
100 BufferDescriptor const &dstDesc,
│ │ │ │ +
101 BufferDescriptor const &duDesc,
│ │ │ │ +
102 BufferDescriptor const &dvDesc,
│ │ │ │ +
103 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
104
│ │ │ │ + │ │ │ │ +
106 BufferDescriptor const &dstDesc,
│ │ │ │ +
107 BufferDescriptor const &duDesc,
│ │ │ │ +
108 BufferDescriptor const &dvDesc,
│ │ │ │ +
109 BufferDescriptor const &duuDesc,
│ │ │ │ +
110 BufferDescriptor const &duvDesc,
│ │ │ │ +
111 BufferDescriptor const &dvvDesc,
│ │ │ │ +
112 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
113
│ │ │ │ + │ │ │ │ +
116
│ │ │ │ + │ │ │ │ +
119
│ │ │ │ +
147 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
148 static bool EvalStencils(
│ │ │ │ +
149 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
150 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
151 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
152 D3D11ComputeEvaluator const *instance,
│ │ │ │ +
153 ID3D11DeviceContext * deviceContext) {
│ │ │ │ +
154 if (instance) {
│ │ │ │ +
155 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
156 dstBuffer, dstDesc,
│ │ │ │ +
157 stencilTable,
│ │ │ │ +
158 deviceContext);
│ │ │ │ +
159 } else {
│ │ │ │ +
160 // Create an instance on demand (slow)
│ │ │ │ +
161 (void)deviceContext; // unused
│ │ │ │ +
162 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
165 deviceContext);
│ │ │ │ +
166 if (instance) {
│ │ │ │ +
167 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
168 dstBuffer, dstDesc,
│ │ │ │ +
169 stencilTable,
│ │ │ │ +
170 deviceContext);
│ │ │ │ +
171 delete instance;
│ │ │ │ +
172 return r;
│ │ │ │ +
173 }
│ │ │ │ +
174 return false;
│ │ │ │ +
175 }
│ │ │ │ +
176 }
│ │ │ │ +
177
│ │ │ │ +
180 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
182 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
183 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
184 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
185 ID3D11DeviceContext *deviceContext) const {
│ │ │ │ +
186 return EvalStencils(srcBuffer->BindD3D11UAV(deviceContext), srcDesc,
│ │ │ │ +
187 dstBuffer->BindD3D11UAV(deviceContext), dstDesc,
│ │ │ │ +
188 stencilTable->GetSizesSRV(),
│ │ │ │ +
189 stencilTable->GetOffsetsSRV(),
│ │ │ │ +
190 stencilTable->GetIndicesSRV(),
│ │ │ │ +
191 stencilTable->GetWeightsSRV(),
│ │ │ │ +
192 /* start = */ 0,
│ │ │ │ +
193 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ +
194 deviceContext);
│ │ │ │ +
195 }
│ │ │ │ +
196
│ │ │ │ +
199 bool EvalStencils(ID3D11UnorderedAccessView *srcSRV,
│ │ │ │ +
200 BufferDescriptor const &srcDesc,
│ │ │ │ +
201 ID3D11UnorderedAccessView *dstUAV,
│ │ │ │ +
202 BufferDescriptor const &dstDesc,
│ │ │ │ +
203 ID3D11ShaderResourceView *sizesSRV,
│ │ │ │ +
204 ID3D11ShaderResourceView *offsetsSRV,
│ │ │ │ +
205 ID3D11ShaderResourceView *indicesSRV,
│ │ │ │ +
206 ID3D11ShaderResourceView *weightsSRV,
│ │ │ │ +
207 int start,
│ │ │ │ +
208 int end,
│ │ │ │ +
209 ID3D11DeviceContext *deviceContext) const;
│ │ │ │ +
210
│ │ │ │ +
212 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
213 BufferDescriptor const &dstDesc,
│ │ │ │ +
214 ID3D11DeviceContext *deviceContext);
│ │ │ │ +
215
│ │ │ │ +
217 static void Synchronize(ID3D11DeviceContext *deviceContext);
│ │ │ │ +
218
│ │ │ │ +
219private:
│ │ │ │ +
220 ID3D11ComputeShader * _computeShader;
│ │ │ │ +
221 ID3D11ClassLinkage * _classLinkage;
│ │ │ │ +
222 ID3D11ClassInstance * _singleBufferKernel;
│ │ │ │ +
223 ID3D11ClassInstance * _separateBufferKernel;
│ │ │ │ +
224 ID3D11Buffer * _uniformArgs; // uniform parameters for kernels
│ │ │ │ +
225
│ │ │ │ +
226 int _workGroupSize;
│ │ │ │ +
227};
│ │ │ │ +
228
│ │ │ │ +
229} // end namespace Osd
│ │ │ │ +
230
│ │ │ │ +
231} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
232using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
233
│ │ │ │ +
234} // end namespace OpenSubdiv
│ │ │ │ +
235
│ │ │ │ +
236
│ │ │ │ +
237#endif // OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │ │ │ │ │ -
MeshInterface< D3D11PatchTable > D3D11MeshInterface
Definition: d3d11Mesh.h:38
│ │ │ │ - │ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ +
static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
D3D11StencilTable(Far::StencilTable const *stencilTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ +
static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, ID3D11DeviceContext *deviceContext)
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, D3D11ComputeEvaluator const *instance, ID3D11DeviceContext *deviceContext)
Generic static compute function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, ID3D11DeviceContext *deviceContext)
│ │ │ │ + │ │ │ │ +
static void Synchronize(ID3D11DeviceContext *deviceContext)
Wait the dispatched kernel finishes.
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, ID3D11DeviceContext *deviceContext) const
│ │ │ │ +
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, ID3D11DeviceContext *deviceContext)
Configure DX kernel. Returns false if it fails to compile the kernel.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, BufferDescriptor const &srcDesc, ID3D11UnorderedAccessView *dstUAV, BufferDescriptor const &dstDesc, ID3D11ShaderResourceView *sizesSRV, ID3D11ShaderResourceView *offsetsSRV, ID3D11ShaderResourceView *indicesSRV, ID3D11ShaderResourceView *weightsSRV, int start, int end, ID3D11DeviceContext *deviceContext) const
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -d3d11Mesh.h │ │ │ │ │ +d3d11ComputeEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,42 +30,274 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/mesh.h" │ │ │ │ │ - 31#include "../osd/d3d11PatchTable.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace OpenSubdiv { │ │ │ │ │ - 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace Osd { │ │ │ │ │ + 30struct ID3D11DeviceContext; │ │ │ │ │ + 31struct ID3D11Buffer; │ │ │ │ │ + 32struct ID3D11ComputeShader; │ │ │ │ │ + 33struct ID3D11ClassLinkage; │ │ │ │ │ + 34struct ID3D11ClassInstance; │ │ │ │ │ + 35struct ID3D11ShaderResourceView; │ │ │ │ │ + 36struct ID3D11UnorderedAccessView; │ │ │ │ │ 37 │ │ │ │ │ -38typedef MeshInterface D3D11MeshInterface; │ │ │ │ │ + 38#include "../osd/bufferDescriptor.h" │ │ │ │ │ 39 │ │ │ │ │ - 40 │ │ │ │ │ - 41} // end namespace Osd │ │ │ │ │ + 40namespace OpenSubdiv { │ │ │ │ │ + 41namespace OPENSUBDIV_VERSION { │ │ │ │ │ 42 │ │ │ │ │ - 43} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 44using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 45 │ │ │ │ │ - 46} // end namespace OpenSubdiv │ │ │ │ │ - 47 │ │ │ │ │ - 48#endif // OPENSUBDIV3_OSD_D3D11MESH_H │ │ │ │ │ + 43namespace Far { │ │ │ │ │ + 44 class StencilTable; │ │ │ │ │ + 45} │ │ │ │ │ + 46 │ │ │ │ │ + 47namespace Osd { │ │ │ │ │ + 48 │ │ │ │ │ +56class D3D11StencilTable { │ │ │ │ │ + 57public: │ │ │ │ │ + 58 template │ │ │ │ │ +59 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ + 60 DEVICE_CONTEXT context) { │ │ │ │ │ + 61 return new D3D11StencilTable(stencilTable, context->GetDeviceContext()); │ │ │ │ │ + 62 } │ │ │ │ │ + 63 │ │ │ │ │ +64 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ + 65 ID3D11DeviceContext *deviceContext) { │ │ │ │ │ + 66 return new D3D11StencilTable(stencilTable, deviceContext); │ │ │ │ │ + 67 } │ │ │ │ │ + 68 │ │ │ │ │ +69 D3D11StencilTable(Far::StencilTable const *stencilTable, │ │ │ │ │ + 70 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 71 │ │ │ │ │ +72 ~D3D11StencilTable(); │ │ │ │ │ + 73 │ │ │ │ │ + 74 // interfaces needed for D3D11ComputeEvaluator │ │ │ │ │ +75 ID3D11ShaderResourceView *GetSizesSRV() const { return _sizes; } │ │ │ │ │ +76 ID3D11ShaderResourceView *GetOffsetsSRV() const { return _offsets; } │ │ │ │ │ +77 ID3D11ShaderResourceView *GetIndicesSRV() const { return _indices; } │ │ │ │ │ +78 ID3D11ShaderResourceView *GetWeightsSRV() const { return _weights; } │ │ │ │ │ +79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 80 │ │ │ │ │ + 81private: │ │ │ │ │ + 82 ID3D11ShaderResourceView *_sizes; │ │ │ │ │ + 83 ID3D11ShaderResourceView *_offsets; │ │ │ │ │ + 84 ID3D11ShaderResourceView *_indices; │ │ │ │ │ + 85 ID3D11ShaderResourceView *_weights; │ │ │ │ │ + 86 ID3D11Buffer *_sizesBuffer; │ │ │ │ │ + 87 ID3D11Buffer *_offsetsBuffer; │ │ │ │ │ + 88 ID3D11Buffer *_indicesBuffer; │ │ │ │ │ + 89 ID3D11Buffer *_weightsBuffer; │ │ │ │ │ + 90 │ │ │ │ │ + 91 int _numStencils; │ │ │ │ │ + 92}; │ │ │ │ │ + 93 │ │ │ │ │ + 94// ------------------------------------------------------------------------- │ │ │ │ │ +-- │ │ │ │ │ + 95 │ │ │ │ │ +96class D3D11ComputeEvaluator { │ │ │ │ │ + 97public: │ │ │ │ │ +98 typedef bool Instantiatable; │ │ │ │ │ +99 static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 100 BufferDescriptor const &dstDesc, │ │ │ │ │ + 101 BufferDescriptor const &duDesc, │ │ │ │ │ + 102 BufferDescriptor const &dvDesc, │ │ │ │ │ + 103 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 104 │ │ │ │ │ +105 static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 106 BufferDescriptor const &dstDesc, │ │ │ │ │ + 107 BufferDescriptor const &duDesc, │ │ │ │ │ + 108 BufferDescriptor const &dvDesc, │ │ │ │ │ + 109 BufferDescriptor const &duuDesc, │ │ │ │ │ + 110 BufferDescriptor const &duvDesc, │ │ │ │ │ + 111 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 112 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 113 │ │ │ │ │ +115 D3D11ComputeEvaluator(); │ │ │ │ │ + 116 │ │ │ │ │ +118 ~D3D11ComputeEvaluator(); │ │ │ │ │ + 119 │ │ │ │ │ + 147 template │ │ │ │ │ +148 static bool EvalStencils( │ │ │ │ │ + 149 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 150 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 151 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 152 D3D11ComputeEvaluator const *instance, │ │ │ │ │ + 153 ID3D11DeviceContext * deviceContext) { │ │ │ │ │ + 154 if (instance) { │ │ │ │ │ + 155 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 156 dstBuffer, dstDesc, │ │ │ │ │ + 157 stencilTable, │ │ │ │ │ + 158 deviceContext); │ │ │ │ │ + 159 } else { │ │ │ │ │ + 160 // Create an instance on demand (slow) │ │ │ │ │ + 161 (void)deviceContext; // unused │ │ │ │ │ + 162 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 163 BufferDescriptor(), │ │ │ │ │ + 164 BufferDescriptor(), │ │ │ │ │ + 165 deviceContext); │ │ │ │ │ + 166 if (instance) { │ │ │ │ │ + 167 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 168 dstBuffer, dstDesc, │ │ │ │ │ + 169 stencilTable, │ │ │ │ │ + 170 deviceContext); │ │ │ │ │ + 171 delete instance; │ │ │ │ │ + 172 return r; │ │ │ │ │ + 173 } │ │ │ │ │ + 174 return false; │ │ │ │ │ + 175 } │ │ │ │ │ + 176 } │ │ │ │ │ + 177 │ │ │ │ │ + 180 template │ │ │ │ │ +181 bool EvalStencils( │ │ │ │ │ + 182 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 183 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 184 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 185 ID3D11DeviceContext *deviceContext) const { │ │ │ │ │ + 186 return EvalStencils(srcBuffer->BindD3D11UAV(deviceContext), srcDesc, │ │ │ │ │ + 187 dstBuffer->BindD3D11UAV(deviceContext), dstDesc, │ │ │ │ │ + 188 stencilTable->GetSizesSRV(), │ │ │ │ │ + 189 stencilTable->GetOffsetsSRV(), │ │ │ │ │ + 190 stencilTable->GetIndicesSRV(), │ │ │ │ │ + 191 stencilTable->GetWeightsSRV(), │ │ │ │ │ + 192 /* start = */ 0, │ │ │ │ │ + 193 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ + 194 deviceContext); │ │ │ │ │ + 195 } │ │ │ │ │ + 196 │ │ │ │ │ +199 bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, │ │ │ │ │ + 200 BufferDescriptor const &srcDesc, │ │ │ │ │ + 201 ID3D11UnorderedAccessView *dstUAV, │ │ │ │ │ + 202 BufferDescriptor const &dstDesc, │ │ │ │ │ + 203 ID3D11ShaderResourceView *sizesSRV, │ │ │ │ │ + 204 ID3D11ShaderResourceView *offsetsSRV, │ │ │ │ │ + 205 ID3D11ShaderResourceView *indicesSRV, │ │ │ │ │ + 206 ID3D11ShaderResourceView *weightsSRV, │ │ │ │ │ + 207 int start, │ │ │ │ │ + 208 int end, │ │ │ │ │ + 209 ID3D11DeviceContext *deviceContext) const; │ │ │ │ │ + 210 │ │ │ │ │ +212 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 213 BufferDescriptor const &dstDesc, │ │ │ │ │ + 214 ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 215 │ │ │ │ │ +217 static void Synchronize(ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 218 │ │ │ │ │ + 219private: │ │ │ │ │ + 220 ID3D11ComputeShader * _computeShader; │ │ │ │ │ + 221 ID3D11ClassLinkage * _classLinkage; │ │ │ │ │ + 222 ID3D11ClassInstance * _singleBufferKernel; │ │ │ │ │ + 223 ID3D11ClassInstance * _separateBufferKernel; │ │ │ │ │ + 224 ID3D11Buffer * _uniformArgs; // uniform parameters for kernels │ │ │ │ │ + 225 │ │ │ │ │ + 226 int _workGroupSize; │ │ │ │ │ + 227}; │ │ │ │ │ + 228 │ │ │ │ │ + 229} // end namespace Osd │ │ │ │ │ + 230 │ │ │ │ │ + 231} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 232using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 233 │ │ │ │ │ + 234} // end namespace OpenSubdiv │ │ │ │ │ + 235 │ │ │ │ │ + 236 │ │ │ │ │ + 237#endif // OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11MeshInterface │ │ │ │ │ -MeshInterface< D3D11PatchTable > D3D11MeshInterface │ │ │ │ │ -Definition: d3d11Mesh.h:38 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ -Definition: mesh.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable │ │ │ │ │ +D3D11 stencil table. │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::Create │ │ │ │ │ +static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ +DEVICE_CONTEXT context) │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetOffsetsSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetOffsetsSRV() const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetIndicesSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetIndicesSRV() const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::~D3D11StencilTable │ │ │ │ │ +~D3D11StencilTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::D3D11StencilTable │ │ │ │ │ +D3D11StencilTable(Far::StencilTable const *stencilTable, ID3D11DeviceContext │ │ │ │ │ +*deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::Create │ │ │ │ │ +static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:64 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetSizesSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetSizesSRV() const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetWeightsSRV │ │ │ │ │ +ID3D11ShaderResourceView * GetWeightsSRV() const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:96 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Create │ │ │ │ │ +static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, ID3D11DeviceContext *deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, D3D11ComputeEvaluator const *instance, ID3D11DeviceContext │ │ │ │ │ +*deviceContext) │ │ │ │ │ +Generic static compute function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:148 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Create │ │ │ │ │ +static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Instantiatable │ │ │ │ │ +bool Instantiatable │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Wait the dispatched kernel finishes. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ +*stencilTable, ID3D11DeviceContext *deviceContext) const │ │ │ │ │ +Definition: d3d11ComputeEvaluator.h:181 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Compile │ │ │ │ │ +bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ +ID3D11DeviceContext *deviceContext) │ │ │ │ │ +Configure DX kernel. Returns false if it fails to compile the kernel. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator:: │ │ │ │ │ +D3D11ComputeEvaluator │ │ │ │ │ +D3D11ComputeEvaluator() │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator:: │ │ │ │ │ +~D3D11ComputeEvaluator │ │ │ │ │ +~D3D11ComputeEvaluator() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, BufferDescriptor const │ │ │ │ │ +&srcDesc, ID3D11UnorderedAccessView *dstUAV, BufferDescriptor const &dstDesc, │ │ │ │ │ +ID3D11ShaderResourceView *sizesSRV, ID3D11ShaderResourceView *offsetsSRV, │ │ │ │ │ +ID3D11ShaderResourceView *indicesSRV, ID3D11ShaderResourceView *weightsSRV, int │ │ │ │ │ +start, int end, ID3D11DeviceContext *deviceContext) const │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11Mesh.h │ │ │ │ │ + * d3d11ComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00830.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/hlslPatchShaderSource.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glXFBEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,41 +83,47 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
hlslPatchShaderSource.h File Reference
│ │ │ │ +
glXFBEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <string>
│ │ │ │ -#include "../far/patchDescriptor.h"
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  HLSLPatchShaderSource
class  GLStencilTableTBO
 GL TextureBuffer stencil table. More...
 
class  GLXFBEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,26 +5,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -hlslPatchShaderSource.h File Reference │ │ │ │ │ +glXFBEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ -#include "../far/patchDescriptor.h" │ │ │ │ │ +#include "../osd/opengl.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  HLSLPatchShaderSource │ │ │ │ │ +class  GLStencilTableTBO │ │ │ │ │ +  GL TextureBuffer stencil table. More... │ │ │ │ │ +  │ │ │ │ │ +class  GLXFBEvaluator │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * hlslPatchShaderSource.h │ │ │ │ │ + * glXFBEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00830.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ │ var a00830 = [ │ │ │ │ │ - ["HLSLPatchShaderSource", "a01257.html", null] │ │ │ │ │ + ["GLStencilTableTBO", "a01241.html", "a01241"], │ │ │ │ │ + ["GLXFBEvaluator", "a01245.html", "a01245"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00830_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/hlslPatchShaderSource.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glXFBEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
hlslPatchShaderSource.h
│ │ │ │ +
glXFBEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,59 +107,1137 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include <string>
│ │ │ │ -
30#include "../far/patchDescriptor.h"
│ │ │ │ -
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ -
34
│ │ │ │ -
35namespace Osd {
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/opengl.h"
│ │ │ │ +
31#include "../osd/types.h"
│ │ │ │ +
32#include "../osd/bufferDescriptor.h"
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │ - │ │ │ │ -
38public:
│ │ │ │ -
39 static std::string GetCommonShaderSource();
│ │ │ │ -
40
│ │ │ │ -
41 static std::string GetPatchBasisShaderSource();
│ │ │ │ +
37namespace Far {
│ │ │ │ +
38 class PatchTable;
│ │ │ │ +
39 class StencilTable;
│ │ │ │ +
40 class LimitStencilTable;
│ │ │ │ +
41}
│ │ │ │
42
│ │ │ │ - │ │ │ │ +
43namespace Osd {
│ │ │ │
44
│ │ │ │ - │ │ │ │ -
46
│ │ │ │ - │ │ │ │ -
48};
│ │ │ │ -
49
│ │ │ │ -
50} // end namespace Osd
│ │ │ │ -
51
│ │ │ │ -
52} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
53using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
54
│ │ │ │ -
55} // end namespace OpenSubdiv
│ │ │ │ -
56
│ │ │ │ -
57#endif // OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ + │ │ │ │ +
53public:
│ │ │ │ + │ │ │ │ +
55 Far::StencilTable const *stencilTable, void *deviceContext = NULL) {
│ │ │ │ +
56 (void)deviceContext; // unused
│ │ │ │ +
57 return new GLStencilTableTBO(stencilTable);
│ │ │ │ +
58 }
│ │ │ │ +
59
│ │ │ │ + │ │ │ │ +
61 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ +
62 void *deviceContext = NULL) {
│ │ │ │ +
63 (void)deviceContext; // unused
│ │ │ │ +
64 return new GLStencilTableTBO(limitStencilTable);
│ │ │ │ +
65 }
│ │ │ │ +
66
│ │ │ │ +
67 explicit GLStencilTableTBO(Far::StencilTable const *stencilTable);
│ │ │ │ +
68 explicit GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable);
│ │ │ │ + │ │ │ │ +
70
│ │ │ │ +
71 // interfaces needed for GLSLTransformFeedbackKernel
│ │ │ │ +
72 GLuint GetSizesTexture() const { return _sizes; }
│ │ │ │ +
73 GLuint GetOffsetsTexture() const { return _offsets; }
│ │ │ │ +
74 GLuint GetIndicesTexture() const { return _indices; }
│ │ │ │ +
75 GLuint GetWeightsTexture() const { return _weights; }
│ │ │ │ +
76 GLuint GetDuWeightsTexture() const { return _duWeights; }
│ │ │ │ +
77 GLuint GetDvWeightsTexture() const { return _dvWeights; }
│ │ │ │ +
78 GLuint GetDuuWeightsTexture() const { return _duuWeights; }
│ │ │ │ +
79 GLuint GetDuvWeightsTexture() const { return _duvWeights; }
│ │ │ │ +
80 GLuint GetDvvWeightsTexture() const { return _dvvWeights; }
│ │ │ │ +
81 int GetNumStencils() const { return _numStencils; }
│ │ │ │ +
82
│ │ │ │ +
83private:
│ │ │ │ +
84 GLuint _sizes;
│ │ │ │ +
85 GLuint _offsets;
│ │ │ │ +
86 GLuint _indices;
│ │ │ │ +
87 GLuint _weights;
│ │ │ │ +
88 GLuint _duWeights;
│ │ │ │ +
89 GLuint _dvWeights;
│ │ │ │ +
90 GLuint _duuWeights;
│ │ │ │ +
91 GLuint _duvWeights;
│ │ │ │ +
92 GLuint _dvvWeights;
│ │ │ │ +
93 int _numStencils;
│ │ │ │ +
94};
│ │ │ │ +
95
│ │ │ │ +
96// ---------------------------------------------------------------------------
│ │ │ │ +
97
│ │ │ │ + │ │ │ │ +
99public:
│ │ │ │ +
100 typedef bool Instantiatable;
│ │ │ │ +
101
│ │ │ │ +
103 template <typename DEVICE_CONTEXT>
│ │ │ │ +
104 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
105 BufferDescriptor const &dstDesc,
│ │ │ │ +
106 BufferDescriptor const &duDesc,
│ │ │ │ +
107 BufferDescriptor const &dvDesc,
│ │ │ │ +
108 DEVICE_CONTEXT deviceContext) {
│ │ │ │ +
109 bool interleavedDerivativeBuffers = deviceContext
│ │ │ │ +
110 ? deviceContext->AreInterleavedDerivativeBuffers()
│ │ │ │ +
111 : false;
│ │ │ │ +
112 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
113 interleavedDerivativeBuffers);
│ │ │ │ +
114 }
│ │ │ │ +
115
│ │ │ │ +
117 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
118 BufferDescriptor const &dstDesc,
│ │ │ │ +
119 BufferDescriptor const &duDesc,
│ │ │ │ +
120 BufferDescriptor const &dvDesc,
│ │ │ │ +
121 void * deviceContext) {
│ │ │ │ +
122 (void)deviceContext; // not used
│ │ │ │ +
123 return Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ +
124 }
│ │ │ │ +
125
│ │ │ │ +
126 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
127 BufferDescriptor const &dstDesc,
│ │ │ │ +
128 BufferDescriptor const &duDesc,
│ │ │ │ +
129 BufferDescriptor const &dvDesc,
│ │ │ │ +
130 bool interleavedDerivativeBuffers = false) {
│ │ │ │ +
131 GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
│ │ │ │ +
132 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
│ │ │ │ +
133 return instance;
│ │ │ │ +
134 delete instance;
│ │ │ │ +
135 return NULL;
│ │ │ │ +
136 }
│ │ │ │ +
137
│ │ │ │ +
139 template <typename DEVICE_CONTEXT>
│ │ │ │ +
140 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
141 BufferDescriptor const &dstDesc,
│ │ │ │ +
142 BufferDescriptor const &duDesc,
│ │ │ │ +
143 BufferDescriptor const &dvDesc,
│ │ │ │ +
144 BufferDescriptor const &duuDesc,
│ │ │ │ +
145 BufferDescriptor const &duvDesc,
│ │ │ │ +
146 BufferDescriptor const &dvvDesc,
│ │ │ │ +
147 DEVICE_CONTEXT deviceContext) {
│ │ │ │ +
148 bool interleavedDerivativeBuffers = deviceContext
│ │ │ │ +
149 ? deviceContext->AreInterleavedDerivativeBuffers()
│ │ │ │ +
150 : false;
│ │ │ │ +
151 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
152 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
153 interleavedDerivativeBuffers);
│ │ │ │ +
154 }
│ │ │ │ +
155
│ │ │ │ +
157 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
158 BufferDescriptor const &dstDesc,
│ │ │ │ +
159 BufferDescriptor const &duDesc,
│ │ │ │ +
160 BufferDescriptor const &dvDesc,
│ │ │ │ +
161 BufferDescriptor const &duuDesc,
│ │ │ │ +
162 BufferDescriptor const &duvDesc,
│ │ │ │ +
163 BufferDescriptor const &dvvDesc,
│ │ │ │ +
164 void * deviceContext) {
│ │ │ │ +
165 (void)deviceContext; // not used
│ │ │ │ +
166 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
167 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
168 }
│ │ │ │ +
169
│ │ │ │ +
170 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ +
171 BufferDescriptor const &dstDesc,
│ │ │ │ +
172 BufferDescriptor const &duDesc,
│ │ │ │ +
173 BufferDescriptor const &dvDesc,
│ │ │ │ +
174 BufferDescriptor const &duuDesc,
│ │ │ │ +
175 BufferDescriptor const &duvDesc,
│ │ │ │ +
176 BufferDescriptor const &dvvDesc,
│ │ │ │ +
177 bool interleavedDerivativeBuffers = false) {
│ │ │ │ +
178 GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
│ │ │ │ +
179 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
180 duuDesc, duvDesc, dvvDesc))
│ │ │ │ +
181 return instance;
│ │ │ │ +
182 delete instance;
│ │ │ │ +
183 return NULL;
│ │ │ │ +
184 }
│ │ │ │ +
185
│ │ │ │ +
199 GLXFBEvaluator(bool interleavedDerivativeBuffers = false);
│ │ │ │ +
200
│ │ │ │ + │ │ │ │ +
203
│ │ │ │ +
209
│ │ │ │ +
237 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
238 static bool EvalStencils(
│ │ │ │ +
239 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
240 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
241 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
242 GLXFBEvaluator const *instance,
│ │ │ │ +
243 void * deviceContext = NULL) {
│ │ │ │ +
244
│ │ │ │ +
245 if (instance) {
│ │ │ │ +
246 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
247 dstBuffer, dstDesc,
│ │ │ │ +
248 stencilTable);
│ │ │ │ +
249 } else {
│ │ │ │ +
250 // Create an instance on demand (slow)
│ │ │ │ +
251 (void)deviceContext; // unused
│ │ │ │ +
252 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
255 if (instance) {
│ │ │ │ +
256 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
257 dstBuffer, dstDesc,
│ │ │ │ +
258 stencilTable);
│ │ │ │ +
259 delete instance;
│ │ │ │ +
260 return r;
│ │ │ │ +
261 }
│ │ │ │ +
262 return false;
│ │ │ │ +
263 }
│ │ │ │ +
264 }
│ │ │ │ +
265
│ │ │ │ +
305 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
306 static bool EvalStencils(
│ │ │ │ +
307 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
308 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
309 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
310 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
312 GLXFBEvaluator const *instance,
│ │ │ │ +
313 void * deviceContext = NULL) {
│ │ │ │ +
314
│ │ │ │ +
315 if (instance) {
│ │ │ │ +
316 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
317 dstBuffer, dstDesc,
│ │ │ │ +
318 duBuffer, duDesc,
│ │ │ │ +
319 dvBuffer, dvDesc,
│ │ │ │ +
320 stencilTable);
│ │ │ │ +
321 } else {
│ │ │ │ +
322 // Create an instance on demand (slow)
│ │ │ │ +
323 (void)deviceContext; // unused
│ │ │ │ +
324 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ +
325 if (instance) {
│ │ │ │ +
326 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
327 dstBuffer, dstDesc,
│ │ │ │ +
328 duBuffer, duDesc,
│ │ │ │ +
329 dvBuffer, dvDesc,
│ │ │ │ +
330 stencilTable);
│ │ │ │ +
331 delete instance;
│ │ │ │ +
332 return r;
│ │ │ │ +
333 }
│ │ │ │ +
334 return false;
│ │ │ │ +
335 }
│ │ │ │ +
336 }
│ │ │ │ +
337
│ │ │ │ +
395 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
396 static bool EvalStencils(
│ │ │ │ +
397 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
398 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
399 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
400 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
401 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
402 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
403 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
404 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
405 GLXFBEvaluator const *instance,
│ │ │ │ +
406 void * deviceContext = NULL) {
│ │ │ │ +
407
│ │ │ │ +
408 if (instance) {
│ │ │ │ +
409 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
410 dstBuffer, dstDesc,
│ │ │ │ +
411 duBuffer, duDesc,
│ │ │ │ +
412 dvBuffer, dvDesc,
│ │ │ │ +
413 duuBuffer, duuDesc,
│ │ │ │ +
414 duvBuffer, duvDesc,
│ │ │ │ +
415 dvvBuffer, dvvDesc,
│ │ │ │ +
416 stencilTable);
│ │ │ │ +
417 } else {
│ │ │ │ +
418 // Create an instance on demand (slow)
│ │ │ │ +
419 (void)deviceContext; // unused
│ │ │ │ +
420 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
421 duDesc, dvDesc,
│ │ │ │ +
422 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
423 if (instance) {
│ │ │ │ +
424 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
425 dstBuffer, dstDesc,
│ │ │ │ +
426 duBuffer, duDesc,
│ │ │ │ +
427 dvBuffer, dvDesc,
│ │ │ │ +
428 duuBuffer, duuDesc,
│ │ │ │ +
429 duvBuffer, duvDesc,
│ │ │ │ +
430 dvvBuffer, dvvDesc,
│ │ │ │ +
431 stencilTable);
│ │ │ │ +
432 delete instance;
│ │ │ │ +
433 return r;
│ │ │ │ +
434 }
│ │ │ │ +
435 return false;
│ │ │ │ +
436 }
│ │ │ │ +
437 }
│ │ │ │ +
438
│ │ │ │ +
456 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
458 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
459 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
460 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
461
│ │ │ │ +
462 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
463 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
464 0, BufferDescriptor(),
│ │ │ │ +
465 0, BufferDescriptor(),
│ │ │ │ +
466 stencilTable->GetSizesTexture(),
│ │ │ │ +
467 stencilTable->GetOffsetsTexture(),
│ │ │ │ +
468 stencilTable->GetIndicesTexture(),
│ │ │ │ +
469 stencilTable->GetWeightsTexture(),
│ │ │ │ +
470 0,
│ │ │ │ +
471 0,
│ │ │ │ +
472 /* start = */ 0,
│ │ │ │ +
473 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
474 }
│ │ │ │ +
475
│ │ │ │ +
505 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
507 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
508 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
509 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
510 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
511 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
512
│ │ │ │ +
513 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
514 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
515 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
516 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
517 stencilTable->GetSizesTexture(),
│ │ │ │ +
518 stencilTable->GetOffsetsTexture(),
│ │ │ │ +
519 stencilTable->GetIndicesTexture(),
│ │ │ │ +
520 stencilTable->GetWeightsTexture(),
│ │ │ │ +
521 stencilTable->GetDuWeightsTexture(),
│ │ │ │ +
522 stencilTable->GetDvWeightsTexture(),
│ │ │ │ +
523 /* start = */ 0,
│ │ │ │ +
524 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
525 }
│ │ │ │ +
526
│ │ │ │ +
574 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
576 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
577 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
578 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
579 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
580 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
581 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
582 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
583 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
584
│ │ │ │ +
585 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
586 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
587 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
588 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
589 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
590 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
591 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
592 stencilTable->GetSizesTexture(),
│ │ │ │ +
593 stencilTable->GetOffsetsTexture(),
│ │ │ │ +
594 stencilTable->GetIndicesTexture(),
│ │ │ │ +
595 stencilTable->GetWeightsTexture(),
│ │ │ │ +
596 stencilTable->GetDuWeightsTexture(),
│ │ │ │ +
597 stencilTable->GetDvWeightsTexture(),
│ │ │ │ +
598 stencilTable->GetDuuWeightsTexture(),
│ │ │ │ +
599 stencilTable->GetDuvWeightsTexture(),
│ │ │ │ +
600 stencilTable->GetDvvWeightsTexture(),
│ │ │ │ +
601 /* start = */ 0,
│ │ │ │ +
602 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
603 }
│ │ │ │ +
604
│ │ │ │ +
640 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
641 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
642 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
643 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
644 GLuint sizesBuffer,
│ │ │ │ +
645 GLuint offsetsBuffer,
│ │ │ │ +
646 GLuint indicesBuffer,
│ │ │ │ +
647 GLuint weightsBuffer,
│ │ │ │ +
648 GLuint duWeightsBuffer,
│ │ │ │ +
649 GLuint dvWeightsBuffer,
│ │ │ │ +
650 int start,
│ │ │ │ +
651 int end) const;
│ │ │ │ +
652
│ │ │ │ +
706 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
707 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
708 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
709 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
710 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
711 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
712 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
713 GLuint sizesBuffer,
│ │ │ │ +
714 GLuint offsetsBuffer,
│ │ │ │ +
715 GLuint indicesBuffer,
│ │ │ │ +
716 GLuint weightsBuffer,
│ │ │ │ +
717 GLuint duWeightsBuffer,
│ │ │ │ +
718 GLuint dvWeightsBuffer,
│ │ │ │ +
719 GLuint duuWeightsBuffer,
│ │ │ │ +
720 GLuint duvWeightsBuffer,
│ │ │ │ +
721 GLuint dvvWeightsBuffer,
│ │ │ │ +
722 int start,
│ │ │ │ +
723 int end) const;
│ │ │ │ +
724
│ │ │ │ +
730
│ │ │ │ +
763 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
764 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
765 static bool EvalPatches(
│ │ │ │ +
766 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
767 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
768 int numPatchCoords,
│ │ │ │ +
769 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
770 PATCH_TABLE *patchTable,
│ │ │ │ +
771 GLXFBEvaluator const *instance,
│ │ │ │ +
772 void * deviceContext = NULL) {
│ │ │ │ +
773
│ │ │ │ +
774 if (instance) {
│ │ │ │ +
775 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
776 dstBuffer, dstDesc,
│ │ │ │ +
777 numPatchCoords, patchCoords,
│ │ │ │ +
778 patchTable);
│ │ │ │ +
779 } else {
│ │ │ │ +
780 // Create an instance on demand (slow)
│ │ │ │ +
781 (void)deviceContext; // unused
│ │ │ │ +
782 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
785 if (instance) {
│ │ │ │ +
786 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
787 dstBuffer, dstDesc,
│ │ │ │ +
788 numPatchCoords, patchCoords,
│ │ │ │ +
789 patchTable);
│ │ │ │ +
790 delete instance;
│ │ │ │ +
791 return r;
│ │ │ │ +
792 }
│ │ │ │ +
793 return false;
│ │ │ │ +
794 }
│ │ │ │ +
795 }
│ │ │ │ +
796
│ │ │ │ +
841 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
842 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
843 static bool EvalPatches(
│ │ │ │ +
844 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
845 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
846 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
847 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
848 int numPatchCoords,
│ │ │ │ +
849 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
850 PATCH_TABLE *patchTable,
│ │ │ │ +
851 GLXFBEvaluator const *instance,
│ │ │ │ +
852 void * deviceContext = NULL) {
│ │ │ │ +
853
│ │ │ │ +
854 if (instance) {
│ │ │ │ +
855 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
856 dstBuffer, dstDesc,
│ │ │ │ +
857 duBuffer, duDesc,
│ │ │ │ +
858 dvBuffer, dvDesc,
│ │ │ │ +
859 numPatchCoords, patchCoords,
│ │ │ │ +
860 patchTable);
│ │ │ │ +
861 } else {
│ │ │ │ +
862 // Create an instance on demand (slow)
│ │ │ │ +
863 (void)deviceContext; // unused
│ │ │ │ +
864 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ +
865 if (instance) {
│ │ │ │ +
866 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
867 dstBuffer, dstDesc,
│ │ │ │ +
868 duBuffer, duDesc,
│ │ │ │ +
869 dvBuffer, dvDesc,
│ │ │ │ +
870 numPatchCoords, patchCoords,
│ │ │ │ +
871 patchTable);
│ │ │ │ +
872 delete instance;
│ │ │ │ +
873 return r;
│ │ │ │ +
874 }
│ │ │ │ +
875 return false;
│ │ │ │ +
876 }
│ │ │ │ +
877 }
│ │ │ │ +
878
│ │ │ │ +
941 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
942 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
943 static bool EvalPatches(
│ │ │ │ +
944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
946 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
947 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
948 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
949 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
950 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
951 int numPatchCoords,
│ │ │ │ +
952 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
953 PATCH_TABLE *patchTable,
│ │ │ │ +
954 GLXFBEvaluator const *instance,
│ │ │ │ +
955 void * deviceContext = NULL) {
│ │ │ │ +
956
│ │ │ │ +
957 if (instance) {
│ │ │ │ +
958 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
959 dstBuffer, dstDesc,
│ │ │ │ +
960 duBuffer, duDesc,
│ │ │ │ +
961 dvBuffer, dvDesc,
│ │ │ │ +
962 duuBuffer, duuDesc,
│ │ │ │ +
963 duvBuffer, duvDesc,
│ │ │ │ +
964 dvvBuffer, dvvDesc,
│ │ │ │ +
965 numPatchCoords, patchCoords,
│ │ │ │ +
966 patchTable);
│ │ │ │ +
967 } else {
│ │ │ │ +
968 // Create an instance on demand (slow)
│ │ │ │ +
969 (void)deviceContext; // unused
│ │ │ │ +
970 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
971 duDesc, dvDesc,
│ │ │ │ +
972 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
973 if (instance) {
│ │ │ │ +
974 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
975 dstBuffer, dstDesc,
│ │ │ │ +
976 duBuffer, duDesc,
│ │ │ │ +
977 dvBuffer, dvDesc,
│ │ │ │ +
978 duuBuffer, duuDesc,
│ │ │ │ +
979 duvBuffer, duvDesc,
│ │ │ │ +
980 dvvBuffer, dvvDesc,
│ │ │ │ +
981 numPatchCoords, patchCoords,
│ │ │ │ +
982 patchTable);
│ │ │ │ +
983 delete instance;
│ │ │ │ +
984 return r;
│ │ │ │ +
985 }
│ │ │ │ +
986 return false;
│ │ │ │ +
987 }
│ │ │ │ +
988 }
│ │ │ │ +
989
│ │ │ │ +
1014 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1015 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1017 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1018 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1019 int numPatchCoords,
│ │ │ │ +
1020 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1021 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1022
│ │ │ │ +
1023 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1024 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1025 0, BufferDescriptor(),
│ │ │ │ +
1026 0, BufferDescriptor(),
│ │ │ │ +
1027 numPatchCoords,
│ │ │ │ +
1028 patchCoords->BindVBO(),
│ │ │ │ +
1029 patchTable->GetPatchArrays(),
│ │ │ │ +
1030 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ +
1031 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1032 }
│ │ │ │ +
1033
│ │ │ │ +
1068 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1069 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1073 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1074 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1075 int numPatchCoords,
│ │ │ │ +
1076 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1077 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1078
│ │ │ │ +
1079 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1080 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1081 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1082 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1083 numPatchCoords,
│ │ │ │ +
1084 patchCoords->BindVBO(),
│ │ │ │ +
1085 patchTable->GetPatchArrays(),
│ │ │ │ +
1086 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ +
1087 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1088 }
│ │ │ │ +
1089
│ │ │ │ +
1142 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1143 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1145 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1146 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1147 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1148 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1149 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1150 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1151 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1152 int numPatchCoords,
│ │ │ │ +
1153 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1154 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1155
│ │ │ │ +
1156 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1157 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1158 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1159 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1160 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
1161 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
1162 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
1163 numPatchCoords,
│ │ │ │ +
1164 patchCoords->BindVBO(),
│ │ │ │ +
1165 patchTable->GetPatchArrays(),
│ │ │ │ +
1166 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ +
1167 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1168 }
│ │ │ │ +
1169
│ │ │ │ +
1170 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1171 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1172 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1173 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1174 int numPatchCoords,
│ │ │ │ +
1175 GLuint patchCoordsBuffer,
│ │ │ │ +
1176 const PatchArrayVector &patchArrays,
│ │ │ │ +
1177 GLuint patchIndexBuffer,
│ │ │ │ +
1178 GLuint patchParamsBuffer) const;
│ │ │ │ +
1179
│ │ │ │ +
1180 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1181 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1182 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1183 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1184 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1185 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1186 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1187 int numPatchCoords,
│ │ │ │ +
1188 GLuint patchCoordsBuffer,
│ │ │ │ +
1189 const PatchArrayVector &patchArrays,
│ │ │ │ +
1190 GLuint patchIndexBuffer,
│ │ │ │ +
1191 GLuint patchParamsBuffer) const;
│ │ │ │ +
1192
│ │ │ │ +
1225 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1226 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1228 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1229 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1230 int numPatchCoords,
│ │ │ │ +
1231 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1232 PATCH_TABLE *patchTable,
│ │ │ │ +
1233 GLXFBEvaluator const *instance,
│ │ │ │ +
1234 void * deviceContext = NULL) {
│ │ │ │ +
1235
│ │ │ │ +
1236 if (instance) {
│ │ │ │ +
1237 return instance->EvalPatchesVarying(
│ │ │ │ +
1238 srcBuffer, srcDesc,
│ │ │ │ +
1239 dstBuffer, dstDesc,
│ │ │ │ +
1240 numPatchCoords, patchCoords,
│ │ │ │ +
1241 patchTable);
│ │ │ │ +
1242 } else {
│ │ │ │ +
1243 // Create an instance on demand (slow)
│ │ │ │ +
1244 (void)deviceContext; // unused
│ │ │ │ +
1245 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1248 if (instance) {
│ │ │ │ +
1249 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1250 srcBuffer, srcDesc,
│ │ │ │ +
1251 dstBuffer, dstDesc,
│ │ │ │ +
1252 numPatchCoords, patchCoords,
│ │ │ │ +
1253 patchTable);
│ │ │ │ +
1254 delete instance;
│ │ │ │ +
1255 return r;
│ │ │ │ +
1256 }
│ │ │ │ +
1257 return false;
│ │ │ │ +
1258 }
│ │ │ │ +
1259 }
│ │ │ │ +
1260
│ │ │ │ +
1285 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1286 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1288 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1289 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1290 int numPatchCoords,
│ │ │ │ +
1291 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1292 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1293
│ │ │ │ +
1294 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1295 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1296 0, BufferDescriptor(),
│ │ │ │ +
1297 0, BufferDescriptor(),
│ │ │ │ +
1298 numPatchCoords,
│ │ │ │ +
1299 patchCoords->BindVBO(),
│ │ │ │ +
1300 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1301 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ +
1302 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1303 }
│ │ │ │ +
1304
│ │ │ │ +
1349 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1350 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1352 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1353 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1354 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1355 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1356 int numPatchCoords,
│ │ │ │ +
1357 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1358 PATCH_TABLE *patchTable,
│ │ │ │ +
1359 GLXFBEvaluator const *instance,
│ │ │ │ +
1360 void * deviceContext = NULL) {
│ │ │ │ +
1361
│ │ │ │ +
1362 if (instance) {
│ │ │ │ +
1363 return instance->EvalPatchesVarying(
│ │ │ │ +
1364 srcBuffer, srcDesc,
│ │ │ │ +
1365 dstBuffer, dstDesc,
│ │ │ │ +
1366 duBuffer, duDesc,
│ │ │ │ +
1367 dvBuffer, dvDesc,
│ │ │ │ +
1368 numPatchCoords, patchCoords,
│ │ │ │ +
1369 patchTable);
│ │ │ │ +
1370 } else {
│ │ │ │ +
1371 // Create an instance on demand (slow)
│ │ │ │ +
1372 (void)deviceContext; // unused
│ │ │ │ +
1373 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1374 duDesc, dvDesc);
│ │ │ │ +
1375 if (instance) {
│ │ │ │ +
1376 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1377 srcBuffer, srcDesc,
│ │ │ │ +
1378 dstBuffer, dstDesc,
│ │ │ │ +
1379 duBuffer, duDesc,
│ │ │ │ +
1380 dvBuffer, dvDesc,
│ │ │ │ +
1381 numPatchCoords, patchCoords,
│ │ │ │ +
1382 patchTable);
│ │ │ │ +
1383 delete instance;
│ │ │ │ +
1384 return r;
│ │ │ │ +
1385 }
│ │ │ │ +
1386 return false;
│ │ │ │ +
1387 }
│ │ │ │ +
1388 }
│ │ │ │ +
1389
│ │ │ │ +
1426 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1427 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1429 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1430 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1431 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1432 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1433 int numPatchCoords,
│ │ │ │ +
1434 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1435 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1436
│ │ │ │ +
1437 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1438 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1439 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1440 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1441 numPatchCoords,
│ │ │ │ +
1442 patchCoords->BindVBO(),
│ │ │ │ +
1443 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1444 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ +
1445 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1446 }
│ │ │ │ +
1447
│ │ │ │ +
1510 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1511 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1513 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1514 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1515 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1516 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1517 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1518 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1519 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1520 int numPatchCoords,
│ │ │ │ +
1521 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1522 PATCH_TABLE *patchTable,
│ │ │ │ +
1523 GLXFBEvaluator const *instance,
│ │ │ │ +
1524 void * deviceContext = NULL) {
│ │ │ │ +
1525
│ │ │ │ +
1526 if (instance) {
│ │ │ │ +
1527 return instance->EvalPatchesVarying(
│ │ │ │ +
1528 srcBuffer, srcDesc,
│ │ │ │ +
1529 dstBuffer, dstDesc,
│ │ │ │ +
1530 duBuffer, duDesc,
│ │ │ │ +
1531 dvBuffer, dvDesc,
│ │ │ │ +
1532 duuBuffer, duuDesc,
│ │ │ │ +
1533 duvBuffer, duvDesc,
│ │ │ │ +
1534 dvvBuffer, dvvDesc,
│ │ │ │ +
1535 numPatchCoords, patchCoords,
│ │ │ │ +
1536 patchTable);
│ │ │ │ +
1537 } else {
│ │ │ │ +
1538 // Create an instance on demand (slow)
│ │ │ │ +
1539 (void)deviceContext; // unused
│ │ │ │ +
1540 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1541 duDesc, dvDesc,
│ │ │ │ +
1542 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
1543 if (instance) {
│ │ │ │ +
1544 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1545 srcBuffer, srcDesc,
│ │ │ │ +
1546 dstBuffer, dstDesc,
│ │ │ │ +
1547 duBuffer, duDesc,
│ │ │ │ +
1548 dvBuffer, dvDesc,
│ │ │ │ +
1549 duuBuffer, duuDesc,
│ │ │ │ +
1550 duvBuffer, duvDesc,
│ │ │ │ +
1551 dvvBuffer, dvvDesc,
│ │ │ │ +
1552 numPatchCoords, patchCoords,
│ │ │ │ +
1553 patchTable);
│ │ │ │ +
1554 delete instance;
│ │ │ │ +
1555 return r;
│ │ │ │ +
1556 }
│ │ │ │ +
1557 return false;
│ │ │ │ +
1558 }
│ │ │ │ +
1559 }
│ │ │ │ +
1560
│ │ │ │ +
1615 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1616 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1618 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1619 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1620 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1621 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1622 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1623 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1624 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1625 int numPatchCoords,
│ │ │ │ +
1626 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1627 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1628
│ │ │ │ +
1629 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1630 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1631 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1632 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1633 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
1634 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
1635 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
1636 numPatchCoords,
│ │ │ │ +
1637 patchCoords->BindVBO(),
│ │ │ │ +
1638 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1639 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ +
1640 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ +
1641 }
│ │ │ │ +
1642
│ │ │ │ +
1677 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1678 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1680 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1681 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1682 int numPatchCoords,
│ │ │ │ +
1683 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1684 PATCH_TABLE *patchTable,
│ │ │ │ +
1685 int fvarChannel,
│ │ │ │ +
1686 GLXFBEvaluator const *instance,
│ │ │ │ +
1687 void * deviceContext = NULL) {
│ │ │ │ +
1688
│ │ │ │ +
1689 if (instance) {
│ │ │ │ +
1690 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1691 srcBuffer, srcDesc,
│ │ │ │ +
1692 dstBuffer, dstDesc,
│ │ │ │ +
1693 numPatchCoords, patchCoords,
│ │ │ │ +
1694 patchTable, fvarChannel);
│ │ │ │ +
1695 } else {
│ │ │ │ +
1696 // Create an instance on demand (slow)
│ │ │ │ +
1697 (void)deviceContext; // unused
│ │ │ │ +
1698 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1701 if (instance) {
│ │ │ │ +
1702 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1703 srcBuffer, srcDesc,
│ │ │ │ +
1704 dstBuffer, dstDesc,
│ │ │ │ +
1705 numPatchCoords, patchCoords,
│ │ │ │ +
1706 patchTable, fvarChannel);
│ │ │ │ +
1707 delete instance;
│ │ │ │ +
1708 return r;
│ │ │ │ +
1709 }
│ │ │ │ +
1710 return false;
│ │ │ │ +
1711 }
│ │ │ │ +
1712 }
│ │ │ │ +
1713
│ │ │ │ +
1740 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1741 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1745 int numPatchCoords,
│ │ │ │ +
1746 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1747 PATCH_TABLE *patchTable,
│ │ │ │ +
1748 int fvarChannel = 0) const {
│ │ │ │ +
1749
│ │ │ │ +
1750 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1751 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1752 0, BufferDescriptor(),
│ │ │ │ +
1753 0, BufferDescriptor(),
│ │ │ │ +
1754 numPatchCoords,
│ │ │ │ +
1755 patchCoords->BindVBO(),
│ │ │ │ +
1756 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1757 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ +
1758 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ +
1759 }
│ │ │ │ +
1760
│ │ │ │ +
1807 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1808 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1810 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1811 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1812 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1813 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1814 int numPatchCoords,
│ │ │ │ +
1815 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1816 PATCH_TABLE *patchTable,
│ │ │ │ +
1817 int fvarChannel,
│ │ │ │ +
1818 GLXFBEvaluator const *instance,
│ │ │ │ +
1819 void * deviceContext = NULL) {
│ │ │ │ +
1820
│ │ │ │ +
1821 if (instance) {
│ │ │ │ +
1822 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1823 srcBuffer, srcDesc,
│ │ │ │ +
1824 dstBuffer, dstDesc,
│ │ │ │ +
1825 duBuffer, duDesc,
│ │ │ │ +
1826 dvBuffer, dvDesc,
│ │ │ │ +
1827 numPatchCoords, patchCoords,
│ │ │ │ +
1828 patchTable, fvarChannel);
│ │ │ │ +
1829 } else {
│ │ │ │ +
1830 // Create an instance on demand (slow)
│ │ │ │ +
1831 (void)deviceContext; // unused
│ │ │ │ +
1832 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1833 duDesc, dvDesc);
│ │ │ │ +
1834 if (instance) {
│ │ │ │ +
1835 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1836 srcBuffer, srcDesc,
│ │ │ │ +
1837 dstBuffer, dstDesc,
│ │ │ │ +
1838 duBuffer, duDesc,
│ │ │ │ +
1839 dvBuffer, dvDesc,
│ │ │ │ +
1840 numPatchCoords, patchCoords,
│ │ │ │ +
1841 patchTable, fvarChannel);
│ │ │ │ +
1842 delete instance;
│ │ │ │ +
1843 return r;
│ │ │ │ +
1844 }
│ │ │ │ +
1845 return false;
│ │ │ │ +
1846 }
│ │ │ │ +
1847 }
│ │ │ │ +
1848
│ │ │ │ +
1887 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1888 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1894 int numPatchCoords,
│ │ │ │ +
1895 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1896 PATCH_TABLE *patchTable,
│ │ │ │ +
1897 int fvarChannel = 0) const {
│ │ │ │ +
1898
│ │ │ │ +
1899 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1900 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1901 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1902 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1903 numPatchCoords,
│ │ │ │ +
1904 patchCoords->BindVBO(),
│ │ │ │ +
1905 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1906 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ +
1907 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ +
1908 }
│ │ │ │ +
1909
│ │ │ │ +
1974 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1975 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1977 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1978 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1979 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1980 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1981 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1982 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1983 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1984 int numPatchCoords,
│ │ │ │ +
1985 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1986 PATCH_TABLE *patchTable,
│ │ │ │ +
1987 int fvarChannel,
│ │ │ │ +
1988 GLXFBEvaluator const *instance,
│ │ │ │ +
1989 void * deviceContext = NULL) {
│ │ │ │ +
1990
│ │ │ │ +
1991 if (instance) {
│ │ │ │ +
1992 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1993 srcBuffer, srcDesc,
│ │ │ │ +
1994 dstBuffer, dstDesc,
│ │ │ │ +
1995 duBuffer, duDesc,
│ │ │ │ +
1996 dvBuffer, dvDesc,
│ │ │ │ +
1997 duuBuffer, duuDesc,
│ │ │ │ +
1998 duvBuffer, duvDesc,
│ │ │ │ +
1999 dvvBuffer, dvvDesc,
│ │ │ │ +
2000 numPatchCoords, patchCoords,
│ │ │ │ +
2001 patchTable, fvarChannel);
│ │ │ │ +
2002 } else {
│ │ │ │ +
2003 // Create an instance on demand (slow)
│ │ │ │ +
2004 (void)deviceContext; // unused
│ │ │ │ +
2005 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
2006 duDesc, dvDesc,
│ │ │ │ +
2007 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
2008 if (instance) {
│ │ │ │ +
2009 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
2010 srcBuffer, srcDesc,
│ │ │ │ +
2011 dstBuffer, dstDesc,
│ │ │ │ +
2012 duBuffer, duDesc,
│ │ │ │ +
2013 dvBuffer, dvDesc,
│ │ │ │ +
2014 duuBuffer, duuDesc,
│ │ │ │ +
2015 duvBuffer, duvDesc,
│ │ │ │ +
2016 dvvBuffer, dvvDesc,
│ │ │ │ +
2017 numPatchCoords, patchCoords,
│ │ │ │ +
2018 patchTable, fvarChannel);
│ │ │ │ +
2019 delete instance;
│ │ │ │ +
2020 return r;
│ │ │ │ +
2021 }
│ │ │ │ +
2022 return false;
│ │ │ │ +
2023 }
│ │ │ │ +
2024 }
│ │ │ │ +
2025
│ │ │ │ +
2082 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2083 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2085 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2086 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2087 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2088 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2089 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
2090 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
2091 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
2092 int numPatchCoords,
│ │ │ │ +
2093 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2094 PATCH_TABLE *patchTable,
│ │ │ │ +
2095 int fvarChannel = 0) const {
│ │ │ │ +
2096
│ │ │ │ +
2097 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
2098 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
2099 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
2100 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
2101 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
2102 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
2103 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
2104 numPatchCoords,
│ │ │ │ +
2105 patchCoords->BindVBO(),
│ │ │ │ +
2106 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
2107 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ +
2108 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ +
2109 }
│ │ │ │ +
2110
│ │ │ │ +
2116
│ │ │ │ +
2119 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2120 BufferDescriptor const &dstDesc,
│ │ │ │ +
2121 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ +
2122 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ +
2123 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ +
2124 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ +
2125 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ +
2126
│ │ │ │ +
2128 static void Synchronize(void *kernel);
│ │ │ │ +
2129
│ │ │ │ +
2130private:
│ │ │ │ +
2131 GLuint _srcBufferTexture;
│ │ │ │ +
2132 GLuint _patchArraysUBO;
│ │ │ │ +
2133 bool _interleavedDerivativeBuffers;
│ │ │ │ +
2134
│ │ │ │ +
2135 struct _StencilKernel {
│ │ │ │ +
2136 _StencilKernel();
│ │ │ │ +
2137 ~_StencilKernel();
│ │ │ │ +
2138 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2139 BufferDescriptor const &dstDesc,
│ │ │ │ +
2140 BufferDescriptor const &duDesc,
│ │ │ │ +
2141 BufferDescriptor const &dvDesc,
│ │ │ │ +
2142 BufferDescriptor const &duuDesc,
│ │ │ │ +
2143 BufferDescriptor const &duvDesc,
│ │ │ │ +
2144 BufferDescriptor const &dvvDesc,
│ │ │ │ +
2145 bool interleavedDerivativeBuffers);
│ │ │ │ +
2146 GLuint program;
│ │ │ │ +
2147 GLint uniformSrcBufferTexture;
│ │ │ │ +
2148 GLint uniformSrcOffset; // src buffer offset (in elements)
│ │ │ │ +
2149
│ │ │ │ +
2150 GLint uniformSizesTexture;
│ │ │ │ +
2151 GLint uniformOffsetsTexture;
│ │ │ │ +
2152 GLint uniformIndicesTexture;
│ │ │ │ +
2153 GLint uniformWeightsTexture;
│ │ │ │ +
2154 GLint uniformDuWeightsTexture;
│ │ │ │ +
2155 GLint uniformDvWeightsTexture;
│ │ │ │ +
2156 GLint uniformDuuWeightsTexture;
│ │ │ │ +
2157 GLint uniformDuvWeightsTexture;
│ │ │ │ +
2158 GLint uniformDvvWeightsTexture;
│ │ │ │ +
2159 GLint uniformStart; // range
│ │ │ │ +
2160 GLint uniformEnd;
│ │ │ │ +
2161 } _stencilKernel;
│ │ │ │ +
2162
│ │ │ │ +
2163 struct _PatchKernel {
│ │ │ │ +
2164 _PatchKernel();
│ │ │ │ +
2165 ~_PatchKernel();
│ │ │ │ +
2166 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2167 BufferDescriptor const &dstDesc,
│ │ │ │ +
2168 BufferDescriptor const &duDesc,
│ │ │ │ +
2169 BufferDescriptor const &dvDesc,
│ │ │ │ +
2170 BufferDescriptor const &duuDesc,
│ │ │ │ +
2171 BufferDescriptor const &duvDesc,
│ │ │ │ +
2172 BufferDescriptor const &dvvDesc,
│ │ │ │ +
2173 bool interleavedDerivativeBuffers);
│ │ │ │ +
2174 GLuint program;
│ │ │ │ +
2175 GLint uniformSrcBufferTexture;
│ │ │ │ +
2176 GLint uniformSrcOffset; // src buffer offset (in elements)
│ │ │ │ +
2177
│ │ │ │ +
2178 GLint uniformPatchArraysUBOBinding;
│ │ │ │ +
2179 GLint uniformPatchParamTexture;
│ │ │ │ +
2180 GLint uniformPatchIndexTexture;
│ │ │ │ +
2181 } _patchKernel;
│ │ │ │ +
2182
│ │ │ │ +
2183};
│ │ │ │ +
2184
│ │ │ │ +
2185} // end namespace Osd
│ │ │ │ +
2186
│ │ │ │ +
2187} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
2188using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
2189
│ │ │ │ +
2190} // end namespace OpenSubdiv
│ │ │ │ +
2191
│ │ │ │ +
2192
│ │ │ │ +
2193#endif // OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ -
static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ -
static std::string GetHullShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ - │ │ │ │ - │ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ +
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static GLStencilTableTBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
GLStencilTableTBO(Far::StencilTable const *stencilTable)
│ │ │ │ +
GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable)
│ │ │ │ + │ │ │ │ +
static GLStencilTableTBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, bool interleavedDerivativeBuffers=false)
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ +
GLXFBEvaluator(bool interleavedDerivativeBuffers=false)
Constructor.
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ + │ │ │ │ +
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, bool interleavedDerivativeBuffers=false)
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext)
Specialization to allow creation without a device context.
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
│ │ │ │ +
static void Synchronize(void *kernel)
Wait the dispatched kernel finishes.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ +
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ +
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext)
Specialization to allow creation without a device context.
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
~GLXFBEvaluator()
Destructor. note that the GL context must be made current.
│ │ │ │ +
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -hlslPatchShaderSource.h │ │ │ │ │ +glXFBEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,65 +30,1454 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include "../far/patchDescriptor.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace Osd { │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/opengl.h" │ │ │ │ │ + 31#include "../osd/types.h" │ │ │ │ │ + 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ -37class HLSLPatchShaderSource { │ │ │ │ │ - 38public: │ │ │ │ │ -39 static std::string GetCommonShaderSource(); │ │ │ │ │ - 40 │ │ │ │ │ -41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 class PatchTable; │ │ │ │ │ + 39 class StencilTable; │ │ │ │ │ + 40 class LimitStencilTable; │ │ │ │ │ + 41} │ │ │ │ │ 42 │ │ │ │ │ -43 static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ 44 │ │ │ │ │ -45 static std::string GetHullShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ - 46 │ │ │ │ │ -47 static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type); │ │ │ │ │ - 48}; │ │ │ │ │ - 49 │ │ │ │ │ - 50} // end namespace Osd │ │ │ │ │ - 51 │ │ │ │ │ - 52} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 53using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 54 │ │ │ │ │ - 55} // end namespace OpenSubdiv │ │ │ │ │ - 56 │ │ │ │ │ - 57#endif // OPENSUBDIV3_OSD_HLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ +52class GLStencilTableTBO { │ │ │ │ │ + 53public: │ │ │ │ │ +54 static GLStencilTableTBO *Create( │ │ │ │ │ + 55 Far::StencilTable const *stencilTable, void *deviceContext = NULL) { │ │ │ │ │ + 56 (void)deviceContext; // unused │ │ │ │ │ + 57 return new GLStencilTableTBO(stencilTable); │ │ │ │ │ + 58 } │ │ │ │ │ + 59 │ │ │ │ │ +60 static GLStencilTableTBO *Create( │ │ │ │ │ + 61 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ + 62 void *deviceContext = NULL) { │ │ │ │ │ + 63 (void)deviceContext; // unused │ │ │ │ │ + 64 return new GLStencilTableTBO(limitStencilTable); │ │ │ │ │ + 65 } │ │ │ │ │ + 66 │ │ │ │ │ +67 explicit GLStencilTableTBO(Far::StencilTable const *stencilTable); │ │ │ │ │ +68 explicit GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable); │ │ │ │ │ +69 ~GLStencilTableTBO(); │ │ │ │ │ + 70 │ │ │ │ │ + 71 // interfaces needed for GLSLTransformFeedbackKernel │ │ │ │ │ +72 GLuint GetSizesTexture() const { return _sizes; } │ │ │ │ │ +73 GLuint GetOffsetsTexture() const { return _offsets; } │ │ │ │ │ +74 GLuint GetIndicesTexture() const { return _indices; } │ │ │ │ │ +75 GLuint GetWeightsTexture() const { return _weights; } │ │ │ │ │ +76 GLuint GetDuWeightsTexture() const { return _duWeights; } │ │ │ │ │ +77 GLuint GetDvWeightsTexture() const { return _dvWeights; } │ │ │ │ │ +78 GLuint GetDuuWeightsTexture() const { return _duuWeights; } │ │ │ │ │ +79 GLuint GetDuvWeightsTexture() const { return _duvWeights; } │ │ │ │ │ +80 GLuint GetDvvWeightsTexture() const { return _dvvWeights; } │ │ │ │ │ +81 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 82 │ │ │ │ │ + 83private: │ │ │ │ │ + 84 GLuint _sizes; │ │ │ │ │ + 85 GLuint _offsets; │ │ │ │ │ + 86 GLuint _indices; │ │ │ │ │ + 87 GLuint _weights; │ │ │ │ │ + 88 GLuint _duWeights; │ │ │ │ │ + 89 GLuint _dvWeights; │ │ │ │ │ + 90 GLuint _duuWeights; │ │ │ │ │ + 91 GLuint _duvWeights; │ │ │ │ │ + 92 GLuint _dvvWeights; │ │ │ │ │ + 93 int _numStencils; │ │ │ │ │ + 94}; │ │ │ │ │ + 95 │ │ │ │ │ + 96// ------------------------------------------------------------------------- │ │ │ │ │ +-- │ │ │ │ │ + 97 │ │ │ │ │ +98class GLXFBEvaluator { │ │ │ │ │ + 99public: │ │ │ │ │ +100 typedef bool Instantiatable; │ │ │ │ │ + 101 │ │ │ │ │ + 103 template │ │ │ │ │ +104 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 105 BufferDescriptor const &dstDesc, │ │ │ │ │ + 106 BufferDescriptor const &duDesc, │ │ │ │ │ + 107 BufferDescriptor const &dvDesc, │ │ │ │ │ + 108 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ + 109 bool interleavedDerivativeBuffers = deviceContext │ │ │ │ │ + 110 ? deviceContext->AreInterleavedDerivativeBuffers() │ │ │ │ │ + 111 : false; │ │ │ │ │ + 112 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 113 interleavedDerivativeBuffers); │ │ │ │ │ + 114 } │ │ │ │ │ + 115 │ │ │ │ │ +117 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 118 BufferDescriptor const &dstDesc, │ │ │ │ │ + 119 BufferDescriptor const &duDesc, │ │ │ │ │ + 120 BufferDescriptor const &dvDesc, │ │ │ │ │ + 121 void * deviceContext) { │ │ │ │ │ + 122 (void)deviceContext; // not used │ │ │ │ │ + 123 return Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ + 124 } │ │ │ │ │ + 125 │ │ │ │ │ +126 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 127 BufferDescriptor const &dstDesc, │ │ │ │ │ + 128 BufferDescriptor const &duDesc, │ │ │ │ │ + 129 BufferDescriptor const &dvDesc, │ │ │ │ │ + 130 bool interleavedDerivativeBuffers = false) { │ │ │ │ │ + 131 GLXFBEvaluator *instance = new GLXFBEvaluator │ │ │ │ │ +(interleavedDerivativeBuffers); │ │ │ │ │ + 132 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc)) │ │ │ │ │ + 133 return instance; │ │ │ │ │ + 134 delete instance; │ │ │ │ │ + 135 return NULL; │ │ │ │ │ + 136 } │ │ │ │ │ + 137 │ │ │ │ │ + 139 template │ │ │ │ │ +140 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 141 BufferDescriptor const &dstDesc, │ │ │ │ │ + 142 BufferDescriptor const &duDesc, │ │ │ │ │ + 143 BufferDescriptor const &dvDesc, │ │ │ │ │ + 144 BufferDescriptor const &duuDesc, │ │ │ │ │ + 145 BufferDescriptor const &duvDesc, │ │ │ │ │ + 146 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 147 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ + 148 bool interleavedDerivativeBuffers = deviceContext │ │ │ │ │ + 149 ? deviceContext->AreInterleavedDerivativeBuffers() │ │ │ │ │ + 150 : false; │ │ │ │ │ + 151 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 152 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 153 interleavedDerivativeBuffers); │ │ │ │ │ + 154 } │ │ │ │ │ + 155 │ │ │ │ │ +157 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 158 BufferDescriptor const &dstDesc, │ │ │ │ │ + 159 BufferDescriptor const &duDesc, │ │ │ │ │ + 160 BufferDescriptor const &dvDesc, │ │ │ │ │ + 161 BufferDescriptor const &duuDesc, │ │ │ │ │ + 162 BufferDescriptor const &duvDesc, │ │ │ │ │ + 163 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 164 void * deviceContext) { │ │ │ │ │ + 165 (void)deviceContext; // not used │ │ │ │ │ + 166 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 167 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 168 } │ │ │ │ │ + 169 │ │ │ │ │ +170 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 171 BufferDescriptor const &dstDesc, │ │ │ │ │ + 172 BufferDescriptor const &duDesc, │ │ │ │ │ + 173 BufferDescriptor const &dvDesc, │ │ │ │ │ + 174 BufferDescriptor const &duuDesc, │ │ │ │ │ + 175 BufferDescriptor const &duvDesc, │ │ │ │ │ + 176 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 177 bool interleavedDerivativeBuffers = false) { │ │ │ │ │ + 178 GLXFBEvaluator *instance = new GLXFBEvaluator │ │ │ │ │ +(interleavedDerivativeBuffers); │ │ │ │ │ + 179 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 180 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ + 181 return instance; │ │ │ │ │ + 182 delete instance; │ │ │ │ │ + 183 return NULL; │ │ │ │ │ + 184 } │ │ │ │ │ + 185 │ │ │ │ │ +199 GLXFBEvaluator(bool interleavedDerivativeBuffers = false); │ │ │ │ │ + 200 │ │ │ │ │ +202 ~GLXFBEvaluator(); │ │ │ │ │ + 203 │ │ │ │ │ + 209 │ │ │ │ │ + 237 template │ │ │ │ │ +238 static bool EvalStencils( │ │ │ │ │ + 239 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 240 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 241 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 242 GLXFBEvaluator const *instance, │ │ │ │ │ + 243 void * deviceContext = NULL) { │ │ │ │ │ + 244 │ │ │ │ │ + 245 if (instance) { │ │ │ │ │ + 246 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 247 dstBuffer, dstDesc, │ │ │ │ │ + 248 stencilTable); │ │ │ │ │ + 249 } else { │ │ │ │ │ + 250 // Create an instance on demand (slow) │ │ │ │ │ + 251 (void)deviceContext; // unused │ │ │ │ │ + 252 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 253 BufferDescriptor(), │ │ │ │ │ + 254 BufferDescriptor()); │ │ │ │ │ + 255 if (instance) { │ │ │ │ │ + 256 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 257 dstBuffer, dstDesc, │ │ │ │ │ + 258 stencilTable); │ │ │ │ │ + 259 delete instance; │ │ │ │ │ + 260 return r; │ │ │ │ │ + 261 } │ │ │ │ │ + 262 return false; │ │ │ │ │ + 263 } │ │ │ │ │ + 264 } │ │ │ │ │ + 265 │ │ │ │ │ + 305 template │ │ │ │ │ +306 static bool EvalStencils( │ │ │ │ │ + 307 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 308 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 309 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 310 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 312 GLXFBEvaluator const *instance, │ │ │ │ │ + 313 void * deviceContext = NULL) { │ │ │ │ │ + 314 │ │ │ │ │ + 315 if (instance) { │ │ │ │ │ + 316 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 317 dstBuffer, dstDesc, │ │ │ │ │ + 318 duBuffer, duDesc, │ │ │ │ │ + 319 dvBuffer, dvDesc, │ │ │ │ │ + 320 stencilTable); │ │ │ │ │ + 321 } else { │ │ │ │ │ + 322 // Create an instance on demand (slow) │ │ │ │ │ + 323 (void)deviceContext; // unused │ │ │ │ │ + 324 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ + 325 if (instance) { │ │ │ │ │ + 326 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 327 dstBuffer, dstDesc, │ │ │ │ │ + 328 duBuffer, duDesc, │ │ │ │ │ + 329 dvBuffer, dvDesc, │ │ │ │ │ + 330 stencilTable); │ │ │ │ │ + 331 delete instance; │ │ │ │ │ + 332 return r; │ │ │ │ │ + 333 } │ │ │ │ │ + 334 return false; │ │ │ │ │ + 335 } │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ + 395 template │ │ │ │ │ +396 static bool EvalStencils( │ │ │ │ │ + 397 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 398 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 399 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 400 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 401 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 402 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 403 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 404 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 405 GLXFBEvaluator const *instance, │ │ │ │ │ + 406 void * deviceContext = NULL) { │ │ │ │ │ + 407 │ │ │ │ │ + 408 if (instance) { │ │ │ │ │ + 409 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 410 dstBuffer, dstDesc, │ │ │ │ │ + 411 duBuffer, duDesc, │ │ │ │ │ + 412 dvBuffer, dvDesc, │ │ │ │ │ + 413 duuBuffer, duuDesc, │ │ │ │ │ + 414 duvBuffer, duvDesc, │ │ │ │ │ + 415 dvvBuffer, dvvDesc, │ │ │ │ │ + 416 stencilTable); │ │ │ │ │ + 417 } else { │ │ │ │ │ + 418 // Create an instance on demand (slow) │ │ │ │ │ + 419 (void)deviceContext; // unused │ │ │ │ │ + 420 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 421 duDesc, dvDesc, │ │ │ │ │ + 422 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 423 if (instance) { │ │ │ │ │ + 424 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 425 dstBuffer, dstDesc, │ │ │ │ │ + 426 duBuffer, duDesc, │ │ │ │ │ + 427 dvBuffer, dvDesc, │ │ │ │ │ + 428 duuBuffer, duuDesc, │ │ │ │ │ + 429 duvBuffer, duvDesc, │ │ │ │ │ + 430 dvvBuffer, dvvDesc, │ │ │ │ │ + 431 stencilTable); │ │ │ │ │ + 432 delete instance; │ │ │ │ │ + 433 return r; │ │ │ │ │ + 434 } │ │ │ │ │ + 435 return false; │ │ │ │ │ + 436 } │ │ │ │ │ + 437 } │ │ │ │ │ + 438 │ │ │ │ │ + 456 template │ │ │ │ │ +457 bool EvalStencils( │ │ │ │ │ + 458 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 459 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 460 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 461 │ │ │ │ │ + 462 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 463 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 464 0, BufferDescriptor(), │ │ │ │ │ + 465 0, BufferDescriptor(), │ │ │ │ │ + 466 stencilTable->GetSizesTexture(), │ │ │ │ │ + 467 stencilTable->GetOffsetsTexture(), │ │ │ │ │ + 468 stencilTable->GetIndicesTexture(), │ │ │ │ │ + 469 stencilTable->GetWeightsTexture(), │ │ │ │ │ + 470 0, │ │ │ │ │ + 471 0, │ │ │ │ │ + 472 /* start = */ 0, │ │ │ │ │ + 473 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 474 } │ │ │ │ │ + 475 │ │ │ │ │ + 505 template │ │ │ │ │ +506 bool EvalStencils( │ │ │ │ │ + 507 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 508 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 509 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 510 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 511 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 512 │ │ │ │ │ + 513 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 514 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 515 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 516 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 517 stencilTable->GetSizesTexture(), │ │ │ │ │ + 518 stencilTable->GetOffsetsTexture(), │ │ │ │ │ + 519 stencilTable->GetIndicesTexture(), │ │ │ │ │ + 520 stencilTable->GetWeightsTexture(), │ │ │ │ │ + 521 stencilTable->GetDuWeightsTexture(), │ │ │ │ │ + 522 stencilTable->GetDvWeightsTexture(), │ │ │ │ │ + 523 /* start = */ 0, │ │ │ │ │ + 524 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 525 } │ │ │ │ │ + 526 │ │ │ │ │ + 574 template │ │ │ │ │ +575 bool EvalStencils( │ │ │ │ │ + 576 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 577 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 578 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 579 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 580 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 581 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 582 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 583 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 584 │ │ │ │ │ + 585 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 586 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 587 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 588 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 589 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 590 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 591 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 592 stencilTable->GetSizesTexture(), │ │ │ │ │ + 593 stencilTable->GetOffsetsTexture(), │ │ │ │ │ + 594 stencilTable->GetIndicesTexture(), │ │ │ │ │ + 595 stencilTable->GetWeightsTexture(), │ │ │ │ │ + 596 stencilTable->GetDuWeightsTexture(), │ │ │ │ │ + 597 stencilTable->GetDvWeightsTexture(), │ │ │ │ │ + 598 stencilTable->GetDuuWeightsTexture(), │ │ │ │ │ + 599 stencilTable->GetDuvWeightsTexture(), │ │ │ │ │ + 600 stencilTable->GetDvvWeightsTexture(), │ │ │ │ │ + 601 /* start = */ 0, │ │ │ │ │ + 602 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 603 } │ │ │ │ │ + 604 │ │ │ │ │ +640 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 641 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 642 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 643 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 644 GLuint sizesBuffer, │ │ │ │ │ + 645 GLuint offsetsBuffer, │ │ │ │ │ + 646 GLuint indicesBuffer, │ │ │ │ │ + 647 GLuint weightsBuffer, │ │ │ │ │ + 648 GLuint duWeightsBuffer, │ │ │ │ │ + 649 GLuint dvWeightsBuffer, │ │ │ │ │ + 650 int start, │ │ │ │ │ + 651 int end) const; │ │ │ │ │ + 652 │ │ │ │ │ +706 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 707 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 708 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 709 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 710 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 711 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 712 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 713 GLuint sizesBuffer, │ │ │ │ │ + 714 GLuint offsetsBuffer, │ │ │ │ │ + 715 GLuint indicesBuffer, │ │ │ │ │ + 716 GLuint weightsBuffer, │ │ │ │ │ + 717 GLuint duWeightsBuffer, │ │ │ │ │ + 718 GLuint dvWeightsBuffer, │ │ │ │ │ + 719 GLuint duuWeightsBuffer, │ │ │ │ │ + 720 GLuint duvWeightsBuffer, │ │ │ │ │ + 721 GLuint dvvWeightsBuffer, │ │ │ │ │ + 722 int start, │ │ │ │ │ + 723 int end) const; │ │ │ │ │ + 724 │ │ │ │ │ + 730 │ │ │ │ │ + 763 template │ │ │ │ │ +765 static bool EvalPatches( │ │ │ │ │ + 766 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 767 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 768 int numPatchCoords, │ │ │ │ │ + 769 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 770 PATCH_TABLE *patchTable, │ │ │ │ │ + 771 GLXFBEvaluator const *instance, │ │ │ │ │ + 772 void * deviceContext = NULL) { │ │ │ │ │ + 773 │ │ │ │ │ + 774 if (instance) { │ │ │ │ │ + 775 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 776 dstBuffer, dstDesc, │ │ │ │ │ + 777 numPatchCoords, patchCoords, │ │ │ │ │ + 778 patchTable); │ │ │ │ │ + 779 } else { │ │ │ │ │ + 780 // Create an instance on demand (slow) │ │ │ │ │ + 781 (void)deviceContext; // unused │ │ │ │ │ + 782 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 783 BufferDescriptor(), │ │ │ │ │ + 784 BufferDescriptor()); │ │ │ │ │ + 785 if (instance) { │ │ │ │ │ + 786 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 787 dstBuffer, dstDesc, │ │ │ │ │ + 788 numPatchCoords, patchCoords, │ │ │ │ │ + 789 patchTable); │ │ │ │ │ + 790 delete instance; │ │ │ │ │ + 791 return r; │ │ │ │ │ + 792 } │ │ │ │ │ + 793 return false; │ │ │ │ │ + 794 } │ │ │ │ │ + 795 } │ │ │ │ │ + 796 │ │ │ │ │ + 841 template │ │ │ │ │ +843 static bool EvalPatches( │ │ │ │ │ + 844 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 845 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 846 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 847 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 848 int numPatchCoords, │ │ │ │ │ + 849 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 850 PATCH_TABLE *patchTable, │ │ │ │ │ + 851 GLXFBEvaluator const *instance, │ │ │ │ │ + 852 void * deviceContext = NULL) { │ │ │ │ │ + 853 │ │ │ │ │ + 854 if (instance) { │ │ │ │ │ + 855 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 856 dstBuffer, dstDesc, │ │ │ │ │ + 857 duBuffer, duDesc, │ │ │ │ │ + 858 dvBuffer, dvDesc, │ │ │ │ │ + 859 numPatchCoords, patchCoords, │ │ │ │ │ + 860 patchTable); │ │ │ │ │ + 861 } else { │ │ │ │ │ + 862 // Create an instance on demand (slow) │ │ │ │ │ + 863 (void)deviceContext; // unused │ │ │ │ │ + 864 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ + 865 if (instance) { │ │ │ │ │ + 866 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 867 dstBuffer, dstDesc, │ │ │ │ │ + 868 duBuffer, duDesc, │ │ │ │ │ + 869 dvBuffer, dvDesc, │ │ │ │ │ + 870 numPatchCoords, patchCoords, │ │ │ │ │ + 871 patchTable); │ │ │ │ │ + 872 delete instance; │ │ │ │ │ + 873 return r; │ │ │ │ │ + 874 } │ │ │ │ │ + 875 return false; │ │ │ │ │ + 876 } │ │ │ │ │ + 877 } │ │ │ │ │ + 878 │ │ │ │ │ + 941 template │ │ │ │ │ +943 static bool EvalPatches( │ │ │ │ │ + 944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 946 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 947 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 948 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 949 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 950 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 951 int numPatchCoords, │ │ │ │ │ + 952 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 953 PATCH_TABLE *patchTable, │ │ │ │ │ + 954 GLXFBEvaluator const *instance, │ │ │ │ │ + 955 void * deviceContext = NULL) { │ │ │ │ │ + 956 │ │ │ │ │ + 957 if (instance) { │ │ │ │ │ + 958 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 959 dstBuffer, dstDesc, │ │ │ │ │ + 960 duBuffer, duDesc, │ │ │ │ │ + 961 dvBuffer, dvDesc, │ │ │ │ │ + 962 duuBuffer, duuDesc, │ │ │ │ │ + 963 duvBuffer, duvDesc, │ │ │ │ │ + 964 dvvBuffer, dvvDesc, │ │ │ │ │ + 965 numPatchCoords, patchCoords, │ │ │ │ │ + 966 patchTable); │ │ │ │ │ + 967 } else { │ │ │ │ │ + 968 // Create an instance on demand (slow) │ │ │ │ │ + 969 (void)deviceContext; // unused │ │ │ │ │ + 970 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 971 duDesc, dvDesc, │ │ │ │ │ + 972 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 973 if (instance) { │ │ │ │ │ + 974 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 975 dstBuffer, dstDesc, │ │ │ │ │ + 976 duBuffer, duDesc, │ │ │ │ │ + 977 dvBuffer, dvDesc, │ │ │ │ │ + 978 duuBuffer, duuDesc, │ │ │ │ │ + 979 duvBuffer, duvDesc, │ │ │ │ │ + 980 dvvBuffer, dvvDesc, │ │ │ │ │ + 981 numPatchCoords, patchCoords, │ │ │ │ │ + 982 patchTable); │ │ │ │ │ + 983 delete instance; │ │ │ │ │ + 984 return r; │ │ │ │ │ + 985 } │ │ │ │ │ + 986 return false; │ │ │ │ │ + 987 } │ │ │ │ │ + 988 } │ │ │ │ │ + 989 │ │ │ │ │ + 1014 template │ │ │ │ │ +1016 bool EvalPatches( │ │ │ │ │ + 1017 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1018 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1019 int numPatchCoords, │ │ │ │ │ + 1020 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1021 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1022 │ │ │ │ │ + 1023 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1024 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1025 0, BufferDescriptor(), │ │ │ │ │ + 1026 0, BufferDescriptor(), │ │ │ │ │ + 1027 numPatchCoords, │ │ │ │ │ + 1028 patchCoords->BindVBO(), │ │ │ │ │ + 1029 patchTable->GetPatchArrays(), │ │ │ │ │ + 1030 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ + 1031 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1032 } │ │ │ │ │ + 1033 │ │ │ │ │ + 1068 template │ │ │ │ │ +1070 bool EvalPatches( │ │ │ │ │ + 1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1073 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1074 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1075 int numPatchCoords, │ │ │ │ │ + 1076 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1077 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1078 │ │ │ │ │ + 1079 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1080 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1081 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1082 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1083 numPatchCoords, │ │ │ │ │ + 1084 patchCoords->BindVBO(), │ │ │ │ │ + 1085 patchTable->GetPatchArrays(), │ │ │ │ │ + 1086 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ + 1087 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1088 } │ │ │ │ │ + 1089 │ │ │ │ │ + 1142 template │ │ │ │ │ +1144 bool EvalPatches( │ │ │ │ │ + 1145 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1146 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1147 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1148 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1149 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1150 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1151 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1152 int numPatchCoords, │ │ │ │ │ + 1153 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1154 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1155 │ │ │ │ │ + 1156 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1157 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1158 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1159 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1160 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 1161 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 1162 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 1163 numPatchCoords, │ │ │ │ │ + 1164 patchCoords->BindVBO(), │ │ │ │ │ + 1165 patchTable->GetPatchArrays(), │ │ │ │ │ + 1166 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ + 1167 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1168 } │ │ │ │ │ + 1169 │ │ │ │ │ +1170 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1171 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1172 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1173 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1174 int numPatchCoords, │ │ │ │ │ + 1175 GLuint patchCoordsBuffer, │ │ │ │ │ + 1176 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1177 GLuint patchIndexBuffer, │ │ │ │ │ + 1178 GLuint patchParamsBuffer) const; │ │ │ │ │ + 1179 │ │ │ │ │ +1180 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1181 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1182 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1183 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1184 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1185 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1186 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1187 int numPatchCoords, │ │ │ │ │ + 1188 GLuint patchCoordsBuffer, │ │ │ │ │ + 1189 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1190 GLuint patchIndexBuffer, │ │ │ │ │ + 1191 GLuint patchParamsBuffer) const; │ │ │ │ │ + 1192 │ │ │ │ │ + 1225 template │ │ │ │ │ +1227 static bool EvalPatchesVarying( │ │ │ │ │ + 1228 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1229 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1230 int numPatchCoords, │ │ │ │ │ + 1231 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1232 PATCH_TABLE *patchTable, │ │ │ │ │ + 1233 GLXFBEvaluator const *instance, │ │ │ │ │ + 1234 void * deviceContext = NULL) { │ │ │ │ │ + 1235 │ │ │ │ │ + 1236 if (instance) { │ │ │ │ │ + 1237 return instance->EvalPatchesVarying( │ │ │ │ │ + 1238 srcBuffer, srcDesc, │ │ │ │ │ + 1239 dstBuffer, dstDesc, │ │ │ │ │ + 1240 numPatchCoords, patchCoords, │ │ │ │ │ + 1241 patchTable); │ │ │ │ │ + 1242 } else { │ │ │ │ │ + 1243 // Create an instance on demand (slow) │ │ │ │ │ + 1244 (void)deviceContext; // unused │ │ │ │ │ + 1245 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1246 BufferDescriptor(), │ │ │ │ │ + 1247 BufferDescriptor()); │ │ │ │ │ + 1248 if (instance) { │ │ │ │ │ + 1249 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1250 srcBuffer, srcDesc, │ │ │ │ │ + 1251 dstBuffer, dstDesc, │ │ │ │ │ + 1252 numPatchCoords, patchCoords, │ │ │ │ │ + 1253 patchTable); │ │ │ │ │ + 1254 delete instance; │ │ │ │ │ + 1255 return r; │ │ │ │ │ + 1256 } │ │ │ │ │ + 1257 return false; │ │ │ │ │ + 1258 } │ │ │ │ │ + 1259 } │ │ │ │ │ + 1260 │ │ │ │ │ + 1285 template │ │ │ │ │ +1287 bool EvalPatchesVarying( │ │ │ │ │ + 1288 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1289 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1290 int numPatchCoords, │ │ │ │ │ + 1291 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1292 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1293 │ │ │ │ │ + 1294 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1295 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1296 0, BufferDescriptor(), │ │ │ │ │ + 1297 0, BufferDescriptor(), │ │ │ │ │ + 1298 numPatchCoords, │ │ │ │ │ + 1299 patchCoords->BindVBO(), │ │ │ │ │ + 1300 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1301 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ + 1302 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1303 } │ │ │ │ │ + 1304 │ │ │ │ │ + 1349 template │ │ │ │ │ +1351 static bool EvalPatchesVarying( │ │ │ │ │ + 1352 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1353 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1354 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1355 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1356 int numPatchCoords, │ │ │ │ │ + 1357 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1358 PATCH_TABLE *patchTable, │ │ │ │ │ + 1359 GLXFBEvaluator const *instance, │ │ │ │ │ + 1360 void * deviceContext = NULL) { │ │ │ │ │ + 1361 │ │ │ │ │ + 1362 if (instance) { │ │ │ │ │ + 1363 return instance->EvalPatchesVarying( │ │ │ │ │ + 1364 srcBuffer, srcDesc, │ │ │ │ │ + 1365 dstBuffer, dstDesc, │ │ │ │ │ + 1366 duBuffer, duDesc, │ │ │ │ │ + 1367 dvBuffer, dvDesc, │ │ │ │ │ + 1368 numPatchCoords, patchCoords, │ │ │ │ │ + 1369 patchTable); │ │ │ │ │ + 1370 } else { │ │ │ │ │ + 1371 // Create an instance on demand (slow) │ │ │ │ │ + 1372 (void)deviceContext; // unused │ │ │ │ │ + 1373 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1374 duDesc, dvDesc); │ │ │ │ │ + 1375 if (instance) { │ │ │ │ │ + 1376 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1377 srcBuffer, srcDesc, │ │ │ │ │ + 1378 dstBuffer, dstDesc, │ │ │ │ │ + 1379 duBuffer, duDesc, │ │ │ │ │ + 1380 dvBuffer, dvDesc, │ │ │ │ │ + 1381 numPatchCoords, patchCoords, │ │ │ │ │ + 1382 patchTable); │ │ │ │ │ + 1383 delete instance; │ │ │ │ │ + 1384 return r; │ │ │ │ │ + 1385 } │ │ │ │ │ + 1386 return false; │ │ │ │ │ + 1387 } │ │ │ │ │ + 1388 } │ │ │ │ │ + 1389 │ │ │ │ │ + 1426 template │ │ │ │ │ +1428 bool EvalPatchesVarying( │ │ │ │ │ + 1429 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1430 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1431 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1432 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1433 int numPatchCoords, │ │ │ │ │ + 1434 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1435 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1436 │ │ │ │ │ + 1437 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1438 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1439 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1440 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1441 numPatchCoords, │ │ │ │ │ + 1442 patchCoords->BindVBO(), │ │ │ │ │ + 1443 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1444 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ + 1445 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1446 } │ │ │ │ │ + 1447 │ │ │ │ │ + 1510 template │ │ │ │ │ +1512 static bool EvalPatchesVarying( │ │ │ │ │ + 1513 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1514 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1515 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1516 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1517 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1518 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1519 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1520 int numPatchCoords, │ │ │ │ │ + 1521 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1522 PATCH_TABLE *patchTable, │ │ │ │ │ + 1523 GLXFBEvaluator const *instance, │ │ │ │ │ + 1524 void * deviceContext = NULL) { │ │ │ │ │ + 1525 │ │ │ │ │ + 1526 if (instance) { │ │ │ │ │ + 1527 return instance->EvalPatchesVarying( │ │ │ │ │ + 1528 srcBuffer, srcDesc, │ │ │ │ │ + 1529 dstBuffer, dstDesc, │ │ │ │ │ + 1530 duBuffer, duDesc, │ │ │ │ │ + 1531 dvBuffer, dvDesc, │ │ │ │ │ + 1532 duuBuffer, duuDesc, │ │ │ │ │ + 1533 duvBuffer, duvDesc, │ │ │ │ │ + 1534 dvvBuffer, dvvDesc, │ │ │ │ │ + 1535 numPatchCoords, patchCoords, │ │ │ │ │ + 1536 patchTable); │ │ │ │ │ + 1537 } else { │ │ │ │ │ + 1538 // Create an instance on demand (slow) │ │ │ │ │ + 1539 (void)deviceContext; // unused │ │ │ │ │ + 1540 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1541 duDesc, dvDesc, │ │ │ │ │ + 1542 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 1543 if (instance) { │ │ │ │ │ + 1544 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1545 srcBuffer, srcDesc, │ │ │ │ │ + 1546 dstBuffer, dstDesc, │ │ │ │ │ + 1547 duBuffer, duDesc, │ │ │ │ │ + 1548 dvBuffer, dvDesc, │ │ │ │ │ + 1549 duuBuffer, duuDesc, │ │ │ │ │ + 1550 duvBuffer, duvDesc, │ │ │ │ │ + 1551 dvvBuffer, dvvDesc, │ │ │ │ │ + 1552 numPatchCoords, patchCoords, │ │ │ │ │ + 1553 patchTable); │ │ │ │ │ + 1554 delete instance; │ │ │ │ │ + 1555 return r; │ │ │ │ │ + 1556 } │ │ │ │ │ + 1557 return false; │ │ │ │ │ + 1558 } │ │ │ │ │ + 1559 } │ │ │ │ │ + 1560 │ │ │ │ │ + 1615 template │ │ │ │ │ +1617 bool EvalPatchesVarying( │ │ │ │ │ + 1618 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1619 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1620 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1621 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1622 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1623 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1624 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1625 int numPatchCoords, │ │ │ │ │ + 1626 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1627 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1628 │ │ │ │ │ + 1629 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1630 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1631 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1632 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1633 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 1634 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 1635 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 1636 numPatchCoords, │ │ │ │ │ + 1637 patchCoords->BindVBO(), │ │ │ │ │ + 1638 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1639 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ + 1640 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ + 1641 } │ │ │ │ │ + 1642 │ │ │ │ │ + 1677 template │ │ │ │ │ +1679 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1680 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1681 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1682 int numPatchCoords, │ │ │ │ │ + 1683 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1684 PATCH_TABLE *patchTable, │ │ │ │ │ + 1685 int fvarChannel, │ │ │ │ │ + 1686 GLXFBEvaluator const *instance, │ │ │ │ │ + 1687 void * deviceContext = NULL) { │ │ │ │ │ + 1688 │ │ │ │ │ + 1689 if (instance) { │ │ │ │ │ + 1690 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1691 srcBuffer, srcDesc, │ │ │ │ │ + 1692 dstBuffer, dstDesc, │ │ │ │ │ + 1693 numPatchCoords, patchCoords, │ │ │ │ │ + 1694 patchTable, fvarChannel); │ │ │ │ │ + 1695 } else { │ │ │ │ │ + 1696 // Create an instance on demand (slow) │ │ │ │ │ + 1697 (void)deviceContext; // unused │ │ │ │ │ + 1698 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1699 BufferDescriptor(), │ │ │ │ │ + 1700 BufferDescriptor()); │ │ │ │ │ + 1701 if (instance) { │ │ │ │ │ + 1702 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1703 srcBuffer, srcDesc, │ │ │ │ │ + 1704 dstBuffer, dstDesc, │ │ │ │ │ + 1705 numPatchCoords, patchCoords, │ │ │ │ │ + 1706 patchTable, fvarChannel); │ │ │ │ │ + 1707 delete instance; │ │ │ │ │ + 1708 return r; │ │ │ │ │ + 1709 } │ │ │ │ │ + 1710 return false; │ │ │ │ │ + 1711 } │ │ │ │ │ + 1712 } │ │ │ │ │ + 1713 │ │ │ │ │ + 1740 template │ │ │ │ │ +1742 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1745 int numPatchCoords, │ │ │ │ │ + 1746 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1747 PATCH_TABLE *patchTable, │ │ │ │ │ + 1748 int fvarChannel = 0) const { │ │ │ │ │ + 1749 │ │ │ │ │ + 1750 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1751 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1752 0, BufferDescriptor(), │ │ │ │ │ + 1753 0, BufferDescriptor(), │ │ │ │ │ + 1754 numPatchCoords, │ │ │ │ │ + 1755 patchCoords->BindVBO(), │ │ │ │ │ + 1756 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1757 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ + 1758 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ + 1759 } │ │ │ │ │ + 1760 │ │ │ │ │ + 1807 template │ │ │ │ │ +1809 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1810 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1811 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1812 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1813 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1814 int numPatchCoords, │ │ │ │ │ + 1815 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1816 PATCH_TABLE *patchTable, │ │ │ │ │ + 1817 int fvarChannel, │ │ │ │ │ + 1818 GLXFBEvaluator const *instance, │ │ │ │ │ + 1819 void * deviceContext = NULL) { │ │ │ │ │ + 1820 │ │ │ │ │ + 1821 if (instance) { │ │ │ │ │ + 1822 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1823 srcBuffer, srcDesc, │ │ │ │ │ + 1824 dstBuffer, dstDesc, │ │ │ │ │ + 1825 duBuffer, duDesc, │ │ │ │ │ + 1826 dvBuffer, dvDesc, │ │ │ │ │ + 1827 numPatchCoords, patchCoords, │ │ │ │ │ + 1828 patchTable, fvarChannel); │ │ │ │ │ + 1829 } else { │ │ │ │ │ + 1830 // Create an instance on demand (slow) │ │ │ │ │ + 1831 (void)deviceContext; // unused │ │ │ │ │ + 1832 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1833 duDesc, dvDesc); │ │ │ │ │ + 1834 if (instance) { │ │ │ │ │ + 1835 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1836 srcBuffer, srcDesc, │ │ │ │ │ + 1837 dstBuffer, dstDesc, │ │ │ │ │ + 1838 duBuffer, duDesc, │ │ │ │ │ + 1839 dvBuffer, dvDesc, │ │ │ │ │ + 1840 numPatchCoords, patchCoords, │ │ │ │ │ + 1841 patchTable, fvarChannel); │ │ │ │ │ + 1842 delete instance; │ │ │ │ │ + 1843 return r; │ │ │ │ │ + 1844 } │ │ │ │ │ + 1845 return false; │ │ │ │ │ + 1846 } │ │ │ │ │ + 1847 } │ │ │ │ │ + 1848 │ │ │ │ │ + 1887 template │ │ │ │ │ +1889 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1894 int numPatchCoords, │ │ │ │ │ + 1895 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1896 PATCH_TABLE *patchTable, │ │ │ │ │ + 1897 int fvarChannel = 0) const { │ │ │ │ │ + 1898 │ │ │ │ │ + 1899 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1900 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1901 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1902 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1903 numPatchCoords, │ │ │ │ │ + 1904 patchCoords->BindVBO(), │ │ │ │ │ + 1905 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1906 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ + 1907 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ + 1908 } │ │ │ │ │ + 1909 │ │ │ │ │ + 1974 template │ │ │ │ │ +1976 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1977 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1978 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1979 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1980 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1981 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1982 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1983 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1984 int numPatchCoords, │ │ │ │ │ + 1985 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1986 PATCH_TABLE *patchTable, │ │ │ │ │ + 1987 int fvarChannel, │ │ │ │ │ + 1988 GLXFBEvaluator const *instance, │ │ │ │ │ + 1989 void * deviceContext = NULL) { │ │ │ │ │ + 1990 │ │ │ │ │ + 1991 if (instance) { │ │ │ │ │ + 1992 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1993 srcBuffer, srcDesc, │ │ │ │ │ + 1994 dstBuffer, dstDesc, │ │ │ │ │ + 1995 duBuffer, duDesc, │ │ │ │ │ + 1996 dvBuffer, dvDesc, │ │ │ │ │ + 1997 duuBuffer, duuDesc, │ │ │ │ │ + 1998 duvBuffer, duvDesc, │ │ │ │ │ + 1999 dvvBuffer, dvvDesc, │ │ │ │ │ + 2000 numPatchCoords, patchCoords, │ │ │ │ │ + 2001 patchTable, fvarChannel); │ │ │ │ │ + 2002 } else { │ │ │ │ │ + 2003 // Create an instance on demand (slow) │ │ │ │ │ + 2004 (void)deviceContext; // unused │ │ │ │ │ + 2005 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 2006 duDesc, dvDesc, │ │ │ │ │ + 2007 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 2008 if (instance) { │ │ │ │ │ + 2009 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 2010 srcBuffer, srcDesc, │ │ │ │ │ + 2011 dstBuffer, dstDesc, │ │ │ │ │ + 2012 duBuffer, duDesc, │ │ │ │ │ + 2013 dvBuffer, dvDesc, │ │ │ │ │ + 2014 duuBuffer, duuDesc, │ │ │ │ │ + 2015 duvBuffer, duvDesc, │ │ │ │ │ + 2016 dvvBuffer, dvvDesc, │ │ │ │ │ + 2017 numPatchCoords, patchCoords, │ │ │ │ │ + 2018 patchTable, fvarChannel); │ │ │ │ │ + 2019 delete instance; │ │ │ │ │ + 2020 return r; │ │ │ │ │ + 2021 } │ │ │ │ │ + 2022 return false; │ │ │ │ │ + 2023 } │ │ │ │ │ + 2024 } │ │ │ │ │ + 2025 │ │ │ │ │ + 2082 template │ │ │ │ │ +2084 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2085 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2086 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2087 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2088 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2089 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 2090 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 2091 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2092 int numPatchCoords, │ │ │ │ │ + 2093 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2094 PATCH_TABLE *patchTable, │ │ │ │ │ + 2095 int fvarChannel = 0) const { │ │ │ │ │ + 2096 │ │ │ │ │ + 2097 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 2098 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 2099 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 2100 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 2101 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 2102 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 2103 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 2104 numPatchCoords, │ │ │ │ │ + 2105 patchCoords->BindVBO(), │ │ │ │ │ + 2106 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 2107 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ + 2108 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ + 2109 } │ │ │ │ │ + 2110 │ │ │ │ │ + 2116 │ │ │ │ │ +2119 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2120 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2121 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ + 2122 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ + 2123 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ + 2124 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ + 2125 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ + 2126 │ │ │ │ │ +2128 static void Synchronize(void *kernel); │ │ │ │ │ + 2129 │ │ │ │ │ + 2130private: │ │ │ │ │ + 2131 GLuint _srcBufferTexture; │ │ │ │ │ + 2132 GLuint _patchArraysUBO; │ │ │ │ │ + 2133 bool _interleavedDerivativeBuffers; │ │ │ │ │ + 2134 │ │ │ │ │ + 2135 struct _StencilKernel { │ │ │ │ │ + 2136 _StencilKernel(); │ │ │ │ │ + 2137 ~_StencilKernel(); │ │ │ │ │ + 2138 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2139 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2140 BufferDescriptor const &duDesc, │ │ │ │ │ + 2141 BufferDescriptor const &dvDesc, │ │ │ │ │ + 2142 BufferDescriptor const &duuDesc, │ │ │ │ │ + 2143 BufferDescriptor const &duvDesc, │ │ │ │ │ + 2144 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2145 bool interleavedDerivativeBuffers); │ │ │ │ │ + 2146 GLuint program; │ │ │ │ │ + 2147 GLint uniformSrcBufferTexture; │ │ │ │ │ + 2148 GLint uniformSrcOffset; // src buffer offset (in elements) │ │ │ │ │ + 2149 │ │ │ │ │ + 2150 GLint uniformSizesTexture; │ │ │ │ │ + 2151 GLint uniformOffsetsTexture; │ │ │ │ │ + 2152 GLint uniformIndicesTexture; │ │ │ │ │ + 2153 GLint uniformWeightsTexture; │ │ │ │ │ + 2154 GLint uniformDuWeightsTexture; │ │ │ │ │ + 2155 GLint uniformDvWeightsTexture; │ │ │ │ │ + 2156 GLint uniformDuuWeightsTexture; │ │ │ │ │ + 2157 GLint uniformDuvWeightsTexture; │ │ │ │ │ + 2158 GLint uniformDvvWeightsTexture; │ │ │ │ │ + 2159 GLint uniformStart; // range │ │ │ │ │ + 2160 GLint uniformEnd; │ │ │ │ │ + 2161 } _stencilKernel; │ │ │ │ │ + 2162 │ │ │ │ │ + 2163 struct _PatchKernel { │ │ │ │ │ + 2164 _PatchKernel(); │ │ │ │ │ + 2165 ~_PatchKernel(); │ │ │ │ │ + 2166 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2167 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2168 BufferDescriptor const &duDesc, │ │ │ │ │ + 2169 BufferDescriptor const &dvDesc, │ │ │ │ │ + 2170 BufferDescriptor const &duuDesc, │ │ │ │ │ + 2171 BufferDescriptor const &duvDesc, │ │ │ │ │ + 2172 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2173 bool interleavedDerivativeBuffers); │ │ │ │ │ + 2174 GLuint program; │ │ │ │ │ + 2175 GLint uniformSrcBufferTexture; │ │ │ │ │ + 2176 GLint uniformSrcOffset; // src buffer offset (in elements) │ │ │ │ │ + 2177 │ │ │ │ │ + 2178 GLint uniformPatchArraysUBOBinding; │ │ │ │ │ + 2179 GLint uniformPatchParamTexture; │ │ │ │ │ + 2180 GLint uniformPatchIndexTexture; │ │ │ │ │ + 2181 } _patchKernel; │ │ │ │ │ + 2182 │ │ │ │ │ + 2183}; │ │ │ │ │ + 2184 │ │ │ │ │ + 2185} // end namespace Osd │ │ │ │ │ + 2186 │ │ │ │ │ + 2187} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 2188using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 2189 │ │ │ │ │ + 2190} // end namespace OpenSubdiv │ │ │ │ │ + 2191 │ │ │ │ │ + 2192 │ │ │ │ │ + 2193#endif // OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource │ │ │ │ │ -Definition: hlslPatchShaderSource.h:37 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ -GetVertexShaderSource │ │ │ │ │ -static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ -GetDomainShaderSource │ │ │ │ │ -static std::string GetDomainShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource::GetHullShaderSource │ │ │ │ │ -static std::string GetHullShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ -GetPatchBasisShaderSource │ │ │ │ │ -static std::string GetPatchBasisShaderSource() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::HLSLPatchShaderSource:: │ │ │ │ │ -GetCommonShaderSource │ │ │ │ │ -static std::string GetCommonShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ +Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:583 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO │ │ │ │ │ +GL TextureBuffer stencil table. │ │ │ │ │ +Definition: glXFBEvaluator.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetSizesTexture │ │ │ │ │ +GLuint GetSizesTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create │ │ │ │ │ +static GLStencilTableTBO * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Definition: glXFBEvaluator.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvvWeightsTexture │ │ │ │ │ +GLuint GetDvvWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Definition: glXFBEvaluator.h:81 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuvWeightsTexture │ │ │ │ │ +GLuint GetDuvWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuuWeightsTexture │ │ │ │ │ +GLuint GetDuuWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetIndicesTexture │ │ │ │ │ +GLuint GetIndicesTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::~GLStencilTableTBO │ │ │ │ │ +~GLStencilTableTBO() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO │ │ │ │ │ +GLStencilTableTBO(Far::StencilTable const *stencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO │ │ │ │ │ +GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetWeightsTexture │ │ │ │ │ +GLuint GetWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create │ │ │ │ │ +static GLStencilTableTBO * Create(Far::LimitStencilTable const │ │ │ │ │ +*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ +Definition: glXFBEvaluator.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvWeightsTexture │ │ │ │ │ +GLuint GetDvWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuWeightsTexture │ │ │ │ │ +GLuint GetDuWeightsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetOffsetsTexture │ │ │ │ │ +GLuint GetOffsetsTexture() const │ │ │ │ │ +Definition: glXFBEvaluator.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator │ │ │ │ │ +Definition: glXFBEvaluator.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1287 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, bool interleavedDerivativeBuffers=false) │ │ │ │ │ +Definition: glXFBEvaluator.h:126 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glXFBEvaluator.h:506 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::GLXFBEvaluator │ │ │ │ │ +GLXFBEvaluator(bool interleavedDerivativeBuffers=false) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glXFBEvaluator.h:575 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Instantiatable │ │ │ │ │ +bool Instantiatable │ │ │ │ │ +Definition: glXFBEvaluator.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ +const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int │ │ │ │ │ +numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ +GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glXFBEvaluator.h:396 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: glXFBEvaluator.h:1144 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, bool │ │ │ │ │ +interleavedDerivativeBuffers=false) │ │ │ │ │ +Definition: glXFBEvaluator.h:170 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, void *deviceContext) │ │ │ │ │ +Specialization to allow creation without a device context. │ │ │ │ │ +Definition: glXFBEvaluator.h:117 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glXFBEvaluator.h:306 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1351 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ +const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint │ │ │ │ │ +sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ +GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint │ │ │ │ │ +duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const │ │ │ │ │ +Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compile... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:843 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, │ │ │ │ │ +DEVICE_CONTEXT deviceContext) │ │ │ │ │ +Generic creator template. │ │ │ │ │ +Definition: glXFBEvaluator.h:140 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext) │ │ │ │ │ +Generic creator template. │ │ │ │ │ +Definition: glXFBEvaluator.h:104 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *kernel) │ │ │ │ │ +Wait the dispatched kernel finishes. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1227 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1617 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1889 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:765 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1809 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1016 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:943 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: glXFBEvaluator.h:1070 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ +*stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glXFBEvaluator.h:457 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int │ │ │ │ │ +numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ +GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ +static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void │ │ │ │ │ +*deviceContext) │ │ │ │ │ +Specialization to allow creation without a device context. │ │ │ │ │ +Definition: glXFBEvaluator.h:157 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) │ │ │ │ │ +const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:2084 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const │ │ │ │ │ +*instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1512 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ +GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const │ │ │ │ │ +Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compile... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1679 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glXFBEvaluator.h:238 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::~GLXFBEvaluator │ │ │ │ │ +~GLXFBEvaluator() │ │ │ │ │ +Destructor. note that the GL context must be made current. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Compile │ │ │ │ │ +bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ +BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ +BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvvDesc=BufferDescriptor()) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1428 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel=0) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1742 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glXFBEvaluator.h:1976 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * hlslPatchShaderSource.h │ │ │ │ │ + * glXFBEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00833.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11VertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glComputeEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,40 +83,47 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
d3d11VertexBuffer.h File Reference
│ │ │ │ +
glComputeEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  D3D11VertexBuffer
 Concrete vertex buffer class for DirectX subdivision and DirectX drawing. More...
class  GLStencilTableSSBO
 GL stencil table (Shader Storage buffer) More...
 
class  GLComputeEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,26 +5,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -d3d11VertexBuffer.h File Reference │ │ │ │ │ +glComputeEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../osd/opengl.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  D3D11VertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for DirectX subdivision and DirectX │ │ │ │ │ - drawing. More... │ │ │ │ │ +class  GLStencilTableSSBO │ │ │ │ │ +  GL stencil table (Shader Storage buffer) More... │ │ │ │ │ +  │ │ │ │ │ +class  GLComputeEvaluator │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ +  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11VertexBuffer.h │ │ │ │ │ + * glComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00833.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,4 @@ │ │ │ │ │ var a00833 = [ │ │ │ │ │ - ["D3D11VertexBuffer", "a01205.html", "a01205"] │ │ │ │ │ + ["GLStencilTableSSBO", "a01209.html", "a01209"], │ │ │ │ │ + ["GLComputeEvaluator", "a01213.html", "a01213"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00833_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11VertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glComputeEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
d3d11VertexBuffer.h
│ │ │ │ +
glComputeEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,89 +107,1072 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30struct ID3D11Buffer;
│ │ │ │ -
31struct ID3D11Device;
│ │ │ │ -
32struct ID3D11DeviceContext;
│ │ │ │ -
33struct ID3D11UnorderedAccessView;
│ │ │ │ -
34
│ │ │ │ -
35namespace OpenSubdiv {
│ │ │ │ -
36namespace OPENSUBDIV_VERSION {
│ │ │ │ -
37
│ │ │ │ -
38namespace Osd {
│ │ │ │ -
39
│ │ │ │ - │ │ │ │ -
47public:
│ │ │ │ -
49 static D3D11VertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
50 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ -
54
│ │ │ │ -
57 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
58 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
59
│ │ │ │ -
61 int GetNumElements() const;
│ │ │ │ -
62
│ │ │ │ -
64 int GetNumVertices() const;
│ │ │ │ -
65
│ │ │ │ -
67 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext);
│ │ │ │ +
30#include "../osd/opengl.h"
│ │ │ │ +
31#include "../osd/types.h"
│ │ │ │ +
32#include "../osd/bufferDescriptor.h"
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Far {
│ │ │ │ +
38 class PatchTable;
│ │ │ │ +
39 class StencilTable;
│ │ │ │ +
40 class LimitStencilTable;
│ │ │ │ +
41}
│ │ │ │ +
42
│ │ │ │ +
43namespace Osd {
│ │ │ │ +
44
│ │ │ │ + │ │ │ │ +
52public:
│ │ │ │ +
53 static GLStencilTableSSBO *Create(Far::StencilTable const *stencilTable,
│ │ │ │ +
54 void *deviceContext = NULL) {
│ │ │ │ +
55 (void)deviceContext; // unused
│ │ │ │ +
56 return new GLStencilTableSSBO(stencilTable);
│ │ │ │ +
57 }
│ │ │ │ + │ │ │ │ +
59 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ +
60 void *deviceContext = NULL) {
│ │ │ │ +
61 (void)deviceContext; // unused
│ │ │ │ +
62 return new GLStencilTableSSBO(limitStencilTable);
│ │ │ │ +
63 }
│ │ │ │ +
64
│ │ │ │ +
65 explicit GLStencilTableSSBO(Far::StencilTable const *stencilTable);
│ │ │ │ +
66 explicit GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable);
│ │ │ │ + │ │ │ │
68
│ │ │ │ -
70 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) {
│ │ │ │ -
71 return BindD3D11Buffer(deviceContext);
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ -
75 ID3D11UnorderedAccessView *BindD3D11UAV(ID3D11DeviceContext *deviceContext);
│ │ │ │ -
76
│ │ │ │ -
77protected:
│ │ │ │ -
79 D3D11VertexBuffer(int numElements, int numVertices);
│ │ │ │ +
69 // interfaces needed for GLSLComputeKernel
│ │ │ │ +
70 GLuint GetSizesBuffer() const { return _sizes; }
│ │ │ │ +
71 GLuint GetOffsetsBuffer() const { return _offsets; }
│ │ │ │ +
72 GLuint GetIndicesBuffer() const { return _indices; }
│ │ │ │ +
73 GLuint GetWeightsBuffer() const { return _weights; }
│ │ │ │ +
74 GLuint GetDuWeightsBuffer() const { return _duWeights; }
│ │ │ │ +
75 GLuint GetDvWeightsBuffer() const { return _dvWeights; }
│ │ │ │ +
76 GLuint GetDuuWeightsBuffer() const { return _duuWeights; }
│ │ │ │ +
77 GLuint GetDuvWeightsBuffer() const { return _duvWeights; }
│ │ │ │ +
78 GLuint GetDvvWeightsBuffer() const { return _dvvWeights; }
│ │ │ │ +
79 int GetNumStencils() const { return _numStencils; }
│ │ │ │
80
│ │ │ │ -
81 // Allocates D3D11 buffer
│ │ │ │ -
82 bool allocate(ID3D11Device *device);
│ │ │ │ -
83
│ │ │ │ -
84private:
│ │ │ │ -
85 int _numElements;
│ │ │ │ -
86 int _numVertices;
│ │ │ │ -
87 ID3D11Buffer *_buffer;
│ │ │ │ -
88 ID3D11Buffer *_uploadBuffer;
│ │ │ │ -
89 ID3D11UnorderedAccessView *_uav;
│ │ │ │ -
90};
│ │ │ │ -
91
│ │ │ │ -
92} // end namespace Osd
│ │ │ │ +
81private:
│ │ │ │ +
82 GLuint _sizes;
│ │ │ │ +
83 GLuint _offsets;
│ │ │ │ +
84 GLuint _indices;
│ │ │ │ +
85 GLuint _weights;
│ │ │ │ +
86 GLuint _duWeights;
│ │ │ │ +
87 GLuint _dvWeights;
│ │ │ │ +
88 GLuint _duuWeights;
│ │ │ │ +
89 GLuint _duvWeights;
│ │ │ │ +
90 GLuint _dvvWeights;
│ │ │ │ +
91 int _numStencils;
│ │ │ │ +
92};
│ │ │ │
93
│ │ │ │ -
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
96
│ │ │ │ -
97} // end namespace OpenSubdiv
│ │ │ │ -
98
│ │ │ │ -
99#endif // OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
94// ---------------------------------------------------------------------------
│ │ │ │ +
95
│ │ │ │ + │ │ │ │ +
97public:
│ │ │ │ +
98 typedef bool Instantiatable;
│ │ │ │ + │ │ │ │ +
100 BufferDescriptor const &dstDesc,
│ │ │ │ +
101 BufferDescriptor const &duDesc,
│ │ │ │ +
102 BufferDescriptor const &dvDesc,
│ │ │ │ +
103 void * deviceContext = NULL) {
│ │ │ │ +
104 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
108 deviceContext);
│ │ │ │ +
109 }
│ │ │ │ +
110
│ │ │ │ + │ │ │ │ +
112 BufferDescriptor const &dstDesc,
│ │ │ │ +
113 BufferDescriptor const &duDesc,
│ │ │ │ +
114 BufferDescriptor const &dvDesc,
│ │ │ │ +
115 BufferDescriptor const &duuDesc,
│ │ │ │ +
116 BufferDescriptor const &duvDesc,
│ │ │ │ +
117 BufferDescriptor const &dvvDesc,
│ │ │ │ +
118 void * deviceContext = NULL) {
│ │ │ │ +
119 (void)deviceContext; // not used
│ │ │ │ +
120 GLComputeEvaluator *instance = new GLComputeEvaluator();
│ │ │ │ +
121 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
122 duuDesc, duvDesc, dvvDesc))
│ │ │ │ +
123 return instance;
│ │ │ │ +
124 delete instance;
│ │ │ │ +
125 return NULL;
│ │ │ │ +
126 }
│ │ │ │ +
127
│ │ │ │ + │ │ │ │ +
130
│ │ │ │ + │ │ │ │ +
133
│ │ │ │ +
139
│ │ │ │ +
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
168 static bool EvalStencils(
│ │ │ │ +
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
171 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
172 GLComputeEvaluator const *instance,
│ │ │ │ +
173 void * deviceContext = NULL) {
│ │ │ │ +
174
│ │ │ │ +
175 if (instance) {
│ │ │ │ +
176 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
177 dstBuffer, dstDesc,
│ │ │ │ +
178 stencilTable);
│ │ │ │ +
179 } else {
│ │ │ │ +
180 // Create an instance on demand (slow)
│ │ │ │ +
181 (void)deviceContext; // unused
│ │ │ │ +
182 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
185 if (instance) {
│ │ │ │ +
186 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
187 dstBuffer, dstDesc,
│ │ │ │ +
188 stencilTable);
│ │ │ │ +
189 delete instance;
│ │ │ │ +
190 return r;
│ │ │ │ +
191 }
│ │ │ │ +
192 return false;
│ │ │ │ +
193 }
│ │ │ │ +
194 }
│ │ │ │ +
195
│ │ │ │ +
235 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
236 static bool EvalStencils(
│ │ │ │ +
237 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
238 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
239 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
240 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
241 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
242 GLComputeEvaluator const *instance,
│ │ │ │ +
243 void * deviceContext = NULL) {
│ │ │ │ +
244
│ │ │ │ +
245 if (instance) {
│ │ │ │ +
246 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
247 dstBuffer, dstDesc,
│ │ │ │ +
248 duBuffer, duDesc,
│ │ │ │ +
249 dvBuffer, dvDesc,
│ │ │ │ +
250 stencilTable);
│ │ │ │ +
251 } else {
│ │ │ │ +
252 // Create an instance on demand (slow)
│ │ │ │ +
253 (void)deviceContext; // unused
│ │ │ │ +
254 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ +
255 if (instance) {
│ │ │ │ +
256 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
257 dstBuffer, dstDesc,
│ │ │ │ +
258 duBuffer, duDesc,
│ │ │ │ +
259 dvBuffer, dvDesc,
│ │ │ │ +
260 stencilTable);
│ │ │ │ +
261 delete instance;
│ │ │ │ +
262 return r;
│ │ │ │ +
263 }
│ │ │ │ +
264 return false;
│ │ │ │ +
265 }
│ │ │ │ +
266 }
│ │ │ │ +
267
│ │ │ │ +
325 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
326 static bool EvalStencils(
│ │ │ │ +
327 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
328 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
329 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
330 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
331 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
332 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
333 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
334 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
335 GLComputeEvaluator const *instance,
│ │ │ │ +
336 void * deviceContext = NULL) {
│ │ │ │ +
337
│ │ │ │ +
338 if (instance) {
│ │ │ │ +
339 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
340 dstBuffer, dstDesc,
│ │ │ │ +
341 duBuffer, duDesc,
│ │ │ │ +
342 dvBuffer, dvDesc,
│ │ │ │ +
343 duuBuffer, duuDesc,
│ │ │ │ +
344 duvBuffer, duvDesc,
│ │ │ │ +
345 dvvBuffer, dvvDesc,
│ │ │ │ +
346 stencilTable);
│ │ │ │ +
347 } else {
│ │ │ │ +
348 // Create an instance on demand (slow)
│ │ │ │ +
349 (void)deviceContext; // unused
│ │ │ │ +
350 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ +
351 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
352 if (instance) {
│ │ │ │ +
353 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ +
354 dstBuffer, dstDesc,
│ │ │ │ +
355 duBuffer, duDesc,
│ │ │ │ +
356 dvBuffer, dvDesc,
│ │ │ │ +
357 duuBuffer, duuDesc,
│ │ │ │ +
358 duvBuffer, duvDesc,
│ │ │ │ +
359 dvvBuffer, dvvDesc,
│ │ │ │ +
360 stencilTable);
│ │ │ │ +
361 delete instance;
│ │ │ │ +
362 return r;
│ │ │ │ +
363 }
│ │ │ │ +
364 return false;
│ │ │ │ +
365 }
│ │ │ │ +
366 }
│ │ │ │ +
367
│ │ │ │ +
385 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
387 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
388 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
389 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
390 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
391 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
392 0, BufferDescriptor(),
│ │ │ │ +
393 0, BufferDescriptor(),
│ │ │ │ +
394 stencilTable->GetSizesBuffer(),
│ │ │ │ +
395 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
396 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
397 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
398 0,
│ │ │ │ +
399 0,
│ │ │ │ +
400 /* start = */ 0,
│ │ │ │ +
401 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
402 }
│ │ │ │ +
403
│ │ │ │ +
433 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
435 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
436 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
437 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
438 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
439 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
440 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
441 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
442 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
443 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
444 stencilTable->GetSizesBuffer(),
│ │ │ │ +
445 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
446 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
447 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
448 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
449 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
450 /* start = */ 0,
│ │ │ │ +
451 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
452 }
│ │ │ │ +
453
│ │ │ │ +
501 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ + │ │ │ │ +
503 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
504 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
505 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
506 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
507 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
508 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
509 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
510 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ +
511 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
512 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
513 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
514 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
515 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
516 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
517 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
518 stencilTable->GetSizesBuffer(),
│ │ │ │ +
519 stencilTable->GetOffsetsBuffer(),
│ │ │ │ +
520 stencilTable->GetIndicesBuffer(),
│ │ │ │ +
521 stencilTable->GetWeightsBuffer(),
│ │ │ │ +
522 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ +
523 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ +
524 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ +
525 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ +
526 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ +
527 /* start = */ 0,
│ │ │ │ +
528 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ +
529 }
│ │ │ │ +
530
│ │ │ │ +
566 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
567 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
568 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
569 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
570 GLuint sizesBuffer,
│ │ │ │ +
571 GLuint offsetsBuffer,
│ │ │ │ +
572 GLuint indicesBuffer,
│ │ │ │ +
573 GLuint weightsBuffer,
│ │ │ │ +
574 GLuint duWeightsBuffer,
│ │ │ │ +
575 GLuint dvWeightsBuffer,
│ │ │ │ +
576 int start,
│ │ │ │ +
577 int end) const;
│ │ │ │ +
578
│ │ │ │ +
632 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
633 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
634 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
635 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
636 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
637 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
638 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
639 GLuint sizesBuffer,
│ │ │ │ +
640 GLuint offsetsBuffer,
│ │ │ │ +
641 GLuint indicesBuffer,
│ │ │ │ +
642 GLuint weightsBuffer,
│ │ │ │ +
643 GLuint duWeightsBuffer,
│ │ │ │ +
644 GLuint dvWeightsBuffer,
│ │ │ │ +
645 GLuint duuWeightsBuffer,
│ │ │ │ +
646 GLuint duvWeightsBuffer,
│ │ │ │ +
647 GLuint dvvWeightsBuffer,
│ │ │ │ +
648 int start,
│ │ │ │ +
649 int end) const;
│ │ │ │ +
650
│ │ │ │ +
656
│ │ │ │ +
689 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
690 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
691 static bool EvalPatches(
│ │ │ │ +
692 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
693 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
694 int numPatchCoords,
│ │ │ │ +
695 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
696 PATCH_TABLE *patchTable,
│ │ │ │ +
697 GLComputeEvaluator const *instance,
│ │ │ │ +
698 void * deviceContext = NULL) {
│ │ │ │ +
699
│ │ │ │ +
700 if (instance) {
│ │ │ │ +
701 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
702 dstBuffer, dstDesc,
│ │ │ │ +
703 numPatchCoords, patchCoords,
│ │ │ │ +
704 patchTable);
│ │ │ │ +
705 } else {
│ │ │ │ +
706 // Create an instance on demand (slow)
│ │ │ │ +
707 (void)deviceContext; // unused
│ │ │ │ +
708 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
711 if (instance) {
│ │ │ │ +
712 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
713 dstBuffer, dstDesc,
│ │ │ │ +
714 numPatchCoords, patchCoords,
│ │ │ │ +
715 patchTable);
│ │ │ │ +
716 delete instance;
│ │ │ │ +
717 return r;
│ │ │ │ +
718 }
│ │ │ │ +
719 return false;
│ │ │ │ +
720 }
│ │ │ │ +
721 }
│ │ │ │ +
722
│ │ │ │ +
767 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
768 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
769 static bool EvalPatches(
│ │ │ │ +
770 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
771 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
772 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
773 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
774 int numPatchCoords,
│ │ │ │ +
775 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
776 PATCH_TABLE *patchTable,
│ │ │ │ +
777 GLComputeEvaluator const *instance,
│ │ │ │ +
778 void * deviceContext = NULL) {
│ │ │ │ +
779
│ │ │ │ +
780 if (instance) {
│ │ │ │ +
781 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
782 dstBuffer, dstDesc,
│ │ │ │ +
783 duBuffer, duDesc,
│ │ │ │ +
784 dvBuffer, dvDesc,
│ │ │ │ +
785 numPatchCoords, patchCoords,
│ │ │ │ +
786 patchTable);
│ │ │ │ +
787 } else {
│ │ │ │ +
788 // Create an instance on demand (slow)
│ │ │ │ +
789 (void)deviceContext; // unused
│ │ │ │ +
790 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
791 duDesc, dvDesc);
│ │ │ │ +
792 if (instance) {
│ │ │ │ +
793 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
794 dstBuffer, dstDesc,
│ │ │ │ +
795 duBuffer, duDesc,
│ │ │ │ +
796 dvBuffer, dvDesc,
│ │ │ │ +
797 numPatchCoords, patchCoords,
│ │ │ │ +
798 patchTable);
│ │ │ │ +
799 delete instance;
│ │ │ │ +
800 return r;
│ │ │ │ +
801 }
│ │ │ │ +
802 return false;
│ │ │ │ +
803 }
│ │ │ │ +
804 }
│ │ │ │ +
805
│ │ │ │ +
868 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
869 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
870 static bool EvalPatches(
│ │ │ │ +
871 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
872 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
873 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
874 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
875 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
876 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
877 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
878 int numPatchCoords,
│ │ │ │ +
879 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
880 PATCH_TABLE *patchTable,
│ │ │ │ +
881 GLComputeEvaluator const *instance,
│ │ │ │ +
882 void * deviceContext = NULL) {
│ │ │ │ +
883
│ │ │ │ +
884 if (instance) {
│ │ │ │ +
885 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
886 dstBuffer, dstDesc,
│ │ │ │ +
887 duBuffer, duDesc,
│ │ │ │ +
888 dvBuffer, dvDesc,
│ │ │ │ +
889 duuBuffer, duuDesc,
│ │ │ │ +
890 duvBuffer, duvDesc,
│ │ │ │ +
891 dvvBuffer, dvvDesc,
│ │ │ │ +
892 numPatchCoords, patchCoords,
│ │ │ │ +
893 patchTable);
│ │ │ │ +
894 } else {
│ │ │ │ +
895 // Create an instance on demand (slow)
│ │ │ │ +
896 (void)deviceContext; // unused
│ │ │ │ +
897 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
898 duDesc, dvDesc,
│ │ │ │ +
899 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
900 if (instance) {
│ │ │ │ +
901 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ +
902 dstBuffer, dstDesc,
│ │ │ │ +
903 duBuffer, duDesc,
│ │ │ │ +
904 dvBuffer, dvDesc,
│ │ │ │ +
905 duuBuffer, duuDesc,
│ │ │ │ +
906 duvBuffer, duvDesc,
│ │ │ │ +
907 dvvBuffer, dvvDesc,
│ │ │ │ +
908 numPatchCoords, patchCoords,
│ │ │ │ +
909 patchTable);
│ │ │ │ +
910 delete instance;
│ │ │ │ +
911 return r;
│ │ │ │ +
912 }
│ │ │ │ +
913 return false;
│ │ │ │ +
914 }
│ │ │ │ +
915 }
│ │ │ │ +
916
│ │ │ │ +
941 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
942 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
946 int numPatchCoords,
│ │ │ │ +
947 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
948 PATCH_TABLE *patchTable) const {
│ │ │ │ +
949
│ │ │ │ +
950 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
951 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
952 0, BufferDescriptor(),
│ │ │ │ +
953 0, BufferDescriptor(),
│ │ │ │ +
954 numPatchCoords,
│ │ │ │ +
955 patchCoords->BindVBO(),
│ │ │ │ +
956 patchTable->GetPatchArrays(),
│ │ │ │ +
957 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
958 patchTable->GetPatchParamBuffer());
│ │ │ │ +
959 }
│ │ │ │ +
960
│ │ │ │ +
995 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
996 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
998 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
999 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1000 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1001 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1002 int numPatchCoords,
│ │ │ │ +
1003 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1004 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1005
│ │ │ │ +
1006 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1007 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1008 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1009 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1010 numPatchCoords,
│ │ │ │ +
1011 patchCoords->BindVBO(),
│ │ │ │ +
1012 patchTable->GetPatchArrays(),
│ │ │ │ +
1013 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1014 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1015 }
│ │ │ │ +
1016
│ │ │ │ +
1069 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1070 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1072 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1073 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1074 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1075 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1076 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1077 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1078 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1079 int numPatchCoords,
│ │ │ │ +
1080 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1081 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1082
│ │ │ │ +
1083 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1084 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1085 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1086 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1087 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
1088 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
1089 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
1090 numPatchCoords,
│ │ │ │ +
1091 patchCoords->BindVBO(),
│ │ │ │ +
1092 patchTable->GetPatchArrays(),
│ │ │ │ +
1093 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
1094 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1095 }
│ │ │ │ +
1096
│ │ │ │ +
1097 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1098 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1099 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1100 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1101 int numPatchCoords,
│ │ │ │ +
1102 GLuint patchCoordsBuffer,
│ │ │ │ +
1103 const PatchArrayVector &patchArrays,
│ │ │ │ +
1104 GLuint patchIndexBuffer,
│ │ │ │ +
1105 GLuint patchParamsBuffer) const;
│ │ │ │ +
1106
│ │ │ │ +
1107 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1108 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1109 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1110 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1111 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1112 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1113 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1114 int numPatchCoords,
│ │ │ │ +
1115 GLuint patchCoordsBuffer,
│ │ │ │ +
1116 const PatchArrayVector &patchArrays,
│ │ │ │ +
1117 GLuint patchIndexBuffer,
│ │ │ │ +
1118 GLuint patchParamsBuffer) const;
│ │ │ │ +
1119
│ │ │ │ +
1152 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1153 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1155 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1156 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1157 int numPatchCoords,
│ │ │ │ +
1158 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1159 PATCH_TABLE *patchTable,
│ │ │ │ +
1160 GLComputeEvaluator const *instance,
│ │ │ │ +
1161 void * deviceContext = NULL) {
│ │ │ │ +
1162
│ │ │ │ +
1163 if (instance) {
│ │ │ │ +
1164 return instance->EvalPatchesVarying(
│ │ │ │ +
1165 srcBuffer, srcDesc,
│ │ │ │ +
1166 dstBuffer, dstDesc,
│ │ │ │ +
1167 numPatchCoords, patchCoords,
│ │ │ │ +
1168 patchTable);
│ │ │ │ +
1169 } else {
│ │ │ │ +
1170 // Create an instance on demand (slow)
│ │ │ │ +
1171 (void)deviceContext; // unused
│ │ │ │ +
1172 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1175 if (instance) {
│ │ │ │ +
1176 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1177 srcBuffer, srcDesc,
│ │ │ │ +
1178 dstBuffer, dstDesc,
│ │ │ │ +
1179 numPatchCoords, patchCoords,
│ │ │ │ +
1180 patchTable);
│ │ │ │ +
1181 delete instance;
│ │ │ │ +
1182 return r;
│ │ │ │ +
1183 }
│ │ │ │ +
1184 return false;
│ │ │ │ +
1185 }
│ │ │ │ +
1186 }
│ │ │ │ +
1187
│ │ │ │ +
1212 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1213 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1215 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1216 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1217 int numPatchCoords,
│ │ │ │ +
1218 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1219 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1220
│ │ │ │ +
1221 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1222 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1223 0, BufferDescriptor(),
│ │ │ │ +
1224 0, BufferDescriptor(),
│ │ │ │ +
1225 numPatchCoords,
│ │ │ │ +
1226 patchCoords->BindVBO(),
│ │ │ │ +
1227 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1228 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1229 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1230 }
│ │ │ │ +
1231
│ │ │ │ +
1276 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1277 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1279 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1280 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1281 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1282 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1283 int numPatchCoords,
│ │ │ │ +
1284 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1285 PATCH_TABLE *patchTable,
│ │ │ │ +
1286 GLComputeEvaluator const *instance,
│ │ │ │ +
1287 void * deviceContext = NULL) {
│ │ │ │ +
1288
│ │ │ │ +
1289 if (instance) {
│ │ │ │ +
1290 return instance->EvalPatchesVarying(
│ │ │ │ +
1291 srcBuffer, srcDesc,
│ │ │ │ +
1292 dstBuffer, dstDesc,
│ │ │ │ +
1293 duBuffer, duDesc,
│ │ │ │ +
1294 dvBuffer, dvDesc,
│ │ │ │ +
1295 numPatchCoords, patchCoords,
│ │ │ │ +
1296 patchTable);
│ │ │ │ +
1297 } else {
│ │ │ │ +
1298 // Create an instance on demand (slow)
│ │ │ │ +
1299 (void)deviceContext; // unused
│ │ │ │ +
1300 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1301 duDesc, dvDesc);
│ │ │ │ +
1302 if (instance) {
│ │ │ │ +
1303 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1304 srcBuffer, srcDesc,
│ │ │ │ +
1305 dstBuffer, dstDesc,
│ │ │ │ +
1306 duBuffer, duDesc,
│ │ │ │ +
1307 dvBuffer, dvDesc,
│ │ │ │ +
1308 numPatchCoords, patchCoords,
│ │ │ │ +
1309 patchTable);
│ │ │ │ +
1310 delete instance;
│ │ │ │ +
1311 return r;
│ │ │ │ +
1312 }
│ │ │ │ +
1313 return false;
│ │ │ │ +
1314 }
│ │ │ │ +
1315 }
│ │ │ │ +
1316
│ │ │ │ +
1353 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1354 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1356 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1357 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1358 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1359 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1360 int numPatchCoords,
│ │ │ │ +
1361 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1362 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1363
│ │ │ │ +
1364 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1365 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1366 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1367 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1368 numPatchCoords,
│ │ │ │ +
1369 patchCoords->BindVBO(),
│ │ │ │ +
1370 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1371 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1372 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1373 }
│ │ │ │ +
1374
│ │ │ │ +
1437 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1438 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1440 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1441 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1442 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1443 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1444 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1445 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1446 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1447 int numPatchCoords,
│ │ │ │ +
1448 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1449 PATCH_TABLE *patchTable,
│ │ │ │ +
1450 GLComputeEvaluator const *instance,
│ │ │ │ +
1451 void * deviceContext = NULL) {
│ │ │ │ +
1452
│ │ │ │ +
1453 if (instance) {
│ │ │ │ +
1454 return instance->EvalPatchesVarying(
│ │ │ │ +
1455 srcBuffer, srcDesc,
│ │ │ │ +
1456 dstBuffer, dstDesc,
│ │ │ │ +
1457 duBuffer, duDesc,
│ │ │ │ +
1458 dvBuffer, dvDesc,
│ │ │ │ +
1459 duuBuffer, duuDesc,
│ │ │ │ +
1460 duvBuffer, duvDesc,
│ │ │ │ +
1461 dvvBuffer, dvvDesc,
│ │ │ │ +
1462 numPatchCoords, patchCoords,
│ │ │ │ +
1463 patchTable);
│ │ │ │ +
1464 } else {
│ │ │ │ +
1465 // Create an instance on demand (slow)
│ │ │ │ +
1466 (void)deviceContext; // unused
│ │ │ │ +
1467 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1468 duDesc, dvDesc,
│ │ │ │ +
1469 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
1470 if (instance) {
│ │ │ │ +
1471 bool r = instance->EvalPatchesVarying(
│ │ │ │ +
1472 srcBuffer, srcDesc,
│ │ │ │ +
1473 dstBuffer, dstDesc,
│ │ │ │ +
1474 duBuffer, duDesc,
│ │ │ │ +
1475 dvBuffer, dvDesc,
│ │ │ │ +
1476 duuBuffer, duuDesc,
│ │ │ │ +
1477 duvBuffer, duvDesc,
│ │ │ │ +
1478 dvvBuffer, dvvDesc,
│ │ │ │ +
1479 numPatchCoords, patchCoords,
│ │ │ │ +
1480 patchTable);
│ │ │ │ +
1481 delete instance;
│ │ │ │ +
1482 return r;
│ │ │ │ +
1483 }
│ │ │ │ +
1484 return false;
│ │ │ │ +
1485 }
│ │ │ │ +
1486 }
│ │ │ │ +
1487
│ │ │ │ +
1542 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1543 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1545 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1546 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1547 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1548 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1549 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1550 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1551 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1552 int numPatchCoords,
│ │ │ │ +
1553 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1554 PATCH_TABLE *patchTable) const {
│ │ │ │ +
1555
│ │ │ │ +
1556 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1557 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1558 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1559 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1560 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
1561 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
1562 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
1563 numPatchCoords,
│ │ │ │ +
1564 patchCoords->BindVBO(),
│ │ │ │ +
1565 patchTable->GetVaryingPatchArrays(),
│ │ │ │ +
1566 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
1567 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1568 }
│ │ │ │ +
1569
│ │ │ │ +
1604 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1605 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1609 int numPatchCoords,
│ │ │ │ +
1610 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1611 PATCH_TABLE *patchTable,
│ │ │ │ +
1612 int fvarChannel,
│ │ │ │ +
1613 GLComputeEvaluator const *instance,
│ │ │ │ +
1614 void * deviceContext = NULL) {
│ │ │ │ +
1615
│ │ │ │ +
1616 if (instance) {
│ │ │ │ +
1617 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1618 srcBuffer, srcDesc,
│ │ │ │ +
1619 dstBuffer, dstDesc,
│ │ │ │ +
1620 numPatchCoords, patchCoords,
│ │ │ │ +
1621 patchTable, fvarChannel);
│ │ │ │ +
1622 } else {
│ │ │ │ +
1623 // Create an instance on demand (slow)
│ │ │ │ +
1624 (void)deviceContext; // unused
│ │ │ │ +
1625 instance = Create(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
1628 if (instance) {
│ │ │ │ +
1629 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1630 srcBuffer, srcDesc,
│ │ │ │ +
1631 dstBuffer, dstDesc,
│ │ │ │ +
1632 numPatchCoords, patchCoords,
│ │ │ │ +
1633 patchTable, fvarChannel);
│ │ │ │ +
1634 delete instance;
│ │ │ │ +
1635 return r;
│ │ │ │ +
1636 }
│ │ │ │ +
1637 return false;
│ │ │ │ +
1638 }
│ │ │ │ +
1639 }
│ │ │ │ +
1640
│ │ │ │ +
1667 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1668 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1670 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1671 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1672 int numPatchCoords,
│ │ │ │ +
1673 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1674 PATCH_TABLE *patchTable,
│ │ │ │ +
1675 int fvarChannel = 0) const {
│ │ │ │ +
1676
│ │ │ │ +
1677 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1678 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1679 0, BufferDescriptor(),
│ │ │ │ +
1680 0, BufferDescriptor(),
│ │ │ │ +
1681 numPatchCoords,
│ │ │ │ +
1682 patchCoords->BindVBO(),
│ │ │ │ +
1683 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1684 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1685 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1686 }
│ │ │ │ +
1687
│ │ │ │ +
1734 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1735 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1737 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1738 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1739 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1740 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1741 int numPatchCoords,
│ │ │ │ +
1742 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1743 PATCH_TABLE *patchTable,
│ │ │ │ +
1744 int fvarChannel,
│ │ │ │ +
1745 GLComputeEvaluator const *instance,
│ │ │ │ +
1746 void * deviceContext = NULL) {
│ │ │ │ +
1747
│ │ │ │ +
1748 if (instance) {
│ │ │ │ +
1749 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1750 srcBuffer, srcDesc,
│ │ │ │ +
1751 dstBuffer, dstDesc,
│ │ │ │ +
1752 duBuffer, duDesc,
│ │ │ │ +
1753 dvBuffer, dvDesc,
│ │ │ │ +
1754 numPatchCoords, patchCoords,
│ │ │ │ +
1755 patchTable, fvarChannel);
│ │ │ │ +
1756 } else {
│ │ │ │ +
1757 // Create an instance on demand (slow)
│ │ │ │ +
1758 (void)deviceContext; // unused
│ │ │ │ +
1759 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1760 duDesc, dvDesc);
│ │ │ │ +
1761 if (instance) {
│ │ │ │ +
1762 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1763 srcBuffer, srcDesc,
│ │ │ │ +
1764 dstBuffer, dstDesc,
│ │ │ │ +
1765 duBuffer, duDesc,
│ │ │ │ +
1766 dvBuffer, dvDesc,
│ │ │ │ +
1767 numPatchCoords, patchCoords,
│ │ │ │ +
1768 patchTable, fvarChannel);
│ │ │ │ +
1769 delete instance;
│ │ │ │ +
1770 return r;
│ │ │ │ +
1771 }
│ │ │ │ +
1772 return false;
│ │ │ │ +
1773 }
│ │ │ │ +
1774 }
│ │ │ │ +
1775
│ │ │ │ +
1814 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1815 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1817 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1818 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1819 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1820 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1821 int numPatchCoords,
│ │ │ │ +
1822 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1823 PATCH_TABLE *patchTable,
│ │ │ │ +
1824 int fvarChannel = 0) const {
│ │ │ │ +
1825
│ │ │ │ +
1826 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
1827 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
1828 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
1829 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
1830 numPatchCoords,
│ │ │ │ +
1831 patchCoords->BindVBO(),
│ │ │ │ +
1832 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
1833 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1834 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1835 }
│ │ │ │ +
1836
│ │ │ │ +
1901 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1902 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1904 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1905 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1906 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1907 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1908 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1909 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1910 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1911 int numPatchCoords,
│ │ │ │ +
1912 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1913 PATCH_TABLE *patchTable,
│ │ │ │ +
1914 int fvarChannel,
│ │ │ │ +
1915 GLComputeEvaluator const *instance,
│ │ │ │ +
1916 void * deviceContext = NULL) {
│ │ │ │ +
1917
│ │ │ │ +
1918 if (instance) {
│ │ │ │ +
1919 return instance->EvalPatchesFaceVarying(
│ │ │ │ +
1920 srcBuffer, srcDesc,
│ │ │ │ +
1921 dstBuffer, dstDesc,
│ │ │ │ +
1922 duBuffer, duDesc,
│ │ │ │ +
1923 dvBuffer, dvDesc,
│ │ │ │ +
1924 duuBuffer, duuDesc,
│ │ │ │ +
1925 duvBuffer, duvDesc,
│ │ │ │ +
1926 dvvBuffer, dvvDesc,
│ │ │ │ +
1927 numPatchCoords, patchCoords,
│ │ │ │ +
1928 patchTable, fvarChannel);
│ │ │ │ +
1929 } else {
│ │ │ │ +
1930 // Create an instance on demand (slow)
│ │ │ │ +
1931 (void)deviceContext; // unused
│ │ │ │ +
1932 instance = Create(srcDesc, dstDesc,
│ │ │ │ +
1933 duDesc, dvDesc,
│ │ │ │ +
1934 duuDesc, duvDesc, dvvDesc);
│ │ │ │ +
1935 if (instance) {
│ │ │ │ +
1936 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ +
1937 srcBuffer, srcDesc,
│ │ │ │ +
1938 dstBuffer, dstDesc,
│ │ │ │ +
1939 duBuffer, duDesc,
│ │ │ │ +
1940 dvBuffer, dvDesc,
│ │ │ │ +
1941 duuBuffer, duuDesc,
│ │ │ │ +
1942 duvBuffer, duvDesc,
│ │ │ │ +
1943 dvvBuffer, dvvDesc,
│ │ │ │ +
1944 numPatchCoords, patchCoords,
│ │ │ │ +
1945 patchTable, fvarChannel);
│ │ │ │ +
1946 delete instance;
│ │ │ │ +
1947 return r;
│ │ │ │ +
1948 }
│ │ │ │ +
1949 return false;
│ │ │ │ +
1950 }
│ │ │ │ +
1951 }
│ │ │ │ +
1952
│ │ │ │ +
2009 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
2010 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
2012 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
2013 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
2014 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
2015 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
2016 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
2017 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
2018 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
2019 int numPatchCoords,
│ │ │ │ +
2020 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
2021 PATCH_TABLE *patchTable,
│ │ │ │ +
2022 int fvarChannel = 0) const {
│ │ │ │ +
2023
│ │ │ │ +
2024 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ +
2025 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ +
2026 duBuffer->BindVBO(), duDesc,
│ │ │ │ +
2027 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ +
2028 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ +
2029 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ +
2030 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ +
2031 numPatchCoords,
│ │ │ │ +
2032 patchCoords->BindVBO(),
│ │ │ │ +
2033 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ +
2034 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
2035 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
2036 }
│ │ │ │ +
2037
│ │ │ │ +
2043
│ │ │ │ +
2046 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2047 BufferDescriptor const &dstDesc,
│ │ │ │ +
2048 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ +
2049 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ +
2050 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ +
2051 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ +
2052 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ +
2053
│ │ │ │ +
2055 static void Synchronize(void *deviceContext);
│ │ │ │ +
2056
│ │ │ │ +
2057private:
│ │ │ │ +
2058 struct _StencilKernel {
│ │ │ │ +
2059 _StencilKernel();
│ │ │ │ +
2060 ~_StencilKernel();
│ │ │ │ +
2061 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2062 BufferDescriptor const &dstDesc,
│ │ │ │ +
2063 BufferDescriptor const &duDesc,
│ │ │ │ +
2064 BufferDescriptor const &dvDesc,
│ │ │ │ +
2065 BufferDescriptor const &duuDesc,
│ │ │ │ +
2066 BufferDescriptor const &duvDesc,
│ │ │ │ +
2067 BufferDescriptor const &dvvDesc,
│ │ │ │ +
2068 int workGroupSize);
│ │ │ │ +
2069 GLuint program;
│ │ │ │ +
2070 GLuint uniformStart;
│ │ │ │ +
2071 GLuint uniformEnd;
│ │ │ │ +
2072 GLuint uniformSrcOffset;
│ │ │ │ +
2073 GLuint uniformDstOffset;
│ │ │ │ +
2074 GLuint uniformDuDesc;
│ │ │ │ +
2075 GLuint uniformDvDesc;
│ │ │ │ +
2076 GLuint uniformDuuDesc;
│ │ │ │ +
2077 GLuint uniformDuvDesc;
│ │ │ │ +
2078 GLuint uniformDvvDesc;
│ │ │ │ +
2079 } _stencilKernel;
│ │ │ │ +
2080
│ │ │ │ +
2081 struct _PatchKernel {
│ │ │ │ +
2082 _PatchKernel();
│ │ │ │ +
2083 ~_PatchKernel();
│ │ │ │ +
2084 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ +
2085 BufferDescriptor const &dstDesc,
│ │ │ │ +
2086 BufferDescriptor const &duDesc,
│ │ │ │ +
2087 BufferDescriptor const &dvDesc,
│ │ │ │ +
2088 BufferDescriptor const &duuDesc,
│ │ │ │ +
2089 BufferDescriptor const &duvDesc,
│ │ │ │ +
2090 BufferDescriptor const &dvvDesc,
│ │ │ │ +
2091 int workGroupSize);
│ │ │ │ +
2092 GLuint program;
│ │ │ │ +
2093 GLuint uniformSrcOffset;
│ │ │ │ +
2094 GLuint uniformDstOffset;
│ │ │ │ +
2095 GLuint uniformPatchArray;
│ │ │ │ +
2096 GLuint uniformDuDesc;
│ │ │ │ +
2097 GLuint uniformDvDesc;
│ │ │ │ +
2098 GLuint uniformDuuDesc;
│ │ │ │ +
2099 GLuint uniformDuvDesc;
│ │ │ │ +
2100 GLuint uniformDvvDesc;
│ │ │ │ +
2101 } _patchKernel;
│ │ │ │ +
2102
│ │ │ │ +
2103 int _workGroupSize;
│ │ │ │ +
2104 GLuint _patchArraysSSBO;
│ │ │ │ +
2105};
│ │ │ │ +
2106
│ │ │ │ +
2107} // end namespace Osd
│ │ │ │ +
2108
│ │ │ │ +
2109} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
2110using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
2111
│ │ │ │ +
2112} // end namespace OpenSubdiv
│ │ │ │ +
2113
│ │ │ │ +
2114
│ │ │ │ +
2115#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for DirectX subdivision and DirectX drawing.
│ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, ID3D11DeviceContext *deviceContext)
│ │ │ │ -
static D3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
│ │ │ │ -
D3D11VertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
│ │ │ │ - │ │ │ │ -
ID3D11UnorderedAccessView * BindD3D11UAV(ID3D11DeviceContext *deviceContext)
Returns the D3D11 UAV.
│ │ │ │ - │ │ │ │ -
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)
│ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ +
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ +
GL stencil table (Shader Storage buffer)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
GLStencilTableSSBO(Far::StencilTable const *stencilTable)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static GLStencilTableSSBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static GLStencilTableSSBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
│ │ │ │ + │ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ + │ │ │ │ +
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ +
~GLComputeEvaluator()
Destructor. note that the GL context must be made current.
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ + │ │ │ │ +
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ +
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext=NULL)
│ │ │ │ +
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ +
static void Synchronize(void *deviceContext)
Wait the dispatched kernel finishes.
│ │ │ │ +
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ +
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext=NULL)
│ │ │ │ +
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -d3d11VertexBuffer.h │ │ │ │ │ +glComputeEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,106 +30,1365 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30struct ID3D11Buffer; │ │ │ │ │ - 31struct ID3D11Device; │ │ │ │ │ - 32struct ID3D11DeviceContext; │ │ │ │ │ - 33struct ID3D11UnorderedAccessView; │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace OpenSubdiv { │ │ │ │ │ - 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 37 │ │ │ │ │ - 38namespace Osd { │ │ │ │ │ - 39 │ │ │ │ │ -46class D3D11VertexBuffer { │ │ │ │ │ - 47public: │ │ │ │ │ -49 static D3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 50 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 51 │ │ │ │ │ -53 virtual ~D3D11VertexBuffer(); │ │ │ │ │ - 54 │ │ │ │ │ -57 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 58 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 59 │ │ │ │ │ -61 int GetNumElements() const; │ │ │ │ │ - 62 │ │ │ │ │ -64 int GetNumVertices() const; │ │ │ │ │ - 65 │ │ │ │ │ -67 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext); │ │ │ │ │ + 30#include "../osd/opengl.h" │ │ │ │ │ + 31#include "../osd/types.h" │ │ │ │ │ + 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Far { │ │ │ │ │ + 38 class PatchTable; │ │ │ │ │ + 39 class StencilTable; │ │ │ │ │ + 40 class LimitStencilTable; │ │ │ │ │ + 41} │ │ │ │ │ + 42 │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ + 44 │ │ │ │ │ +51class GLStencilTableSSBO { │ │ │ │ │ + 52public: │ │ │ │ │ +53 static GLStencilTableSSBO *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ + 54 void *deviceContext = NULL) { │ │ │ │ │ + 55 (void)deviceContext; // unused │ │ │ │ │ + 56 return new GLStencilTableSSBO(stencilTable); │ │ │ │ │ + 57 } │ │ │ │ │ +58 static GLStencilTableSSBO *Create( │ │ │ │ │ + 59 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ + 60 void *deviceContext = NULL) { │ │ │ │ │ + 61 (void)deviceContext; // unused │ │ │ │ │ + 62 return new GLStencilTableSSBO(limitStencilTable); │ │ │ │ │ + 63 } │ │ │ │ │ + 64 │ │ │ │ │ +65 explicit GLStencilTableSSBO(Far::StencilTable const *stencilTable); │ │ │ │ │ +66 explicit GLStencilTableSSBO(Far::LimitStencilTable const │ │ │ │ │ +*limitStencilTable); │ │ │ │ │ +67 ~GLStencilTableSSBO(); │ │ │ │ │ 68 │ │ │ │ │ -70 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) { │ │ │ │ │ - 71 return BindD3D11Buffer(deviceContext); │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ -75 ID3D11UnorderedAccessView *BindD3D11UAV(ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 76 │ │ │ │ │ - 77protected: │ │ │ │ │ -79 D3D11VertexBuffer(int numElements, int numVertices); │ │ │ │ │ + 69 // interfaces needed for GLSLComputeKernel │ │ │ │ │ +70 GLuint GetSizesBuffer() const { return _sizes; } │ │ │ │ │ +71 GLuint GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ +72 GLuint GetIndicesBuffer() const { return _indices; } │ │ │ │ │ +73 GLuint GetWeightsBuffer() const { return _weights; } │ │ │ │ │ +74 GLuint GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ +75 GLuint GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ +76 GLuint GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ +77 GLuint GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ +78 GLuint GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ +79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ 80 │ │ │ │ │ - 81 // Allocates D3D11 buffer │ │ │ │ │ -82 bool allocate(ID3D11Device *device); │ │ │ │ │ - 83 │ │ │ │ │ - 84private: │ │ │ │ │ - 85 int _numElements; │ │ │ │ │ - 86 int _numVertices; │ │ │ │ │ - 87 ID3D11Buffer *_buffer; │ │ │ │ │ - 88 ID3D11Buffer *_uploadBuffer; │ │ │ │ │ - 89 ID3D11UnorderedAccessView *_uav; │ │ │ │ │ - 90}; │ │ │ │ │ - 91 │ │ │ │ │ - 92} // end namespace Osd │ │ │ │ │ + 81private: │ │ │ │ │ + 82 GLuint _sizes; │ │ │ │ │ + 83 GLuint _offsets; │ │ │ │ │ + 84 GLuint _indices; │ │ │ │ │ + 85 GLuint _weights; │ │ │ │ │ + 86 GLuint _duWeights; │ │ │ │ │ + 87 GLuint _dvWeights; │ │ │ │ │ + 88 GLuint _duuWeights; │ │ │ │ │ + 89 GLuint _duvWeights; │ │ │ │ │ + 90 GLuint _dvvWeights; │ │ │ │ │ + 91 int _numStencils; │ │ │ │ │ + 92}; │ │ │ │ │ 93 │ │ │ │ │ - 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 96 │ │ │ │ │ - 97} // end namespace OpenSubdiv │ │ │ │ │ - 98 │ │ │ │ │ - 99#endif // OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 94// ------------------------------------------------------------------------- │ │ │ │ │ +-- │ │ │ │ │ + 95 │ │ │ │ │ +96class GLComputeEvaluator { │ │ │ │ │ + 97public: │ │ │ │ │ +98 typedef bool Instantiatable; │ │ │ │ │ +99 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 100 BufferDescriptor const &dstDesc, │ │ │ │ │ + 101 BufferDescriptor const &duDesc, │ │ │ │ │ + 102 BufferDescriptor const &dvDesc, │ │ │ │ │ + 103 void * deviceContext = NULL) { │ │ │ │ │ + 104 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 105 BufferDescriptor(), │ │ │ │ │ + 106 BufferDescriptor(), │ │ │ │ │ + 107 BufferDescriptor(), │ │ │ │ │ + 108 deviceContext); │ │ │ │ │ + 109 } │ │ │ │ │ + 110 │ │ │ │ │ +111 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ + 112 BufferDescriptor const &dstDesc, │ │ │ │ │ + 113 BufferDescriptor const &duDesc, │ │ │ │ │ + 114 BufferDescriptor const &dvDesc, │ │ │ │ │ + 115 BufferDescriptor const &duuDesc, │ │ │ │ │ + 116 BufferDescriptor const &duvDesc, │ │ │ │ │ + 117 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 118 void * deviceContext = NULL) { │ │ │ │ │ + 119 (void)deviceContext; // not used │ │ │ │ │ + 120 GLComputeEvaluator *instance = new GLComputeEvaluator(); │ │ │ │ │ + 121 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 122 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ + 123 return instance; │ │ │ │ │ + 124 delete instance; │ │ │ │ │ + 125 return NULL; │ │ │ │ │ + 126 } │ │ │ │ │ + 127 │ │ │ │ │ +129 GLComputeEvaluator(); │ │ │ │ │ + 130 │ │ │ │ │ +132 ~GLComputeEvaluator(); │ │ │ │ │ + 133 │ │ │ │ │ + 139 │ │ │ │ │ + 167 template │ │ │ │ │ +168 static bool EvalStencils( │ │ │ │ │ + 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 171 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 172 GLComputeEvaluator const *instance, │ │ │ │ │ + 173 void * deviceContext = NULL) { │ │ │ │ │ + 174 │ │ │ │ │ + 175 if (instance) { │ │ │ │ │ + 176 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 177 dstBuffer, dstDesc, │ │ │ │ │ + 178 stencilTable); │ │ │ │ │ + 179 } else { │ │ │ │ │ + 180 // Create an instance on demand (slow) │ │ │ │ │ + 181 (void)deviceContext; // unused │ │ │ │ │ + 182 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 183 BufferDescriptor(), │ │ │ │ │ + 184 BufferDescriptor()); │ │ │ │ │ + 185 if (instance) { │ │ │ │ │ + 186 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 187 dstBuffer, dstDesc, │ │ │ │ │ + 188 stencilTable); │ │ │ │ │ + 189 delete instance; │ │ │ │ │ + 190 return r; │ │ │ │ │ + 191 } │ │ │ │ │ + 192 return false; │ │ │ │ │ + 193 } │ │ │ │ │ + 194 } │ │ │ │ │ + 195 │ │ │ │ │ + 235 template │ │ │ │ │ +236 static bool EvalStencils( │ │ │ │ │ + 237 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 238 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 239 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 240 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 241 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 242 GLComputeEvaluator const *instance, │ │ │ │ │ + 243 void * deviceContext = NULL) { │ │ │ │ │ + 244 │ │ │ │ │ + 245 if (instance) { │ │ │ │ │ + 246 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 247 dstBuffer, dstDesc, │ │ │ │ │ + 248 duBuffer, duDesc, │ │ │ │ │ + 249 dvBuffer, dvDesc, │ │ │ │ │ + 250 stencilTable); │ │ │ │ │ + 251 } else { │ │ │ │ │ + 252 // Create an instance on demand (slow) │ │ │ │ │ + 253 (void)deviceContext; // unused │ │ │ │ │ + 254 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ + 255 if (instance) { │ │ │ │ │ + 256 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 257 dstBuffer, dstDesc, │ │ │ │ │ + 258 duBuffer, duDesc, │ │ │ │ │ + 259 dvBuffer, dvDesc, │ │ │ │ │ + 260 stencilTable); │ │ │ │ │ + 261 delete instance; │ │ │ │ │ + 262 return r; │ │ │ │ │ + 263 } │ │ │ │ │ + 264 return false; │ │ │ │ │ + 265 } │ │ │ │ │ + 266 } │ │ │ │ │ + 267 │ │ │ │ │ + 325 template │ │ │ │ │ +326 static bool EvalStencils( │ │ │ │ │ + 327 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 328 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 329 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 330 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 331 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 332 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 333 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 334 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 335 GLComputeEvaluator const *instance, │ │ │ │ │ + 336 void * deviceContext = NULL) { │ │ │ │ │ + 337 │ │ │ │ │ + 338 if (instance) { │ │ │ │ │ + 339 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 340 dstBuffer, dstDesc, │ │ │ │ │ + 341 duBuffer, duDesc, │ │ │ │ │ + 342 dvBuffer, dvDesc, │ │ │ │ │ + 343 duuBuffer, duuDesc, │ │ │ │ │ + 344 duvBuffer, duvDesc, │ │ │ │ │ + 345 dvvBuffer, dvvDesc, │ │ │ │ │ + 346 stencilTable); │ │ │ │ │ + 347 } else { │ │ │ │ │ + 348 // Create an instance on demand (slow) │ │ │ │ │ + 349 (void)deviceContext; // unused │ │ │ │ │ + 350 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ + 351 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 352 if (instance) { │ │ │ │ │ + 353 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ + 354 dstBuffer, dstDesc, │ │ │ │ │ + 355 duBuffer, duDesc, │ │ │ │ │ + 356 dvBuffer, dvDesc, │ │ │ │ │ + 357 duuBuffer, duuDesc, │ │ │ │ │ + 358 duvBuffer, duvDesc, │ │ │ │ │ + 359 dvvBuffer, dvvDesc, │ │ │ │ │ + 360 stencilTable); │ │ │ │ │ + 361 delete instance; │ │ │ │ │ + 362 return r; │ │ │ │ │ + 363 } │ │ │ │ │ + 364 return false; │ │ │ │ │ + 365 } │ │ │ │ │ + 366 } │ │ │ │ │ + 367 │ │ │ │ │ + 385 template │ │ │ │ │ +386 bool EvalStencils( │ │ │ │ │ + 387 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 388 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 389 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 390 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 391 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 392 0, BufferDescriptor(), │ │ │ │ │ + 393 0, BufferDescriptor(), │ │ │ │ │ + 394 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 395 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 396 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 397 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 398 0, │ │ │ │ │ + 399 0, │ │ │ │ │ + 400 /* start = */ 0, │ │ │ │ │ + 401 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 402 } │ │ │ │ │ + 403 │ │ │ │ │ + 433 template │ │ │ │ │ +434 bool EvalStencils( │ │ │ │ │ + 435 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 436 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 437 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 438 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 439 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 440 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 441 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 442 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 443 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 444 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 445 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 446 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 447 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 448 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 449 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 450 /* start = */ 0, │ │ │ │ │ + 451 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 452 } │ │ │ │ │ + 453 │ │ │ │ │ + 501 template │ │ │ │ │ +502 bool EvalStencils( │ │ │ │ │ + 503 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 504 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 505 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 506 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 507 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 508 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 509 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 510 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ + 511 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 512 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 513 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 514 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 515 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 516 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 517 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 518 stencilTable->GetSizesBuffer(), │ │ │ │ │ + 519 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ + 520 stencilTable->GetIndicesBuffer(), │ │ │ │ │ + 521 stencilTable->GetWeightsBuffer(), │ │ │ │ │ + 522 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ + 523 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ + 524 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ + 525 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ + 526 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ + 527 /* start = */ 0, │ │ │ │ │ + 528 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 529 } │ │ │ │ │ + 530 │ │ │ │ │ +566 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 567 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 568 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 569 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 570 GLuint sizesBuffer, │ │ │ │ │ + 571 GLuint offsetsBuffer, │ │ │ │ │ + 572 GLuint indicesBuffer, │ │ │ │ │ + 573 GLuint weightsBuffer, │ │ │ │ │ + 574 GLuint duWeightsBuffer, │ │ │ │ │ + 575 GLuint dvWeightsBuffer, │ │ │ │ │ + 576 int start, │ │ │ │ │ + 577 int end) const; │ │ │ │ │ + 578 │ │ │ │ │ +632 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 633 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 634 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 635 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 636 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 637 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 638 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 639 GLuint sizesBuffer, │ │ │ │ │ + 640 GLuint offsetsBuffer, │ │ │ │ │ + 641 GLuint indicesBuffer, │ │ │ │ │ + 642 GLuint weightsBuffer, │ │ │ │ │ + 643 GLuint duWeightsBuffer, │ │ │ │ │ + 644 GLuint dvWeightsBuffer, │ │ │ │ │ + 645 GLuint duuWeightsBuffer, │ │ │ │ │ + 646 GLuint duvWeightsBuffer, │ │ │ │ │ + 647 GLuint dvvWeightsBuffer, │ │ │ │ │ + 648 int start, │ │ │ │ │ + 649 int end) const; │ │ │ │ │ + 650 │ │ │ │ │ + 656 │ │ │ │ │ + 689 template │ │ │ │ │ +691 static bool EvalPatches( │ │ │ │ │ + 692 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 693 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 694 int numPatchCoords, │ │ │ │ │ + 695 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 696 PATCH_TABLE *patchTable, │ │ │ │ │ + 697 GLComputeEvaluator const *instance, │ │ │ │ │ + 698 void * deviceContext = NULL) { │ │ │ │ │ + 699 │ │ │ │ │ + 700 if (instance) { │ │ │ │ │ + 701 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 702 dstBuffer, dstDesc, │ │ │ │ │ + 703 numPatchCoords, patchCoords, │ │ │ │ │ + 704 patchTable); │ │ │ │ │ + 705 } else { │ │ │ │ │ + 706 // Create an instance on demand (slow) │ │ │ │ │ + 707 (void)deviceContext; // unused │ │ │ │ │ + 708 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 709 BufferDescriptor(), │ │ │ │ │ + 710 BufferDescriptor()); │ │ │ │ │ + 711 if (instance) { │ │ │ │ │ + 712 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 713 dstBuffer, dstDesc, │ │ │ │ │ + 714 numPatchCoords, patchCoords, │ │ │ │ │ + 715 patchTable); │ │ │ │ │ + 716 delete instance; │ │ │ │ │ + 717 return r; │ │ │ │ │ + 718 } │ │ │ │ │ + 719 return false; │ │ │ │ │ + 720 } │ │ │ │ │ + 721 } │ │ │ │ │ + 722 │ │ │ │ │ + 767 template │ │ │ │ │ +769 static bool EvalPatches( │ │ │ │ │ + 770 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 771 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 772 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 773 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 774 int numPatchCoords, │ │ │ │ │ + 775 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 776 PATCH_TABLE *patchTable, │ │ │ │ │ + 777 GLComputeEvaluator const *instance, │ │ │ │ │ + 778 void * deviceContext = NULL) { │ │ │ │ │ + 779 │ │ │ │ │ + 780 if (instance) { │ │ │ │ │ + 781 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 782 dstBuffer, dstDesc, │ │ │ │ │ + 783 duBuffer, duDesc, │ │ │ │ │ + 784 dvBuffer, dvDesc, │ │ │ │ │ + 785 numPatchCoords, patchCoords, │ │ │ │ │ + 786 patchTable); │ │ │ │ │ + 787 } else { │ │ │ │ │ + 788 // Create an instance on demand (slow) │ │ │ │ │ + 789 (void)deviceContext; // unused │ │ │ │ │ + 790 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 791 duDesc, dvDesc); │ │ │ │ │ + 792 if (instance) { │ │ │ │ │ + 793 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 794 dstBuffer, dstDesc, │ │ │ │ │ + 795 duBuffer, duDesc, │ │ │ │ │ + 796 dvBuffer, dvDesc, │ │ │ │ │ + 797 numPatchCoords, patchCoords, │ │ │ │ │ + 798 patchTable); │ │ │ │ │ + 799 delete instance; │ │ │ │ │ + 800 return r; │ │ │ │ │ + 801 } │ │ │ │ │ + 802 return false; │ │ │ │ │ + 803 } │ │ │ │ │ + 804 } │ │ │ │ │ + 805 │ │ │ │ │ + 868 template │ │ │ │ │ +870 static bool EvalPatches( │ │ │ │ │ + 871 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 872 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 873 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 874 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 875 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 876 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 877 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 878 int numPatchCoords, │ │ │ │ │ + 879 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 880 PATCH_TABLE *patchTable, │ │ │ │ │ + 881 GLComputeEvaluator const *instance, │ │ │ │ │ + 882 void * deviceContext = NULL) { │ │ │ │ │ + 883 │ │ │ │ │ + 884 if (instance) { │ │ │ │ │ + 885 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 886 dstBuffer, dstDesc, │ │ │ │ │ + 887 duBuffer, duDesc, │ │ │ │ │ + 888 dvBuffer, dvDesc, │ │ │ │ │ + 889 duuBuffer, duuDesc, │ │ │ │ │ + 890 duvBuffer, duvDesc, │ │ │ │ │ + 891 dvvBuffer, dvvDesc, │ │ │ │ │ + 892 numPatchCoords, patchCoords, │ │ │ │ │ + 893 patchTable); │ │ │ │ │ + 894 } else { │ │ │ │ │ + 895 // Create an instance on demand (slow) │ │ │ │ │ + 896 (void)deviceContext; // unused │ │ │ │ │ + 897 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 898 duDesc, dvDesc, │ │ │ │ │ + 899 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 900 if (instance) { │ │ │ │ │ + 901 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ + 902 dstBuffer, dstDesc, │ │ │ │ │ + 903 duBuffer, duDesc, │ │ │ │ │ + 904 dvBuffer, dvDesc, │ │ │ │ │ + 905 duuBuffer, duuDesc, │ │ │ │ │ + 906 duvBuffer, duvDesc, │ │ │ │ │ + 907 dvvBuffer, dvvDesc, │ │ │ │ │ + 908 numPatchCoords, patchCoords, │ │ │ │ │ + 909 patchTable); │ │ │ │ │ + 910 delete instance; │ │ │ │ │ + 911 return r; │ │ │ │ │ + 912 } │ │ │ │ │ + 913 return false; │ │ │ │ │ + 914 } │ │ │ │ │ + 915 } │ │ │ │ │ + 916 │ │ │ │ │ + 941 template │ │ │ │ │ +943 bool EvalPatches( │ │ │ │ │ + 944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 946 int numPatchCoords, │ │ │ │ │ + 947 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 948 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 949 │ │ │ │ │ + 950 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 951 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 952 0, BufferDescriptor(), │ │ │ │ │ + 953 0, BufferDescriptor(), │ │ │ │ │ + 954 numPatchCoords, │ │ │ │ │ + 955 patchCoords->BindVBO(), │ │ │ │ │ + 956 patchTable->GetPatchArrays(), │ │ │ │ │ + 957 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 958 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 959 } │ │ │ │ │ + 960 │ │ │ │ │ + 995 template │ │ │ │ │ +997 bool EvalPatches( │ │ │ │ │ + 998 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 999 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1000 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1001 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1002 int numPatchCoords, │ │ │ │ │ + 1003 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1004 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1005 │ │ │ │ │ + 1006 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1007 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1008 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1009 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1010 numPatchCoords, │ │ │ │ │ + 1011 patchCoords->BindVBO(), │ │ │ │ │ + 1012 patchTable->GetPatchArrays(), │ │ │ │ │ + 1013 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1014 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1015 } │ │ │ │ │ + 1016 │ │ │ │ │ + 1069 template │ │ │ │ │ +1071 bool EvalPatches( │ │ │ │ │ + 1072 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1073 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1074 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1075 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1076 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1077 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1078 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1079 int numPatchCoords, │ │ │ │ │ + 1080 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1081 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1082 │ │ │ │ │ + 1083 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1084 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1085 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1086 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1087 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 1088 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 1089 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 1090 numPatchCoords, │ │ │ │ │ + 1091 patchCoords->BindVBO(), │ │ │ │ │ + 1092 patchTable->GetPatchArrays(), │ │ │ │ │ + 1093 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 1094 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1095 } │ │ │ │ │ + 1096 │ │ │ │ │ +1097 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1098 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1099 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1100 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1101 int numPatchCoords, │ │ │ │ │ + 1102 GLuint patchCoordsBuffer, │ │ │ │ │ + 1103 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1104 GLuint patchIndexBuffer, │ │ │ │ │ + 1105 GLuint patchParamsBuffer) const; │ │ │ │ │ + 1106 │ │ │ │ │ +1107 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1108 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1109 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1110 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1111 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1112 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1113 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1114 int numPatchCoords, │ │ │ │ │ + 1115 GLuint patchCoordsBuffer, │ │ │ │ │ + 1116 const PatchArrayVector &patchArrays, │ │ │ │ │ + 1117 GLuint patchIndexBuffer, │ │ │ │ │ + 1118 GLuint patchParamsBuffer) const; │ │ │ │ │ + 1119 │ │ │ │ │ + 1152 template │ │ │ │ │ +1154 static bool EvalPatchesVarying( │ │ │ │ │ + 1155 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1156 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1157 int numPatchCoords, │ │ │ │ │ + 1158 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1159 PATCH_TABLE *patchTable, │ │ │ │ │ + 1160 GLComputeEvaluator const *instance, │ │ │ │ │ + 1161 void * deviceContext = NULL) { │ │ │ │ │ + 1162 │ │ │ │ │ + 1163 if (instance) { │ │ │ │ │ + 1164 return instance->EvalPatchesVarying( │ │ │ │ │ + 1165 srcBuffer, srcDesc, │ │ │ │ │ + 1166 dstBuffer, dstDesc, │ │ │ │ │ + 1167 numPatchCoords, patchCoords, │ │ │ │ │ + 1168 patchTable); │ │ │ │ │ + 1169 } else { │ │ │ │ │ + 1170 // Create an instance on demand (slow) │ │ │ │ │ + 1171 (void)deviceContext; // unused │ │ │ │ │ + 1172 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1173 BufferDescriptor(), │ │ │ │ │ + 1174 BufferDescriptor()); │ │ │ │ │ + 1175 if (instance) { │ │ │ │ │ + 1176 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1177 srcBuffer, srcDesc, │ │ │ │ │ + 1178 dstBuffer, dstDesc, │ │ │ │ │ + 1179 numPatchCoords, patchCoords, │ │ │ │ │ + 1180 patchTable); │ │ │ │ │ + 1181 delete instance; │ │ │ │ │ + 1182 return r; │ │ │ │ │ + 1183 } │ │ │ │ │ + 1184 return false; │ │ │ │ │ + 1185 } │ │ │ │ │ + 1186 } │ │ │ │ │ + 1187 │ │ │ │ │ + 1212 template │ │ │ │ │ +1214 bool EvalPatchesVarying( │ │ │ │ │ + 1215 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1216 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1217 int numPatchCoords, │ │ │ │ │ + 1218 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1219 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1220 │ │ │ │ │ + 1221 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1222 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1223 0, BufferDescriptor(), │ │ │ │ │ + 1224 0, BufferDescriptor(), │ │ │ │ │ + 1225 numPatchCoords, │ │ │ │ │ + 1226 patchCoords->BindVBO(), │ │ │ │ │ + 1227 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1228 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1229 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1230 } │ │ │ │ │ + 1231 │ │ │ │ │ + 1276 template │ │ │ │ │ +1278 static bool EvalPatchesVarying( │ │ │ │ │ + 1279 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1280 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1281 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1282 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1283 int numPatchCoords, │ │ │ │ │ + 1284 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1285 PATCH_TABLE *patchTable, │ │ │ │ │ + 1286 GLComputeEvaluator const *instance, │ │ │ │ │ + 1287 void * deviceContext = NULL) { │ │ │ │ │ + 1288 │ │ │ │ │ + 1289 if (instance) { │ │ │ │ │ + 1290 return instance->EvalPatchesVarying( │ │ │ │ │ + 1291 srcBuffer, srcDesc, │ │ │ │ │ + 1292 dstBuffer, dstDesc, │ │ │ │ │ + 1293 duBuffer, duDesc, │ │ │ │ │ + 1294 dvBuffer, dvDesc, │ │ │ │ │ + 1295 numPatchCoords, patchCoords, │ │ │ │ │ + 1296 patchTable); │ │ │ │ │ + 1297 } else { │ │ │ │ │ + 1298 // Create an instance on demand (slow) │ │ │ │ │ + 1299 (void)deviceContext; // unused │ │ │ │ │ + 1300 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1301 duDesc, dvDesc); │ │ │ │ │ + 1302 if (instance) { │ │ │ │ │ + 1303 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1304 srcBuffer, srcDesc, │ │ │ │ │ + 1305 dstBuffer, dstDesc, │ │ │ │ │ + 1306 duBuffer, duDesc, │ │ │ │ │ + 1307 dvBuffer, dvDesc, │ │ │ │ │ + 1308 numPatchCoords, patchCoords, │ │ │ │ │ + 1309 patchTable); │ │ │ │ │ + 1310 delete instance; │ │ │ │ │ + 1311 return r; │ │ │ │ │ + 1312 } │ │ │ │ │ + 1313 return false; │ │ │ │ │ + 1314 } │ │ │ │ │ + 1315 } │ │ │ │ │ + 1316 │ │ │ │ │ + 1353 template │ │ │ │ │ +1355 bool EvalPatchesVarying( │ │ │ │ │ + 1356 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1357 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1358 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1359 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1360 int numPatchCoords, │ │ │ │ │ + 1361 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1362 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1363 │ │ │ │ │ + 1364 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1365 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1366 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1367 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1368 numPatchCoords, │ │ │ │ │ + 1369 patchCoords->BindVBO(), │ │ │ │ │ + 1370 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1371 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1372 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1373 } │ │ │ │ │ + 1374 │ │ │ │ │ + 1437 template │ │ │ │ │ +1439 static bool EvalPatchesVarying( │ │ │ │ │ + 1440 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1441 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1442 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1443 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1444 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1445 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1446 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1447 int numPatchCoords, │ │ │ │ │ + 1448 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1449 PATCH_TABLE *patchTable, │ │ │ │ │ + 1450 GLComputeEvaluator const *instance, │ │ │ │ │ + 1451 void * deviceContext = NULL) { │ │ │ │ │ + 1452 │ │ │ │ │ + 1453 if (instance) { │ │ │ │ │ + 1454 return instance->EvalPatchesVarying( │ │ │ │ │ + 1455 srcBuffer, srcDesc, │ │ │ │ │ + 1456 dstBuffer, dstDesc, │ │ │ │ │ + 1457 duBuffer, duDesc, │ │ │ │ │ + 1458 dvBuffer, dvDesc, │ │ │ │ │ + 1459 duuBuffer, duuDesc, │ │ │ │ │ + 1460 duvBuffer, duvDesc, │ │ │ │ │ + 1461 dvvBuffer, dvvDesc, │ │ │ │ │ + 1462 numPatchCoords, patchCoords, │ │ │ │ │ + 1463 patchTable); │ │ │ │ │ + 1464 } else { │ │ │ │ │ + 1465 // Create an instance on demand (slow) │ │ │ │ │ + 1466 (void)deviceContext; // unused │ │ │ │ │ + 1467 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1468 duDesc, dvDesc, │ │ │ │ │ + 1469 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 1470 if (instance) { │ │ │ │ │ + 1471 bool r = instance->EvalPatchesVarying( │ │ │ │ │ + 1472 srcBuffer, srcDesc, │ │ │ │ │ + 1473 dstBuffer, dstDesc, │ │ │ │ │ + 1474 duBuffer, duDesc, │ │ │ │ │ + 1475 dvBuffer, dvDesc, │ │ │ │ │ + 1476 duuBuffer, duuDesc, │ │ │ │ │ + 1477 duvBuffer, duvDesc, │ │ │ │ │ + 1478 dvvBuffer, dvvDesc, │ │ │ │ │ + 1479 numPatchCoords, patchCoords, │ │ │ │ │ + 1480 patchTable); │ │ │ │ │ + 1481 delete instance; │ │ │ │ │ + 1482 return r; │ │ │ │ │ + 1483 } │ │ │ │ │ + 1484 return false; │ │ │ │ │ + 1485 } │ │ │ │ │ + 1486 } │ │ │ │ │ + 1487 │ │ │ │ │ + 1542 template │ │ │ │ │ +1544 bool EvalPatchesVarying( │ │ │ │ │ + 1545 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1546 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1547 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1548 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1549 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1550 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1551 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1552 int numPatchCoords, │ │ │ │ │ + 1553 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1554 PATCH_TABLE *patchTable) const { │ │ │ │ │ + 1555 │ │ │ │ │ + 1556 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1557 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1558 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1559 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1560 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 1561 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 1562 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 1563 numPatchCoords, │ │ │ │ │ + 1564 patchCoords->BindVBO(), │ │ │ │ │ + 1565 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ + 1566 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 1567 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1568 } │ │ │ │ │ + 1569 │ │ │ │ │ + 1604 template │ │ │ │ │ +1606 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1609 int numPatchCoords, │ │ │ │ │ + 1610 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1611 PATCH_TABLE *patchTable, │ │ │ │ │ + 1612 int fvarChannel, │ │ │ │ │ + 1613 GLComputeEvaluator const *instance, │ │ │ │ │ + 1614 void * deviceContext = NULL) { │ │ │ │ │ + 1615 │ │ │ │ │ + 1616 if (instance) { │ │ │ │ │ + 1617 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1618 srcBuffer, srcDesc, │ │ │ │ │ + 1619 dstBuffer, dstDesc, │ │ │ │ │ + 1620 numPatchCoords, patchCoords, │ │ │ │ │ + 1621 patchTable, fvarChannel); │ │ │ │ │ + 1622 } else { │ │ │ │ │ + 1623 // Create an instance on demand (slow) │ │ │ │ │ + 1624 (void)deviceContext; // unused │ │ │ │ │ + 1625 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1626 BufferDescriptor(), │ │ │ │ │ + 1627 BufferDescriptor()); │ │ │ │ │ + 1628 if (instance) { │ │ │ │ │ + 1629 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1630 srcBuffer, srcDesc, │ │ │ │ │ + 1631 dstBuffer, dstDesc, │ │ │ │ │ + 1632 numPatchCoords, patchCoords, │ │ │ │ │ + 1633 patchTable, fvarChannel); │ │ │ │ │ + 1634 delete instance; │ │ │ │ │ + 1635 return r; │ │ │ │ │ + 1636 } │ │ │ │ │ + 1637 return false; │ │ │ │ │ + 1638 } │ │ │ │ │ + 1639 } │ │ │ │ │ + 1640 │ │ │ │ │ + 1667 template │ │ │ │ │ +1669 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1670 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1671 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1672 int numPatchCoords, │ │ │ │ │ + 1673 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1674 PATCH_TABLE *patchTable, │ │ │ │ │ + 1675 int fvarChannel = 0) const { │ │ │ │ │ + 1676 │ │ │ │ │ + 1677 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1678 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1679 0, BufferDescriptor(), │ │ │ │ │ + 1680 0, BufferDescriptor(), │ │ │ │ │ + 1681 numPatchCoords, │ │ │ │ │ + 1682 patchCoords->BindVBO(), │ │ │ │ │ + 1683 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1684 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1685 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1686 } │ │ │ │ │ + 1687 │ │ │ │ │ + 1734 template │ │ │ │ │ +1736 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1737 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1738 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1739 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1740 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1741 int numPatchCoords, │ │ │ │ │ + 1742 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1743 PATCH_TABLE *patchTable, │ │ │ │ │ + 1744 int fvarChannel, │ │ │ │ │ + 1745 GLComputeEvaluator const *instance, │ │ │ │ │ + 1746 void * deviceContext = NULL) { │ │ │ │ │ + 1747 │ │ │ │ │ + 1748 if (instance) { │ │ │ │ │ + 1749 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1750 srcBuffer, srcDesc, │ │ │ │ │ + 1751 dstBuffer, dstDesc, │ │ │ │ │ + 1752 duBuffer, duDesc, │ │ │ │ │ + 1753 dvBuffer, dvDesc, │ │ │ │ │ + 1754 numPatchCoords, patchCoords, │ │ │ │ │ + 1755 patchTable, fvarChannel); │ │ │ │ │ + 1756 } else { │ │ │ │ │ + 1757 // Create an instance on demand (slow) │ │ │ │ │ + 1758 (void)deviceContext; // unused │ │ │ │ │ + 1759 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1760 duDesc, dvDesc); │ │ │ │ │ + 1761 if (instance) { │ │ │ │ │ + 1762 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1763 srcBuffer, srcDesc, │ │ │ │ │ + 1764 dstBuffer, dstDesc, │ │ │ │ │ + 1765 duBuffer, duDesc, │ │ │ │ │ + 1766 dvBuffer, dvDesc, │ │ │ │ │ + 1767 numPatchCoords, patchCoords, │ │ │ │ │ + 1768 patchTable, fvarChannel); │ │ │ │ │ + 1769 delete instance; │ │ │ │ │ + 1770 return r; │ │ │ │ │ + 1771 } │ │ │ │ │ + 1772 return false; │ │ │ │ │ + 1773 } │ │ │ │ │ + 1774 } │ │ │ │ │ + 1775 │ │ │ │ │ + 1814 template │ │ │ │ │ +1816 bool EvalPatchesFaceVarying( │ │ │ │ │ + 1817 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1818 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1819 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1820 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1821 int numPatchCoords, │ │ │ │ │ + 1822 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1823 PATCH_TABLE *patchTable, │ │ │ │ │ + 1824 int fvarChannel = 0) const { │ │ │ │ │ + 1825 │ │ │ │ │ + 1826 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 1827 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 1828 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 1829 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 1830 numPatchCoords, │ │ │ │ │ + 1831 patchCoords->BindVBO(), │ │ │ │ │ + 1832 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 1833 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1834 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1835 } │ │ │ │ │ + 1836 │ │ │ │ │ + 1901 template │ │ │ │ │ +1903 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1904 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1905 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1906 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1907 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1908 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1909 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1910 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1911 int numPatchCoords, │ │ │ │ │ + 1912 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1913 PATCH_TABLE *patchTable, │ │ │ │ │ + 1914 int fvarChannel, │ │ │ │ │ + 1915 GLComputeEvaluator const *instance, │ │ │ │ │ + 1916 void * deviceContext = NULL) { │ │ │ │ │ + 1917 │ │ │ │ │ + 1918 if (instance) { │ │ │ │ │ + 1919 return instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1920 srcBuffer, srcDesc, │ │ │ │ │ + 1921 dstBuffer, dstDesc, │ │ │ │ │ + 1922 duBuffer, duDesc, │ │ │ │ │ + 1923 dvBuffer, dvDesc, │ │ │ │ │ + 1924 duuBuffer, duuDesc, │ │ │ │ │ + 1925 duvBuffer, duvDesc, │ │ │ │ │ + 1926 dvvBuffer, dvvDesc, │ │ │ │ │ + 1927 numPatchCoords, patchCoords, │ │ │ │ │ + 1928 patchTable, fvarChannel); │ │ │ │ │ + 1929 } else { │ │ │ │ │ + 1930 // Create an instance on demand (slow) │ │ │ │ │ + 1931 (void)deviceContext; // unused │ │ │ │ │ + 1932 instance = Create(srcDesc, dstDesc, │ │ │ │ │ + 1933 duDesc, dvDesc, │ │ │ │ │ + 1934 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ + 1935 if (instance) { │ │ │ │ │ + 1936 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ + 1937 srcBuffer, srcDesc, │ │ │ │ │ + 1938 dstBuffer, dstDesc, │ │ │ │ │ + 1939 duBuffer, duDesc, │ │ │ │ │ + 1940 dvBuffer, dvDesc, │ │ │ │ │ + 1941 duuBuffer, duuDesc, │ │ │ │ │ + 1942 duvBuffer, duvDesc, │ │ │ │ │ + 1943 dvvBuffer, dvvDesc, │ │ │ │ │ + 1944 numPatchCoords, patchCoords, │ │ │ │ │ + 1945 patchTable, fvarChannel); │ │ │ │ │ + 1946 delete instance; │ │ │ │ │ + 1947 return r; │ │ │ │ │ + 1948 } │ │ │ │ │ + 1949 return false; │ │ │ │ │ + 1950 } │ │ │ │ │ + 1951 } │ │ │ │ │ + 1952 │ │ │ │ │ + 2009 template │ │ │ │ │ +2011 bool EvalPatchesFaceVarying( │ │ │ │ │ + 2012 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 2013 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 2014 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 2015 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 2016 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 2017 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 2018 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2019 int numPatchCoords, │ │ │ │ │ + 2020 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 2021 PATCH_TABLE *patchTable, │ │ │ │ │ + 2022 int fvarChannel = 0) const { │ │ │ │ │ + 2023 │ │ │ │ │ + 2024 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ + 2025 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ + 2026 duBuffer->BindVBO(), duDesc, │ │ │ │ │ + 2027 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ + 2028 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ + 2029 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ + 2030 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ + 2031 numPatchCoords, │ │ │ │ │ + 2032 patchCoords->BindVBO(), │ │ │ │ │ + 2033 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ + 2034 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 2035 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 2036 } │ │ │ │ │ + 2037 │ │ │ │ │ + 2043 │ │ │ │ │ +2046 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2047 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2048 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ + 2049 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ + 2050 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ + 2051 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ + 2052 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ + 2053 │ │ │ │ │ +2055 static void Synchronize(void *deviceContext); │ │ │ │ │ + 2056 │ │ │ │ │ + 2057private: │ │ │ │ │ + 2058 struct _StencilKernel { │ │ │ │ │ + 2059 _StencilKernel(); │ │ │ │ │ + 2060 ~_StencilKernel(); │ │ │ │ │ + 2061 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2062 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2063 BufferDescriptor const &duDesc, │ │ │ │ │ + 2064 BufferDescriptor const &dvDesc, │ │ │ │ │ + 2065 BufferDescriptor const &duuDesc, │ │ │ │ │ + 2066 BufferDescriptor const &duvDesc, │ │ │ │ │ + 2067 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2068 int workGroupSize); │ │ │ │ │ + 2069 GLuint program; │ │ │ │ │ + 2070 GLuint uniformStart; │ │ │ │ │ + 2071 GLuint uniformEnd; │ │ │ │ │ + 2072 GLuint uniformSrcOffset; │ │ │ │ │ + 2073 GLuint uniformDstOffset; │ │ │ │ │ + 2074 GLuint uniformDuDesc; │ │ │ │ │ + 2075 GLuint uniformDvDesc; │ │ │ │ │ + 2076 GLuint uniformDuuDesc; │ │ │ │ │ + 2077 GLuint uniformDuvDesc; │ │ │ │ │ + 2078 GLuint uniformDvvDesc; │ │ │ │ │ + 2079 } _stencilKernel; │ │ │ │ │ + 2080 │ │ │ │ │ + 2081 struct _PatchKernel { │ │ │ │ │ + 2082 _PatchKernel(); │ │ │ │ │ + 2083 ~_PatchKernel(); │ │ │ │ │ + 2084 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ + 2085 BufferDescriptor const &dstDesc, │ │ │ │ │ + 2086 BufferDescriptor const &duDesc, │ │ │ │ │ + 2087 BufferDescriptor const &dvDesc, │ │ │ │ │ + 2088 BufferDescriptor const &duuDesc, │ │ │ │ │ + 2089 BufferDescriptor const &duvDesc, │ │ │ │ │ + 2090 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 2091 int workGroupSize); │ │ │ │ │ + 2092 GLuint program; │ │ │ │ │ + 2093 GLuint uniformSrcOffset; │ │ │ │ │ + 2094 GLuint uniformDstOffset; │ │ │ │ │ + 2095 GLuint uniformPatchArray; │ │ │ │ │ + 2096 GLuint uniformDuDesc; │ │ │ │ │ + 2097 GLuint uniformDvDesc; │ │ │ │ │ + 2098 GLuint uniformDuuDesc; │ │ │ │ │ + 2099 GLuint uniformDuvDesc; │ │ │ │ │ + 2100 GLuint uniformDvvDesc; │ │ │ │ │ + 2101 } _patchKernel; │ │ │ │ │ + 2102 │ │ │ │ │ + 2103 int _workGroupSize; │ │ │ │ │ + 2104 GLuint _patchArraysSSBO; │ │ │ │ │ + 2105}; │ │ │ │ │ + 2106 │ │ │ │ │ + 2107} // end namespace Osd │ │ │ │ │ + 2108 │ │ │ │ │ + 2109} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 2110using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 2111 │ │ │ │ │ + 2112} // end namespace OpenSubdiv │ │ │ │ │ + 2113 │ │ │ │ │ + 2114 │ │ │ │ │ + 2115#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer │ │ │ │ │ -Concrete vertex buffer class for DirectX subdivision and DirectX drawing. │ │ │ │ │ -Definition: d3d11VertexBuffer.h:46 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::Create │ │ │ │ │ -static D3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::D3D11VertexBuffer │ │ │ │ │ -D3D11VertexBuffer(int numElements, int numVertices) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ +Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:583 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO │ │ │ │ │ +GL stencil table (Shader Storage buffer) │ │ │ │ │ +Definition: glComputeEvaluator.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuvWeightsBuffer │ │ │ │ │ +GLuint GetDuvWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:77 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetWeightsBuffer │ │ │ │ │ +GLuint GetWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO │ │ │ │ │ +GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuWeightsBuffer │ │ │ │ │ +GLuint GetDuWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::~GLStencilTableSSBO │ │ │ │ │ +~GLStencilTableSSBO() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Definition: glComputeEvaluator.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetIndicesBuffer │ │ │ │ │ +GLuint GetIndicesBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetOffsetsBuffer │ │ │ │ │ +GLuint GetOffsetsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO │ │ │ │ │ +GLStencilTableSSBO(Far::StencilTable const *stencilTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvvWeightsBuffer │ │ │ │ │ +GLuint GetDvvWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:78 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetSizesBuffer │ │ │ │ │ +GLuint GetSizesBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create │ │ │ │ │ +static GLStencilTableSSBO * Create(Far::LimitStencilTable const │ │ │ │ │ +*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ +Definition: glComputeEvaluator.h:58 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuuWeightsBuffer │ │ │ │ │ +GLuint GetDuuWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvWeightsBuffer │ │ │ │ │ +GLuint GetDvWeightsBuffer() const │ │ │ │ │ +Definition: glComputeEvaluator.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create │ │ │ │ │ +static GLStencilTableSSBO * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Definition: glComputeEvaluator.h:53 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator │ │ │ │ │ +Definition: glComputeEvaluator.h:96 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1214 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator │ │ │ │ │ +const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1736 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glComputeEvaluator.h:434 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1154 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1606 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glComputeEvaluator.h:502 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1278 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Instantiatable │ │ │ │ │ +bool Instantiatable │ │ │ │ │ +Definition: glComputeEvaluator.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ +const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int │ │ │ │ │ +numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ +GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::~GLComputeEvaluator │ │ │ │ │ +~GLComputeEvaluator() │ │ │ │ │ +Destructor. note that the GL context must be made current. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: glComputeEvaluator.h:1071 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glComputeEvaluator.h:236 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ +const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint │ │ │ │ │ +sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ +GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint │ │ │ │ │ +duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const │ │ │ │ │ +Dispatch the GLSL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compil... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, GLComputeEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glComputeEvaluator.h:168 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator │ │ │ │ │ +const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1439 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:769 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1903 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1544 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1816 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:943 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::GLComputeEvaluator │ │ │ │ │ +GLComputeEvaluator() │ │ │ │ │ Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::GetNumVertices │ │ │ │ │ -int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindD3D11Buffer │ │ │ │ │ -ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Returns the D3D11 buffer object. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::~D3D11VertexBuffer │ │ │ │ │ -virtual ~D3D11VertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindD3D11UAV │ │ │ │ │ -ID3D11UnorderedAccessView * BindD3D11UAV(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Returns the D3D11 UAV. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::allocate │ │ │ │ │ -bool allocate(ID3D11Device *device) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11VertexBuffer::BindVBO │ │ │ │ │ -ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Returns the D3D11 buffer object (for Osd::Mesh interface) │ │ │ │ │ -Definition: d3d11VertexBuffer.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable) const │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: glComputeEvaluator.h:997 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator │ │ │ │ │ +const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:691 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ +*stencilTable) const │ │ │ │ │ +Generic stencil function. │ │ │ │ │ +Definition: glComputeEvaluator.h:386 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int │ │ │ │ │ +numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ +GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) │ │ │ │ │ +const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:2011 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create │ │ │ │ │ +static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, void *deviceContext=NULL) │ │ │ │ │ +Definition: glComputeEvaluator.h:99 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ +dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ +const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ +sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ +GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const │ │ │ │ │ +Dispatch the GLSL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ +kernel hasn't been compil... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ +Generic static stencil function. This function has a same signature as other │ │ │ │ │ +device kernels have so t... │ │ │ │ │ +Definition: glComputeEvaluator.h:326 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *deviceContext) │ │ │ │ │ +Wait the dispatched kernel finishes. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Compile │ │ │ │ │ +bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ +BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ +BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ +&dvvDesc=BufferDescriptor()) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ +bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1355 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create │ │ │ │ │ +static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ +BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ +BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ +BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Definition: glComputeEvaluator.h:111 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel=0) const │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:1669 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: glComputeEvaluator.h:870 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11VertexBuffer.h │ │ │ │ │ + * glComputeEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00836.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11PatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glslPatchShaderSource.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,45 +83,41 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
d3d11PatchTable.h File Reference
│ │ │ │ +
glslPatchShaderSource.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <vector>
│ │ │ │ +#include <string>
│ │ │ │ #include "../far/patchDescriptor.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  D3D11PatchTable
class  GLSLPatchShaderSource
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -d3d11PatchTable.h File Reference │ │ │ │ │ +glslPatchShaderSource.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include "../far/patchDescriptor.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  D3D11PatchTable │ │ │ │ │ +class  GLSLPatchShaderSource │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11PatchTable.h │ │ │ │ │ + * glslPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00836.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00836 = [ │ │ │ │ │ - ["D3D11PatchTable", "a01201.html", "a01201"] │ │ │ │ │ + ["GLSLPatchShaderSource", "a01233.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00836_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11PatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glslPatchShaderSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
d3d11PatchTable.h
│ │ │ │ +
glslPatchShaderSource.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,108 +107,62 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <vector>
│ │ │ │ -
31#include "../far/patchDescriptor.h"
│ │ │ │ -
32#include "../osd/nonCopyable.h"
│ │ │ │ -
33#include "../osd/types.h"
│ │ │ │ +
29#include <string>
│ │ │ │ +
30#include "../far/patchDescriptor.h"
│ │ │ │ +
31
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │
34
│ │ │ │ -
35struct ID3D11Buffer;
│ │ │ │ -
36struct ID3D11ShaderResourceView;
│ │ │ │ -
37struct ID3D11Device;
│ │ │ │ -
38struct ID3D11DeviceContext;
│ │ │ │ -
39
│ │ │ │ -
40namespace OpenSubdiv {
│ │ │ │ -
41namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35namespace Osd {
│ │ │ │ +
36
│ │ │ │ + │ │ │ │ +
38public:
│ │ │ │ +
39 static std::string GetCommonShaderSource();
│ │ │ │ +
40
│ │ │ │ +
41 static std::string GetPatchBasisShaderSource();
│ │ │ │
42
│ │ │ │ -
43namespace Far{
│ │ │ │ -
44 class PatchTable;
│ │ │ │ -
45};
│ │ │ │ -
46
│ │ │ │ -
47namespace Osd {
│ │ │ │ +
43 static std::string GetVertexShaderSource(
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ +
46 static std::string GetTessControlShaderSource(
│ │ │ │ + │ │ │ │
48
│ │ │ │ -
49class D3D11PatchTable : private NonCopyable<D3D11PatchTable> {
│ │ │ │ -
50public:
│ │ │ │ -
51 typedef ID3D11Buffer * VertexBufferBinding;
│ │ │ │ +
49 static std::string GetTessEvalShaderSource(
│ │ │ │ + │ │ │ │ +
51};
│ │ │ │
52
│ │ │ │ - │ │ │ │ - │ │ │ │ -
55
│ │ │ │ -
56 template<typename DEVICE_CONTEXT>
│ │ │ │ -
57 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ -
58 DEVICE_CONTEXT context) {
│ │ │ │ -
59 return Create(farPatchTable, context->GetDeviceContext());
│ │ │ │ -
60 }
│ │ │ │ -
61
│ │ │ │ -
62 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ -
63 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
64
│ │ │ │ - │ │ │ │ -
66 return _patchArrays;
│ │ │ │ -
67 }
│ │ │ │ -
68
│ │ │ │ -
70 ID3D11Buffer* GetPatchIndexBuffer() const {
│ │ │ │ -
71 return _indexBuffer;
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ -
75 ID3D11ShaderResourceView* GetPatchParamSRV() const {
│ │ │ │ - │ │ │ │ -
77 }
│ │ │ │ -
78
│ │ │ │ -
79protected:
│ │ │ │ -
80 // allocate buffers from patchTable
│ │ │ │ -
81 bool allocate(Far::PatchTable const *farPatchTable,
│ │ │ │ -
82 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
83
│ │ │ │ - │ │ │ │ -
85
│ │ │ │ -
86 ID3D11Buffer *_indexBuffer;
│ │ │ │ -
87 ID3D11Buffer *_patchParamBuffer;
│ │ │ │ -
88 ID3D11ShaderResourceView *_patchParamBufferSRV;
│ │ │ │ -
89};
│ │ │ │ -
90
│ │ │ │ -
91
│ │ │ │ -
92} // end namespace Osd
│ │ │ │ -
93
│ │ │ │ -
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
96
│ │ │ │ -
97} // end namespace OpenSubdiv
│ │ │ │ -
98
│ │ │ │ -
99#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ +
53} // end namespace Osd
│ │ │ │ +
54
│ │ │ │ +
55} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
56using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
57
│ │ │ │ +
58} // end namespace OpenSubdiv
│ │ │ │ +
59
│ │ │ │ +
60#endif // OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE
│ │ │ │ │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ -
static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ -
PatchArrayVector const & GetPatchArrays() const
│ │ │ │ -
bool allocate(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
ID3D11Buffer * GetPatchIndexBuffer() const
Returns the index buffer containing the patch control vertices.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
ID3D11ShaderResourceView * GetPatchParamSRV() const
Returns the SRV containing the patch parameter.
│ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
static std::string GetTessEvalShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static std::string GetTessControlShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -d3d11PatchTable.h │ │ │ │ │ +glslPatchShaderSource.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,134 +30,69 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include "../far/patchDescriptor.h" │ │ │ │ │ - 32#include "../osd/nonCopyable.h" │ │ │ │ │ - 33#include "../osd/types.h" │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include "../far/patchDescriptor.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ 34 │ │ │ │ │ - 35struct ID3D11Buffer; │ │ │ │ │ - 36struct ID3D11ShaderResourceView; │ │ │ │ │ - 37struct ID3D11Device; │ │ │ │ │ - 38struct ID3D11DeviceContext; │ │ │ │ │ - 39 │ │ │ │ │ - 40namespace OpenSubdiv { │ │ │ │ │ - 41namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35namespace Osd { │ │ │ │ │ + 36 │ │ │ │ │ +37class GLSLPatchShaderSource { │ │ │ │ │ + 38public: │ │ │ │ │ +39 static std::string GetCommonShaderSource(); │ │ │ │ │ + 40 │ │ │ │ │ +41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ 42 │ │ │ │ │ - 43namespace Far{ │ │ │ │ │ - 44 class PatchTable; │ │ │ │ │ - 45}; │ │ │ │ │ - 46 │ │ │ │ │ - 47namespace Osd { │ │ │ │ │ +43 static std::string GetVertexShaderSource( │ │ │ │ │ + 44 Far::PatchDescriptor::Type type); │ │ │ │ │ + 45 │ │ │ │ │ +46 static std::string GetTessControlShaderSource( │ │ │ │ │ + 47 Far::PatchDescriptor::Type type); │ │ │ │ │ 48 │ │ │ │ │ -49class D3D11PatchTable : private NonCopyable { │ │ │ │ │ - 50public: │ │ │ │ │ -51 typedef ID3D11Buffer * VertexBufferBinding; │ │ │ │ │ +49 static std::string GetTessEvalShaderSource( │ │ │ │ │ + 50 Far::PatchDescriptor::Type type); │ │ │ │ │ + 51}; │ │ │ │ │ 52 │ │ │ │ │ -53 D3D11PatchTable(); │ │ │ │ │ -54 ~D3D11PatchTable(); │ │ │ │ │ - 55 │ │ │ │ │ - 56 template │ │ │ │ │ -57 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ - 58 DEVICE_CONTEXT context) { │ │ │ │ │ - 59 return Create(farPatchTable, context->GetDeviceContext()); │ │ │ │ │ - 60 } │ │ │ │ │ - 61 │ │ │ │ │ -62 static D3D11PatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ - 63 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 64 │ │ │ │ │ -65 PatchArrayVector const &GetPatchArrays() const { │ │ │ │ │ - 66 return _patchArrays; │ │ │ │ │ - 67 } │ │ │ │ │ - 68 │ │ │ │ │ -70 ID3D11Buffer* GetPatchIndexBuffer() const { │ │ │ │ │ - 71 return _indexBuffer; │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ -75 ID3D11ShaderResourceView* GetPatchParamSRV() const { │ │ │ │ │ - 76 return _patchParamBufferSRV; │ │ │ │ │ - 77 } │ │ │ │ │ - 78 │ │ │ │ │ - 79protected: │ │ │ │ │ - 80 // allocate buffers from patchTable │ │ │ │ │ -81 bool allocate(Far::PatchTable const *farPatchTable, │ │ │ │ │ - 82 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 83 │ │ │ │ │ -84 PatchArrayVector _patchArrays; │ │ │ │ │ - 85 │ │ │ │ │ -86 ID3D11Buffer *_indexBuffer; │ │ │ │ │ -87 ID3D11Buffer *_patchParamBuffer; │ │ │ │ │ -88 ID3D11ShaderResourceView *_patchParamBufferSRV; │ │ │ │ │ - 89}; │ │ │ │ │ - 90 │ │ │ │ │ - 91 │ │ │ │ │ - 92} // end namespace Osd │ │ │ │ │ - 93 │ │ │ │ │ - 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 96 │ │ │ │ │ - 97} // end namespace OpenSubdiv │ │ │ │ │ - 98 │ │ │ │ │ - 99#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ + 53} // end namespace Osd │ │ │ │ │ + 54 │ │ │ │ │ + 55} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 56using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 57 │ │ │ │ │ + 58} // end namespace OpenSubdiv │ │ │ │ │ + 59 │ │ │ │ │ + 60#endif // OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable │ │ │ │ │ -Definition: d3d11PatchTable.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::Create │ │ │ │ │ -static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ -Definition: d3d11PatchTable.h:57 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchArrays │ │ │ │ │ -PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ -Definition: d3d11PatchTable.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::allocate │ │ │ │ │ -bool allocate(Far::PatchTable const *farPatchTable, ID3D11DeviceContext │ │ │ │ │ -*deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::VertexBufferBinding │ │ │ │ │ -ID3D11Buffer * VertexBufferBinding │ │ │ │ │ -Definition: d3d11PatchTable.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::~D3D11PatchTable │ │ │ │ │ -~D3D11PatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchIndexBuffer │ │ │ │ │ -ID3D11Buffer * GetPatchIndexBuffer() const │ │ │ │ │ -Returns the index buffer containing the patch control vertices. │ │ │ │ │ -Definition: d3d11PatchTable.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchArrays │ │ │ │ │ -PatchArrayVector _patchArrays │ │ │ │ │ -Definition: d3d11PatchTable.h:84 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_indexBuffer │ │ │ │ │ -ID3D11Buffer * _indexBuffer │ │ │ │ │ -Definition: d3d11PatchTable.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::Create │ │ │ │ │ -static D3D11PatchTable * Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchParamBufferSRV │ │ │ │ │ -ID3D11ShaderResourceView * _patchParamBufferSRV │ │ │ │ │ -Definition: d3d11PatchTable.h:88 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::_patchParamBuffer │ │ │ │ │ -ID3D11Buffer * _patchParamBuffer │ │ │ │ │ -Definition: d3d11PatchTable.h:87 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::GetPatchParamSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetPatchParamSRV() const │ │ │ │ │ -Returns the SRV containing the patch parameter. │ │ │ │ │ -Definition: d3d11PatchTable.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11PatchTable::D3D11PatchTable │ │ │ │ │ -D3D11PatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource │ │ │ │ │ +Definition: glslPatchShaderSource.h:37 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ +GetVertexShaderSource │ │ │ │ │ +static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ +GetTessEvalShaderSource │ │ │ │ │ +static std::string GetTessEvalShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ +GetPatchBasisShaderSource │ │ │ │ │ +static std::string GetPatchBasisShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ +GetCommonShaderSource │ │ │ │ │ +static std::string GetCommonShaderSource() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ +GetTessControlShaderSource │ │ │ │ │ +static std::string GetTessControlShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11PatchTable.h │ │ │ │ │ + * glslPatchShaderSource.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00839.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11LegacyGregoryPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glMesh.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,43 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
d3d11LegacyGregoryPatchTable.h File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs
│ │ │ │ +
glMesh.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/mesh.h"
│ │ │ │ +#include "../osd/glPatchTable.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  D3D11LegacyGregoryPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Typedefs

typedef MeshInterface< GLPatchTable > GLMeshInterface
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -d3d11LegacyGregoryPatchTable.h File Reference │ │ │ │ │ +Namespaces | Typedefs │ │ │ │ │ +glMesh.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchTable.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/mesh.h" │ │ │ │ │ +#include "../osd/glPatchTable.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  D3D11LegacyGregoryPatchTable │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ + Typedefs │ │ │ │ │ +typedef MeshInterface< GLPatchTable > GLMeshInterface │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11LegacyGregoryPatchTable.h │ │ │ │ │ + * glMesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00839.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00839 = [ │ │ │ │ │ - ["D3D11LegacyGregoryPatchTable", "a01197.html", "a01197"] │ │ │ │ │ + ["GLMeshInterface", "a00839.html#a7f9cf2b729178bdbb847fc4afd91af9e", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00839_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11LegacyGregoryPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glMesh.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
d3d11LegacyGregoryPatchTable.h
│ │ │ │ +
glMesh.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,110 +107,45 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../far/patchTable.h"
│ │ │ │ -
31#include "../osd/nonCopyable.h"
│ │ │ │ +
30#include "../osd/mesh.h"
│ │ │ │ +
31#include "../osd/glPatchTable.h"
│ │ │ │
32
│ │ │ │ -
33struct ID3D11Buffer;
│ │ │ │ -
34struct ID3D11ShaderResourceView;
│ │ │ │ -
35struct ID3D11Device;
│ │ │ │ -
36struct ID3D11DeviceContext;
│ │ │ │ +
33namespace OpenSubdiv {
│ │ │ │ +
34namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35
│ │ │ │ +
36namespace Osd {
│ │ │ │
37
│ │ │ │ -
38namespace OpenSubdiv {
│ │ │ │ -
39namespace OPENSUBDIV_VERSION {
│ │ │ │ + │ │ │ │ +
39
│ │ │ │
40
│ │ │ │ -
41namespace Osd {
│ │ │ │ +
41} // end namespace Osd
│ │ │ │
42
│ │ │ │ - │ │ │ │ -
44 : private NonCopyable<D3D11LegacyGregoryPatchTable> {
│ │ │ │ -
45public:
│ │ │ │ - │ │ │ │ +
43} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
44using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
45
│ │ │ │ +
46} // end namespace OpenSubdiv
│ │ │ │
47
│ │ │ │ -
48 template<typename DEVICE_CONTEXT>
│ │ │ │ - │ │ │ │ -
50 Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context) {
│ │ │ │ -
51 return Create(farPatchTable, context->GetDeviceContext());
│ │ │ │ -
52 }
│ │ │ │ -
53
│ │ │ │ - │ │ │ │ -
55 Far::PatchTable const *farPatchTable,
│ │ │ │ -
56 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
57
│ │ │ │ -
58 void UpdateVertexBuffer(ID3D11Buffer *vbo,
│ │ │ │ -
59 int numVertices, int numVertexElements,
│ │ │ │ -
60 ID3D11DeviceContext *pd3d11DeviceContext);
│ │ │ │ -
61
│ │ │ │ -
62 ID3D11ShaderResourceView* GetVertexSRV() const {
│ │ │ │ -
63 return _vertexSRV;
│ │ │ │ -
64 }
│ │ │ │ -
65
│ │ │ │ -
66 ID3D11ShaderResourceView* GetVertexValenceSRV() const {
│ │ │ │ -
67 return _vertexValenceSRV;
│ │ │ │ -
68 }
│ │ │ │ -
69
│ │ │ │ -
70 ID3D11ShaderResourceView* GetQuadOffsetsSRV() const {
│ │ │ │ -
71 return _quadOffsetsSRV;
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ - │ │ │ │ - │ │ │ │ -
76 return _quadOffsetsBase[1];
│ │ │ │ -
77 }
│ │ │ │ -
78 return _quadOffsetsBase[0];
│ │ │ │ -
79 }
│ │ │ │ -
80
│ │ │ │ -
81protected:
│ │ │ │ - │ │ │ │ -
83
│ │ │ │ -
84private:
│ │ │ │ -
85 ID3D11Buffer* _vertexValenceBuffer;
│ │ │ │ -
86 ID3D11Buffer* _quadOffsetsBuffer;
│ │ │ │ -
87 ID3D11ShaderResourceView* _vertexSRV;
│ │ │ │ -
88 ID3D11ShaderResourceView* _vertexValenceSRV;
│ │ │ │ -
89 ID3D11ShaderResourceView* _quadOffsetsSRV;
│ │ │ │ -
90 int _quadOffsetsBase[2]; // gregory, boundaryGregory
│ │ │ │ -
91};
│ │ │ │ -
92
│ │ │ │ -
93
│ │ │ │ -
94
│ │ │ │ -
95} // end namespace Osd
│ │ │ │ -
96
│ │ │ │ -
97} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
98using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
99
│ │ │ │ -
100} // end namespace OpenSubdiv
│ │ │ │ -
101
│ │ │ │ -
102#endif // OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
48#endif // OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ -
void UpdateVertexBuffer(ID3D11Buffer *vbo, int numVertices, int numVertexElements, ID3D11DeviceContext *pd3d11DeviceContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ - │ │ │ │ -
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
MeshInterface< GLPatchTable > GLMeshInterface
Definition: glMesh.h:38
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -d3d11LegacyGregoryPatchTable.h │ │ │ │ │ +glMesh.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,134 +30,42 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../far/patchTable.h" │ │ │ │ │ - 31#include "../osd/nonCopyable.h" │ │ │ │ │ + 30#include "../osd/mesh.h" │ │ │ │ │ + 31#include "../osd/glPatchTable.h" │ │ │ │ │ 32 │ │ │ │ │ - 33struct ID3D11Buffer; │ │ │ │ │ - 34struct ID3D11ShaderResourceView; │ │ │ │ │ - 35struct ID3D11Device; │ │ │ │ │ - 36struct ID3D11DeviceContext; │ │ │ │ │ + 33namespace OpenSubdiv { │ │ │ │ │ + 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Osd { │ │ │ │ │ 37 │ │ │ │ │ - 38namespace OpenSubdiv { │ │ │ │ │ - 39namespace OPENSUBDIV_VERSION { │ │ │ │ │ +38typedef MeshInterface GLMeshInterface; │ │ │ │ │ + 39 │ │ │ │ │ 40 │ │ │ │ │ - 41namespace Osd { │ │ │ │ │ + 41} // end namespace Osd │ │ │ │ │ 42 │ │ │ │ │ -43class D3D11LegacyGregoryPatchTable │ │ │ │ │ - 44 : private NonCopyable { │ │ │ │ │ - 45public: │ │ │ │ │ -46 ~D3D11LegacyGregoryPatchTable(); │ │ │ │ │ + 43} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 44using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 45 │ │ │ │ │ + 46} // end namespace OpenSubdiv │ │ │ │ │ 47 │ │ │ │ │ - 48 template │ │ │ │ │ -49 static D3D11LegacyGregoryPatchTable *Create( │ │ │ │ │ - 50 Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context) { │ │ │ │ │ - 51 return Create(farPatchTable, context->GetDeviceContext()); │ │ │ │ │ - 52 } │ │ │ │ │ - 53 │ │ │ │ │ -54 static D3D11LegacyGregoryPatchTable *Create( │ │ │ │ │ - 55 Far::PatchTable const *farPatchTable, │ │ │ │ │ - 56 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 57 │ │ │ │ │ -58 void UpdateVertexBuffer(ID3D11Buffer *vbo, │ │ │ │ │ - 59 int numVertices, int numVertexElements, │ │ │ │ │ - 60 ID3D11DeviceContext *pd3d11DeviceContext); │ │ │ │ │ - 61 │ │ │ │ │ -62 ID3D11ShaderResourceView* GetVertexSRV() const { │ │ │ │ │ - 63 return _vertexSRV; │ │ │ │ │ - 64 } │ │ │ │ │ - 65 │ │ │ │ │ -66 ID3D11ShaderResourceView* GetVertexValenceSRV() const { │ │ │ │ │ - 67 return _vertexValenceSRV; │ │ │ │ │ - 68 } │ │ │ │ │ - 69 │ │ │ │ │ -70 ID3D11ShaderResourceView* GetQuadOffsetsSRV() const { │ │ │ │ │ - 71 return _quadOffsetsSRV; │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ -74 int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) { │ │ │ │ │ - 75 if (type == Far::PatchDescriptor::GREGORY_BOUNDARY) { │ │ │ │ │ - 76 return _quadOffsetsBase[1]; │ │ │ │ │ - 77 } │ │ │ │ │ - 78 return _quadOffsetsBase[0]; │ │ │ │ │ - 79 } │ │ │ │ │ - 80 │ │ │ │ │ - 81protected: │ │ │ │ │ -82 D3D11LegacyGregoryPatchTable(); │ │ │ │ │ - 83 │ │ │ │ │ - 84private: │ │ │ │ │ - 85 ID3D11Buffer* _vertexValenceBuffer; │ │ │ │ │ - 86 ID3D11Buffer* _quadOffsetsBuffer; │ │ │ │ │ - 87 ID3D11ShaderResourceView* _vertexSRV; │ │ │ │ │ - 88 ID3D11ShaderResourceView* _vertexValenceSRV; │ │ │ │ │ - 89 ID3D11ShaderResourceView* _quadOffsetsSRV; │ │ │ │ │ - 90 int _quadOffsetsBase[2]; // gregory, boundaryGregory │ │ │ │ │ - 91}; │ │ │ │ │ - 92 │ │ │ │ │ - 93 │ │ │ │ │ - 94 │ │ │ │ │ - 95} // end namespace Osd │ │ │ │ │ - 96 │ │ │ │ │ - 97} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 98using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 99 │ │ │ │ │ - 100} // end namespace OpenSubdiv │ │ │ │ │ - 101 │ │ │ │ │ - 102#endif // OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 48#endif // OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ -@ GREGORY_BOUNDARY │ │ │ │ │ -Definition: patchDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:44 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -UpdateVertexBuffer │ │ │ │ │ -void UpdateVertexBuffer(ID3D11Buffer *vbo, int numVertices, int │ │ │ │ │ -numVertexElements, ID3D11DeviceContext *pd3d11DeviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsBase │ │ │ │ │ -int GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -~D3D11LegacyGregoryPatchTable │ │ │ │ │ -~D3D11LegacyGregoryPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::Create │ │ │ │ │ -static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ -*farPatchTable, ID3D11DeviceContext *deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::GetVertexSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetVertexSRV() const │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:62 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable::Create │ │ │ │ │ -static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const │ │ │ │ │ -*farPatchTable, DEVICE_CONTEXT context) │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:49 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -GetVertexValenceSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetVertexValenceSRV() const │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetQuadOffsetsSRV() const │ │ │ │ │ -Definition: d3d11LegacyGregoryPatchTable.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11LegacyGregoryPatchTable:: │ │ │ │ │ -D3D11LegacyGregoryPatchTable │ │ │ │ │ -D3D11LegacyGregoryPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLMeshInterface │ │ │ │ │ +MeshInterface< GLPatchTable > GLMeshInterface │ │ │ │ │ +Definition: glMesh.h:38 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ +Definition: mesh.h:68 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11LegacyGregoryPatchTable.h │ │ │ │ │ + * glMesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00842.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11ComputeEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,28 +83,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
d3d11ComputeEvaluator.h File Reference
│ │ │ │ +
glPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <vector>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  D3D11StencilTable
 D3D11 stencil table. More...
 
class  D3D11ComputeEvaluator
class  GLPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -115,13 +115,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -d3d11ComputeEvaluator.h File Reference │ │ │ │ │ +glPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/opengl.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  D3D11StencilTable │ │ │ │ │ -  D3D11 stencil table. More... │ │ │ │ │ -  │ │ │ │ │ -class  D3D11ComputeEvaluator │ │ │ │ │ +class  GLPatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11ComputeEvaluator.h │ │ │ │ │ + * glPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00842.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00842 = [ │ │ │ │ │ - ["D3D11StencilTable", "a01189.html", "a01189"], │ │ │ │ │ - ["D3D11ComputeEvaluator", "a01193.html", "a01193"] │ │ │ │ │ + ["GLPatchTable", "a01229.html", "a01229"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00842_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/d3d11ComputeEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
d3d11ComputeEvaluator.h
│ │ │ │ +
glPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,213 +107,172 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30struct ID3D11DeviceContext;
│ │ │ │ -
31struct ID3D11Buffer;
│ │ │ │ -
32struct ID3D11ComputeShader;
│ │ │ │ -
33struct ID3D11ClassLinkage;
│ │ │ │ -
34struct ID3D11ClassInstance;
│ │ │ │ -
35struct ID3D11ShaderResourceView;
│ │ │ │ -
36struct ID3D11UnorderedAccessView;
│ │ │ │ -
37
│ │ │ │ -
38#include "../osd/bufferDescriptor.h"
│ │ │ │ -
39
│ │ │ │ -
40namespace OpenSubdiv {
│ │ │ │ -
41namespace OPENSUBDIV_VERSION {
│ │ │ │ +
30#include "../osd/nonCopyable.h"
│ │ │ │ +
31#include "../osd/opengl.h"
│ │ │ │ +
32#include "../osd/types.h"
│ │ │ │ +
33
│ │ │ │ +
34#include <vector>
│ │ │ │ +
35
│ │ │ │ +
36namespace OpenSubdiv {
│ │ │ │ +
37namespace OPENSUBDIV_VERSION {
│ │ │ │ +
38
│ │ │ │ +
39namespace Far{
│ │ │ │ +
40 class PatchTable;
│ │ │ │ +
41};
│ │ │ │
42
│ │ │ │ -
43namespace Far {
│ │ │ │ -
44 class StencilTable;
│ │ │ │ -
45}
│ │ │ │ -
46
│ │ │ │ -
47namespace Osd {
│ │ │ │ +
43namespace Osd {
│ │ │ │ +
44
│ │ │ │ +
45class GLPatchTable : private NonCopyable<GLPatchTable> {
│ │ │ │ +
46public:
│ │ │ │ +
47 typedef GLuint VertexBufferBinding;
│ │ │ │
48
│ │ │ │ - │ │ │ │ -
57public:
│ │ │ │ -
58 template <typename DEVICE_CONTEXT>
│ │ │ │ -
59 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ -
60 DEVICE_CONTEXT context) {
│ │ │ │ -
61 return new D3D11StencilTable(stencilTable, context->GetDeviceContext());
│ │ │ │ + │ │ │ │ +
50
│ │ │ │ +
51 static GLPatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ +
52 void *deviceContext = NULL);
│ │ │ │ +
53
│ │ │ │ + │ │ │ │ +
56 return _patchArrays;
│ │ │ │ +
57 }
│ │ │ │ +
58
│ │ │ │ +
60 GLuint GetPatchIndexBuffer() const {
│ │ │ │ +
61 return _patchIndexBuffer;
│ │ │ │
62 }
│ │ │ │
63
│ │ │ │ -
64 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable,
│ │ │ │ -
65 ID3D11DeviceContext *deviceContext) {
│ │ │ │ -
66 return new D3D11StencilTable(stencilTable, deviceContext);
│ │ │ │ +
65 GLuint GetPatchParamBuffer() const {
│ │ │ │ +
66 return _patchParamBuffer;
│ │ │ │
67 }
│ │ │ │
68
│ │ │ │ - │ │ │ │ -
70 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
71
│ │ │ │ - │ │ │ │ + │ │ │ │ +
71 return _patchIndexTexture;
│ │ │ │ +
72 }
│ │ │ │
73
│ │ │ │ -
74 // interfaces needed for D3D11ComputeEvaluator
│ │ │ │ -
75 ID3D11ShaderResourceView *GetSizesSRV() const { return _sizes; }
│ │ │ │ -
76 ID3D11ShaderResourceView *GetOffsetsSRV() const { return _offsets; }
│ │ │ │ -
77 ID3D11ShaderResourceView *GetIndicesSRV() const { return _indices; }
│ │ │ │ -
78 ID3D11ShaderResourceView *GetWeightsSRV() const { return _weights; }
│ │ │ │ -
79 int GetNumStencils() const { return _numStencils; }
│ │ │ │ -
80
│ │ │ │ -
81private:
│ │ │ │ -
82 ID3D11ShaderResourceView *_sizes;
│ │ │ │ -
83 ID3D11ShaderResourceView *_offsets;
│ │ │ │ -
84 ID3D11ShaderResourceView *_indices;
│ │ │ │ -
85 ID3D11ShaderResourceView *_weights;
│ │ │ │ -
86 ID3D11Buffer *_sizesBuffer;
│ │ │ │ -
87 ID3D11Buffer *_offsetsBuffer;
│ │ │ │ -
88 ID3D11Buffer *_indicesBuffer;
│ │ │ │ -
89 ID3D11Buffer *_weightsBuffer;
│ │ │ │ -
90
│ │ │ │ -
91 int _numStencils;
│ │ │ │ -
92};
│ │ │ │ + │ │ │ │ +
76 return _patchParamTexture;
│ │ │ │ +
77 }
│ │ │ │ +
78
│ │ │ │ + │ │ │ │ + │ │ │ │ +
82 }
│ │ │ │ +
83
│ │ │ │ + │ │ │ │ + │ │ │ │ +
87 }
│ │ │ │ +
88
│ │ │ │ + │ │ │ │ + │ │ │ │ +
92 }
│ │ │ │
93
│ │ │ │ -
94// ---------------------------------------------------------------------------
│ │ │ │ -
95
│ │ │ │ - │ │ │ │ -
97public:
│ │ │ │ -
98 typedef bool Instantiatable;
│ │ │ │ - │ │ │ │ -
100 BufferDescriptor const &dstDesc,
│ │ │ │ -
101 BufferDescriptor const &duDesc,
│ │ │ │ -
102 BufferDescriptor const &dvDesc,
│ │ │ │ -
103 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
104
│ │ │ │ - │ │ │ │ -
106 BufferDescriptor const &dstDesc,
│ │ │ │ -
107 BufferDescriptor const &duDesc,
│ │ │ │ -
108 BufferDescriptor const &dvDesc,
│ │ │ │ -
109 BufferDescriptor const &duuDesc,
│ │ │ │ -
110 BufferDescriptor const &duvDesc,
│ │ │ │ -
111 BufferDescriptor const &dvvDesc,
│ │ │ │ -
112 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
113
│ │ │ │ - │ │ │ │ +
95 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ +
96
│ │ │ │ +
98 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const {
│ │ │ │ +
99 return _fvarPatchArrays[fvarChannel];
│ │ │ │ +
100 }
│ │ │ │ +
101
│ │ │ │ +
103 GLuint GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ +
104 return _fvarIndexBuffers[fvarChannel];
│ │ │ │ +
105 }
│ │ │ │ +
106
│ │ │ │ +
108 GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel = 0) const {
│ │ │ │ +
109 return _fvarIndexTextures[fvarChannel];
│ │ │ │ +
110 }
│ │ │ │ +
111
│ │ │ │ +
113 GLuint GetFVarPatchParamBuffer(int fvarChannel = 0) const {
│ │ │ │ +
114 return _fvarParamBuffers[fvarChannel];
│ │ │ │ +
115 }
│ │ │ │
116
│ │ │ │ - │ │ │ │ -
119
│ │ │ │ -
147 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
148 static bool EvalStencils(
│ │ │ │ -
149 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
150 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
151 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
152 D3D11ComputeEvaluator const *instance,
│ │ │ │ -
153 ID3D11DeviceContext * deviceContext) {
│ │ │ │ -
154 if (instance) {
│ │ │ │ -
155 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
156 dstBuffer, dstDesc,
│ │ │ │ -
157 stencilTable,
│ │ │ │ -
158 deviceContext);
│ │ │ │ -
159 } else {
│ │ │ │ -
160 // Create an instance on demand (slow)
│ │ │ │ -
161 (void)deviceContext; // unused
│ │ │ │ -
162 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
165 deviceContext);
│ │ │ │ -
166 if (instance) {
│ │ │ │ -
167 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
168 dstBuffer, dstDesc,
│ │ │ │ -
169 stencilTable,
│ │ │ │ -
170 deviceContext);
│ │ │ │ -
171 delete instance;
│ │ │ │ -
172 return r;
│ │ │ │ -
173 }
│ │ │ │ -
174 return false;
│ │ │ │ -
175 }
│ │ │ │ -
176 }
│ │ │ │ -
177
│ │ │ │ -
180 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
182 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
183 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
184 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
185 ID3D11DeviceContext *deviceContext) const {
│ │ │ │ -
186 return EvalStencils(srcBuffer->BindD3D11UAV(deviceContext), srcDesc,
│ │ │ │ -
187 dstBuffer->BindD3D11UAV(deviceContext), dstDesc,
│ │ │ │ -
188 stencilTable->GetSizesSRV(),
│ │ │ │ -
189 stencilTable->GetOffsetsSRV(),
│ │ │ │ -
190 stencilTable->GetIndicesSRV(),
│ │ │ │ -
191 stencilTable->GetWeightsSRV(),
│ │ │ │ -
192 /* start = */ 0,
│ │ │ │ -
193 /* end = */ stencilTable->GetNumStencils(),
│ │ │ │ -
194 deviceContext);
│ │ │ │ -
195 }
│ │ │ │ -
196
│ │ │ │ -
199 bool EvalStencils(ID3D11UnorderedAccessView *srcSRV,
│ │ │ │ -
200 BufferDescriptor const &srcDesc,
│ │ │ │ -
201 ID3D11UnorderedAccessView *dstUAV,
│ │ │ │ -
202 BufferDescriptor const &dstDesc,
│ │ │ │ -
203 ID3D11ShaderResourceView *sizesSRV,
│ │ │ │ -
204 ID3D11ShaderResourceView *offsetsSRV,
│ │ │ │ -
205 ID3D11ShaderResourceView *indicesSRV,
│ │ │ │ -
206 ID3D11ShaderResourceView *weightsSRV,
│ │ │ │ -
207 int start,
│ │ │ │ -
208 int end,
│ │ │ │ -
209 ID3D11DeviceContext *deviceContext) const;
│ │ │ │ -
210
│ │ │ │ -
212 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
213 BufferDescriptor const &dstDesc,
│ │ │ │ -
214 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
215
│ │ │ │ -
217 static void Synchronize(ID3D11DeviceContext *deviceContext);
│ │ │ │ -
218
│ │ │ │ -
219private:
│ │ │ │ -
220 ID3D11ComputeShader * _computeShader;
│ │ │ │ -
221 ID3D11ClassLinkage * _classLinkage;
│ │ │ │ -
222 ID3D11ClassInstance * _singleBufferKernel;
│ │ │ │ -
223 ID3D11ClassInstance * _separateBufferKernel;
│ │ │ │ -
224 ID3D11Buffer * _uniformArgs; // uniform parameters for kernels
│ │ │ │ -
225
│ │ │ │ -
226 int _workGroupSize;
│ │ │ │ -
227};
│ │ │ │ -
228
│ │ │ │ -
229} // end namespace Osd
│ │ │ │ -
230
│ │ │ │ -
231} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
232using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
233
│ │ │ │ -
234} // end namespace OpenSubdiv
│ │ │ │ -
235
│ │ │ │ -
236
│ │ │ │ -
237#endif // OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
│ │ │ │ +
118 GLuint GetFVarPatchParamTextureBuffer(int fvarChannel = 0) const {
│ │ │ │ +
119 return _fvarParamTextures[fvarChannel];
│ │ │ │ +
120 }
│ │ │ │ +
121
│ │ │ │ +
122protected:
│ │ │ │ + │ │ │ │ +
124
│ │ │ │ +
125 // allocate buffers from patchTable
│ │ │ │ +
126 bool allocate(Far::PatchTable const *farPatchTable);
│ │ │ │ +
127
│ │ │ │ + │ │ │ │ +
129
│ │ │ │ + │ │ │ │ + │ │ │ │ +
132
│ │ │ │ + │ │ │ │ + │ │ │ │ +
135
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
139
│ │ │ │ +
140 std::vector<PatchArrayVector> _fvarPatchArrays;
│ │ │ │ +
141 std::vector<GLuint> _fvarIndexBuffers;
│ │ │ │ +
142 std::vector<GLuint> _fvarIndexTextures;
│ │ │ │ +
143
│ │ │ │ +
144 std::vector<GLuint> _fvarParamBuffers;
│ │ │ │ +
145 std::vector<GLuint> _fvarParamTextures;
│ │ │ │ +
146};
│ │ │ │ +
147
│ │ │ │ +
148
│ │ │ │ +
149} // end namespace Osd
│ │ │ │ +
150
│ │ │ │ +
151} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
152using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
153
│ │ │ │ +
154} // end namespace OpenSubdiv
│ │ │ │ +
155
│ │ │ │ +
156#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ -
static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
D3D11StencilTable(Far::StencilTable const *stencilTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ -
static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, ID3D11DeviceContext *deviceContext)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, ID3D11DeviceContext *deviceContext)
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, D3D11ComputeEvaluator const *instance, ID3D11DeviceContext *deviceContext)
Generic static compute function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, ID3D11DeviceContext *deviceContext)
│ │ │ │ - │ │ │ │ -
static void Synchronize(ID3D11DeviceContext *deviceContext)
Wait the dispatched kernel finishes.
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, ID3D11DeviceContext *deviceContext) const
│ │ │ │ -
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, ID3D11DeviceContext *deviceContext)
Configure DX kernel. Returns false if it fails to compile the kernel.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, BufferDescriptor const &srcDesc, ID3D11UnorderedAccessView *dstUAV, BufferDescriptor const &dstDesc, ID3D11ShaderResourceView *sizesSRV, ID3D11ShaderResourceView *offsetsSRV, ID3D11ShaderResourceView *indicesSRV, ID3D11ShaderResourceView *weightsSRV, int start, int end, ID3D11DeviceContext *deviceContext) const
│ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
PatchArrayVector const & GetPatchArrays() const
Returns the patch arrays for vertex index buffer data.
Definition: glPatchTable.h:55
│ │ │ │ +
GLuint GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying control vertices.
Definition: glPatchTable.h:103
│ │ │ │ + │ │ │ │ + │ │ │ │ +
GLuint GetPatchParamTextureBuffer() const
Returns the GL texture buffer containing the patch parameter.
Definition: glPatchTable.h:75
│ │ │ │ + │ │ │ │ +
bool allocate(Far::PatchTable const *farPatchTable)
│ │ │ │ +
static GLPatchTable * Create(Far::PatchTable const *farPatchTable, void *deviceContext=NULL)
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
GLuint GetPatchParamBuffer() const
Returns the GL index buffer containing the patch parameter.
Definition: glPatchTable.h:65
│ │ │ │ +
GLuint GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying patch params.
Definition: glPatchTable.h:113
│ │ │ │ + │ │ │ │ + │ │ │ │ +
GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel=0) const
Returns the GL texture buffer containing face-varying control vertices.
Definition: glPatchTable.h:108
│ │ │ │ +
GLuint GetFVarPatchParamTextureBuffer(int fvarChannel=0) const
Returns the GL texture buffer containing face-varying patch params.
Definition: glPatchTable.h:118
│ │ │ │ +
GLuint GetPatchIndexBuffer() const
Returns the GL index buffer containing the patch control vertices.
Definition: glPatchTable.h:60
│ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channel buffers.
Definition: glPatchTable.h:95
│ │ │ │ +
PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const
Returns the patch arrays for face-varying index buffer data.
Definition: glPatchTable.h:98
│ │ │ │ + │ │ │ │ + │ │ │ │ +
std::vector< PatchArrayVector > _fvarPatchArrays
Definition: glPatchTable.h:140
│ │ │ │ +
GLuint GetPatchIndexTextureBuffer() const
Returns the GL texture buffer containing the patch control vertices.
Definition: glPatchTable.h:70
│ │ │ │ +
GLuint GetVaryingPatchIndexTextureBuffer() const
Returns the GL texture buffer containing the varying control vertices.
Definition: glPatchTable.h:90
│ │ │ │ + │ │ │ │ +
GLuint GetVaryingPatchIndexBuffer() const
Returns the GL index buffer containing the varying control vertices.
Definition: glPatchTable.h:85
│ │ │ │ +
PatchArrayVector const & GetVaryingPatchArrays() const
Returns the patch arrays for varying index buffer data.
Definition: glPatchTable.h:80
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -d3d11ComputeEvaluator.h │ │ │ │ │ +glPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,274 +30,249 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30struct ID3D11DeviceContext; │ │ │ │ │ - 31struct ID3D11Buffer; │ │ │ │ │ - 32struct ID3D11ComputeShader; │ │ │ │ │ - 33struct ID3D11ClassLinkage; │ │ │ │ │ - 34struct ID3D11ClassInstance; │ │ │ │ │ - 35struct ID3D11ShaderResourceView; │ │ │ │ │ - 36struct ID3D11UnorderedAccessView; │ │ │ │ │ - 37 │ │ │ │ │ - 38#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 39 │ │ │ │ │ - 40namespace OpenSubdiv { │ │ │ │ │ - 41namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 30#include "../osd/nonCopyable.h" │ │ │ │ │ + 31#include "../osd/opengl.h" │ │ │ │ │ + 32#include "../osd/types.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34#include │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace OpenSubdiv { │ │ │ │ │ + 37namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 38 │ │ │ │ │ + 39namespace Far{ │ │ │ │ │ + 40 class PatchTable; │ │ │ │ │ + 41}; │ │ │ │ │ 42 │ │ │ │ │ - 43namespace Far { │ │ │ │ │ - 44 class StencilTable; │ │ │ │ │ - 45} │ │ │ │ │ - 46 │ │ │ │ │ - 47namespace Osd { │ │ │ │ │ + 43namespace Osd { │ │ │ │ │ + 44 │ │ │ │ │ +45class GLPatchTable : private NonCopyable { │ │ │ │ │ + 46public: │ │ │ │ │ +47 typedef GLuint VertexBufferBinding; │ │ │ │ │ 48 │ │ │ │ │ -56class D3D11StencilTable { │ │ │ │ │ - 57public: │ │ │ │ │ - 58 template │ │ │ │ │ -59 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ - 60 DEVICE_CONTEXT context) { │ │ │ │ │ - 61 return new D3D11StencilTable(stencilTable, context->GetDeviceContext()); │ │ │ │ │ +49 ~GLPatchTable(); │ │ │ │ │ + 50 │ │ │ │ │ +51 static GLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ + 52 void *deviceContext = NULL); │ │ │ │ │ + 53 │ │ │ │ │ +55 PatchArrayVector const &GetPatchArrays() const { │ │ │ │ │ + 56 return _patchArrays; │ │ │ │ │ + 57 } │ │ │ │ │ + 58 │ │ │ │ │ +60 GLuint GetPatchIndexBuffer() const { │ │ │ │ │ + 61 return _patchIndexBuffer; │ │ │ │ │ 62 } │ │ │ │ │ 63 │ │ │ │ │ -64 static D3D11StencilTable *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ - 65 ID3D11DeviceContext *deviceContext) { │ │ │ │ │ - 66 return new D3D11StencilTable(stencilTable, deviceContext); │ │ │ │ │ +65 GLuint GetPatchParamBuffer() const { │ │ │ │ │ + 66 return _patchParamBuffer; │ │ │ │ │ 67 } │ │ │ │ │ 68 │ │ │ │ │ -69 D3D11StencilTable(Far::StencilTable const *stencilTable, │ │ │ │ │ - 70 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 71 │ │ │ │ │ -72 ~D3D11StencilTable(); │ │ │ │ │ +70 GLuint GetPatchIndexTextureBuffer() const { │ │ │ │ │ + 71 return _patchIndexTexture; │ │ │ │ │ + 72 } │ │ │ │ │ 73 │ │ │ │ │ - 74 // interfaces needed for D3D11ComputeEvaluator │ │ │ │ │ -75 ID3D11ShaderResourceView *GetSizesSRV() const { return _sizes; } │ │ │ │ │ -76 ID3D11ShaderResourceView *GetOffsetsSRV() const { return _offsets; } │ │ │ │ │ -77 ID3D11ShaderResourceView *GetIndicesSRV() const { return _indices; } │ │ │ │ │ -78 ID3D11ShaderResourceView *GetWeightsSRV() const { return _weights; } │ │ │ │ │ -79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ - 80 │ │ │ │ │ - 81private: │ │ │ │ │ - 82 ID3D11ShaderResourceView *_sizes; │ │ │ │ │ - 83 ID3D11ShaderResourceView *_offsets; │ │ │ │ │ - 84 ID3D11ShaderResourceView *_indices; │ │ │ │ │ - 85 ID3D11ShaderResourceView *_weights; │ │ │ │ │ - 86 ID3D11Buffer *_sizesBuffer; │ │ │ │ │ - 87 ID3D11Buffer *_offsetsBuffer; │ │ │ │ │ - 88 ID3D11Buffer *_indicesBuffer; │ │ │ │ │ - 89 ID3D11Buffer *_weightsBuffer; │ │ │ │ │ - 90 │ │ │ │ │ - 91 int _numStencils; │ │ │ │ │ - 92}; │ │ │ │ │ +75 GLuint GetPatchParamTextureBuffer() const { │ │ │ │ │ + 76 return _patchParamTexture; │ │ │ │ │ + 77 } │ │ │ │ │ + 78 │ │ │ │ │ +80 PatchArrayVector const &GetVaryingPatchArrays() const { │ │ │ │ │ + 81 return _varyingPatchArrays; │ │ │ │ │ + 82 } │ │ │ │ │ + 83 │ │ │ │ │ +85 GLuint GetVaryingPatchIndexBuffer() const { │ │ │ │ │ + 86 return _varyingIndexBuffer; │ │ │ │ │ + 87 } │ │ │ │ │ + 88 │ │ │ │ │ +90 GLuint GetVaryingPatchIndexTextureBuffer() const { │ │ │ │ │ + 91 return _varyingIndexTexture; │ │ │ │ │ + 92 } │ │ │ │ │ 93 │ │ │ │ │ - 94// ------------------------------------------------------------------------- │ │ │ │ │ --- │ │ │ │ │ - 95 │ │ │ │ │ -96class D3D11ComputeEvaluator { │ │ │ │ │ - 97public: │ │ │ │ │ -98 typedef bool Instantiatable; │ │ │ │ │ -99 static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 100 BufferDescriptor const &dstDesc, │ │ │ │ │ - 101 BufferDescriptor const &duDesc, │ │ │ │ │ - 102 BufferDescriptor const &dvDesc, │ │ │ │ │ - 103 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 104 │ │ │ │ │ -105 static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 106 BufferDescriptor const &dstDesc, │ │ │ │ │ - 107 BufferDescriptor const &duDesc, │ │ │ │ │ - 108 BufferDescriptor const &dvDesc, │ │ │ │ │ - 109 BufferDescriptor const &duuDesc, │ │ │ │ │ - 110 BufferDescriptor const &duvDesc, │ │ │ │ │ - 111 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 112 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 113 │ │ │ │ │ -115 D3D11ComputeEvaluator(); │ │ │ │ │ +95 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ + 96 │ │ │ │ │ +98 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const { │ │ │ │ │ + 99 return _fvarPatchArrays[fvarChannel]; │ │ │ │ │ + 100 } │ │ │ │ │ + 101 │ │ │ │ │ +103 GLuint GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 104 return _fvarIndexBuffers[fvarChannel]; │ │ │ │ │ + 105 } │ │ │ │ │ + 106 │ │ │ │ │ +108 GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 109 return _fvarIndexTextures[fvarChannel]; │ │ │ │ │ + 110 } │ │ │ │ │ + 111 │ │ │ │ │ +113 GLuint GetFVarPatchParamBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 114 return _fvarParamBuffers[fvarChannel]; │ │ │ │ │ + 115 } │ │ │ │ │ 116 │ │ │ │ │ -118 ~D3D11ComputeEvaluator(); │ │ │ │ │ - 119 │ │ │ │ │ - 147 template │ │ │ │ │ -148 static bool EvalStencils( │ │ │ │ │ - 149 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 150 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 151 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 152 D3D11ComputeEvaluator const *instance, │ │ │ │ │ - 153 ID3D11DeviceContext * deviceContext) { │ │ │ │ │ - 154 if (instance) { │ │ │ │ │ - 155 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 156 dstBuffer, dstDesc, │ │ │ │ │ - 157 stencilTable, │ │ │ │ │ - 158 deviceContext); │ │ │ │ │ - 159 } else { │ │ │ │ │ - 160 // Create an instance on demand (slow) │ │ │ │ │ - 161 (void)deviceContext; // unused │ │ │ │ │ - 162 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 163 BufferDescriptor(), │ │ │ │ │ - 164 BufferDescriptor(), │ │ │ │ │ - 165 deviceContext); │ │ │ │ │ - 166 if (instance) { │ │ │ │ │ - 167 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 168 dstBuffer, dstDesc, │ │ │ │ │ - 169 stencilTable, │ │ │ │ │ - 170 deviceContext); │ │ │ │ │ - 171 delete instance; │ │ │ │ │ - 172 return r; │ │ │ │ │ - 173 } │ │ │ │ │ - 174 return false; │ │ │ │ │ - 175 } │ │ │ │ │ - 176 } │ │ │ │ │ - 177 │ │ │ │ │ - 180 template │ │ │ │ │ -181 bool EvalStencils( │ │ │ │ │ - 182 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 183 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 184 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 185 ID3D11DeviceContext *deviceContext) const { │ │ │ │ │ - 186 return EvalStencils(srcBuffer->BindD3D11UAV(deviceContext), srcDesc, │ │ │ │ │ - 187 dstBuffer->BindD3D11UAV(deviceContext), dstDesc, │ │ │ │ │ - 188 stencilTable->GetSizesSRV(), │ │ │ │ │ - 189 stencilTable->GetOffsetsSRV(), │ │ │ │ │ - 190 stencilTable->GetIndicesSRV(), │ │ │ │ │ - 191 stencilTable->GetWeightsSRV(), │ │ │ │ │ - 192 /* start = */ 0, │ │ │ │ │ - 193 /* end = */ stencilTable->GetNumStencils(), │ │ │ │ │ - 194 deviceContext); │ │ │ │ │ - 195 } │ │ │ │ │ - 196 │ │ │ │ │ -199 bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, │ │ │ │ │ - 200 BufferDescriptor const &srcDesc, │ │ │ │ │ - 201 ID3D11UnorderedAccessView *dstUAV, │ │ │ │ │ - 202 BufferDescriptor const &dstDesc, │ │ │ │ │ - 203 ID3D11ShaderResourceView *sizesSRV, │ │ │ │ │ - 204 ID3D11ShaderResourceView *offsetsSRV, │ │ │ │ │ - 205 ID3D11ShaderResourceView *indicesSRV, │ │ │ │ │ - 206 ID3D11ShaderResourceView *weightsSRV, │ │ │ │ │ - 207 int start, │ │ │ │ │ - 208 int end, │ │ │ │ │ - 209 ID3D11DeviceContext *deviceContext) const; │ │ │ │ │ - 210 │ │ │ │ │ -212 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 213 BufferDescriptor const &dstDesc, │ │ │ │ │ - 214 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 215 │ │ │ │ │ -217 static void Synchronize(ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 218 │ │ │ │ │ - 219private: │ │ │ │ │ - 220 ID3D11ComputeShader * _computeShader; │ │ │ │ │ - 221 ID3D11ClassLinkage * _classLinkage; │ │ │ │ │ - 222 ID3D11ClassInstance * _singleBufferKernel; │ │ │ │ │ - 223 ID3D11ClassInstance * _separateBufferKernel; │ │ │ │ │ - 224 ID3D11Buffer * _uniformArgs; // uniform parameters for kernels │ │ │ │ │ - 225 │ │ │ │ │ - 226 int _workGroupSize; │ │ │ │ │ - 227}; │ │ │ │ │ - 228 │ │ │ │ │ - 229} // end namespace Osd │ │ │ │ │ - 230 │ │ │ │ │ - 231} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 232using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 233 │ │ │ │ │ - 234} // end namespace OpenSubdiv │ │ │ │ │ - 235 │ │ │ │ │ - 236 │ │ │ │ │ - 237#endif // OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H │ │ │ │ │ +118 GLuint GetFVarPatchParamTextureBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 119 return _fvarParamTextures[fvarChannel]; │ │ │ │ │ + 120 } │ │ │ │ │ + 121 │ │ │ │ │ + 122protected: │ │ │ │ │ +123 GLPatchTable(); │ │ │ │ │ + 124 │ │ │ │ │ + 125 // allocate buffers from patchTable │ │ │ │ │ +126 bool allocate(Far::PatchTable const *farPatchTable); │ │ │ │ │ + 127 │ │ │ │ │ +128 PatchArrayVector _patchArrays; │ │ │ │ │ + 129 │ │ │ │ │ +130 GLuint _patchIndexBuffer; │ │ │ │ │ +131 GLuint _patchParamBuffer; │ │ │ │ │ + 132 │ │ │ │ │ +133 GLuint _patchIndexTexture; │ │ │ │ │ +134 GLuint _patchParamTexture; │ │ │ │ │ + 135 │ │ │ │ │ +136 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ +137 GLuint _varyingIndexBuffer; │ │ │ │ │ +138 GLuint _varyingIndexTexture; │ │ │ │ │ + 139 │ │ │ │ │ +140 std::vector _fvarPatchArrays; │ │ │ │ │ +141 std::vector _fvarIndexBuffers; │ │ │ │ │ +142 std::vector _fvarIndexTextures; │ │ │ │ │ + 143 │ │ │ │ │ +144 std::vector _fvarParamBuffers; │ │ │ │ │ +145 std::vector _fvarParamTextures; │ │ │ │ │ + 146}; │ │ │ │ │ + 147 │ │ │ │ │ + 148 │ │ │ │ │ + 149} // end namespace Osd │ │ │ │ │ + 150 │ │ │ │ │ + 151} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 152using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 153 │ │ │ │ │ + 154} // end namespace OpenSubdiv │ │ │ │ │ + 155 │ │ │ │ │ + 156#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable │ │ │ │ │ -D3D11 stencil table. │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:56 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::Create │ │ │ │ │ -static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ -DEVICE_CONTEXT context) │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:59 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetOffsetsSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetOffsetsSRV() const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetNumStencils │ │ │ │ │ -int GetNumStencils() const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetIndicesSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetIndicesSRV() const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::~D3D11StencilTable │ │ │ │ │ -~D3D11StencilTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::D3D11StencilTable │ │ │ │ │ -D3D11StencilTable(Far::StencilTable const *stencilTable, ID3D11DeviceContext │ │ │ │ │ -*deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::Create │ │ │ │ │ -static D3D11StencilTable * Create(Far::StencilTable const *stencilTable, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:64 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetSizesSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetSizesSRV() const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11StencilTable::GetWeightsSRV │ │ │ │ │ -ID3D11ShaderResourceView * GetWeightsSRV() const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:96 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Create │ │ │ │ │ -static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, ID3D11DeviceContext *deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, D3D11ComputeEvaluator const *instance, ID3D11DeviceContext │ │ │ │ │ -*deviceContext) │ │ │ │ │ -Generic static compute function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:148 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Create │ │ │ │ │ -static D3D11ComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Instantiatable │ │ │ │ │ -bool Instantiatable │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Wait the dispatched kernel finishes. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ -*stencilTable, ID3D11DeviceContext *deviceContext) const │ │ │ │ │ -Definition: d3d11ComputeEvaluator.h:181 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::Compile │ │ │ │ │ -bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Configure DX kernel. Returns false if it fails to compile the kernel. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator:: │ │ │ │ │ -D3D11ComputeEvaluator │ │ │ │ │ -D3D11ComputeEvaluator() │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator:: │ │ │ │ │ -~D3D11ComputeEvaluator │ │ │ │ │ -~D3D11ComputeEvaluator() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::D3D11ComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(ID3D11UnorderedAccessView *srcSRV, BufferDescriptor const │ │ │ │ │ -&srcDesc, ID3D11UnorderedAccessView *dstUAV, BufferDescriptor const &dstDesc, │ │ │ │ │ -ID3D11ShaderResourceView *sizesSRV, ID3D11ShaderResourceView *offsetsSRV, │ │ │ │ │ -ID3D11ShaderResourceView *indicesSRV, ID3D11ShaderResourceView *weightsSRV, int │ │ │ │ │ -start, int end, ID3D11DeviceContext *deviceContext) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable │ │ │ │ │ +Definition: glPatchTable.h:45 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::VertexBufferBinding │ │ │ │ │ +GLuint VertexBufferBinding │ │ │ │ │ +Definition: glPatchTable.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarIndexBuffers │ │ │ │ │ +std::vector< GLuint > _fvarIndexBuffers │ │ │ │ │ +Definition: glPatchTable.h:141 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchArrays │ │ │ │ │ +PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ +Returns the patch arrays for vertex index buffer data. │ │ │ │ │ +Definition: glPatchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ +GLuint GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the GL index buffer containing face-varying control vertices. │ │ │ │ │ +Definition: glPatchTable.h:103 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::~GLPatchTable │ │ │ │ │ +~GLPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarParamBuffers │ │ │ │ │ +std::vector< GLuint > _fvarParamBuffers │ │ │ │ │ +Definition: glPatchTable.h:144 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchParamTextureBuffer │ │ │ │ │ +GLuint GetPatchParamTextureBuffer() const │ │ │ │ │ +Returns the GL texture buffer containing the patch parameter. │ │ │ │ │ +Definition: glPatchTable.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingIndexBuffer │ │ │ │ │ +GLuint _varyingIndexBuffer │ │ │ │ │ +Definition: glPatchTable.h:137 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::allocate │ │ │ │ │ +bool allocate(Far::PatchTable const *farPatchTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::Create │ │ │ │ │ +static GLPatchTable * Create(Far::PatchTable const *farPatchTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingIndexTexture │ │ │ │ │ +GLuint _varyingIndexTexture │ │ │ │ │ +Definition: glPatchTable.h:138 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarParamTextures │ │ │ │ │ +std::vector< GLuint > _fvarParamTextures │ │ │ │ │ +Definition: glPatchTable.h:145 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchArrays │ │ │ │ │ +PatchArrayVector _patchArrays │ │ │ │ │ +Definition: glPatchTable.h:128 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchIndexBuffer │ │ │ │ │ +GLuint _patchIndexBuffer │ │ │ │ │ +Definition: glPatchTable.h:130 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchParamBuffer │ │ │ │ │ +GLuint GetPatchParamBuffer() const │ │ │ │ │ +Returns the GL index buffer containing the patch parameter. │ │ │ │ │ +Definition: glPatchTable.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ +GLuint GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the GL index buffer containing face-varying patch params. │ │ │ │ │ +Definition: glPatchTable.h:113 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchParamTexture │ │ │ │ │ +GLuint _patchParamTexture │ │ │ │ │ +Definition: glPatchTable.h:134 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GLPatchTable │ │ │ │ │ +GLPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ +GetFVarPatchIndexTextureBuffer │ │ │ │ │ +GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the GL texture buffer containing face-varying control vertices. │ │ │ │ │ +Definition: glPatchTable.h:108 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ +GetFVarPatchParamTextureBuffer │ │ │ │ │ +GLuint GetFVarPatchParamTextureBuffer(int fvarChannel=0) const │ │ │ │ │ +Returns the GL texture buffer containing face-varying patch params. │ │ │ │ │ +Definition: glPatchTable.h:118 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchIndexBuffer │ │ │ │ │ +GLuint GetPatchIndexBuffer() const │ │ │ │ │ +Returns the GL index buffer containing the patch control vertices. │ │ │ │ │ +Definition: glPatchTable.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channel buffers. │ │ │ │ │ +Definition: glPatchTable.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchArrays │ │ │ │ │ +PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const │ │ │ │ │ +Returns the patch arrays for face-varying index buffer data. │ │ │ │ │ +Definition: glPatchTable.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarIndexTextures │ │ │ │ │ +std::vector< GLuint > _fvarIndexTextures │ │ │ │ │ +Definition: glPatchTable.h:142 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchIndexTexture │ │ │ │ │ +GLuint _patchIndexTexture │ │ │ │ │ +Definition: glPatchTable.h:133 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarPatchArrays │ │ │ │ │ +std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ +Definition: glPatchTable.h:140 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchIndexTextureBuffer │ │ │ │ │ +GLuint GetPatchIndexTextureBuffer() const │ │ │ │ │ +Returns the GL texture buffer containing the patch control vertices. │ │ │ │ │ +Definition: glPatchTable.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ +GetVaryingPatchIndexTextureBuffer │ │ │ │ │ +GLuint GetVaryingPatchIndexTextureBuffer() const │ │ │ │ │ +Returns the GL texture buffer containing the varying control vertices. │ │ │ │ │ +Definition: glPatchTable.h:90 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingPatchArrays │ │ │ │ │ +PatchArrayVector _varyingPatchArrays │ │ │ │ │ +Definition: glPatchTable.h:136 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ +GLuint GetVaryingPatchIndexBuffer() const │ │ │ │ │ +Returns the GL index buffer containing the varying control vertices. │ │ │ │ │ +Definition: glPatchTable.h:85 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetVaryingPatchArrays │ │ │ │ │ +PatchArrayVector const & GetVaryingPatchArrays() const │ │ │ │ │ +Returns the patch arrays for varying index buffer data. │ │ │ │ │ +Definition: glPatchTable.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchParamBuffer │ │ │ │ │ +GLuint _patchParamBuffer │ │ │ │ │ +Definition: glPatchTable.h:131 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * d3d11ComputeEvaluator.h │ │ │ │ │ + * glPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00845.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuD3D11VertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,26 +83,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
cpuD3D11VertexBuffer.h File Reference
│ │ │ │ +
glVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │ #include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CpuD3D11VertexBuffer
 Concrete vertex buffer class for Cpu subdivision and DirectX drawing. More...
class  GLVertexBuffer
 Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -111,13 +112,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -cpuD3D11VertexBuffer.h File Reference │ │ │ │ │ +glVertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../osd/opengl.h" │ │ │ │ │ #include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CpuD3D11VertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for Cpu subdivision and DirectX drawing. │ │ │ │ │ +class  GLVertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. │ │ │ │ │ More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cpuD3D11VertexBuffer.h │ │ │ │ │ + * glVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00845.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00845 = [ │ │ │ │ │ - ["CpuD3D11VertexBuffer", "a01153.html", "a01153"] │ │ │ │ │ + ["GLVertexBuffer", "a01237.html", "a01237"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00845_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuD3D11VertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cpuD3D11VertexBuffer.h
│ │ │ │ +
glVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,87 +107,76 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include <cstddef>
│ │ │ │ -
30
│ │ │ │ -
31struct ID3D11Buffer;
│ │ │ │ -
32struct ID3D11Device;
│ │ │ │ -
33struct ID3D11DeviceContext;
│ │ │ │ -
34
│ │ │ │ -
35namespace OpenSubdiv {
│ │ │ │ -
36namespace OPENSUBDIV_VERSION {
│ │ │ │ +
29
│ │ │ │ +
30#include "../osd/opengl.h"
│ │ │ │ +
31#include <cstddef>
│ │ │ │ +
32
│ │ │ │ +
33namespace OpenSubdiv {
│ │ │ │ +
34namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35
│ │ │ │ +
36namespace Osd {
│ │ │ │
37
│ │ │ │ -
38namespace Osd {
│ │ │ │ -
39
│ │ │ │ - │ │ │ │ -
49public:
│ │ │ │ -
51 static CpuD3D11VertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
52 ID3D11DeviceContext *deviceContext);
│ │ │ │ -
53
│ │ │ │ - │ │ │ │ -
56
│ │ │ │ -
59 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
60 void *deviceContext = NULL);
│ │ │ │ -
61
│ │ │ │ -
63 int GetNumElements() const;
│ │ │ │ -
64
│ │ │ │ -
66 int GetNumVertices() const;
│ │ │ │ -
67
│ │ │ │ -
69 float * BindCpuBuffer();
│ │ │ │ + │ │ │ │ +
45public:
│ │ │ │ +
47 static GLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
48 void *deviceContext = NULL);
│ │ │ │ +
49
│ │ │ │ + │ │ │ │ +
52
│ │ │ │ +
55 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
56 void *deviceContext = NULL);
│ │ │ │ +
57
│ │ │ │ +
59 int GetNumElements() const;
│ │ │ │ +
60
│ │ │ │ +
62 int GetNumVertices() const;
│ │ │ │ +
63
│ │ │ │ +
65 GLuint BindVBO(void *deviceContext = NULL);
│ │ │ │ +
66
│ │ │ │ +
67protected:
│ │ │ │ +
69 GLVertexBuffer(int numElements, int numVertices);
│ │ │ │
70
│ │ │ │ -
72 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext);
│ │ │ │ -
73
│ │ │ │ -
75 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) {
│ │ │ │ -
76 return BindD3D11Buffer(deviceContext);
│ │ │ │ -
77 }
│ │ │ │ -
78
│ │ │ │ -
79protected:
│ │ │ │ -
81 CpuD3D11VertexBuffer(int numElements, int numVertices);
│ │ │ │ +
73 bool allocate();
│ │ │ │ +
74
│ │ │ │ +
75private:
│ │ │ │ +
76 int _numElements;
│ │ │ │ +
77 int _numVertices;
│ │ │ │ +
78 GLuint _vbo;
│ │ │ │ +
79};
│ │ │ │ +
80
│ │ │ │ +
81} // end namespace Osd
│ │ │ │
82
│ │ │ │ -
83 bool allocate(ID3D11Device *device);
│ │ │ │ -
84
│ │ │ │ -
85private:
│ │ │ │ -
86 int _numElements;
│ │ │ │ -
87 int _numVertices;
│ │ │ │ -
88 ID3D11Buffer *_d3d11Buffer;
│ │ │ │ -
89 float *_cpuBuffer;
│ │ │ │ -
90};
│ │ │ │ -
91
│ │ │ │ -
92} // end namespace Osd
│ │ │ │ -
93
│ │ │ │ -
94} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
95using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
96
│ │ │ │ -
97} // end namespace OpenSubdiv
│ │ │ │ -
98
│ │ │ │ -
99#endif // OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
│ │ │ │ +
83} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
84using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
85
│ │ │ │ +
86} // end namespace OpenSubdiv
│ │ │ │ +
87
│ │ │ │ +
88#endif // OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for Cpu subdivision and DirectX drawing.
│ │ │ │ -
static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
│ │ │ │ -
CpuD3D11VertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
│ │ │ │ -
float * BindCpuBuffer()
Returns the address of CPU buffer.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)
│ │ │ │ +
Concrete vertex buffer class for GLSL subdivision and OpenGL drawing.
│ │ │ │ + │ │ │ │ +
GLuint BindVBO(void *deviceContext=NULL)
Returns the GL buffer object.
│ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ +
GLVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
static GLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cpuD3D11VertexBuffer.h │ │ │ │ │ +glVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,105 +30,88 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include │ │ │ │ │ - 30 │ │ │ │ │ - 31struct ID3D11Buffer; │ │ │ │ │ - 32struct ID3D11Device; │ │ │ │ │ - 33struct ID3D11DeviceContext; │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace OpenSubdiv { │ │ │ │ │ - 36namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 29 │ │ │ │ │ + 30#include "../osd/opengl.h" │ │ │ │ │ + 31#include │ │ │ │ │ + 32 │ │ │ │ │ + 33namespace OpenSubdiv { │ │ │ │ │ + 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Osd { │ │ │ │ │ 37 │ │ │ │ │ - 38namespace Osd { │ │ │ │ │ - 39 │ │ │ │ │ -48class CpuD3D11VertexBuffer { │ │ │ │ │ - 49public: │ │ │ │ │ -51 static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 52 ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 53 │ │ │ │ │ -55 virtual ~CpuD3D11VertexBuffer(); │ │ │ │ │ - 56 │ │ │ │ │ -59 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 60 void *deviceContext = NULL); │ │ │ │ │ - 61 │ │ │ │ │ -63 int GetNumElements() const; │ │ │ │ │ - 64 │ │ │ │ │ -66 int GetNumVertices() const; │ │ │ │ │ - 67 │ │ │ │ │ -69 float * BindCpuBuffer(); │ │ │ │ │ +44class GLVertexBuffer { │ │ │ │ │ + 45public: │ │ │ │ │ +47 static GLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 48 void *deviceContext = NULL); │ │ │ │ │ + 49 │ │ │ │ │ +51 ~GLVertexBuffer(); │ │ │ │ │ + 52 │ │ │ │ │ +55 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 56 void *deviceContext = NULL); │ │ │ │ │ + 57 │ │ │ │ │ +59 int GetNumElements() const; │ │ │ │ │ + 60 │ │ │ │ │ +62 int GetNumVertices() const; │ │ │ │ │ + 63 │ │ │ │ │ +65 GLuint BindVBO(void *deviceContext = NULL); │ │ │ │ │ + 66 │ │ │ │ │ + 67protected: │ │ │ │ │ +69 GLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ 70 │ │ │ │ │ -72 ID3D11Buffer *BindD3D11Buffer(ID3D11DeviceContext *deviceContext); │ │ │ │ │ - 73 │ │ │ │ │ -75 ID3D11Buffer *BindVBO(ID3D11DeviceContext *deviceContext) { │ │ │ │ │ - 76 return BindD3D11Buffer(deviceContext); │ │ │ │ │ - 77 } │ │ │ │ │ - 78 │ │ │ │ │ - 79protected: │ │ │ │ │ -81 CpuD3D11VertexBuffer(int numElements, int numVertices); │ │ │ │ │ +73 bool allocate(); │ │ │ │ │ + 74 │ │ │ │ │ + 75private: │ │ │ │ │ + 76 int _numElements; │ │ │ │ │ + 77 int _numVertices; │ │ │ │ │ + 78 GLuint _vbo; │ │ │ │ │ + 79}; │ │ │ │ │ + 80 │ │ │ │ │ + 81} // end namespace Osd │ │ │ │ │ 82 │ │ │ │ │ -83 bool allocate(ID3D11Device *device); │ │ │ │ │ - 84 │ │ │ │ │ - 85private: │ │ │ │ │ - 86 int _numElements; │ │ │ │ │ - 87 int _numVertices; │ │ │ │ │ - 88 ID3D11Buffer *_d3d11Buffer; │ │ │ │ │ - 89 float *_cpuBuffer; │ │ │ │ │ - 90}; │ │ │ │ │ - 91 │ │ │ │ │ - 92} // end namespace Osd │ │ │ │ │ - 93 │ │ │ │ │ - 94} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 95using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 96 │ │ │ │ │ - 97} // end namespace OpenSubdiv │ │ │ │ │ - 98 │ │ │ │ │ - 99#endif // OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H │ │ │ │ │ + 83} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 84using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 85 │ │ │ │ │ + 86} // end namespace OpenSubdiv │ │ │ │ │ + 87 │ │ │ │ │ + 88#endif // OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer │ │ │ │ │ -Concrete vertex buffer class for Cpu subdivision and DirectX drawing. │ │ │ │ │ -Definition: cpuD3D11VertexBuffer.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::Create │ │ │ │ │ -static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ -ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::CpuD3D11VertexBuffer │ │ │ │ │ -CpuD3D11VertexBuffer(int numElements, int numVertices) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::GetNumElements │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer │ │ │ │ │ +Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. │ │ │ │ │ +Definition: glVertexBuffer.h:44 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::~GLVertexBuffer │ │ │ │ │ +~GLVertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::BindVBO │ │ │ │ │ +GLuint BindVBO(void *deviceContext=NULL) │ │ │ │ │ +Returns the GL buffer object. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GetNumElements │ │ │ │ │ int GetNumElements() const │ │ │ │ │ Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::UpdateData │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::UpdateData │ │ │ │ │ void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ *deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::GetNumVertices │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GLVertexBuffer │ │ │ │ │ +GLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ +Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GetNumVertices │ │ │ │ │ int GetNumVertices() const │ │ │ │ │ Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindD3D11Buffer │ │ │ │ │ -ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Returns the D3D11 buffer object. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindCpuBuffer │ │ │ │ │ -float * BindCpuBuffer() │ │ │ │ │ -Returns the address of CPU buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::allocate │ │ │ │ │ -bool allocate(ID3D11Device *device) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer:: │ │ │ │ │ -~CpuD3D11VertexBuffer │ │ │ │ │ -virtual ~CpuD3D11VertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuD3D11VertexBuffer::BindVBO │ │ │ │ │ -ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext) │ │ │ │ │ -Returns the D3D11 buffer object (for Osd::Mesh interface) │ │ │ │ │ -Definition: cpuD3D11VertexBuffer.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::Create │ │ │ │ │ +static GLVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::allocate │ │ │ │ │ +bool allocate() │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cpuD3D11VertexBuffer.h │ │ │ │ │ + * glVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00848.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glComputeEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/glLegacyGregoryPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,47 +83,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
glComputeEvaluator.h File Reference
│ │ │ │ +
glLegacyGregoryPatchTable.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  GLStencilTableSSBO
 GL stencil table (Shader Storage buffer) More...
 
class  GLComputeEvaluator
class  GLLegacyGregoryPatchTable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -glComputeEvaluator.h File Reference │ │ │ │ │ +glLegacyGregoryPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../far/patchTable.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ #include "../osd/opengl.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  GLStencilTableSSBO │ │ │ │ │ -  GL stencil table (Shader Storage buffer) More... │ │ │ │ │ -  │ │ │ │ │ -class  GLComputeEvaluator │ │ │ │ │ +class  GLLegacyGregoryPatchTable │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glComputeEvaluator.h │ │ │ │ │ + * glLegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00848.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00848 = [ │ │ │ │ │ - ["GLStencilTableSSBO", "a01209.html", "a01209"], │ │ │ │ │ - ["GLComputeEvaluator", "a01213.html", "a01213"] │ │ │ │ │ + ["GLLegacyGregoryPatchTable", "a01225.html", "a01225"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00848_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glComputeEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/glLegacyGregoryPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glComputeEvaluator.h
│ │ │ │ +
glLegacyGregoryPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,1072 +107,93 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/opengl.h"
│ │ │ │ -
31#include "../osd/types.h"
│ │ │ │ -
32#include "../osd/bufferDescriptor.h"
│ │ │ │ +
30#include "../far/patchTable.h"
│ │ │ │ +
31#include "../osd/nonCopyable.h"
│ │ │ │ +
32#include "../osd/opengl.h"
│ │ │ │
33
│ │ │ │
34namespace OpenSubdiv {
│ │ │ │
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38 class PatchTable;
│ │ │ │ -
39 class StencilTable;
│ │ │ │ -
40 class LimitStencilTable;
│ │ │ │ -
41}
│ │ │ │ -
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ -
44
│ │ │ │ - │ │ │ │ -
52public:
│ │ │ │ -
53 static GLStencilTableSSBO *Create(Far::StencilTable const *stencilTable,
│ │ │ │ -
54 void *deviceContext = NULL) {
│ │ │ │ -
55 (void)deviceContext; // unused
│ │ │ │ -
56 return new GLStencilTableSSBO(stencilTable);
│ │ │ │ -
57 }
│ │ │ │ - │ │ │ │ -
59 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ -
60 void *deviceContext = NULL) {
│ │ │ │ -
61 (void)deviceContext; // unused
│ │ │ │ -
62 return new GLStencilTableSSBO(limitStencilTable);
│ │ │ │ -
63 }
│ │ │ │ -
64
│ │ │ │ -
65 explicit GLStencilTableSSBO(Far::StencilTable const *stencilTable);
│ │ │ │ -
66 explicit GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable);
│ │ │ │ - │ │ │ │ -
68
│ │ │ │ -
69 // interfaces needed for GLSLComputeKernel
│ │ │ │ -
70 GLuint GetSizesBuffer() const { return _sizes; }
│ │ │ │ -
71 GLuint GetOffsetsBuffer() const { return _offsets; }
│ │ │ │ -
72 GLuint GetIndicesBuffer() const { return _indices; }
│ │ │ │ -
73 GLuint GetWeightsBuffer() const { return _weights; }
│ │ │ │ -
74 GLuint GetDuWeightsBuffer() const { return _duWeights; }
│ │ │ │ -
75 GLuint GetDvWeightsBuffer() const { return _dvWeights; }
│ │ │ │ -
76 GLuint GetDuuWeightsBuffer() const { return _duuWeights; }
│ │ │ │ -
77 GLuint GetDuvWeightsBuffer() const { return _duvWeights; }
│ │ │ │ -
78 GLuint GetDvvWeightsBuffer() const { return _dvvWeights; }
│ │ │ │ -
79 int GetNumStencils() const { return _numStencils; }
│ │ │ │ +
37namespace Osd {
│ │ │ │ +
38
│ │ │ │ + │ │ │ │ +
40 : private NonCopyable<GLLegacyGregoryPatchTable> {
│ │ │ │ +
41public:
│ │ │ │ + │ │ │ │ +
43
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ +
46 void UpdateVertexBuffer(GLuint vbo);
│ │ │ │ +
47
│ │ │ │ +
48 GLuint GetVertexTextureBuffer() const {
│ │ │ │ +
49 return _vertexTextureBuffer;
│ │ │ │ +
50 }
│ │ │ │ +
51
│ │ │ │ + │ │ │ │ +
53 return _vertexValenceTextureBuffer;
│ │ │ │ +
54 }
│ │ │ │ +
55
│ │ │ │ + │ │ │ │ +
57 return _quadOffsetsTextureBuffer;
│ │ │ │ +
58 }
│ │ │ │ +
59
│ │ │ │ + │ │ │ │ + │ │ │ │ +
62 return _quadOffsetsBase[1];
│ │ │ │ +
63 }
│ │ │ │ +
64 return _quadOffsetsBase[0];
│ │ │ │ +
65 }
│ │ │ │ +
66
│ │ │ │ +
67protected:
│ │ │ │ + │ │ │ │ +
69
│ │ │ │ +
70private:
│ │ │ │ +
71 GLuint _vertexTextureBuffer;
│ │ │ │ +
72 GLuint _vertexValenceTextureBuffer;
│ │ │ │ +
73 GLuint _quadOffsetsTextureBuffer;
│ │ │ │ +
74 GLuint _quadOffsetsBase[2]; // gregory, boundaryGregory
│ │ │ │ +
75};
│ │ │ │ +
76
│ │ │ │ +
77
│ │ │ │ +
78
│ │ │ │ +
79} // end namespace Osd
│ │ │ │
80
│ │ │ │ -
81private:
│ │ │ │ -
82 GLuint _sizes;
│ │ │ │ -
83 GLuint _offsets;
│ │ │ │ -
84 GLuint _indices;
│ │ │ │ -
85 GLuint _weights;
│ │ │ │ -
86 GLuint _duWeights;
│ │ │ │ -
87 GLuint _dvWeights;
│ │ │ │ -
88 GLuint _duuWeights;
│ │ │ │ -
89 GLuint _duvWeights;
│ │ │ │ -
90 GLuint _dvvWeights;
│ │ │ │ -
91 int _numStencils;
│ │ │ │ -
92};
│ │ │ │ -
93
│ │ │ │ -
94// ---------------------------------------------------------------------------
│ │ │ │ -
95
│ │ │ │ - │ │ │ │ -
97public:
│ │ │ │ -
98 typedef bool Instantiatable;
│ │ │ │ - │ │ │ │ -
100 BufferDescriptor const &dstDesc,
│ │ │ │ -
101 BufferDescriptor const &duDesc,
│ │ │ │ -
102 BufferDescriptor const &dvDesc,
│ │ │ │ -
103 void * deviceContext = NULL) {
│ │ │ │ -
104 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
108 deviceContext);
│ │ │ │ -
109 }
│ │ │ │ -
110
│ │ │ │ - │ │ │ │ -
112 BufferDescriptor const &dstDesc,
│ │ │ │ -
113 BufferDescriptor const &duDesc,
│ │ │ │ -
114 BufferDescriptor const &dvDesc,
│ │ │ │ -
115 BufferDescriptor const &duuDesc,
│ │ │ │ -
116 BufferDescriptor const &duvDesc,
│ │ │ │ -
117 BufferDescriptor const &dvvDesc,
│ │ │ │ -
118 void * deviceContext = NULL) {
│ │ │ │ -
119 (void)deviceContext; // not used
│ │ │ │ -
120 GLComputeEvaluator *instance = new GLComputeEvaluator();
│ │ │ │ -
121 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
122 duuDesc, duvDesc, dvvDesc))
│ │ │ │ -
123 return instance;
│ │ │ │ -
124 delete instance;
│ │ │ │ -
125 return NULL;
│ │ │ │ -
126 }
│ │ │ │ -
127
│ │ │ │ - │ │ │ │ -
130
│ │ │ │ - │ │ │ │ -
133
│ │ │ │ -
139
│ │ │ │ -
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
168 static bool EvalStencils(
│ │ │ │ -
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
171 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
172 GLComputeEvaluator const *instance,
│ │ │ │ -
173 void * deviceContext = NULL) {
│ │ │ │ -
174
│ │ │ │ -
175 if (instance) {
│ │ │ │ -
176 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
177 dstBuffer, dstDesc,
│ │ │ │ -
178 stencilTable);
│ │ │ │ -
179 } else {
│ │ │ │ -
180 // Create an instance on demand (slow)
│ │ │ │ -
181 (void)deviceContext; // unused
│ │ │ │ -
182 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
185 if (instance) {
│ │ │ │ -
186 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
187 dstBuffer, dstDesc,
│ │ │ │ -
188 stencilTable);
│ │ │ │ -
189 delete instance;
│ │ │ │ -
190 return r;
│ │ │ │ -
191 }
│ │ │ │ -
192 return false;
│ │ │ │ -
193 }
│ │ │ │ -
194 }
│ │ │ │ -
195
│ │ │ │ -
235 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
236 static bool EvalStencils(
│ │ │ │ -
237 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
238 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
239 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
240 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
241 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
242 GLComputeEvaluator const *instance,
│ │ │ │ -
243 void * deviceContext = NULL) {
│ │ │ │ -
244
│ │ │ │ -
245 if (instance) {
│ │ │ │ -
246 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
247 dstBuffer, dstDesc,
│ │ │ │ -
248 duBuffer, duDesc,
│ │ │ │ -
249 dvBuffer, dvDesc,
│ │ │ │ -
250 stencilTable);
│ │ │ │ -
251 } else {
│ │ │ │ -
252 // Create an instance on demand (slow)
│ │ │ │ -
253 (void)deviceContext; // unused
│ │ │ │ -
254 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ -
255 if (instance) {
│ │ │ │ -
256 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
257 dstBuffer, dstDesc,
│ │ │ │ -
258 duBuffer, duDesc,
│ │ │ │ -
259 dvBuffer, dvDesc,
│ │ │ │ -
260 stencilTable);
│ │ │ │ -
261 delete instance;
│ │ │ │ -
262 return r;
│ │ │ │ -
263 }
│ │ │ │ -
264 return false;
│ │ │ │ -
265 }
│ │ │ │ -
266 }
│ │ │ │ -
267
│ │ │ │ -
325 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
326 static bool EvalStencils(
│ │ │ │ -
327 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
328 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
329 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
330 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
331 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
332 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
333 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
334 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
335 GLComputeEvaluator const *instance,
│ │ │ │ -
336 void * deviceContext = NULL) {
│ │ │ │ -
337
│ │ │ │ -
338 if (instance) {
│ │ │ │ -
339 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
340 dstBuffer, dstDesc,
│ │ │ │ -
341 duBuffer, duDesc,
│ │ │ │ -
342 dvBuffer, dvDesc,
│ │ │ │ -
343 duuBuffer, duuDesc,
│ │ │ │ -
344 duvBuffer, duvDesc,
│ │ │ │ -
345 dvvBuffer, dvvDesc,
│ │ │ │ -
346 stencilTable);
│ │ │ │ -
347 } else {
│ │ │ │ -
348 // Create an instance on demand (slow)
│ │ │ │ -
349 (void)deviceContext; // unused
│ │ │ │ -
350 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
351 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
352 if (instance) {
│ │ │ │ -
353 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
354 dstBuffer, dstDesc,
│ │ │ │ -
355 duBuffer, duDesc,
│ │ │ │ -
356 dvBuffer, dvDesc,
│ │ │ │ -
357 duuBuffer, duuDesc,
│ │ │ │ -
358 duvBuffer, duvDesc,
│ │ │ │ -
359 dvvBuffer, dvvDesc,
│ │ │ │ -
360 stencilTable);
│ │ │ │ -
361 delete instance;
│ │ │ │ -
362 return r;
│ │ │ │ -
363 }
│ │ │ │ -
364 return false;
│ │ │ │ -
365 }
│ │ │ │ -
366 }
│ │ │ │ -
367
│ │ │ │ -
385 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
387 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
388 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
389 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
390 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
391 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
392 0, BufferDescriptor(),
│ │ │ │ -
393 0, BufferDescriptor(),
│ │ │ │ -
394 stencilTable->GetSizesBuffer(),
│ │ │ │ -
395 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
396 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
397 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
398 0,
│ │ │ │ -
399 0,
│ │ │ │ -
400 /* start = */ 0,
│ │ │ │ -
401 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
402 }
│ │ │ │ -
403
│ │ │ │ -
433 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
435 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
436 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
437 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
438 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
439 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
440 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
441 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
442 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
443 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
444 stencilTable->GetSizesBuffer(),
│ │ │ │ -
445 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
446 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
447 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
448 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
449 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
450 /* start = */ 0,
│ │ │ │ -
451 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
452 }
│ │ │ │ -
453
│ │ │ │ -
501 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
503 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
504 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
505 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
506 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
507 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
508 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
509 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
510 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
511 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
512 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
513 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
514 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
515 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
516 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
517 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
518 stencilTable->GetSizesBuffer(),
│ │ │ │ -
519 stencilTable->GetOffsetsBuffer(),
│ │ │ │ -
520 stencilTable->GetIndicesBuffer(),
│ │ │ │ -
521 stencilTable->GetWeightsBuffer(),
│ │ │ │ -
522 stencilTable->GetDuWeightsBuffer(),
│ │ │ │ -
523 stencilTable->GetDvWeightsBuffer(),
│ │ │ │ -
524 stencilTable->GetDuuWeightsBuffer(),
│ │ │ │ -
525 stencilTable->GetDuvWeightsBuffer(),
│ │ │ │ -
526 stencilTable->GetDvvWeightsBuffer(),
│ │ │ │ -
527 /* start = */ 0,
│ │ │ │ -
528 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
529 }
│ │ │ │ -
530
│ │ │ │ -
566 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
567 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
568 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
569 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
570 GLuint sizesBuffer,
│ │ │ │ -
571 GLuint offsetsBuffer,
│ │ │ │ -
572 GLuint indicesBuffer,
│ │ │ │ -
573 GLuint weightsBuffer,
│ │ │ │ -
574 GLuint duWeightsBuffer,
│ │ │ │ -
575 GLuint dvWeightsBuffer,
│ │ │ │ -
576 int start,
│ │ │ │ -
577 int end) const;
│ │ │ │ -
578
│ │ │ │ -
632 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
633 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
634 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
635 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
636 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
637 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
638 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
639 GLuint sizesBuffer,
│ │ │ │ -
640 GLuint offsetsBuffer,
│ │ │ │ -
641 GLuint indicesBuffer,
│ │ │ │ -
642 GLuint weightsBuffer,
│ │ │ │ -
643 GLuint duWeightsBuffer,
│ │ │ │ -
644 GLuint dvWeightsBuffer,
│ │ │ │ -
645 GLuint duuWeightsBuffer,
│ │ │ │ -
646 GLuint duvWeightsBuffer,
│ │ │ │ -
647 GLuint dvvWeightsBuffer,
│ │ │ │ -
648 int start,
│ │ │ │ -
649 int end) const;
│ │ │ │ -
650
│ │ │ │ -
656
│ │ │ │ -
689 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
690 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
691 static bool EvalPatches(
│ │ │ │ -
692 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
693 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
694 int numPatchCoords,
│ │ │ │ -
695 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
696 PATCH_TABLE *patchTable,
│ │ │ │ -
697 GLComputeEvaluator const *instance,
│ │ │ │ -
698 void * deviceContext = NULL) {
│ │ │ │ -
699
│ │ │ │ -
700 if (instance) {
│ │ │ │ -
701 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
702 dstBuffer, dstDesc,
│ │ │ │ -
703 numPatchCoords, patchCoords,
│ │ │ │ -
704 patchTable);
│ │ │ │ -
705 } else {
│ │ │ │ -
706 // Create an instance on demand (slow)
│ │ │ │ -
707 (void)deviceContext; // unused
│ │ │ │ -
708 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
711 if (instance) {
│ │ │ │ -
712 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
713 dstBuffer, dstDesc,
│ │ │ │ -
714 numPatchCoords, patchCoords,
│ │ │ │ -
715 patchTable);
│ │ │ │ -
716 delete instance;
│ │ │ │ -
717 return r;
│ │ │ │ -
718 }
│ │ │ │ -
719 return false;
│ │ │ │ -
720 }
│ │ │ │ -
721 }
│ │ │ │ -
722
│ │ │ │ -
767 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
768 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
769 static bool EvalPatches(
│ │ │ │ -
770 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
771 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
772 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
773 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
774 int numPatchCoords,
│ │ │ │ -
775 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
776 PATCH_TABLE *patchTable,
│ │ │ │ -
777 GLComputeEvaluator const *instance,
│ │ │ │ -
778 void * deviceContext = NULL) {
│ │ │ │ -
779
│ │ │ │ -
780 if (instance) {
│ │ │ │ -
781 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
782 dstBuffer, dstDesc,
│ │ │ │ -
783 duBuffer, duDesc,
│ │ │ │ -
784 dvBuffer, dvDesc,
│ │ │ │ -
785 numPatchCoords, patchCoords,
│ │ │ │ -
786 patchTable);
│ │ │ │ -
787 } else {
│ │ │ │ -
788 // Create an instance on demand (slow)
│ │ │ │ -
789 (void)deviceContext; // unused
│ │ │ │ -
790 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
791 duDesc, dvDesc);
│ │ │ │ -
792 if (instance) {
│ │ │ │ -
793 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
794 dstBuffer, dstDesc,
│ │ │ │ -
795 duBuffer, duDesc,
│ │ │ │ -
796 dvBuffer, dvDesc,
│ │ │ │ -
797 numPatchCoords, patchCoords,
│ │ │ │ -
798 patchTable);
│ │ │ │ -
799 delete instance;
│ │ │ │ -
800 return r;
│ │ │ │ -
801 }
│ │ │ │ -
802 return false;
│ │ │ │ -
803 }
│ │ │ │ -
804 }
│ │ │ │ -
805
│ │ │ │ -
868 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
869 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
870 static bool EvalPatches(
│ │ │ │ -
871 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
872 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
873 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
874 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
875 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
876 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
877 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
878 int numPatchCoords,
│ │ │ │ -
879 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
880 PATCH_TABLE *patchTable,
│ │ │ │ -
881 GLComputeEvaluator const *instance,
│ │ │ │ -
882 void * deviceContext = NULL) {
│ │ │ │ -
883
│ │ │ │ -
884 if (instance) {
│ │ │ │ -
885 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
886 dstBuffer, dstDesc,
│ │ │ │ -
887 duBuffer, duDesc,
│ │ │ │ -
888 dvBuffer, dvDesc,
│ │ │ │ -
889 duuBuffer, duuDesc,
│ │ │ │ -
890 duvBuffer, duvDesc,
│ │ │ │ -
891 dvvBuffer, dvvDesc,
│ │ │ │ -
892 numPatchCoords, patchCoords,
│ │ │ │ -
893 patchTable);
│ │ │ │ -
894 } else {
│ │ │ │ -
895 // Create an instance on demand (slow)
│ │ │ │ -
896 (void)deviceContext; // unused
│ │ │ │ -
897 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
898 duDesc, dvDesc,
│ │ │ │ -
899 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
900 if (instance) {
│ │ │ │ -
901 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
902 dstBuffer, dstDesc,
│ │ │ │ -
903 duBuffer, duDesc,
│ │ │ │ -
904 dvBuffer, dvDesc,
│ │ │ │ -
905 duuBuffer, duuDesc,
│ │ │ │ -
906 duvBuffer, duvDesc,
│ │ │ │ -
907 dvvBuffer, dvvDesc,
│ │ │ │ -
908 numPatchCoords, patchCoords,
│ │ │ │ -
909 patchTable);
│ │ │ │ -
910 delete instance;
│ │ │ │ -
911 return r;
│ │ │ │ -
912 }
│ │ │ │ -
913 return false;
│ │ │ │ -
914 }
│ │ │ │ -
915 }
│ │ │ │ -
916
│ │ │ │ -
941 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
942 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
946 int numPatchCoords,
│ │ │ │ -
947 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
948 PATCH_TABLE *patchTable) const {
│ │ │ │ -
949
│ │ │ │ -
950 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
951 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
952 0, BufferDescriptor(),
│ │ │ │ -
953 0, BufferDescriptor(),
│ │ │ │ -
954 numPatchCoords,
│ │ │ │ -
955 patchCoords->BindVBO(),
│ │ │ │ -
956 patchTable->GetPatchArrays(),
│ │ │ │ -
957 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
958 patchTable->GetPatchParamBuffer());
│ │ │ │ -
959 }
│ │ │ │ -
960
│ │ │ │ -
995 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
996 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
998 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
999 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1000 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1001 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1002 int numPatchCoords,
│ │ │ │ -
1003 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1004 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1005
│ │ │ │ -
1006 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1007 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1008 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1009 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1010 numPatchCoords,
│ │ │ │ -
1011 patchCoords->BindVBO(),
│ │ │ │ -
1012 patchTable->GetPatchArrays(),
│ │ │ │ -
1013 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1014 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1015 }
│ │ │ │ -
1016
│ │ │ │ -
1069 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1070 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1072 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1073 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1074 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1075 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1076 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1077 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1078 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1079 int numPatchCoords,
│ │ │ │ -
1080 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1081 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1082
│ │ │ │ -
1083 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1084 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1085 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1086 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1087 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
1088 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
1089 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
1090 numPatchCoords,
│ │ │ │ -
1091 patchCoords->BindVBO(),
│ │ │ │ -
1092 patchTable->GetPatchArrays(),
│ │ │ │ -
1093 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
1094 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1095 }
│ │ │ │ -
1096
│ │ │ │ -
1097 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1098 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1099 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1100 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1101 int numPatchCoords,
│ │ │ │ -
1102 GLuint patchCoordsBuffer,
│ │ │ │ -
1103 const PatchArrayVector &patchArrays,
│ │ │ │ -
1104 GLuint patchIndexBuffer,
│ │ │ │ -
1105 GLuint patchParamsBuffer) const;
│ │ │ │ -
1106
│ │ │ │ -
1107 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1108 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1109 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1110 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1111 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1112 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1113 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1114 int numPatchCoords,
│ │ │ │ -
1115 GLuint patchCoordsBuffer,
│ │ │ │ -
1116 const PatchArrayVector &patchArrays,
│ │ │ │ -
1117 GLuint patchIndexBuffer,
│ │ │ │ -
1118 GLuint patchParamsBuffer) const;
│ │ │ │ -
1119
│ │ │ │ -
1152 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1153 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1155 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1156 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1157 int numPatchCoords,
│ │ │ │ -
1158 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1159 PATCH_TABLE *patchTable,
│ │ │ │ -
1160 GLComputeEvaluator const *instance,
│ │ │ │ -
1161 void * deviceContext = NULL) {
│ │ │ │ -
1162
│ │ │ │ -
1163 if (instance) {
│ │ │ │ -
1164 return instance->EvalPatchesVarying(
│ │ │ │ -
1165 srcBuffer, srcDesc,
│ │ │ │ -
1166 dstBuffer, dstDesc,
│ │ │ │ -
1167 numPatchCoords, patchCoords,
│ │ │ │ -
1168 patchTable);
│ │ │ │ -
1169 } else {
│ │ │ │ -
1170 // Create an instance on demand (slow)
│ │ │ │ -
1171 (void)deviceContext; // unused
│ │ │ │ -
1172 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1175 if (instance) {
│ │ │ │ -
1176 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1177 srcBuffer, srcDesc,
│ │ │ │ -
1178 dstBuffer, dstDesc,
│ │ │ │ -
1179 numPatchCoords, patchCoords,
│ │ │ │ -
1180 patchTable);
│ │ │ │ -
1181 delete instance;
│ │ │ │ -
1182 return r;
│ │ │ │ -
1183 }
│ │ │ │ -
1184 return false;
│ │ │ │ -
1185 }
│ │ │ │ -
1186 }
│ │ │ │ -
1187
│ │ │ │ -
1212 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1213 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1215 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1216 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1217 int numPatchCoords,
│ │ │ │ -
1218 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1219 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1220
│ │ │ │ -
1221 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1222 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1223 0, BufferDescriptor(),
│ │ │ │ -
1224 0, BufferDescriptor(),
│ │ │ │ -
1225 numPatchCoords,
│ │ │ │ -
1226 patchCoords->BindVBO(),
│ │ │ │ -
1227 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1228 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1229 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1230 }
│ │ │ │ -
1231
│ │ │ │ -
1276 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1277 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1279 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1280 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1281 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1282 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1283 int numPatchCoords,
│ │ │ │ -
1284 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1285 PATCH_TABLE *patchTable,
│ │ │ │ -
1286 GLComputeEvaluator const *instance,
│ │ │ │ -
1287 void * deviceContext = NULL) {
│ │ │ │ -
1288
│ │ │ │ -
1289 if (instance) {
│ │ │ │ -
1290 return instance->EvalPatchesVarying(
│ │ │ │ -
1291 srcBuffer, srcDesc,
│ │ │ │ -
1292 dstBuffer, dstDesc,
│ │ │ │ -
1293 duBuffer, duDesc,
│ │ │ │ -
1294 dvBuffer, dvDesc,
│ │ │ │ -
1295 numPatchCoords, patchCoords,
│ │ │ │ -
1296 patchTable);
│ │ │ │ -
1297 } else {
│ │ │ │ -
1298 // Create an instance on demand (slow)
│ │ │ │ -
1299 (void)deviceContext; // unused
│ │ │ │ -
1300 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1301 duDesc, dvDesc);
│ │ │ │ -
1302 if (instance) {
│ │ │ │ -
1303 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1304 srcBuffer, srcDesc,
│ │ │ │ -
1305 dstBuffer, dstDesc,
│ │ │ │ -
1306 duBuffer, duDesc,
│ │ │ │ -
1307 dvBuffer, dvDesc,
│ │ │ │ -
1308 numPatchCoords, patchCoords,
│ │ │ │ -
1309 patchTable);
│ │ │ │ -
1310 delete instance;
│ │ │ │ -
1311 return r;
│ │ │ │ -
1312 }
│ │ │ │ -
1313 return false;
│ │ │ │ -
1314 }
│ │ │ │ -
1315 }
│ │ │ │ -
1316
│ │ │ │ -
1353 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1354 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1356 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1357 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1358 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1359 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1360 int numPatchCoords,
│ │ │ │ -
1361 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1362 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1363
│ │ │ │ -
1364 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1365 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1366 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1367 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1368 numPatchCoords,
│ │ │ │ -
1369 patchCoords->BindVBO(),
│ │ │ │ -
1370 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1371 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1372 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1373 }
│ │ │ │ -
1374
│ │ │ │ -
1437 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1438 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1440 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1441 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1442 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1443 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1444 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1445 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1446 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1447 int numPatchCoords,
│ │ │ │ -
1448 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1449 PATCH_TABLE *patchTable,
│ │ │ │ -
1450 GLComputeEvaluator const *instance,
│ │ │ │ -
1451 void * deviceContext = NULL) {
│ │ │ │ -
1452
│ │ │ │ -
1453 if (instance) {
│ │ │ │ -
1454 return instance->EvalPatchesVarying(
│ │ │ │ -
1455 srcBuffer, srcDesc,
│ │ │ │ -
1456 dstBuffer, dstDesc,
│ │ │ │ -
1457 duBuffer, duDesc,
│ │ │ │ -
1458 dvBuffer, dvDesc,
│ │ │ │ -
1459 duuBuffer, duuDesc,
│ │ │ │ -
1460 duvBuffer, duvDesc,
│ │ │ │ -
1461 dvvBuffer, dvvDesc,
│ │ │ │ -
1462 numPatchCoords, patchCoords,
│ │ │ │ -
1463 patchTable);
│ │ │ │ -
1464 } else {
│ │ │ │ -
1465 // Create an instance on demand (slow)
│ │ │ │ -
1466 (void)deviceContext; // unused
│ │ │ │ -
1467 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1468 duDesc, dvDesc,
│ │ │ │ -
1469 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
1470 if (instance) {
│ │ │ │ -
1471 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1472 srcBuffer, srcDesc,
│ │ │ │ -
1473 dstBuffer, dstDesc,
│ │ │ │ -
1474 duBuffer, duDesc,
│ │ │ │ -
1475 dvBuffer, dvDesc,
│ │ │ │ -
1476 duuBuffer, duuDesc,
│ │ │ │ -
1477 duvBuffer, duvDesc,
│ │ │ │ -
1478 dvvBuffer, dvvDesc,
│ │ │ │ -
1479 numPatchCoords, patchCoords,
│ │ │ │ -
1480 patchTable);
│ │ │ │ -
1481 delete instance;
│ │ │ │ -
1482 return r;
│ │ │ │ -
1483 }
│ │ │ │ -
1484 return false;
│ │ │ │ -
1485 }
│ │ │ │ -
1486 }
│ │ │ │ -
1487
│ │ │ │ -
1542 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1543 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1545 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1546 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1547 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1548 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1549 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1550 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1551 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1552 int numPatchCoords,
│ │ │ │ -
1553 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1554 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1555
│ │ │ │ -
1556 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1557 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1558 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1559 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1560 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
1561 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
1562 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
1563 numPatchCoords,
│ │ │ │ -
1564 patchCoords->BindVBO(),
│ │ │ │ -
1565 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1566 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
1567 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1568 }
│ │ │ │ -
1569
│ │ │ │ -
1604 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1605 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1609 int numPatchCoords,
│ │ │ │ -
1610 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1611 PATCH_TABLE *patchTable,
│ │ │ │ -
1612 int fvarChannel,
│ │ │ │ -
1613 GLComputeEvaluator const *instance,
│ │ │ │ -
1614 void * deviceContext = NULL) {
│ │ │ │ -
1615
│ │ │ │ -
1616 if (instance) {
│ │ │ │ -
1617 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1618 srcBuffer, srcDesc,
│ │ │ │ -
1619 dstBuffer, dstDesc,
│ │ │ │ -
1620 numPatchCoords, patchCoords,
│ │ │ │ -
1621 patchTable, fvarChannel);
│ │ │ │ -
1622 } else {
│ │ │ │ -
1623 // Create an instance on demand (slow)
│ │ │ │ -
1624 (void)deviceContext; // unused
│ │ │ │ -
1625 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1628 if (instance) {
│ │ │ │ -
1629 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1630 srcBuffer, srcDesc,
│ │ │ │ -
1631 dstBuffer, dstDesc,
│ │ │ │ -
1632 numPatchCoords, patchCoords,
│ │ │ │ -
1633 patchTable, fvarChannel);
│ │ │ │ -
1634 delete instance;
│ │ │ │ -
1635 return r;
│ │ │ │ -
1636 }
│ │ │ │ -
1637 return false;
│ │ │ │ -
1638 }
│ │ │ │ -
1639 }
│ │ │ │ -
1640
│ │ │ │ -
1667 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1668 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1670 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1671 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1672 int numPatchCoords,
│ │ │ │ -
1673 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1674 PATCH_TABLE *patchTable,
│ │ │ │ -
1675 int fvarChannel = 0) const {
│ │ │ │ -
1676
│ │ │ │ -
1677 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1678 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1679 0, BufferDescriptor(),
│ │ │ │ -
1680 0, BufferDescriptor(),
│ │ │ │ -
1681 numPatchCoords,
│ │ │ │ -
1682 patchCoords->BindVBO(),
│ │ │ │ -
1683 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1684 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1685 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1686 }
│ │ │ │ -
1687
│ │ │ │ -
1734 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1735 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1737 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1738 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1739 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1740 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1741 int numPatchCoords,
│ │ │ │ -
1742 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1743 PATCH_TABLE *patchTable,
│ │ │ │ -
1744 int fvarChannel,
│ │ │ │ -
1745 GLComputeEvaluator const *instance,
│ │ │ │ -
1746 void * deviceContext = NULL) {
│ │ │ │ -
1747
│ │ │ │ -
1748 if (instance) {
│ │ │ │ -
1749 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1750 srcBuffer, srcDesc,
│ │ │ │ -
1751 dstBuffer, dstDesc,
│ │ │ │ -
1752 duBuffer, duDesc,
│ │ │ │ -
1753 dvBuffer, dvDesc,
│ │ │ │ -
1754 numPatchCoords, patchCoords,
│ │ │ │ -
1755 patchTable, fvarChannel);
│ │ │ │ -
1756 } else {
│ │ │ │ -
1757 // Create an instance on demand (slow)
│ │ │ │ -
1758 (void)deviceContext; // unused
│ │ │ │ -
1759 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1760 duDesc, dvDesc);
│ │ │ │ -
1761 if (instance) {
│ │ │ │ -
1762 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1763 srcBuffer, srcDesc,
│ │ │ │ -
1764 dstBuffer, dstDesc,
│ │ │ │ -
1765 duBuffer, duDesc,
│ │ │ │ -
1766 dvBuffer, dvDesc,
│ │ │ │ -
1767 numPatchCoords, patchCoords,
│ │ │ │ -
1768 patchTable, fvarChannel);
│ │ │ │ -
1769 delete instance;
│ │ │ │ -
1770 return r;
│ │ │ │ -
1771 }
│ │ │ │ -
1772 return false;
│ │ │ │ -
1773 }
│ │ │ │ -
1774 }
│ │ │ │ -
1775
│ │ │ │ -
1814 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1815 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1817 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1818 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1819 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1820 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1821 int numPatchCoords,
│ │ │ │ -
1822 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1823 PATCH_TABLE *patchTable,
│ │ │ │ -
1824 int fvarChannel = 0) const {
│ │ │ │ -
1825
│ │ │ │ -
1826 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1827 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1828 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1829 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1830 numPatchCoords,
│ │ │ │ -
1831 patchCoords->BindVBO(),
│ │ │ │ -
1832 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1833 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1834 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1835 }
│ │ │ │ -
1836
│ │ │ │ -
1901 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1902 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1904 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1905 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1906 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1907 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1908 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1909 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1910 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1911 int numPatchCoords,
│ │ │ │ -
1912 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1913 PATCH_TABLE *patchTable,
│ │ │ │ -
1914 int fvarChannel,
│ │ │ │ -
1915 GLComputeEvaluator const *instance,
│ │ │ │ -
1916 void * deviceContext = NULL) {
│ │ │ │ -
1917
│ │ │ │ -
1918 if (instance) {
│ │ │ │ -
1919 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1920 srcBuffer, srcDesc,
│ │ │ │ -
1921 dstBuffer, dstDesc,
│ │ │ │ -
1922 duBuffer, duDesc,
│ │ │ │ -
1923 dvBuffer, dvDesc,
│ │ │ │ -
1924 duuBuffer, duuDesc,
│ │ │ │ -
1925 duvBuffer, duvDesc,
│ │ │ │ -
1926 dvvBuffer, dvvDesc,
│ │ │ │ -
1927 numPatchCoords, patchCoords,
│ │ │ │ -
1928 patchTable, fvarChannel);
│ │ │ │ -
1929 } else {
│ │ │ │ -
1930 // Create an instance on demand (slow)
│ │ │ │ -
1931 (void)deviceContext; // unused
│ │ │ │ -
1932 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1933 duDesc, dvDesc,
│ │ │ │ -
1934 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
1935 if (instance) {
│ │ │ │ -
1936 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1937 srcBuffer, srcDesc,
│ │ │ │ -
1938 dstBuffer, dstDesc,
│ │ │ │ -
1939 duBuffer, duDesc,
│ │ │ │ -
1940 dvBuffer, dvDesc,
│ │ │ │ -
1941 duuBuffer, duuDesc,
│ │ │ │ -
1942 duvBuffer, duvDesc,
│ │ │ │ -
1943 dvvBuffer, dvvDesc,
│ │ │ │ -
1944 numPatchCoords, patchCoords,
│ │ │ │ -
1945 patchTable, fvarChannel);
│ │ │ │ -
1946 delete instance;
│ │ │ │ -
1947 return r;
│ │ │ │ -
1948 }
│ │ │ │ -
1949 return false;
│ │ │ │ -
1950 }
│ │ │ │ -
1951 }
│ │ │ │ -
1952
│ │ │ │ -
2009 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2010 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2012 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2013 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2014 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2015 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2016 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
2017 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
2018 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
2019 int numPatchCoords,
│ │ │ │ -
2020 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2021 PATCH_TABLE *patchTable,
│ │ │ │ -
2022 int fvarChannel = 0) const {
│ │ │ │ -
2023
│ │ │ │ -
2024 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
2025 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
2026 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
2027 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
2028 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
2029 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
2030 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
2031 numPatchCoords,
│ │ │ │ -
2032 patchCoords->BindVBO(),
│ │ │ │ -
2033 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
2034 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
2035 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
2036 }
│ │ │ │ -
2037
│ │ │ │ -
2043
│ │ │ │ -
2046 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2047 BufferDescriptor const &dstDesc,
│ │ │ │ -
2048 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ -
2049 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ -
2050 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ -
2051 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ -
2052 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ -
2053
│ │ │ │ -
2055 static void Synchronize(void *deviceContext);
│ │ │ │ -
2056
│ │ │ │ -
2057private:
│ │ │ │ -
2058 struct _StencilKernel {
│ │ │ │ -
2059 _StencilKernel();
│ │ │ │ -
2060 ~_StencilKernel();
│ │ │ │ -
2061 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2062 BufferDescriptor const &dstDesc,
│ │ │ │ -
2063 BufferDescriptor const &duDesc,
│ │ │ │ -
2064 BufferDescriptor const &dvDesc,
│ │ │ │ -
2065 BufferDescriptor const &duuDesc,
│ │ │ │ -
2066 BufferDescriptor const &duvDesc,
│ │ │ │ -
2067 BufferDescriptor const &dvvDesc,
│ │ │ │ -
2068 int workGroupSize);
│ │ │ │ -
2069 GLuint program;
│ │ │ │ -
2070 GLuint uniformStart;
│ │ │ │ -
2071 GLuint uniformEnd;
│ │ │ │ -
2072 GLuint uniformSrcOffset;
│ │ │ │ -
2073 GLuint uniformDstOffset;
│ │ │ │ -
2074 GLuint uniformDuDesc;
│ │ │ │ -
2075 GLuint uniformDvDesc;
│ │ │ │ -
2076 GLuint uniformDuuDesc;
│ │ │ │ -
2077 GLuint uniformDuvDesc;
│ │ │ │ -
2078 GLuint uniformDvvDesc;
│ │ │ │ -
2079 } _stencilKernel;
│ │ │ │ -
2080
│ │ │ │ -
2081 struct _PatchKernel {
│ │ │ │ -
2082 _PatchKernel();
│ │ │ │ -
2083 ~_PatchKernel();
│ │ │ │ -
2084 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2085 BufferDescriptor const &dstDesc,
│ │ │ │ -
2086 BufferDescriptor const &duDesc,
│ │ │ │ -
2087 BufferDescriptor const &dvDesc,
│ │ │ │ -
2088 BufferDescriptor const &duuDesc,
│ │ │ │ -
2089 BufferDescriptor const &duvDesc,
│ │ │ │ -
2090 BufferDescriptor const &dvvDesc,
│ │ │ │ -
2091 int workGroupSize);
│ │ │ │ -
2092 GLuint program;
│ │ │ │ -
2093 GLuint uniformSrcOffset;
│ │ │ │ -
2094 GLuint uniformDstOffset;
│ │ │ │ -
2095 GLuint uniformPatchArray;
│ │ │ │ -
2096 GLuint uniformDuDesc;
│ │ │ │ -
2097 GLuint uniformDvDesc;
│ │ │ │ -
2098 GLuint uniformDuuDesc;
│ │ │ │ -
2099 GLuint uniformDuvDesc;
│ │ │ │ -
2100 GLuint uniformDvvDesc;
│ │ │ │ -
2101 } _patchKernel;
│ │ │ │ -
2102
│ │ │ │ -
2103 int _workGroupSize;
│ │ │ │ -
2104 GLuint _patchArraysSSBO;
│ │ │ │ -
2105};
│ │ │ │ -
2106
│ │ │ │ -
2107} // end namespace Osd
│ │ │ │ -
2108
│ │ │ │ -
2109} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
2110using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
2111
│ │ │ │ -
2112} // end namespace OpenSubdiv
│ │ │ │ -
2113
│ │ │ │ -
2114
│ │ │ │ -
2115#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
│ │ │ │ +
81} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
82using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
83
│ │ │ │ +
84} // end namespace OpenSubdiv
│ │ │ │ +
85
│ │ │ │ +
86#endif // OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ -
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ -
GL stencil table (Shader Storage buffer)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
GLStencilTableSSBO(Far::StencilTable const *stencilTable)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static GLStencilTableSSBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static GLStencilTableSSBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
│ │ │ │ - │ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ - │ │ │ │ -
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ -
~GLComputeEvaluator()
Destructor. note that the GL context must be made current.
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ - │ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ -
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext=NULL)
│ │ │ │ -
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static void Synchronize(void *deviceContext)
Wait the dispatched kernel finishes.
│ │ │ │ -
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext=NULL)
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static GLLegacyGregoryPatchTable * Create(Far::PatchTable const *patchTable)
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glComputeEvaluator.h │ │ │ │ │ +glLegacyGregoryPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,1365 +30,113 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/opengl.h" │ │ │ │ │ - 31#include "../osd/types.h" │ │ │ │ │ - 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 30#include "../far/patchTable.h" │ │ │ │ │ + 31#include "../osd/nonCopyable.h" │ │ │ │ │ + 32#include "../osd/opengl.h" │ │ │ │ │ 33 │ │ │ │ │ 34namespace OpenSubdiv { │ │ │ │ │ 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 class PatchTable; │ │ │ │ │ - 39 class StencilTable; │ │ │ │ │ - 40 class LimitStencilTable; │ │ │ │ │ - 41} │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ - 44 │ │ │ │ │ -51class GLStencilTableSSBO { │ │ │ │ │ - 52public: │ │ │ │ │ -53 static GLStencilTableSSBO *Create(Far::StencilTable const *stencilTable, │ │ │ │ │ - 54 void *deviceContext = NULL) { │ │ │ │ │ - 55 (void)deviceContext; // unused │ │ │ │ │ - 56 return new GLStencilTableSSBO(stencilTable); │ │ │ │ │ - 57 } │ │ │ │ │ -58 static GLStencilTableSSBO *Create( │ │ │ │ │ - 59 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ - 60 void *deviceContext = NULL) { │ │ │ │ │ - 61 (void)deviceContext; // unused │ │ │ │ │ - 62 return new GLStencilTableSSBO(limitStencilTable); │ │ │ │ │ + 37namespace Osd { │ │ │ │ │ + 38 │ │ │ │ │ +39class GLLegacyGregoryPatchTable │ │ │ │ │ + 40 : private NonCopyable { │ │ │ │ │ + 41public: │ │ │ │ │ +42 ~GLLegacyGregoryPatchTable(); │ │ │ │ │ + 43 │ │ │ │ │ +44 static GLLegacyGregoryPatchTable *Create(Far::PatchTable const *patchTable); │ │ │ │ │ + 45 │ │ │ │ │ +46 void UpdateVertexBuffer(GLuint vbo); │ │ │ │ │ + 47 │ │ │ │ │ +48 GLuint GetVertexTextureBuffer() const { │ │ │ │ │ + 49 return _vertexTextureBuffer; │ │ │ │ │ + 50 } │ │ │ │ │ + 51 │ │ │ │ │ +52 GLuint GetVertexValenceTextureBuffer() const { │ │ │ │ │ + 53 return _vertexValenceTextureBuffer; │ │ │ │ │ + 54 } │ │ │ │ │ + 55 │ │ │ │ │ +56 GLuint GetQuadOffsetsTextureBuffer() const { │ │ │ │ │ + 57 return _quadOffsetsTextureBuffer; │ │ │ │ │ + 58 } │ │ │ │ │ + 59 │ │ │ │ │ +60 GLuint GetQuadOffsetsBase(Far::PatchDescriptor::Type type) { │ │ │ │ │ + 61 if (type == Far::PatchDescriptor::GREGORY_BOUNDARY) { │ │ │ │ │ + 62 return _quadOffsetsBase[1]; │ │ │ │ │ 63 } │ │ │ │ │ - 64 │ │ │ │ │ -65 explicit GLStencilTableSSBO(Far::StencilTable const *stencilTable); │ │ │ │ │ -66 explicit GLStencilTableSSBO(Far::LimitStencilTable const │ │ │ │ │ -*limitStencilTable); │ │ │ │ │ -67 ~GLStencilTableSSBO(); │ │ │ │ │ - 68 │ │ │ │ │ - 69 // interfaces needed for GLSLComputeKernel │ │ │ │ │ -70 GLuint GetSizesBuffer() const { return _sizes; } │ │ │ │ │ -71 GLuint GetOffsetsBuffer() const { return _offsets; } │ │ │ │ │ -72 GLuint GetIndicesBuffer() const { return _indices; } │ │ │ │ │ -73 GLuint GetWeightsBuffer() const { return _weights; } │ │ │ │ │ -74 GLuint GetDuWeightsBuffer() const { return _duWeights; } │ │ │ │ │ -75 GLuint GetDvWeightsBuffer() const { return _dvWeights; } │ │ │ │ │ -76 GLuint GetDuuWeightsBuffer() const { return _duuWeights; } │ │ │ │ │ -77 GLuint GetDuvWeightsBuffer() const { return _duvWeights; } │ │ │ │ │ -78 GLuint GetDvvWeightsBuffer() const { return _dvvWeights; } │ │ │ │ │ -79 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ + 64 return _quadOffsetsBase[0]; │ │ │ │ │ + 65 } │ │ │ │ │ + 66 │ │ │ │ │ + 67protected: │ │ │ │ │ +68 GLLegacyGregoryPatchTable(); │ │ │ │ │ + 69 │ │ │ │ │ + 70private: │ │ │ │ │ + 71 GLuint _vertexTextureBuffer; │ │ │ │ │ + 72 GLuint _vertexValenceTextureBuffer; │ │ │ │ │ + 73 GLuint _quadOffsetsTextureBuffer; │ │ │ │ │ + 74 GLuint _quadOffsetsBase[2]; // gregory, boundaryGregory │ │ │ │ │ + 75}; │ │ │ │ │ + 76 │ │ │ │ │ + 77 │ │ │ │ │ + 78 │ │ │ │ │ + 79} // end namespace Osd │ │ │ │ │ 80 │ │ │ │ │ - 81private: │ │ │ │ │ - 82 GLuint _sizes; │ │ │ │ │ - 83 GLuint _offsets; │ │ │ │ │ - 84 GLuint _indices; │ │ │ │ │ - 85 GLuint _weights; │ │ │ │ │ - 86 GLuint _duWeights; │ │ │ │ │ - 87 GLuint _dvWeights; │ │ │ │ │ - 88 GLuint _duuWeights; │ │ │ │ │ - 89 GLuint _duvWeights; │ │ │ │ │ - 90 GLuint _dvvWeights; │ │ │ │ │ - 91 int _numStencils; │ │ │ │ │ - 92}; │ │ │ │ │ - 93 │ │ │ │ │ - 94// ------------------------------------------------------------------------- │ │ │ │ │ --- │ │ │ │ │ - 95 │ │ │ │ │ -96class GLComputeEvaluator { │ │ │ │ │ - 97public: │ │ │ │ │ -98 typedef bool Instantiatable; │ │ │ │ │ -99 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 100 BufferDescriptor const &dstDesc, │ │ │ │ │ - 101 BufferDescriptor const &duDesc, │ │ │ │ │ - 102 BufferDescriptor const &dvDesc, │ │ │ │ │ - 103 void * deviceContext = NULL) { │ │ │ │ │ - 104 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 105 BufferDescriptor(), │ │ │ │ │ - 106 BufferDescriptor(), │ │ │ │ │ - 107 BufferDescriptor(), │ │ │ │ │ - 108 deviceContext); │ │ │ │ │ - 109 } │ │ │ │ │ - 110 │ │ │ │ │ -111 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 112 BufferDescriptor const &dstDesc, │ │ │ │ │ - 113 BufferDescriptor const &duDesc, │ │ │ │ │ - 114 BufferDescriptor const &dvDesc, │ │ │ │ │ - 115 BufferDescriptor const &duuDesc, │ │ │ │ │ - 116 BufferDescriptor const &duvDesc, │ │ │ │ │ - 117 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 118 void * deviceContext = NULL) { │ │ │ │ │ - 119 (void)deviceContext; // not used │ │ │ │ │ - 120 GLComputeEvaluator *instance = new GLComputeEvaluator(); │ │ │ │ │ - 121 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 122 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ - 123 return instance; │ │ │ │ │ - 124 delete instance; │ │ │ │ │ - 125 return NULL; │ │ │ │ │ - 126 } │ │ │ │ │ - 127 │ │ │ │ │ -129 GLComputeEvaluator(); │ │ │ │ │ - 130 │ │ │ │ │ -132 ~GLComputeEvaluator(); │ │ │ │ │ - 133 │ │ │ │ │ - 139 │ │ │ │ │ - 167 template │ │ │ │ │ -168 static bool EvalStencils( │ │ │ │ │ - 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 171 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 172 GLComputeEvaluator const *instance, │ │ │ │ │ - 173 void * deviceContext = NULL) { │ │ │ │ │ - 174 │ │ │ │ │ - 175 if (instance) { │ │ │ │ │ - 176 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 177 dstBuffer, dstDesc, │ │ │ │ │ - 178 stencilTable); │ │ │ │ │ - 179 } else { │ │ │ │ │ - 180 // Create an instance on demand (slow) │ │ │ │ │ - 181 (void)deviceContext; // unused │ │ │ │ │ - 182 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 183 BufferDescriptor(), │ │ │ │ │ - 184 BufferDescriptor()); │ │ │ │ │ - 185 if (instance) { │ │ │ │ │ - 186 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 187 dstBuffer, dstDesc, │ │ │ │ │ - 188 stencilTable); │ │ │ │ │ - 189 delete instance; │ │ │ │ │ - 190 return r; │ │ │ │ │ - 191 } │ │ │ │ │ - 192 return false; │ │ │ │ │ - 193 } │ │ │ │ │ - 194 } │ │ │ │ │ - 195 │ │ │ │ │ - 235 template │ │ │ │ │ -236 static bool EvalStencils( │ │ │ │ │ - 237 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 238 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 239 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 240 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 241 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 242 GLComputeEvaluator const *instance, │ │ │ │ │ - 243 void * deviceContext = NULL) { │ │ │ │ │ - 244 │ │ │ │ │ - 245 if (instance) { │ │ │ │ │ - 246 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 247 dstBuffer, dstDesc, │ │ │ │ │ - 248 duBuffer, duDesc, │ │ │ │ │ - 249 dvBuffer, dvDesc, │ │ │ │ │ - 250 stencilTable); │ │ │ │ │ - 251 } else { │ │ │ │ │ - 252 // Create an instance on demand (slow) │ │ │ │ │ - 253 (void)deviceContext; // unused │ │ │ │ │ - 254 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ - 255 if (instance) { │ │ │ │ │ - 256 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 257 dstBuffer, dstDesc, │ │ │ │ │ - 258 duBuffer, duDesc, │ │ │ │ │ - 259 dvBuffer, dvDesc, │ │ │ │ │ - 260 stencilTable); │ │ │ │ │ - 261 delete instance; │ │ │ │ │ - 262 return r; │ │ │ │ │ - 263 } │ │ │ │ │ - 264 return false; │ │ │ │ │ - 265 } │ │ │ │ │ - 266 } │ │ │ │ │ - 267 │ │ │ │ │ - 325 template │ │ │ │ │ -326 static bool EvalStencils( │ │ │ │ │ - 327 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 328 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 329 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 330 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 331 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 332 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 333 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 334 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 335 GLComputeEvaluator const *instance, │ │ │ │ │ - 336 void * deviceContext = NULL) { │ │ │ │ │ - 337 │ │ │ │ │ - 338 if (instance) { │ │ │ │ │ - 339 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 340 dstBuffer, dstDesc, │ │ │ │ │ - 341 duBuffer, duDesc, │ │ │ │ │ - 342 dvBuffer, dvDesc, │ │ │ │ │ - 343 duuBuffer, duuDesc, │ │ │ │ │ - 344 duvBuffer, duvDesc, │ │ │ │ │ - 345 dvvBuffer, dvvDesc, │ │ │ │ │ - 346 stencilTable); │ │ │ │ │ - 347 } else { │ │ │ │ │ - 348 // Create an instance on demand (slow) │ │ │ │ │ - 349 (void)deviceContext; // unused │ │ │ │ │ - 350 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 351 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 352 if (instance) { │ │ │ │ │ - 353 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 354 dstBuffer, dstDesc, │ │ │ │ │ - 355 duBuffer, duDesc, │ │ │ │ │ - 356 dvBuffer, dvDesc, │ │ │ │ │ - 357 duuBuffer, duuDesc, │ │ │ │ │ - 358 duvBuffer, duvDesc, │ │ │ │ │ - 359 dvvBuffer, dvvDesc, │ │ │ │ │ - 360 stencilTable); │ │ │ │ │ - 361 delete instance; │ │ │ │ │ - 362 return r; │ │ │ │ │ - 363 } │ │ │ │ │ - 364 return false; │ │ │ │ │ - 365 } │ │ │ │ │ - 366 } │ │ │ │ │ - 367 │ │ │ │ │ - 385 template │ │ │ │ │ -386 bool EvalStencils( │ │ │ │ │ - 387 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 388 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 389 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 390 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 391 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 392 0, BufferDescriptor(), │ │ │ │ │ - 393 0, BufferDescriptor(), │ │ │ │ │ - 394 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 395 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 396 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 397 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 398 0, │ │ │ │ │ - 399 0, │ │ │ │ │ - 400 /* start = */ 0, │ │ │ │ │ - 401 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 402 } │ │ │ │ │ - 403 │ │ │ │ │ - 433 template │ │ │ │ │ -434 bool EvalStencils( │ │ │ │ │ - 435 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 436 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 437 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 438 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 439 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 440 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 441 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 442 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 443 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 444 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 445 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 446 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 447 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 448 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 449 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 450 /* start = */ 0, │ │ │ │ │ - 451 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 452 } │ │ │ │ │ - 453 │ │ │ │ │ - 501 template │ │ │ │ │ -502 bool EvalStencils( │ │ │ │ │ - 503 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 504 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 505 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 506 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 507 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 508 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 509 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 510 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 511 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 512 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 513 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 514 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 515 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 516 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 517 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 518 stencilTable->GetSizesBuffer(), │ │ │ │ │ - 519 stencilTable->GetOffsetsBuffer(), │ │ │ │ │ - 520 stencilTable->GetIndicesBuffer(), │ │ │ │ │ - 521 stencilTable->GetWeightsBuffer(), │ │ │ │ │ - 522 stencilTable->GetDuWeightsBuffer(), │ │ │ │ │ - 523 stencilTable->GetDvWeightsBuffer(), │ │ │ │ │ - 524 stencilTable->GetDuuWeightsBuffer(), │ │ │ │ │ - 525 stencilTable->GetDuvWeightsBuffer(), │ │ │ │ │ - 526 stencilTable->GetDvvWeightsBuffer(), │ │ │ │ │ - 527 /* start = */ 0, │ │ │ │ │ - 528 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 529 } │ │ │ │ │ - 530 │ │ │ │ │ -566 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 567 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 568 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 569 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 570 GLuint sizesBuffer, │ │ │ │ │ - 571 GLuint offsetsBuffer, │ │ │ │ │ - 572 GLuint indicesBuffer, │ │ │ │ │ - 573 GLuint weightsBuffer, │ │ │ │ │ - 574 GLuint duWeightsBuffer, │ │ │ │ │ - 575 GLuint dvWeightsBuffer, │ │ │ │ │ - 576 int start, │ │ │ │ │ - 577 int end) const; │ │ │ │ │ - 578 │ │ │ │ │ -632 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 633 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 634 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 635 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 636 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 637 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 638 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 639 GLuint sizesBuffer, │ │ │ │ │ - 640 GLuint offsetsBuffer, │ │ │ │ │ - 641 GLuint indicesBuffer, │ │ │ │ │ - 642 GLuint weightsBuffer, │ │ │ │ │ - 643 GLuint duWeightsBuffer, │ │ │ │ │ - 644 GLuint dvWeightsBuffer, │ │ │ │ │ - 645 GLuint duuWeightsBuffer, │ │ │ │ │ - 646 GLuint duvWeightsBuffer, │ │ │ │ │ - 647 GLuint dvvWeightsBuffer, │ │ │ │ │ - 648 int start, │ │ │ │ │ - 649 int end) const; │ │ │ │ │ - 650 │ │ │ │ │ - 656 │ │ │ │ │ - 689 template │ │ │ │ │ -691 static bool EvalPatches( │ │ │ │ │ - 692 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 693 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 694 int numPatchCoords, │ │ │ │ │ - 695 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 696 PATCH_TABLE *patchTable, │ │ │ │ │ - 697 GLComputeEvaluator const *instance, │ │ │ │ │ - 698 void * deviceContext = NULL) { │ │ │ │ │ - 699 │ │ │ │ │ - 700 if (instance) { │ │ │ │ │ - 701 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 702 dstBuffer, dstDesc, │ │ │ │ │ - 703 numPatchCoords, patchCoords, │ │ │ │ │ - 704 patchTable); │ │ │ │ │ - 705 } else { │ │ │ │ │ - 706 // Create an instance on demand (slow) │ │ │ │ │ - 707 (void)deviceContext; // unused │ │ │ │ │ - 708 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 709 BufferDescriptor(), │ │ │ │ │ - 710 BufferDescriptor()); │ │ │ │ │ - 711 if (instance) { │ │ │ │ │ - 712 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 713 dstBuffer, dstDesc, │ │ │ │ │ - 714 numPatchCoords, patchCoords, │ │ │ │ │ - 715 patchTable); │ │ │ │ │ - 716 delete instance; │ │ │ │ │ - 717 return r; │ │ │ │ │ - 718 } │ │ │ │ │ - 719 return false; │ │ │ │ │ - 720 } │ │ │ │ │ - 721 } │ │ │ │ │ - 722 │ │ │ │ │ - 767 template │ │ │ │ │ -769 static bool EvalPatches( │ │ │ │ │ - 770 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 771 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 772 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 773 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 774 int numPatchCoords, │ │ │ │ │ - 775 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 776 PATCH_TABLE *patchTable, │ │ │ │ │ - 777 GLComputeEvaluator const *instance, │ │ │ │ │ - 778 void * deviceContext = NULL) { │ │ │ │ │ - 779 │ │ │ │ │ - 780 if (instance) { │ │ │ │ │ - 781 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 782 dstBuffer, dstDesc, │ │ │ │ │ - 783 duBuffer, duDesc, │ │ │ │ │ - 784 dvBuffer, dvDesc, │ │ │ │ │ - 785 numPatchCoords, patchCoords, │ │ │ │ │ - 786 patchTable); │ │ │ │ │ - 787 } else { │ │ │ │ │ - 788 // Create an instance on demand (slow) │ │ │ │ │ - 789 (void)deviceContext; // unused │ │ │ │ │ - 790 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 791 duDesc, dvDesc); │ │ │ │ │ - 792 if (instance) { │ │ │ │ │ - 793 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 794 dstBuffer, dstDesc, │ │ │ │ │ - 795 duBuffer, duDesc, │ │ │ │ │ - 796 dvBuffer, dvDesc, │ │ │ │ │ - 797 numPatchCoords, patchCoords, │ │ │ │ │ - 798 patchTable); │ │ │ │ │ - 799 delete instance; │ │ │ │ │ - 800 return r; │ │ │ │ │ - 801 } │ │ │ │ │ - 802 return false; │ │ │ │ │ - 803 } │ │ │ │ │ - 804 } │ │ │ │ │ - 805 │ │ │ │ │ - 868 template │ │ │ │ │ -870 static bool EvalPatches( │ │ │ │ │ - 871 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 872 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 873 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 874 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 875 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 876 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 877 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 878 int numPatchCoords, │ │ │ │ │ - 879 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 880 PATCH_TABLE *patchTable, │ │ │ │ │ - 881 GLComputeEvaluator const *instance, │ │ │ │ │ - 882 void * deviceContext = NULL) { │ │ │ │ │ - 883 │ │ │ │ │ - 884 if (instance) { │ │ │ │ │ - 885 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 886 dstBuffer, dstDesc, │ │ │ │ │ - 887 duBuffer, duDesc, │ │ │ │ │ - 888 dvBuffer, dvDesc, │ │ │ │ │ - 889 duuBuffer, duuDesc, │ │ │ │ │ - 890 duvBuffer, duvDesc, │ │ │ │ │ - 891 dvvBuffer, dvvDesc, │ │ │ │ │ - 892 numPatchCoords, patchCoords, │ │ │ │ │ - 893 patchTable); │ │ │ │ │ - 894 } else { │ │ │ │ │ - 895 // Create an instance on demand (slow) │ │ │ │ │ - 896 (void)deviceContext; // unused │ │ │ │ │ - 897 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 898 duDesc, dvDesc, │ │ │ │ │ - 899 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 900 if (instance) { │ │ │ │ │ - 901 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 902 dstBuffer, dstDesc, │ │ │ │ │ - 903 duBuffer, duDesc, │ │ │ │ │ - 904 dvBuffer, dvDesc, │ │ │ │ │ - 905 duuBuffer, duuDesc, │ │ │ │ │ - 906 duvBuffer, duvDesc, │ │ │ │ │ - 907 dvvBuffer, dvvDesc, │ │ │ │ │ - 908 numPatchCoords, patchCoords, │ │ │ │ │ - 909 patchTable); │ │ │ │ │ - 910 delete instance; │ │ │ │ │ - 911 return r; │ │ │ │ │ - 912 } │ │ │ │ │ - 913 return false; │ │ │ │ │ - 914 } │ │ │ │ │ - 915 } │ │ │ │ │ - 916 │ │ │ │ │ - 941 template │ │ │ │ │ -943 bool EvalPatches( │ │ │ │ │ - 944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 946 int numPatchCoords, │ │ │ │ │ - 947 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 948 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 949 │ │ │ │ │ - 950 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 951 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 952 0, BufferDescriptor(), │ │ │ │ │ - 953 0, BufferDescriptor(), │ │ │ │ │ - 954 numPatchCoords, │ │ │ │ │ - 955 patchCoords->BindVBO(), │ │ │ │ │ - 956 patchTable->GetPatchArrays(), │ │ │ │ │ - 957 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 958 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 959 } │ │ │ │ │ - 960 │ │ │ │ │ - 995 template │ │ │ │ │ -997 bool EvalPatches( │ │ │ │ │ - 998 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 999 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1000 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1001 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1002 int numPatchCoords, │ │ │ │ │ - 1003 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1004 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1005 │ │ │ │ │ - 1006 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1007 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1008 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1009 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1010 numPatchCoords, │ │ │ │ │ - 1011 patchCoords->BindVBO(), │ │ │ │ │ - 1012 patchTable->GetPatchArrays(), │ │ │ │ │ - 1013 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1014 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1015 } │ │ │ │ │ - 1016 │ │ │ │ │ - 1069 template │ │ │ │ │ -1071 bool EvalPatches( │ │ │ │ │ - 1072 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1073 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1074 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1075 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1076 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1077 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1078 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1079 int numPatchCoords, │ │ │ │ │ - 1080 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1081 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1082 │ │ │ │ │ - 1083 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1084 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1085 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1086 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1087 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 1088 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 1089 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 1090 numPatchCoords, │ │ │ │ │ - 1091 patchCoords->BindVBO(), │ │ │ │ │ - 1092 patchTable->GetPatchArrays(), │ │ │ │ │ - 1093 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 1094 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1095 } │ │ │ │ │ - 1096 │ │ │ │ │ -1097 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1098 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1099 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1100 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1101 int numPatchCoords, │ │ │ │ │ - 1102 GLuint patchCoordsBuffer, │ │ │ │ │ - 1103 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1104 GLuint patchIndexBuffer, │ │ │ │ │ - 1105 GLuint patchParamsBuffer) const; │ │ │ │ │ - 1106 │ │ │ │ │ -1107 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1108 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1109 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1110 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1111 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1112 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1113 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1114 int numPatchCoords, │ │ │ │ │ - 1115 GLuint patchCoordsBuffer, │ │ │ │ │ - 1116 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1117 GLuint patchIndexBuffer, │ │ │ │ │ - 1118 GLuint patchParamsBuffer) const; │ │ │ │ │ - 1119 │ │ │ │ │ - 1152 template │ │ │ │ │ -1154 static bool EvalPatchesVarying( │ │ │ │ │ - 1155 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1156 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1157 int numPatchCoords, │ │ │ │ │ - 1158 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1159 PATCH_TABLE *patchTable, │ │ │ │ │ - 1160 GLComputeEvaluator const *instance, │ │ │ │ │ - 1161 void * deviceContext = NULL) { │ │ │ │ │ - 1162 │ │ │ │ │ - 1163 if (instance) { │ │ │ │ │ - 1164 return instance->EvalPatchesVarying( │ │ │ │ │ - 1165 srcBuffer, srcDesc, │ │ │ │ │ - 1166 dstBuffer, dstDesc, │ │ │ │ │ - 1167 numPatchCoords, patchCoords, │ │ │ │ │ - 1168 patchTable); │ │ │ │ │ - 1169 } else { │ │ │ │ │ - 1170 // Create an instance on demand (slow) │ │ │ │ │ - 1171 (void)deviceContext; // unused │ │ │ │ │ - 1172 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1173 BufferDescriptor(), │ │ │ │ │ - 1174 BufferDescriptor()); │ │ │ │ │ - 1175 if (instance) { │ │ │ │ │ - 1176 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1177 srcBuffer, srcDesc, │ │ │ │ │ - 1178 dstBuffer, dstDesc, │ │ │ │ │ - 1179 numPatchCoords, patchCoords, │ │ │ │ │ - 1180 patchTable); │ │ │ │ │ - 1181 delete instance; │ │ │ │ │ - 1182 return r; │ │ │ │ │ - 1183 } │ │ │ │ │ - 1184 return false; │ │ │ │ │ - 1185 } │ │ │ │ │ - 1186 } │ │ │ │ │ - 1187 │ │ │ │ │ - 1212 template │ │ │ │ │ -1214 bool EvalPatchesVarying( │ │ │ │ │ - 1215 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1216 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1217 int numPatchCoords, │ │ │ │ │ - 1218 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1219 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1220 │ │ │ │ │ - 1221 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1222 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1223 0, BufferDescriptor(), │ │ │ │ │ - 1224 0, BufferDescriptor(), │ │ │ │ │ - 1225 numPatchCoords, │ │ │ │ │ - 1226 patchCoords->BindVBO(), │ │ │ │ │ - 1227 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1228 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1229 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1230 } │ │ │ │ │ - 1231 │ │ │ │ │ - 1276 template │ │ │ │ │ -1278 static bool EvalPatchesVarying( │ │ │ │ │ - 1279 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1280 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1281 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1282 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1283 int numPatchCoords, │ │ │ │ │ - 1284 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1285 PATCH_TABLE *patchTable, │ │ │ │ │ - 1286 GLComputeEvaluator const *instance, │ │ │ │ │ - 1287 void * deviceContext = NULL) { │ │ │ │ │ - 1288 │ │ │ │ │ - 1289 if (instance) { │ │ │ │ │ - 1290 return instance->EvalPatchesVarying( │ │ │ │ │ - 1291 srcBuffer, srcDesc, │ │ │ │ │ - 1292 dstBuffer, dstDesc, │ │ │ │ │ - 1293 duBuffer, duDesc, │ │ │ │ │ - 1294 dvBuffer, dvDesc, │ │ │ │ │ - 1295 numPatchCoords, patchCoords, │ │ │ │ │ - 1296 patchTable); │ │ │ │ │ - 1297 } else { │ │ │ │ │ - 1298 // Create an instance on demand (slow) │ │ │ │ │ - 1299 (void)deviceContext; // unused │ │ │ │ │ - 1300 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1301 duDesc, dvDesc); │ │ │ │ │ - 1302 if (instance) { │ │ │ │ │ - 1303 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1304 srcBuffer, srcDesc, │ │ │ │ │ - 1305 dstBuffer, dstDesc, │ │ │ │ │ - 1306 duBuffer, duDesc, │ │ │ │ │ - 1307 dvBuffer, dvDesc, │ │ │ │ │ - 1308 numPatchCoords, patchCoords, │ │ │ │ │ - 1309 patchTable); │ │ │ │ │ - 1310 delete instance; │ │ │ │ │ - 1311 return r; │ │ │ │ │ - 1312 } │ │ │ │ │ - 1313 return false; │ │ │ │ │ - 1314 } │ │ │ │ │ - 1315 } │ │ │ │ │ - 1316 │ │ │ │ │ - 1353 template │ │ │ │ │ -1355 bool EvalPatchesVarying( │ │ │ │ │ - 1356 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1357 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1358 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1359 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1360 int numPatchCoords, │ │ │ │ │ - 1361 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1362 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1363 │ │ │ │ │ - 1364 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1365 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1366 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1367 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1368 numPatchCoords, │ │ │ │ │ - 1369 patchCoords->BindVBO(), │ │ │ │ │ - 1370 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1371 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1372 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1373 } │ │ │ │ │ - 1374 │ │ │ │ │ - 1437 template │ │ │ │ │ -1439 static bool EvalPatchesVarying( │ │ │ │ │ - 1440 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1441 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1442 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1443 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1444 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1445 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1446 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1447 int numPatchCoords, │ │ │ │ │ - 1448 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1449 PATCH_TABLE *patchTable, │ │ │ │ │ - 1450 GLComputeEvaluator const *instance, │ │ │ │ │ - 1451 void * deviceContext = NULL) { │ │ │ │ │ - 1452 │ │ │ │ │ - 1453 if (instance) { │ │ │ │ │ - 1454 return instance->EvalPatchesVarying( │ │ │ │ │ - 1455 srcBuffer, srcDesc, │ │ │ │ │ - 1456 dstBuffer, dstDesc, │ │ │ │ │ - 1457 duBuffer, duDesc, │ │ │ │ │ - 1458 dvBuffer, dvDesc, │ │ │ │ │ - 1459 duuBuffer, duuDesc, │ │ │ │ │ - 1460 duvBuffer, duvDesc, │ │ │ │ │ - 1461 dvvBuffer, dvvDesc, │ │ │ │ │ - 1462 numPatchCoords, patchCoords, │ │ │ │ │ - 1463 patchTable); │ │ │ │ │ - 1464 } else { │ │ │ │ │ - 1465 // Create an instance on demand (slow) │ │ │ │ │ - 1466 (void)deviceContext; // unused │ │ │ │ │ - 1467 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1468 duDesc, dvDesc, │ │ │ │ │ - 1469 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 1470 if (instance) { │ │ │ │ │ - 1471 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1472 srcBuffer, srcDesc, │ │ │ │ │ - 1473 dstBuffer, dstDesc, │ │ │ │ │ - 1474 duBuffer, duDesc, │ │ │ │ │ - 1475 dvBuffer, dvDesc, │ │ │ │ │ - 1476 duuBuffer, duuDesc, │ │ │ │ │ - 1477 duvBuffer, duvDesc, │ │ │ │ │ - 1478 dvvBuffer, dvvDesc, │ │ │ │ │ - 1479 numPatchCoords, patchCoords, │ │ │ │ │ - 1480 patchTable); │ │ │ │ │ - 1481 delete instance; │ │ │ │ │ - 1482 return r; │ │ │ │ │ - 1483 } │ │ │ │ │ - 1484 return false; │ │ │ │ │ - 1485 } │ │ │ │ │ - 1486 } │ │ │ │ │ - 1487 │ │ │ │ │ - 1542 template │ │ │ │ │ -1544 bool EvalPatchesVarying( │ │ │ │ │ - 1545 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1546 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1547 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1548 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1549 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1550 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1551 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1552 int numPatchCoords, │ │ │ │ │ - 1553 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1554 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1555 │ │ │ │ │ - 1556 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1557 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1558 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1559 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1560 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 1561 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 1562 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 1563 numPatchCoords, │ │ │ │ │ - 1564 patchCoords->BindVBO(), │ │ │ │ │ - 1565 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1566 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 1567 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1568 } │ │ │ │ │ - 1569 │ │ │ │ │ - 1604 template │ │ │ │ │ -1606 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1607 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1608 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1609 int numPatchCoords, │ │ │ │ │ - 1610 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1611 PATCH_TABLE *patchTable, │ │ │ │ │ - 1612 int fvarChannel, │ │ │ │ │ - 1613 GLComputeEvaluator const *instance, │ │ │ │ │ - 1614 void * deviceContext = NULL) { │ │ │ │ │ - 1615 │ │ │ │ │ - 1616 if (instance) { │ │ │ │ │ - 1617 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1618 srcBuffer, srcDesc, │ │ │ │ │ - 1619 dstBuffer, dstDesc, │ │ │ │ │ - 1620 numPatchCoords, patchCoords, │ │ │ │ │ - 1621 patchTable, fvarChannel); │ │ │ │ │ - 1622 } else { │ │ │ │ │ - 1623 // Create an instance on demand (slow) │ │ │ │ │ - 1624 (void)deviceContext; // unused │ │ │ │ │ - 1625 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1626 BufferDescriptor(), │ │ │ │ │ - 1627 BufferDescriptor()); │ │ │ │ │ - 1628 if (instance) { │ │ │ │ │ - 1629 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1630 srcBuffer, srcDesc, │ │ │ │ │ - 1631 dstBuffer, dstDesc, │ │ │ │ │ - 1632 numPatchCoords, patchCoords, │ │ │ │ │ - 1633 patchTable, fvarChannel); │ │ │ │ │ - 1634 delete instance; │ │ │ │ │ - 1635 return r; │ │ │ │ │ - 1636 } │ │ │ │ │ - 1637 return false; │ │ │ │ │ - 1638 } │ │ │ │ │ - 1639 } │ │ │ │ │ - 1640 │ │ │ │ │ - 1667 template │ │ │ │ │ -1669 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1670 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1671 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1672 int numPatchCoords, │ │ │ │ │ - 1673 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1674 PATCH_TABLE *patchTable, │ │ │ │ │ - 1675 int fvarChannel = 0) const { │ │ │ │ │ - 1676 │ │ │ │ │ - 1677 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1678 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1679 0, BufferDescriptor(), │ │ │ │ │ - 1680 0, BufferDescriptor(), │ │ │ │ │ - 1681 numPatchCoords, │ │ │ │ │ - 1682 patchCoords->BindVBO(), │ │ │ │ │ - 1683 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1684 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1685 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1686 } │ │ │ │ │ - 1687 │ │ │ │ │ - 1734 template │ │ │ │ │ -1736 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1737 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1738 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1739 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1740 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1741 int numPatchCoords, │ │ │ │ │ - 1742 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1743 PATCH_TABLE *patchTable, │ │ │ │ │ - 1744 int fvarChannel, │ │ │ │ │ - 1745 GLComputeEvaluator const *instance, │ │ │ │ │ - 1746 void * deviceContext = NULL) { │ │ │ │ │ - 1747 │ │ │ │ │ - 1748 if (instance) { │ │ │ │ │ - 1749 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1750 srcBuffer, srcDesc, │ │ │ │ │ - 1751 dstBuffer, dstDesc, │ │ │ │ │ - 1752 duBuffer, duDesc, │ │ │ │ │ - 1753 dvBuffer, dvDesc, │ │ │ │ │ - 1754 numPatchCoords, patchCoords, │ │ │ │ │ - 1755 patchTable, fvarChannel); │ │ │ │ │ - 1756 } else { │ │ │ │ │ - 1757 // Create an instance on demand (slow) │ │ │ │ │ - 1758 (void)deviceContext; // unused │ │ │ │ │ - 1759 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1760 duDesc, dvDesc); │ │ │ │ │ - 1761 if (instance) { │ │ │ │ │ - 1762 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1763 srcBuffer, srcDesc, │ │ │ │ │ - 1764 dstBuffer, dstDesc, │ │ │ │ │ - 1765 duBuffer, duDesc, │ │ │ │ │ - 1766 dvBuffer, dvDesc, │ │ │ │ │ - 1767 numPatchCoords, patchCoords, │ │ │ │ │ - 1768 patchTable, fvarChannel); │ │ │ │ │ - 1769 delete instance; │ │ │ │ │ - 1770 return r; │ │ │ │ │ - 1771 } │ │ │ │ │ - 1772 return false; │ │ │ │ │ - 1773 } │ │ │ │ │ - 1774 } │ │ │ │ │ - 1775 │ │ │ │ │ - 1814 template │ │ │ │ │ -1816 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1817 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1818 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1819 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1820 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1821 int numPatchCoords, │ │ │ │ │ - 1822 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1823 PATCH_TABLE *patchTable, │ │ │ │ │ - 1824 int fvarChannel = 0) const { │ │ │ │ │ - 1825 │ │ │ │ │ - 1826 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1827 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1828 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1829 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1830 numPatchCoords, │ │ │ │ │ - 1831 patchCoords->BindVBO(), │ │ │ │ │ - 1832 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1833 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1834 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1835 } │ │ │ │ │ - 1836 │ │ │ │ │ - 1901 template │ │ │ │ │ -1903 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1904 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1905 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1906 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1907 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1908 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1909 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1910 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1911 int numPatchCoords, │ │ │ │ │ - 1912 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1913 PATCH_TABLE *patchTable, │ │ │ │ │ - 1914 int fvarChannel, │ │ │ │ │ - 1915 GLComputeEvaluator const *instance, │ │ │ │ │ - 1916 void * deviceContext = NULL) { │ │ │ │ │ - 1917 │ │ │ │ │ - 1918 if (instance) { │ │ │ │ │ - 1919 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1920 srcBuffer, srcDesc, │ │ │ │ │ - 1921 dstBuffer, dstDesc, │ │ │ │ │ - 1922 duBuffer, duDesc, │ │ │ │ │ - 1923 dvBuffer, dvDesc, │ │ │ │ │ - 1924 duuBuffer, duuDesc, │ │ │ │ │ - 1925 duvBuffer, duvDesc, │ │ │ │ │ - 1926 dvvBuffer, dvvDesc, │ │ │ │ │ - 1927 numPatchCoords, patchCoords, │ │ │ │ │ - 1928 patchTable, fvarChannel); │ │ │ │ │ - 1929 } else { │ │ │ │ │ - 1930 // Create an instance on demand (slow) │ │ │ │ │ - 1931 (void)deviceContext; // unused │ │ │ │ │ - 1932 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1933 duDesc, dvDesc, │ │ │ │ │ - 1934 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 1935 if (instance) { │ │ │ │ │ - 1936 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1937 srcBuffer, srcDesc, │ │ │ │ │ - 1938 dstBuffer, dstDesc, │ │ │ │ │ - 1939 duBuffer, duDesc, │ │ │ │ │ - 1940 dvBuffer, dvDesc, │ │ │ │ │ - 1941 duuBuffer, duuDesc, │ │ │ │ │ - 1942 duvBuffer, duvDesc, │ │ │ │ │ - 1943 dvvBuffer, dvvDesc, │ │ │ │ │ - 1944 numPatchCoords, patchCoords, │ │ │ │ │ - 1945 patchTable, fvarChannel); │ │ │ │ │ - 1946 delete instance; │ │ │ │ │ - 1947 return r; │ │ │ │ │ - 1948 } │ │ │ │ │ - 1949 return false; │ │ │ │ │ - 1950 } │ │ │ │ │ - 1951 } │ │ │ │ │ - 1952 │ │ │ │ │ - 2009 template │ │ │ │ │ -2011 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2012 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2013 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2014 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2015 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2016 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 2017 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 2018 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2019 int numPatchCoords, │ │ │ │ │ - 2020 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2021 PATCH_TABLE *patchTable, │ │ │ │ │ - 2022 int fvarChannel = 0) const { │ │ │ │ │ - 2023 │ │ │ │ │ - 2024 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 2025 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 2026 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 2027 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 2028 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 2029 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 2030 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 2031 numPatchCoords, │ │ │ │ │ - 2032 patchCoords->BindVBO(), │ │ │ │ │ - 2033 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 2034 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 2035 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 2036 } │ │ │ │ │ - 2037 │ │ │ │ │ - 2043 │ │ │ │ │ -2046 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2047 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2048 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ - 2049 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ - 2050 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ - 2051 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ - 2052 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ - 2053 │ │ │ │ │ -2055 static void Synchronize(void *deviceContext); │ │ │ │ │ - 2056 │ │ │ │ │ - 2057private: │ │ │ │ │ - 2058 struct _StencilKernel { │ │ │ │ │ - 2059 _StencilKernel(); │ │ │ │ │ - 2060 ~_StencilKernel(); │ │ │ │ │ - 2061 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2062 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2063 BufferDescriptor const &duDesc, │ │ │ │ │ - 2064 BufferDescriptor const &dvDesc, │ │ │ │ │ - 2065 BufferDescriptor const &duuDesc, │ │ │ │ │ - 2066 BufferDescriptor const &duvDesc, │ │ │ │ │ - 2067 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2068 int workGroupSize); │ │ │ │ │ - 2069 GLuint program; │ │ │ │ │ - 2070 GLuint uniformStart; │ │ │ │ │ - 2071 GLuint uniformEnd; │ │ │ │ │ - 2072 GLuint uniformSrcOffset; │ │ │ │ │ - 2073 GLuint uniformDstOffset; │ │ │ │ │ - 2074 GLuint uniformDuDesc; │ │ │ │ │ - 2075 GLuint uniformDvDesc; │ │ │ │ │ - 2076 GLuint uniformDuuDesc; │ │ │ │ │ - 2077 GLuint uniformDuvDesc; │ │ │ │ │ - 2078 GLuint uniformDvvDesc; │ │ │ │ │ - 2079 } _stencilKernel; │ │ │ │ │ - 2080 │ │ │ │ │ - 2081 struct _PatchKernel { │ │ │ │ │ - 2082 _PatchKernel(); │ │ │ │ │ - 2083 ~_PatchKernel(); │ │ │ │ │ - 2084 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2085 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2086 BufferDescriptor const &duDesc, │ │ │ │ │ - 2087 BufferDescriptor const &dvDesc, │ │ │ │ │ - 2088 BufferDescriptor const &duuDesc, │ │ │ │ │ - 2089 BufferDescriptor const &duvDesc, │ │ │ │ │ - 2090 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2091 int workGroupSize); │ │ │ │ │ - 2092 GLuint program; │ │ │ │ │ - 2093 GLuint uniformSrcOffset; │ │ │ │ │ - 2094 GLuint uniformDstOffset; │ │ │ │ │ - 2095 GLuint uniformPatchArray; │ │ │ │ │ - 2096 GLuint uniformDuDesc; │ │ │ │ │ - 2097 GLuint uniformDvDesc; │ │ │ │ │ - 2098 GLuint uniformDuuDesc; │ │ │ │ │ - 2099 GLuint uniformDuvDesc; │ │ │ │ │ - 2100 GLuint uniformDvvDesc; │ │ │ │ │ - 2101 } _patchKernel; │ │ │ │ │ - 2102 │ │ │ │ │ - 2103 int _workGroupSize; │ │ │ │ │ - 2104 GLuint _patchArraysSSBO; │ │ │ │ │ - 2105}; │ │ │ │ │ - 2106 │ │ │ │ │ - 2107} // end namespace Osd │ │ │ │ │ - 2108 │ │ │ │ │ - 2109} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 2110using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 2111 │ │ │ │ │ - 2112} // end namespace OpenSubdiv │ │ │ │ │ - 2113 │ │ │ │ │ - 2114 │ │ │ │ │ - 2115#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H │ │ │ │ │ + 81} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 82using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 83 │ │ │ │ │ + 84} // end namespace OpenSubdiv │ │ │ │ │ + 85 │ │ │ │ │ + 86#endif // OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ -Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:583 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO │ │ │ │ │ -GL stencil table (Shader Storage buffer) │ │ │ │ │ -Definition: glComputeEvaluator.h:51 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuvWeightsBuffer │ │ │ │ │ -GLuint GetDuvWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetWeightsBuffer │ │ │ │ │ -GLuint GetWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO │ │ │ │ │ -GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuWeightsBuffer │ │ │ │ │ -GLuint GetDuWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::~GLStencilTableSSBO │ │ │ │ │ -~GLStencilTableSSBO() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetNumStencils │ │ │ │ │ -int GetNumStencils() const │ │ │ │ │ -Definition: glComputeEvaluator.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetIndicesBuffer │ │ │ │ │ -GLuint GetIndicesBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetOffsetsBuffer │ │ │ │ │ -GLuint GetOffsetsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:71 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO │ │ │ │ │ -GLStencilTableSSBO(Far::StencilTable const *stencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvvWeightsBuffer │ │ │ │ │ -GLuint GetDvvWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetSizesBuffer │ │ │ │ │ -GLuint GetSizesBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create │ │ │ │ │ -static GLStencilTableSSBO * Create(Far::LimitStencilTable const │ │ │ │ │ -*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ -Definition: glComputeEvaluator.h:58 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuuWeightsBuffer │ │ │ │ │ -GLuint GetDuuWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvWeightsBuffer │ │ │ │ │ -GLuint GetDvWeightsBuffer() const │ │ │ │ │ -Definition: glComputeEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create │ │ │ │ │ -static GLStencilTableSSBO * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Definition: glComputeEvaluator.h:53 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator │ │ │ │ │ -Definition: glComputeEvaluator.h:96 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1214 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator │ │ │ │ │ -const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1736 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glComputeEvaluator.h:434 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1154 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1606 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glComputeEvaluator.h:502 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1278 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Instantiatable │ │ │ │ │ -bool Instantiatable │ │ │ │ │ -Definition: glComputeEvaluator.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ -const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int │ │ │ │ │ -numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ -GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::~GLComputeEvaluator │ │ │ │ │ -~GLComputeEvaluator() │ │ │ │ │ -Destructor. note that the GL context must be made current. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: glComputeEvaluator.h:1071 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glComputeEvaluator.h:236 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ -const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint │ │ │ │ │ -sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ -GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint │ │ │ │ │ -duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const │ │ │ │ │ -Dispatch the GLSL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compil... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, GLComputeEvaluator const *instance, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glComputeEvaluator.h:168 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator │ │ │ │ │ -const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1439 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:769 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1903 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1544 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1816 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:943 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::GLComputeEvaluator │ │ │ │ │ -GLComputeEvaluator() │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: glComputeEvaluator.h:997 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator │ │ │ │ │ -const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:691 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ -*stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glComputeEvaluator.h:386 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int │ │ │ │ │ -numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ -GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) │ │ │ │ │ -const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:2011 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create │ │ │ │ │ -static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, void *deviceContext=NULL) │ │ │ │ │ -Definition: glComputeEvaluator.h:99 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ -GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const │ │ │ │ │ -Dispatch the GLSL compute kernel on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compil... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -GLComputeEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glComputeEvaluator.h:326 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *deviceContext) │ │ │ │ │ -Wait the dispatched kernel finishes. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Compile │ │ │ │ │ -bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ -BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ -BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvvDesc=BufferDescriptor()) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1355 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create │ │ │ │ │ -static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Definition: glComputeEvaluator.h:111 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel=0) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:1669 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glComputeEvaluator.h:870 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: patchDescriptor.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ +@ GREGORY_BOUNDARY │ │ │ │ │ +Definition: patchDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable │ │ │ │ │ +Definition: glLegacyGregoryPatchTable.h:40 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +GetVertexValenceTextureBuffer │ │ │ │ │ +GLuint GetVertexValenceTextureBuffer() const │ │ │ │ │ +Definition: glLegacyGregoryPatchTable.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsTextureBuffer │ │ │ │ │ +GLuint GetQuadOffsetsTextureBuffer() const │ │ │ │ │ +Definition: glLegacyGregoryPatchTable.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +~GLLegacyGregoryPatchTable │ │ │ │ │ +~GLLegacyGregoryPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +GLLegacyGregoryPatchTable │ │ │ │ │ +GLLegacyGregoryPatchTable() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +UpdateVertexBuffer │ │ │ │ │ +void UpdateVertexBuffer(GLuint vbo) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +GetQuadOffsetsBase │ │ │ │ │ +GLuint GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ +Definition: glLegacyGregoryPatchTable.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ +GetVertexTextureBuffer │ │ │ │ │ +GLuint GetVertexTextureBuffer() const │ │ │ │ │ +Definition: glLegacyGregoryPatchTable.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::Create │ │ │ │ │ +static GLLegacyGregoryPatchTable * Create(Far::PatchTable const *patchTable) │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glComputeEvaluator.h │ │ │ │ │ + * glLegacyGregoryPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00851.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glXFBEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuGLVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,47 +83,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
glXFBEvaluator.h File Reference
│ │ │ │ +
cpuGLVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include <cstddef>
│ │ │ │ +#include "../osd/opengl.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  GLStencilTableTBO
 GL TextureBuffer stencil table. More...
 
class  GLXFBEvaluator
class  CpuGLVertexBuffer
 Concrete vertex buffer class for cpu subdivision and OpenGL drawing. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -glXFBEvaluator.h File Reference │ │ │ │ │ +cpuGLVertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include │ │ │ │ │ #include "../osd/opengl.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  GLStencilTableTBO │ │ │ │ │ -  GL TextureBuffer stencil table. More... │ │ │ │ │ -  │ │ │ │ │ -class  GLXFBEvaluator │ │ │ │ │ +class  CpuGLVertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for cpu subdivision and OpenGL drawing. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glXFBEvaluator.h │ │ │ │ │ + * cpuGLVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00851.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,4 +1,3 @@ │ │ │ │ │ var a00851 = [ │ │ │ │ │ - ["GLStencilTableTBO", "a01241.html", "a01241"], │ │ │ │ │ - ["GLXFBEvaluator", "a01245.html", "a01245"] │ │ │ │ │ + ["CpuGLVertexBuffer", "a01161.html", "a01161"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00851_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glXFBEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuGLVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glXFBEvaluator.h
│ │ │ │ +
cpuGLVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,1137 +107,81 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/opengl.h"
│ │ │ │ -
31#include "../osd/types.h"
│ │ │ │ -
32#include "../osd/bufferDescriptor.h"
│ │ │ │ -
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Far {
│ │ │ │ -
38 class PatchTable;
│ │ │ │ -
39 class StencilTable;
│ │ │ │ -
40 class LimitStencilTable;
│ │ │ │ -
41}
│ │ │ │ -
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ -
44
│ │ │ │ - │ │ │ │ -
53public:
│ │ │ │ - │ │ │ │ -
55 Far::StencilTable const *stencilTable, void *deviceContext = NULL) {
│ │ │ │ -
56 (void)deviceContext; // unused
│ │ │ │ -
57 return new GLStencilTableTBO(stencilTable);
│ │ │ │ -
58 }
│ │ │ │ -
59
│ │ │ │ - │ │ │ │ -
61 Far::LimitStencilTable const *limitStencilTable,
│ │ │ │ -
62 void *deviceContext = NULL) {
│ │ │ │ -
63 (void)deviceContext; // unused
│ │ │ │ -
64 return new GLStencilTableTBO(limitStencilTable);
│ │ │ │ -
65 }
│ │ │ │ +
30#include <cstddef>
│ │ │ │ +
31#include "../osd/opengl.h"
│ │ │ │ +
32
│ │ │ │ +
33namespace OpenSubdiv {
│ │ │ │ +
34namespace OPENSUBDIV_VERSION {
│ │ │ │ +
35
│ │ │ │ +
36namespace Osd {
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
48public:
│ │ │ │ +
50 static CpuGLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
51 void *deviceContext = NULL);
│ │ │ │ +
52
│ │ │ │ + │ │ │ │ +
55
│ │ │ │ +
58 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
59 void *deviceContext = NULL);
│ │ │ │ +
60
│ │ │ │ +
62 int GetNumElements() const;
│ │ │ │ +
63
│ │ │ │ +
65 int GetNumVertices() const;
│ │ │ │
66
│ │ │ │ -
67 explicit GLStencilTableTBO(Far::StencilTable const *stencilTable);
│ │ │ │ -
68 explicit GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable);
│ │ │ │ - │ │ │ │ +
69 float * BindCpuBuffer();
│ │ │ │
70
│ │ │ │ -
71 // interfaces needed for GLSLTransformFeedbackKernel
│ │ │ │ -
72 GLuint GetSizesTexture() const { return _sizes; }
│ │ │ │ -
73 GLuint GetOffsetsTexture() const { return _offsets; }
│ │ │ │ -
74 GLuint GetIndicesTexture() const { return _indices; }
│ │ │ │ -
75 GLuint GetWeightsTexture() const { return _weights; }
│ │ │ │ -
76 GLuint GetDuWeightsTexture() const { return _duWeights; }
│ │ │ │ -
77 GLuint GetDvWeightsTexture() const { return _dvWeights; }
│ │ │ │ -
78 GLuint GetDuuWeightsTexture() const { return _duuWeights; }
│ │ │ │ -
79 GLuint GetDuvWeightsTexture() const { return _duvWeights; }
│ │ │ │ -
80 GLuint GetDvvWeightsTexture() const { return _dvvWeights; }
│ │ │ │ -
81 int GetNumStencils() const { return _numStencils; }
│ │ │ │ -
82
│ │ │ │ -
83private:
│ │ │ │ -
84 GLuint _sizes;
│ │ │ │ -
85 GLuint _offsets;
│ │ │ │ -
86 GLuint _indices;
│ │ │ │ -
87 GLuint _weights;
│ │ │ │ -
88 GLuint _duWeights;
│ │ │ │ -
89 GLuint _dvWeights;
│ │ │ │ -
90 GLuint _duuWeights;
│ │ │ │ -
91 GLuint _duvWeights;
│ │ │ │ -
92 GLuint _dvvWeights;
│ │ │ │ -
93 int _numStencils;
│ │ │ │ -
94};
│ │ │ │ -
95
│ │ │ │ -
96// ---------------------------------------------------------------------------
│ │ │ │ -
97
│ │ │ │ - │ │ │ │ -
99public:
│ │ │ │ -
100 typedef bool Instantiatable;
│ │ │ │ -
101
│ │ │ │ -
103 template <typename DEVICE_CONTEXT>
│ │ │ │ -
104 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
105 BufferDescriptor const &dstDesc,
│ │ │ │ -
106 BufferDescriptor const &duDesc,
│ │ │ │ -
107 BufferDescriptor const &dvDesc,
│ │ │ │ -
108 DEVICE_CONTEXT deviceContext) {
│ │ │ │ -
109 bool interleavedDerivativeBuffers = deviceContext
│ │ │ │ -
110 ? deviceContext->AreInterleavedDerivativeBuffers()
│ │ │ │ -
111 : false;
│ │ │ │ -
112 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
113 interleavedDerivativeBuffers);
│ │ │ │ -
114 }
│ │ │ │ -
115
│ │ │ │ -
117 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
118 BufferDescriptor const &dstDesc,
│ │ │ │ -
119 BufferDescriptor const &duDesc,
│ │ │ │ -
120 BufferDescriptor const &dvDesc,
│ │ │ │ -
121 void * deviceContext) {
│ │ │ │ -
122 (void)deviceContext; // not used
│ │ │ │ -
123 return Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ -
124 }
│ │ │ │ -
125
│ │ │ │ -
126 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
127 BufferDescriptor const &dstDesc,
│ │ │ │ -
128 BufferDescriptor const &duDesc,
│ │ │ │ -
129 BufferDescriptor const &dvDesc,
│ │ │ │ -
130 bool interleavedDerivativeBuffers = false) {
│ │ │ │ -
131 GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
│ │ │ │ -
132 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
│ │ │ │ -
133 return instance;
│ │ │ │ -
134 delete instance;
│ │ │ │ -
135 return NULL;
│ │ │ │ -
136 }
│ │ │ │ -
137
│ │ │ │ -
139 template <typename DEVICE_CONTEXT>
│ │ │ │ -
140 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
141 BufferDescriptor const &dstDesc,
│ │ │ │ -
142 BufferDescriptor const &duDesc,
│ │ │ │ -
143 BufferDescriptor const &dvDesc,
│ │ │ │ -
144 BufferDescriptor const &duuDesc,
│ │ │ │ -
145 BufferDescriptor const &duvDesc,
│ │ │ │ -
146 BufferDescriptor const &dvvDesc,
│ │ │ │ -
147 DEVICE_CONTEXT deviceContext) {
│ │ │ │ -
148 bool interleavedDerivativeBuffers = deviceContext
│ │ │ │ -
149 ? deviceContext->AreInterleavedDerivativeBuffers()
│ │ │ │ -
150 : false;
│ │ │ │ -
151 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
152 duuDesc, duvDesc, dvvDesc,
│ │ │ │ -
153 interleavedDerivativeBuffers);
│ │ │ │ -
154 }
│ │ │ │ -
155
│ │ │ │ -
157 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
158 BufferDescriptor const &dstDesc,
│ │ │ │ -
159 BufferDescriptor const &duDesc,
│ │ │ │ -
160 BufferDescriptor const &dvDesc,
│ │ │ │ -
161 BufferDescriptor const &duuDesc,
│ │ │ │ -
162 BufferDescriptor const &duvDesc,
│ │ │ │ -
163 BufferDescriptor const &dvvDesc,
│ │ │ │ -
164 void * deviceContext) {
│ │ │ │ -
165 (void)deviceContext; // not used
│ │ │ │ -
166 return Create(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
167 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
168 }
│ │ │ │ -
169
│ │ │ │ -
170 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
│ │ │ │ -
171 BufferDescriptor const &dstDesc,
│ │ │ │ -
172 BufferDescriptor const &duDesc,
│ │ │ │ -
173 BufferDescriptor const &dvDesc,
│ │ │ │ -
174 BufferDescriptor const &duuDesc,
│ │ │ │ -
175 BufferDescriptor const &duvDesc,
│ │ │ │ -
176 BufferDescriptor const &dvvDesc,
│ │ │ │ -
177 bool interleavedDerivativeBuffers = false) {
│ │ │ │ -
178 GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
│ │ │ │ -
179 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
│ │ │ │ -
180 duuDesc, duvDesc, dvvDesc))
│ │ │ │ -
181 return instance;
│ │ │ │ -
182 delete instance;
│ │ │ │ -
183 return NULL;
│ │ │ │ -
184 }
│ │ │ │ -
185
│ │ │ │ -
199 GLXFBEvaluator(bool interleavedDerivativeBuffers = false);
│ │ │ │ -
200
│ │ │ │ - │ │ │ │ -
203
│ │ │ │ -
209
│ │ │ │ -
237 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
238 static bool EvalStencils(
│ │ │ │ -
239 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
240 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
241 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
242 GLXFBEvaluator const *instance,
│ │ │ │ -
243 void * deviceContext = NULL) {
│ │ │ │ -
244
│ │ │ │ -
245 if (instance) {
│ │ │ │ -
246 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
247 dstBuffer, dstDesc,
│ │ │ │ -
248 stencilTable);
│ │ │ │ -
249 } else {
│ │ │ │ -
250 // Create an instance on demand (slow)
│ │ │ │ -
251 (void)deviceContext; // unused
│ │ │ │ -
252 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
255 if (instance) {
│ │ │ │ -
256 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
257 dstBuffer, dstDesc,
│ │ │ │ -
258 stencilTable);
│ │ │ │ -
259 delete instance;
│ │ │ │ -
260 return r;
│ │ │ │ -
261 }
│ │ │ │ -
262 return false;
│ │ │ │ -
263 }
│ │ │ │ -
264 }
│ │ │ │ -
265
│ │ │ │ -
305 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
306 static bool EvalStencils(
│ │ │ │ -
307 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
308 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
309 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
310 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
312 GLXFBEvaluator const *instance,
│ │ │ │ -
313 void * deviceContext = NULL) {
│ │ │ │ -
314
│ │ │ │ -
315 if (instance) {
│ │ │ │ -
316 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
317 dstBuffer, dstDesc,
│ │ │ │ -
318 duBuffer, duDesc,
│ │ │ │ -
319 dvBuffer, dvDesc,
│ │ │ │ -
320 stencilTable);
│ │ │ │ -
321 } else {
│ │ │ │ -
322 // Create an instance on demand (slow)
│ │ │ │ -
323 (void)deviceContext; // unused
│ │ │ │ -
324 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ -
325 if (instance) {
│ │ │ │ -
326 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
327 dstBuffer, dstDesc,
│ │ │ │ -
328 duBuffer, duDesc,
│ │ │ │ -
329 dvBuffer, dvDesc,
│ │ │ │ -
330 stencilTable);
│ │ │ │ -
331 delete instance;
│ │ │ │ -
332 return r;
│ │ │ │ -
333 }
│ │ │ │ -
334 return false;
│ │ │ │ -
335 }
│ │ │ │ -
336 }
│ │ │ │ -
337
│ │ │ │ -
395 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
396 static bool EvalStencils(
│ │ │ │ -
397 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
398 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
399 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
400 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
401 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
402 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
403 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
404 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
405 GLXFBEvaluator const *instance,
│ │ │ │ -
406 void * deviceContext = NULL) {
│ │ │ │ -
407
│ │ │ │ -
408 if (instance) {
│ │ │ │ -
409 return instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
410 dstBuffer, dstDesc,
│ │ │ │ -
411 duBuffer, duDesc,
│ │ │ │ -
412 dvBuffer, dvDesc,
│ │ │ │ -
413 duuBuffer, duuDesc,
│ │ │ │ -
414 duvBuffer, duvDesc,
│ │ │ │ -
415 dvvBuffer, dvvDesc,
│ │ │ │ -
416 stencilTable);
│ │ │ │ -
417 } else {
│ │ │ │ -
418 // Create an instance on demand (slow)
│ │ │ │ -
419 (void)deviceContext; // unused
│ │ │ │ -
420 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
421 duDesc, dvDesc,
│ │ │ │ -
422 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
423 if (instance) {
│ │ │ │ -
424 bool r = instance->EvalStencils(srcBuffer, srcDesc,
│ │ │ │ -
425 dstBuffer, dstDesc,
│ │ │ │ -
426 duBuffer, duDesc,
│ │ │ │ -
427 dvBuffer, dvDesc,
│ │ │ │ -
428 duuBuffer, duuDesc,
│ │ │ │ -
429 duvBuffer, duvDesc,
│ │ │ │ -
430 dvvBuffer, dvvDesc,
│ │ │ │ -
431 stencilTable);
│ │ │ │ -
432 delete instance;
│ │ │ │ -
433 return r;
│ │ │ │ -
434 }
│ │ │ │ -
435 return false;
│ │ │ │ -
436 }
│ │ │ │ -
437 }
│ │ │ │ -
438
│ │ │ │ -
456 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
458 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
459 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
460 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
461
│ │ │ │ -
462 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
463 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
464 0, BufferDescriptor(),
│ │ │ │ -
465 0, BufferDescriptor(),
│ │ │ │ -
466 stencilTable->GetSizesTexture(),
│ │ │ │ -
467 stencilTable->GetOffsetsTexture(),
│ │ │ │ -
468 stencilTable->GetIndicesTexture(),
│ │ │ │ -
469 stencilTable->GetWeightsTexture(),
│ │ │ │ -
470 0,
│ │ │ │ -
471 0,
│ │ │ │ -
472 /* start = */ 0,
│ │ │ │ -
473 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
474 }
│ │ │ │ -
475
│ │ │ │ -
505 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
507 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
508 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
509 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
510 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
511 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
512
│ │ │ │ -
513 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
514 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
515 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
516 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
517 stencilTable->GetSizesTexture(),
│ │ │ │ -
518 stencilTable->GetOffsetsTexture(),
│ │ │ │ -
519 stencilTable->GetIndicesTexture(),
│ │ │ │ -
520 stencilTable->GetWeightsTexture(),
│ │ │ │ -
521 stencilTable->GetDuWeightsTexture(),
│ │ │ │ -
522 stencilTable->GetDvWeightsTexture(),
│ │ │ │ -
523 /* start = */ 0,
│ │ │ │ -
524 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
525 }
│ │ │ │ -
526
│ │ │ │ -
574 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ - │ │ │ │ -
576 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
577 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
578 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
579 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
580 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
581 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
582 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
583 STENCIL_TABLE const *stencilTable) const {
│ │ │ │ -
584
│ │ │ │ -
585 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
586 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
587 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
588 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
589 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
590 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
591 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
592 stencilTable->GetSizesTexture(),
│ │ │ │ -
593 stencilTable->GetOffsetsTexture(),
│ │ │ │ -
594 stencilTable->GetIndicesTexture(),
│ │ │ │ -
595 stencilTable->GetWeightsTexture(),
│ │ │ │ -
596 stencilTable->GetDuWeightsTexture(),
│ │ │ │ -
597 stencilTable->GetDvWeightsTexture(),
│ │ │ │ -
598 stencilTable->GetDuuWeightsTexture(),
│ │ │ │ -
599 stencilTable->GetDuvWeightsTexture(),
│ │ │ │ -
600 stencilTable->GetDvvWeightsTexture(),
│ │ │ │ -
601 /* start = */ 0,
│ │ │ │ -
602 /* end = */ stencilTable->GetNumStencils());
│ │ │ │ -
603 }
│ │ │ │ -
604
│ │ │ │ -
640 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
641 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
642 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
643 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
644 GLuint sizesBuffer,
│ │ │ │ -
645 GLuint offsetsBuffer,
│ │ │ │ -
646 GLuint indicesBuffer,
│ │ │ │ -
647 GLuint weightsBuffer,
│ │ │ │ -
648 GLuint duWeightsBuffer,
│ │ │ │ -
649 GLuint dvWeightsBuffer,
│ │ │ │ -
650 int start,
│ │ │ │ -
651 int end) const;
│ │ │ │ -
652
│ │ │ │ -
706 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
707 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
708 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
709 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
710 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
711 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
712 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
713 GLuint sizesBuffer,
│ │ │ │ -
714 GLuint offsetsBuffer,
│ │ │ │ -
715 GLuint indicesBuffer,
│ │ │ │ -
716 GLuint weightsBuffer,
│ │ │ │ -
717 GLuint duWeightsBuffer,
│ │ │ │ -
718 GLuint dvWeightsBuffer,
│ │ │ │ -
719 GLuint duuWeightsBuffer,
│ │ │ │ -
720 GLuint duvWeightsBuffer,
│ │ │ │ -
721 GLuint dvvWeightsBuffer,
│ │ │ │ -
722 int start,
│ │ │ │ -
723 int end) const;
│ │ │ │ -
724
│ │ │ │ -
730
│ │ │ │ -
763 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
764 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
765 static bool EvalPatches(
│ │ │ │ -
766 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
767 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
768 int numPatchCoords,
│ │ │ │ -
769 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
770 PATCH_TABLE *patchTable,
│ │ │ │ -
771 GLXFBEvaluator const *instance,
│ │ │ │ -
772 void * deviceContext = NULL) {
│ │ │ │ -
773
│ │ │ │ -
774 if (instance) {
│ │ │ │ -
775 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
776 dstBuffer, dstDesc,
│ │ │ │ -
777 numPatchCoords, patchCoords,
│ │ │ │ -
778 patchTable);
│ │ │ │ -
779 } else {
│ │ │ │ -
780 // Create an instance on demand (slow)
│ │ │ │ -
781 (void)deviceContext; // unused
│ │ │ │ -
782 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
785 if (instance) {
│ │ │ │ -
786 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
787 dstBuffer, dstDesc,
│ │ │ │ -
788 numPatchCoords, patchCoords,
│ │ │ │ -
789 patchTable);
│ │ │ │ -
790 delete instance;
│ │ │ │ -
791 return r;
│ │ │ │ -
792 }
│ │ │ │ -
793 return false;
│ │ │ │ -
794 }
│ │ │ │ -
795 }
│ │ │ │ -
796
│ │ │ │ -
841 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
842 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
843 static bool EvalPatches(
│ │ │ │ -
844 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
845 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
846 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
847 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
848 int numPatchCoords,
│ │ │ │ -
849 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
850 PATCH_TABLE *patchTable,
│ │ │ │ -
851 GLXFBEvaluator const *instance,
│ │ │ │ -
852 void * deviceContext = NULL) {
│ │ │ │ -
853
│ │ │ │ -
854 if (instance) {
│ │ │ │ -
855 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
856 dstBuffer, dstDesc,
│ │ │ │ -
857 duBuffer, duDesc,
│ │ │ │ -
858 dvBuffer, dvDesc,
│ │ │ │ -
859 numPatchCoords, patchCoords,
│ │ │ │ -
860 patchTable);
│ │ │ │ -
861 } else {
│ │ │ │ -
862 // Create an instance on demand (slow)
│ │ │ │ -
863 (void)deviceContext; // unused
│ │ │ │ -
864 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
│ │ │ │ -
865 if (instance) {
│ │ │ │ -
866 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
867 dstBuffer, dstDesc,
│ │ │ │ -
868 duBuffer, duDesc,
│ │ │ │ -
869 dvBuffer, dvDesc,
│ │ │ │ -
870 numPatchCoords, patchCoords,
│ │ │ │ -
871 patchTable);
│ │ │ │ -
872 delete instance;
│ │ │ │ -
873 return r;
│ │ │ │ -
874 }
│ │ │ │ -
875 return false;
│ │ │ │ -
876 }
│ │ │ │ -
877 }
│ │ │ │ -
878
│ │ │ │ -
941 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
942 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
943 static bool EvalPatches(
│ │ │ │ -
944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
946 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
947 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
948 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
949 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
950 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
951 int numPatchCoords,
│ │ │ │ -
952 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
953 PATCH_TABLE *patchTable,
│ │ │ │ -
954 GLXFBEvaluator const *instance,
│ │ │ │ -
955 void * deviceContext = NULL) {
│ │ │ │ -
956
│ │ │ │ -
957 if (instance) {
│ │ │ │ -
958 return instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
959 dstBuffer, dstDesc,
│ │ │ │ -
960 duBuffer, duDesc,
│ │ │ │ -
961 dvBuffer, dvDesc,
│ │ │ │ -
962 duuBuffer, duuDesc,
│ │ │ │ -
963 duvBuffer, duvDesc,
│ │ │ │ -
964 dvvBuffer, dvvDesc,
│ │ │ │ -
965 numPatchCoords, patchCoords,
│ │ │ │ -
966 patchTable);
│ │ │ │ -
967 } else {
│ │ │ │ -
968 // Create an instance on demand (slow)
│ │ │ │ -
969 (void)deviceContext; // unused
│ │ │ │ -
970 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
971 duDesc, dvDesc,
│ │ │ │ -
972 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
973 if (instance) {
│ │ │ │ -
974 bool r = instance->EvalPatches(srcBuffer, srcDesc,
│ │ │ │ -
975 dstBuffer, dstDesc,
│ │ │ │ -
976 duBuffer, duDesc,
│ │ │ │ -
977 dvBuffer, dvDesc,
│ │ │ │ -
978 duuBuffer, duuDesc,
│ │ │ │ -
979 duvBuffer, duvDesc,
│ │ │ │ -
980 dvvBuffer, dvvDesc,
│ │ │ │ -
981 numPatchCoords, patchCoords,
│ │ │ │ -
982 patchTable);
│ │ │ │ -
983 delete instance;
│ │ │ │ -
984 return r;
│ │ │ │ -
985 }
│ │ │ │ -
986 return false;
│ │ │ │ -
987 }
│ │ │ │ -
988 }
│ │ │ │ -
989
│ │ │ │ -
1014 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1015 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1017 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1018 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1019 int numPatchCoords,
│ │ │ │ -
1020 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1021 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1022
│ │ │ │ -
1023 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1024 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1025 0, BufferDescriptor(),
│ │ │ │ -
1026 0, BufferDescriptor(),
│ │ │ │ -
1027 numPatchCoords,
│ │ │ │ -
1028 patchCoords->BindVBO(),
│ │ │ │ -
1029 patchTable->GetPatchArrays(),
│ │ │ │ -
1030 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ -
1031 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1032 }
│ │ │ │ -
1033
│ │ │ │ -
1068 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1069 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1073 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1074 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1075 int numPatchCoords,
│ │ │ │ -
1076 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1077 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1078
│ │ │ │ -
1079 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1080 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1081 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1082 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1083 numPatchCoords,
│ │ │ │ -
1084 patchCoords->BindVBO(),
│ │ │ │ -
1085 patchTable->GetPatchArrays(),
│ │ │ │ -
1086 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ -
1087 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1088 }
│ │ │ │ -
1089
│ │ │ │ -
1142 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1143 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1145 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1146 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1147 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1148 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1149 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1150 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1151 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1152 int numPatchCoords,
│ │ │ │ -
1153 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1154 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1155
│ │ │ │ -
1156 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1157 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1158 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1159 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1160 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
1161 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
1162 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
1163 numPatchCoords,
│ │ │ │ -
1164 patchCoords->BindVBO(),
│ │ │ │ -
1165 patchTable->GetPatchArrays(),
│ │ │ │ -
1166 patchTable->GetPatchIndexTextureBuffer(),
│ │ │ │ -
1167 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1168 }
│ │ │ │ -
1169
│ │ │ │ -
1170 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1171 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1172 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1173 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1174 int numPatchCoords,
│ │ │ │ -
1175 GLuint patchCoordsBuffer,
│ │ │ │ -
1176 const PatchArrayVector &patchArrays,
│ │ │ │ -
1177 GLuint patchIndexBuffer,
│ │ │ │ -
1178 GLuint patchParamsBuffer) const;
│ │ │ │ -
1179
│ │ │ │ -
1180 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1181 GLuint dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1182 GLuint duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1183 GLuint dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1184 GLuint duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1185 GLuint duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1186 GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1187 int numPatchCoords,
│ │ │ │ -
1188 GLuint patchCoordsBuffer,
│ │ │ │ -
1189 const PatchArrayVector &patchArrays,
│ │ │ │ -
1190 GLuint patchIndexBuffer,
│ │ │ │ -
1191 GLuint patchParamsBuffer) const;
│ │ │ │ -
1192
│ │ │ │ -
1225 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1226 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1228 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1229 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1230 int numPatchCoords,
│ │ │ │ -
1231 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1232 PATCH_TABLE *patchTable,
│ │ │ │ -
1233 GLXFBEvaluator const *instance,
│ │ │ │ -
1234 void * deviceContext = NULL) {
│ │ │ │ -
1235
│ │ │ │ -
1236 if (instance) {
│ │ │ │ -
1237 return instance->EvalPatchesVarying(
│ │ │ │ -
1238 srcBuffer, srcDesc,
│ │ │ │ -
1239 dstBuffer, dstDesc,
│ │ │ │ -
1240 numPatchCoords, patchCoords,
│ │ │ │ -
1241 patchTable);
│ │ │ │ -
1242 } else {
│ │ │ │ -
1243 // Create an instance on demand (slow)
│ │ │ │ -
1244 (void)deviceContext; // unused
│ │ │ │ -
1245 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1248 if (instance) {
│ │ │ │ -
1249 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1250 srcBuffer, srcDesc,
│ │ │ │ -
1251 dstBuffer, dstDesc,
│ │ │ │ -
1252 numPatchCoords, patchCoords,
│ │ │ │ -
1253 patchTable);
│ │ │ │ -
1254 delete instance;
│ │ │ │ -
1255 return r;
│ │ │ │ -
1256 }
│ │ │ │ -
1257 return false;
│ │ │ │ -
1258 }
│ │ │ │ -
1259 }
│ │ │ │ -
1260
│ │ │ │ -
1285 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1286 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1288 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1289 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1290 int numPatchCoords,
│ │ │ │ -
1291 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1292 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1293
│ │ │ │ -
1294 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1295 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1296 0, BufferDescriptor(),
│ │ │ │ -
1297 0, BufferDescriptor(),
│ │ │ │ -
1298 numPatchCoords,
│ │ │ │ -
1299 patchCoords->BindVBO(),
│ │ │ │ -
1300 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1301 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ -
1302 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1303 }
│ │ │ │ -
1304
│ │ │ │ -
1349 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1350 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1352 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1353 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1354 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1355 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1356 int numPatchCoords,
│ │ │ │ -
1357 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1358 PATCH_TABLE *patchTable,
│ │ │ │ -
1359 GLXFBEvaluator const *instance,
│ │ │ │ -
1360 void * deviceContext = NULL) {
│ │ │ │ -
1361
│ │ │ │ -
1362 if (instance) {
│ │ │ │ -
1363 return instance->EvalPatchesVarying(
│ │ │ │ -
1364 srcBuffer, srcDesc,
│ │ │ │ -
1365 dstBuffer, dstDesc,
│ │ │ │ -
1366 duBuffer, duDesc,
│ │ │ │ -
1367 dvBuffer, dvDesc,
│ │ │ │ -
1368 numPatchCoords, patchCoords,
│ │ │ │ -
1369 patchTable);
│ │ │ │ -
1370 } else {
│ │ │ │ -
1371 // Create an instance on demand (slow)
│ │ │ │ -
1372 (void)deviceContext; // unused
│ │ │ │ -
1373 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1374 duDesc, dvDesc);
│ │ │ │ -
1375 if (instance) {
│ │ │ │ -
1376 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1377 srcBuffer, srcDesc,
│ │ │ │ -
1378 dstBuffer, dstDesc,
│ │ │ │ -
1379 duBuffer, duDesc,
│ │ │ │ -
1380 dvBuffer, dvDesc,
│ │ │ │ -
1381 numPatchCoords, patchCoords,
│ │ │ │ -
1382 patchTable);
│ │ │ │ -
1383 delete instance;
│ │ │ │ -
1384 return r;
│ │ │ │ -
1385 }
│ │ │ │ -
1386 return false;
│ │ │ │ -
1387 }
│ │ │ │ -
1388 }
│ │ │ │ -
1389
│ │ │ │ -
1426 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1427 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1429 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1430 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1431 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1432 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1433 int numPatchCoords,
│ │ │ │ -
1434 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1435 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1436
│ │ │ │ -
1437 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1438 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1439 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1440 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1441 numPatchCoords,
│ │ │ │ -
1442 patchCoords->BindVBO(),
│ │ │ │ -
1443 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1444 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ -
1445 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1446 }
│ │ │ │ -
1447
│ │ │ │ -
1510 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1511 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1513 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1514 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1515 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1516 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1517 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1518 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1519 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1520 int numPatchCoords,
│ │ │ │ -
1521 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1522 PATCH_TABLE *patchTable,
│ │ │ │ -
1523 GLXFBEvaluator const *instance,
│ │ │ │ -
1524 void * deviceContext = NULL) {
│ │ │ │ -
1525
│ │ │ │ -
1526 if (instance) {
│ │ │ │ -
1527 return instance->EvalPatchesVarying(
│ │ │ │ -
1528 srcBuffer, srcDesc,
│ │ │ │ -
1529 dstBuffer, dstDesc,
│ │ │ │ -
1530 duBuffer, duDesc,
│ │ │ │ -
1531 dvBuffer, dvDesc,
│ │ │ │ -
1532 duuBuffer, duuDesc,
│ │ │ │ -
1533 duvBuffer, duvDesc,
│ │ │ │ -
1534 dvvBuffer, dvvDesc,
│ │ │ │ -
1535 numPatchCoords, patchCoords,
│ │ │ │ -
1536 patchTable);
│ │ │ │ -
1537 } else {
│ │ │ │ -
1538 // Create an instance on demand (slow)
│ │ │ │ -
1539 (void)deviceContext; // unused
│ │ │ │ -
1540 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1541 duDesc, dvDesc,
│ │ │ │ -
1542 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
1543 if (instance) {
│ │ │ │ -
1544 bool r = instance->EvalPatchesVarying(
│ │ │ │ -
1545 srcBuffer, srcDesc,
│ │ │ │ -
1546 dstBuffer, dstDesc,
│ │ │ │ -
1547 duBuffer, duDesc,
│ │ │ │ -
1548 dvBuffer, dvDesc,
│ │ │ │ -
1549 duuBuffer, duuDesc,
│ │ │ │ -
1550 duvBuffer, duvDesc,
│ │ │ │ -
1551 dvvBuffer, dvvDesc,
│ │ │ │ -
1552 numPatchCoords, patchCoords,
│ │ │ │ -
1553 patchTable);
│ │ │ │ -
1554 delete instance;
│ │ │ │ -
1555 return r;
│ │ │ │ -
1556 }
│ │ │ │ -
1557 return false;
│ │ │ │ -
1558 }
│ │ │ │ -
1559 }
│ │ │ │ -
1560
│ │ │ │ -
1615 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1616 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1618 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1619 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1620 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1621 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1622 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1623 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1624 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1625 int numPatchCoords,
│ │ │ │ -
1626 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1627 PATCH_TABLE *patchTable) const {
│ │ │ │ -
1628
│ │ │ │ -
1629 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1630 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1631 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1632 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1633 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
1634 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
1635 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
1636 numPatchCoords,
│ │ │ │ -
1637 patchCoords->BindVBO(),
│ │ │ │ -
1638 patchTable->GetVaryingPatchArrays(),
│ │ │ │ -
1639 patchTable->GetVaryingPatchIndexTextureBuffer(),
│ │ │ │ -
1640 patchTable->GetPatchParamTextureBuffer());
│ │ │ │ -
1641 }
│ │ │ │ -
1642
│ │ │ │ -
1677 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1678 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1680 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1681 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1682 int numPatchCoords,
│ │ │ │ -
1683 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1684 PATCH_TABLE *patchTable,
│ │ │ │ -
1685 int fvarChannel,
│ │ │ │ -
1686 GLXFBEvaluator const *instance,
│ │ │ │ -
1687 void * deviceContext = NULL) {
│ │ │ │ -
1688
│ │ │ │ -
1689 if (instance) {
│ │ │ │ -
1690 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1691 srcBuffer, srcDesc,
│ │ │ │ -
1692 dstBuffer, dstDesc,
│ │ │ │ -
1693 numPatchCoords, patchCoords,
│ │ │ │ -
1694 patchTable, fvarChannel);
│ │ │ │ -
1695 } else {
│ │ │ │ -
1696 // Create an instance on demand (slow)
│ │ │ │ -
1697 (void)deviceContext; // unused
│ │ │ │ -
1698 instance = Create(srcDesc, dstDesc,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
1701 if (instance) {
│ │ │ │ -
1702 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1703 srcBuffer, srcDesc,
│ │ │ │ -
1704 dstBuffer, dstDesc,
│ │ │ │ -
1705 numPatchCoords, patchCoords,
│ │ │ │ -
1706 patchTable, fvarChannel);
│ │ │ │ -
1707 delete instance;
│ │ │ │ -
1708 return r;
│ │ │ │ -
1709 }
│ │ │ │ -
1710 return false;
│ │ │ │ -
1711 }
│ │ │ │ -
1712 }
│ │ │ │ -
1713
│ │ │ │ -
1740 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1741 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1745 int numPatchCoords,
│ │ │ │ -
1746 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1747 PATCH_TABLE *patchTable,
│ │ │ │ -
1748 int fvarChannel = 0) const {
│ │ │ │ -
1749
│ │ │ │ -
1750 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1751 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1752 0, BufferDescriptor(),
│ │ │ │ -
1753 0, BufferDescriptor(),
│ │ │ │ -
1754 numPatchCoords,
│ │ │ │ -
1755 patchCoords->BindVBO(),
│ │ │ │ -
1756 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1757 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ -
1758 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ -
1759 }
│ │ │ │ -
1760
│ │ │ │ -
1807 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1808 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1810 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1811 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1812 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1813 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1814 int numPatchCoords,
│ │ │ │ -
1815 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1816 PATCH_TABLE *patchTable,
│ │ │ │ -
1817 int fvarChannel,
│ │ │ │ -
1818 GLXFBEvaluator const *instance,
│ │ │ │ -
1819 void * deviceContext = NULL) {
│ │ │ │ -
1820
│ │ │ │ -
1821 if (instance) {
│ │ │ │ -
1822 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1823 srcBuffer, srcDesc,
│ │ │ │ -
1824 dstBuffer, dstDesc,
│ │ │ │ -
1825 duBuffer, duDesc,
│ │ │ │ -
1826 dvBuffer, dvDesc,
│ │ │ │ -
1827 numPatchCoords, patchCoords,
│ │ │ │ -
1828 patchTable, fvarChannel);
│ │ │ │ -
1829 } else {
│ │ │ │ -
1830 // Create an instance on demand (slow)
│ │ │ │ -
1831 (void)deviceContext; // unused
│ │ │ │ -
1832 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
1833 duDesc, dvDesc);
│ │ │ │ -
1834 if (instance) {
│ │ │ │ -
1835 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
1836 srcBuffer, srcDesc,
│ │ │ │ -
1837 dstBuffer, dstDesc,
│ │ │ │ -
1838 duBuffer, duDesc,
│ │ │ │ -
1839 dvBuffer, dvDesc,
│ │ │ │ -
1840 numPatchCoords, patchCoords,
│ │ │ │ -
1841 patchTable, fvarChannel);
│ │ │ │ -
1842 delete instance;
│ │ │ │ -
1843 return r;
│ │ │ │ -
1844 }
│ │ │ │ -
1845 return false;
│ │ │ │ -
1846 }
│ │ │ │ -
1847 }
│ │ │ │ -
1848
│ │ │ │ -
1887 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1888 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1894 int numPatchCoords,
│ │ │ │ -
1895 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1896 PATCH_TABLE *patchTable,
│ │ │ │ -
1897 int fvarChannel = 0) const {
│ │ │ │ -
1898
│ │ │ │ -
1899 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
1900 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
1901 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
1902 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
1903 numPatchCoords,
│ │ │ │ -
1904 patchCoords->BindVBO(),
│ │ │ │ -
1905 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
1906 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ -
1907 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ -
1908 }
│ │ │ │ -
1909
│ │ │ │ -
1974 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1975 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1977 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1978 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1979 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1980 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1981 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1982 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1983 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1984 int numPatchCoords,
│ │ │ │ -
1985 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1986 PATCH_TABLE *patchTable,
│ │ │ │ -
1987 int fvarChannel,
│ │ │ │ -
1988 GLXFBEvaluator const *instance,
│ │ │ │ -
1989 void * deviceContext = NULL) {
│ │ │ │ -
1990
│ │ │ │ -
1991 if (instance) {
│ │ │ │ -
1992 return instance->EvalPatchesFaceVarying(
│ │ │ │ -
1993 srcBuffer, srcDesc,
│ │ │ │ -
1994 dstBuffer, dstDesc,
│ │ │ │ -
1995 duBuffer, duDesc,
│ │ │ │ -
1996 dvBuffer, dvDesc,
│ │ │ │ -
1997 duuBuffer, duuDesc,
│ │ │ │ -
1998 duvBuffer, duvDesc,
│ │ │ │ -
1999 dvvBuffer, dvvDesc,
│ │ │ │ -
2000 numPatchCoords, patchCoords,
│ │ │ │ -
2001 patchTable, fvarChannel);
│ │ │ │ -
2002 } else {
│ │ │ │ -
2003 // Create an instance on demand (slow)
│ │ │ │ -
2004 (void)deviceContext; // unused
│ │ │ │ -
2005 instance = Create(srcDesc, dstDesc,
│ │ │ │ -
2006 duDesc, dvDesc,
│ │ │ │ -
2007 duuDesc, duvDesc, dvvDesc);
│ │ │ │ -
2008 if (instance) {
│ │ │ │ -
2009 bool r = instance->EvalPatchesFaceVarying(
│ │ │ │ -
2010 srcBuffer, srcDesc,
│ │ │ │ -
2011 dstBuffer, dstDesc,
│ │ │ │ -
2012 duBuffer, duDesc,
│ │ │ │ -
2013 dvBuffer, dvDesc,
│ │ │ │ -
2014 duuBuffer, duuDesc,
│ │ │ │ -
2015 duvBuffer, duvDesc,
│ │ │ │ -
2016 dvvBuffer, dvvDesc,
│ │ │ │ -
2017 numPatchCoords, patchCoords,
│ │ │ │ -
2018 patchTable, fvarChannel);
│ │ │ │ -
2019 delete instance;
│ │ │ │ -
2020 return r;
│ │ │ │ -
2021 }
│ │ │ │ -
2022 return false;
│ │ │ │ -
2023 }
│ │ │ │ -
2024 }
│ │ │ │ -
2025
│ │ │ │ -
2082 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
2083 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
2085 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
2086 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
2087 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
2088 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
2089 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
2090 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
2091 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
2092 int numPatchCoords,
│ │ │ │ -
2093 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
2094 PATCH_TABLE *patchTable,
│ │ │ │ -
2095 int fvarChannel = 0) const {
│ │ │ │ -
2096
│ │ │ │ -
2097 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
│ │ │ │ -
2098 dstBuffer->BindVBO(), dstDesc,
│ │ │ │ -
2099 duBuffer->BindVBO(), duDesc,
│ │ │ │ -
2100 dvBuffer->BindVBO(), dvDesc,
│ │ │ │ -
2101 duuBuffer->BindVBO(), duuDesc,
│ │ │ │ -
2102 duvBuffer->BindVBO(), duvDesc,
│ │ │ │ -
2103 dvvBuffer->BindVBO(), dvvDesc,
│ │ │ │ -
2104 numPatchCoords,
│ │ │ │ -
2105 patchCoords->BindVBO(),
│ │ │ │ -
2106 patchTable->GetFVarPatchArrays(fvarChannel),
│ │ │ │ -
2107 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
│ │ │ │ -
2108 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
│ │ │ │ -
2109 }
│ │ │ │ -
2110
│ │ │ │ -
2116
│ │ │ │ -
2119 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2120 BufferDescriptor const &dstDesc,
│ │ │ │ -
2121 BufferDescriptor const &duDesc = BufferDescriptor(),
│ │ │ │ -
2122 BufferDescriptor const &dvDesc = BufferDescriptor(),
│ │ │ │ -
2123 BufferDescriptor const &duuDesc = BufferDescriptor(),
│ │ │ │ -
2124 BufferDescriptor const &duvDesc = BufferDescriptor(),
│ │ │ │ -
2125 BufferDescriptor const &dvvDesc = BufferDescriptor());
│ │ │ │ -
2126
│ │ │ │ -
2128 static void Synchronize(void *kernel);
│ │ │ │ -
2129
│ │ │ │ -
2130private:
│ │ │ │ -
2131 GLuint _srcBufferTexture;
│ │ │ │ -
2132 GLuint _patchArraysUBO;
│ │ │ │ -
2133 bool _interleavedDerivativeBuffers;
│ │ │ │ -
2134
│ │ │ │ -
2135 struct _StencilKernel {
│ │ │ │ -
2136 _StencilKernel();
│ │ │ │ -
2137 ~_StencilKernel();
│ │ │ │ -
2138 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2139 BufferDescriptor const &dstDesc,
│ │ │ │ -
2140 BufferDescriptor const &duDesc,
│ │ │ │ -
2141 BufferDescriptor const &dvDesc,
│ │ │ │ -
2142 BufferDescriptor const &duuDesc,
│ │ │ │ -
2143 BufferDescriptor const &duvDesc,
│ │ │ │ -
2144 BufferDescriptor const &dvvDesc,
│ │ │ │ -
2145 bool interleavedDerivativeBuffers);
│ │ │ │ -
2146 GLuint program;
│ │ │ │ -
2147 GLint uniformSrcBufferTexture;
│ │ │ │ -
2148 GLint uniformSrcOffset; // src buffer offset (in elements)
│ │ │ │ -
2149
│ │ │ │ -
2150 GLint uniformSizesTexture;
│ │ │ │ -
2151 GLint uniformOffsetsTexture;
│ │ │ │ -
2152 GLint uniformIndicesTexture;
│ │ │ │ -
2153 GLint uniformWeightsTexture;
│ │ │ │ -
2154 GLint uniformDuWeightsTexture;
│ │ │ │ -
2155 GLint uniformDvWeightsTexture;
│ │ │ │ -
2156 GLint uniformDuuWeightsTexture;
│ │ │ │ -
2157 GLint uniformDuvWeightsTexture;
│ │ │ │ -
2158 GLint uniformDvvWeightsTexture;
│ │ │ │ -
2159 GLint uniformStart; // range
│ │ │ │ -
2160 GLint uniformEnd;
│ │ │ │ -
2161 } _stencilKernel;
│ │ │ │ -
2162
│ │ │ │ -
2163 struct _PatchKernel {
│ │ │ │ -
2164 _PatchKernel();
│ │ │ │ -
2165 ~_PatchKernel();
│ │ │ │ -
2166 bool Compile(BufferDescriptor const &srcDesc,
│ │ │ │ -
2167 BufferDescriptor const &dstDesc,
│ │ │ │ -
2168 BufferDescriptor const &duDesc,
│ │ │ │ -
2169 BufferDescriptor const &dvDesc,
│ │ │ │ -
2170 BufferDescriptor const &duuDesc,
│ │ │ │ -
2171 BufferDescriptor const &duvDesc,
│ │ │ │ -
2172 BufferDescriptor const &dvvDesc,
│ │ │ │ -
2173 bool interleavedDerivativeBuffers);
│ │ │ │ -
2174 GLuint program;
│ │ │ │ -
2175 GLint uniformSrcBufferTexture;
│ │ │ │ -
2176 GLint uniformSrcOffset; // src buffer offset (in elements)
│ │ │ │ -
2177
│ │ │ │ -
2178 GLint uniformPatchArraysUBOBinding;
│ │ │ │ -
2179 GLint uniformPatchParamTexture;
│ │ │ │ -
2180 GLint uniformPatchIndexTexture;
│ │ │ │ -
2181 } _patchKernel;
│ │ │ │ -
2182
│ │ │ │ -
2183};
│ │ │ │ -
2184
│ │ │ │ -
2185} // end namespace Osd
│ │ │ │ -
2186
│ │ │ │ -
2187} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
2188using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
2189
│ │ │ │ -
2190} // end namespace OpenSubdiv
│ │ │ │ -
2191
│ │ │ │ -
2192
│ │ │ │ -
2193#endif // OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
│ │ │ │ +
73 GLuint BindVBO(void *deviceContext = NULL);
│ │ │ │ +
74
│ │ │ │ +
75protected:
│ │ │ │ +
77 CpuGLVertexBuffer(int numElements, int numVertices);
│ │ │ │ +
78
│ │ │ │ +
80 bool allocate();
│ │ │ │ +
81
│ │ │ │ +
82private:
│ │ │ │ +
83 int _numElements;
│ │ │ │ +
84 int _numVertices;
│ │ │ │ +
85 GLuint _vbo;
│ │ │ │ +
86 float *_cpuBuffer;
│ │ │ │ +
87 bool _dataDirty;
│ │ │ │ +
88};
│ │ │ │ +
89
│ │ │ │ +
90} // end namespace Osd
│ │ │ │ +
91
│ │ │ │ +
92} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
93using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
94
│ │ │ │ +
95} // end namespace OpenSubdiv
│ │ │ │ +
96
│ │ │ │ +
97#endif // OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ -
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static GLStencilTableTBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
GLStencilTableTBO(Far::StencilTable const *stencilTable)
│ │ │ │ -
GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable)
│ │ │ │ - │ │ │ │ -
static GLStencilTableTBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, bool interleavedDerivativeBuffers=false)
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ -
GLXFBEvaluator(bool interleavedDerivativeBuffers=false)
Constructor.
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ - │ │ │ │ -
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, bool interleavedDerivativeBuffers=false)
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext)
Specialization to allow creation without a device context.
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
│ │ │ │ -
static void Synchronize(void *kernel)
Wait the dispatched kernel finishes.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
│ │ │ │ -
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
│ │ │ │ -
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
│ │ │ │ -
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext)
Specialization to allow creation without a device context.
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
│ │ │ │ -
~GLXFBEvaluator()
Destructor. note that the GL context must be made current.
│ │ │ │ -
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
│ │ │ │ -
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
Concrete vertex buffer class for cpu subdivision and OpenGL drawing.
│ │ │ │ +
CpuGLVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ + │ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
static CpuGLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ +
bool allocate()
Allocates VBO for this buffer. Returns true if success.
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glXFBEvaluator.h │ │ │ │ │ +cpuGLVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,1454 +30,94 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/opengl.h" │ │ │ │ │ - 31#include "../osd/types.h" │ │ │ │ │ - 32#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Far { │ │ │ │ │ - 38 class PatchTable; │ │ │ │ │ - 39 class StencilTable; │ │ │ │ │ - 40 class LimitStencilTable; │ │ │ │ │ - 41} │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ - 44 │ │ │ │ │ -52class GLStencilTableTBO { │ │ │ │ │ - 53public: │ │ │ │ │ -54 static GLStencilTableTBO *Create( │ │ │ │ │ - 55 Far::StencilTable const *stencilTable, void *deviceContext = NULL) { │ │ │ │ │ - 56 (void)deviceContext; // unused │ │ │ │ │ - 57 return new GLStencilTableTBO(stencilTable); │ │ │ │ │ - 58 } │ │ │ │ │ - 59 │ │ │ │ │ -60 static GLStencilTableTBO *Create( │ │ │ │ │ - 61 Far::LimitStencilTable const *limitStencilTable, │ │ │ │ │ - 62 void *deviceContext = NULL) { │ │ │ │ │ - 63 (void)deviceContext; // unused │ │ │ │ │ - 64 return new GLStencilTableTBO(limitStencilTable); │ │ │ │ │ - 65 } │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include "../osd/opengl.h" │ │ │ │ │ + 32 │ │ │ │ │ + 33namespace OpenSubdiv { │ │ │ │ │ + 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Osd { │ │ │ │ │ + 37 │ │ │ │ │ +47class CpuGLVertexBuffer { │ │ │ │ │ + 48public: │ │ │ │ │ +50 static CpuGLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 51 void *deviceContext = NULL); │ │ │ │ │ + 52 │ │ │ │ │ +54 ~CpuGLVertexBuffer(); │ │ │ │ │ + 55 │ │ │ │ │ +58 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 59 void *deviceContext = NULL); │ │ │ │ │ + 60 │ │ │ │ │ +62 int GetNumElements() const; │ │ │ │ │ + 63 │ │ │ │ │ +65 int GetNumVertices() const; │ │ │ │ │ 66 │ │ │ │ │ -67 explicit GLStencilTableTBO(Far::StencilTable const *stencilTable); │ │ │ │ │ -68 explicit GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable); │ │ │ │ │ -69 ~GLStencilTableTBO(); │ │ │ │ │ +69 float * BindCpuBuffer(); │ │ │ │ │ 70 │ │ │ │ │ - 71 // interfaces needed for GLSLTransformFeedbackKernel │ │ │ │ │ -72 GLuint GetSizesTexture() const { return _sizes; } │ │ │ │ │ -73 GLuint GetOffsetsTexture() const { return _offsets; } │ │ │ │ │ -74 GLuint GetIndicesTexture() const { return _indices; } │ │ │ │ │ -75 GLuint GetWeightsTexture() const { return _weights; } │ │ │ │ │ -76 GLuint GetDuWeightsTexture() const { return _duWeights; } │ │ │ │ │ -77 GLuint GetDvWeightsTexture() const { return _dvWeights; } │ │ │ │ │ -78 GLuint GetDuuWeightsTexture() const { return _duuWeights; } │ │ │ │ │ -79 GLuint GetDuvWeightsTexture() const { return _duvWeights; } │ │ │ │ │ -80 GLuint GetDvvWeightsTexture() const { return _dvvWeights; } │ │ │ │ │ -81 int GetNumStencils() const { return _numStencils; } │ │ │ │ │ - 82 │ │ │ │ │ - 83private: │ │ │ │ │ - 84 GLuint _sizes; │ │ │ │ │ - 85 GLuint _offsets; │ │ │ │ │ - 86 GLuint _indices; │ │ │ │ │ - 87 GLuint _weights; │ │ │ │ │ - 88 GLuint _duWeights; │ │ │ │ │ - 89 GLuint _dvWeights; │ │ │ │ │ - 90 GLuint _duuWeights; │ │ │ │ │ - 91 GLuint _duvWeights; │ │ │ │ │ - 92 GLuint _dvvWeights; │ │ │ │ │ - 93 int _numStencils; │ │ │ │ │ - 94}; │ │ │ │ │ - 95 │ │ │ │ │ - 96// ------------------------------------------------------------------------- │ │ │ │ │ --- │ │ │ │ │ - 97 │ │ │ │ │ -98class GLXFBEvaluator { │ │ │ │ │ - 99public: │ │ │ │ │ -100 typedef bool Instantiatable; │ │ │ │ │ - 101 │ │ │ │ │ - 103 template │ │ │ │ │ -104 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 105 BufferDescriptor const &dstDesc, │ │ │ │ │ - 106 BufferDescriptor const &duDesc, │ │ │ │ │ - 107 BufferDescriptor const &dvDesc, │ │ │ │ │ - 108 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ - 109 bool interleavedDerivativeBuffers = deviceContext │ │ │ │ │ - 110 ? deviceContext->AreInterleavedDerivativeBuffers() │ │ │ │ │ - 111 : false; │ │ │ │ │ - 112 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 113 interleavedDerivativeBuffers); │ │ │ │ │ - 114 } │ │ │ │ │ - 115 │ │ │ │ │ -117 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 118 BufferDescriptor const &dstDesc, │ │ │ │ │ - 119 BufferDescriptor const &duDesc, │ │ │ │ │ - 120 BufferDescriptor const &dvDesc, │ │ │ │ │ - 121 void * deviceContext) { │ │ │ │ │ - 122 (void)deviceContext; // not used │ │ │ │ │ - 123 return Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ - 124 } │ │ │ │ │ - 125 │ │ │ │ │ -126 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 127 BufferDescriptor const &dstDesc, │ │ │ │ │ - 128 BufferDescriptor const &duDesc, │ │ │ │ │ - 129 BufferDescriptor const &dvDesc, │ │ │ │ │ - 130 bool interleavedDerivativeBuffers = false) { │ │ │ │ │ - 131 GLXFBEvaluator *instance = new GLXFBEvaluator │ │ │ │ │ -(interleavedDerivativeBuffers); │ │ │ │ │ - 132 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc)) │ │ │ │ │ - 133 return instance; │ │ │ │ │ - 134 delete instance; │ │ │ │ │ - 135 return NULL; │ │ │ │ │ - 136 } │ │ │ │ │ - 137 │ │ │ │ │ - 139 template │ │ │ │ │ -140 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 141 BufferDescriptor const &dstDesc, │ │ │ │ │ - 142 BufferDescriptor const &duDesc, │ │ │ │ │ - 143 BufferDescriptor const &dvDesc, │ │ │ │ │ - 144 BufferDescriptor const &duuDesc, │ │ │ │ │ - 145 BufferDescriptor const &duvDesc, │ │ │ │ │ - 146 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 147 DEVICE_CONTEXT deviceContext) { │ │ │ │ │ - 148 bool interleavedDerivativeBuffers = deviceContext │ │ │ │ │ - 149 ? deviceContext->AreInterleavedDerivativeBuffers() │ │ │ │ │ - 150 : false; │ │ │ │ │ - 151 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 152 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ - 153 interleavedDerivativeBuffers); │ │ │ │ │ - 154 } │ │ │ │ │ - 155 │ │ │ │ │ -157 static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 158 BufferDescriptor const &dstDesc, │ │ │ │ │ - 159 BufferDescriptor const &duDesc, │ │ │ │ │ - 160 BufferDescriptor const &dvDesc, │ │ │ │ │ - 161 BufferDescriptor const &duuDesc, │ │ │ │ │ - 162 BufferDescriptor const &duvDesc, │ │ │ │ │ - 163 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 164 void * deviceContext) { │ │ │ │ │ - 165 (void)deviceContext; // not used │ │ │ │ │ - 166 return Create(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 167 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 168 } │ │ │ │ │ - 169 │ │ │ │ │ -170 static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ - 171 BufferDescriptor const &dstDesc, │ │ │ │ │ - 172 BufferDescriptor const &duDesc, │ │ │ │ │ - 173 BufferDescriptor const &dvDesc, │ │ │ │ │ - 174 BufferDescriptor const &duuDesc, │ │ │ │ │ - 175 BufferDescriptor const &duvDesc, │ │ │ │ │ - 176 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 177 bool interleavedDerivativeBuffers = false) { │ │ │ │ │ - 178 GLXFBEvaluator *instance = new GLXFBEvaluator │ │ │ │ │ -(interleavedDerivativeBuffers); │ │ │ │ │ - 179 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ - 180 duuDesc, duvDesc, dvvDesc)) │ │ │ │ │ - 181 return instance; │ │ │ │ │ - 182 delete instance; │ │ │ │ │ - 183 return NULL; │ │ │ │ │ - 184 } │ │ │ │ │ - 185 │ │ │ │ │ -199 GLXFBEvaluator(bool interleavedDerivativeBuffers = false); │ │ │ │ │ - 200 │ │ │ │ │ -202 ~GLXFBEvaluator(); │ │ │ │ │ - 203 │ │ │ │ │ - 209 │ │ │ │ │ - 237 template │ │ │ │ │ -238 static bool EvalStencils( │ │ │ │ │ - 239 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 240 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 241 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 242 GLXFBEvaluator const *instance, │ │ │ │ │ - 243 void * deviceContext = NULL) { │ │ │ │ │ - 244 │ │ │ │ │ - 245 if (instance) { │ │ │ │ │ - 246 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 247 dstBuffer, dstDesc, │ │ │ │ │ - 248 stencilTable); │ │ │ │ │ - 249 } else { │ │ │ │ │ - 250 // Create an instance on demand (slow) │ │ │ │ │ - 251 (void)deviceContext; // unused │ │ │ │ │ - 252 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 253 BufferDescriptor(), │ │ │ │ │ - 254 BufferDescriptor()); │ │ │ │ │ - 255 if (instance) { │ │ │ │ │ - 256 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 257 dstBuffer, dstDesc, │ │ │ │ │ - 258 stencilTable); │ │ │ │ │ - 259 delete instance; │ │ │ │ │ - 260 return r; │ │ │ │ │ - 261 } │ │ │ │ │ - 262 return false; │ │ │ │ │ - 263 } │ │ │ │ │ - 264 } │ │ │ │ │ - 265 │ │ │ │ │ - 305 template │ │ │ │ │ -306 static bool EvalStencils( │ │ │ │ │ - 307 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 308 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 309 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 310 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 312 GLXFBEvaluator const *instance, │ │ │ │ │ - 313 void * deviceContext = NULL) { │ │ │ │ │ - 314 │ │ │ │ │ - 315 if (instance) { │ │ │ │ │ - 316 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 317 dstBuffer, dstDesc, │ │ │ │ │ - 318 duBuffer, duDesc, │ │ │ │ │ - 319 dvBuffer, dvDesc, │ │ │ │ │ - 320 stencilTable); │ │ │ │ │ - 321 } else { │ │ │ │ │ - 322 // Create an instance on demand (slow) │ │ │ │ │ - 323 (void)deviceContext; // unused │ │ │ │ │ - 324 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ - 325 if (instance) { │ │ │ │ │ - 326 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 327 dstBuffer, dstDesc, │ │ │ │ │ - 328 duBuffer, duDesc, │ │ │ │ │ - 329 dvBuffer, dvDesc, │ │ │ │ │ - 330 stencilTable); │ │ │ │ │ - 331 delete instance; │ │ │ │ │ - 332 return r; │ │ │ │ │ - 333 } │ │ │ │ │ - 334 return false; │ │ │ │ │ - 335 } │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ - 395 template │ │ │ │ │ -396 static bool EvalStencils( │ │ │ │ │ - 397 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 398 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 399 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 400 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 401 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 402 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 403 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 404 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 405 GLXFBEvaluator const *instance, │ │ │ │ │ - 406 void * deviceContext = NULL) { │ │ │ │ │ - 407 │ │ │ │ │ - 408 if (instance) { │ │ │ │ │ - 409 return instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 410 dstBuffer, dstDesc, │ │ │ │ │ - 411 duBuffer, duDesc, │ │ │ │ │ - 412 dvBuffer, dvDesc, │ │ │ │ │ - 413 duuBuffer, duuDesc, │ │ │ │ │ - 414 duvBuffer, duvDesc, │ │ │ │ │ - 415 dvvBuffer, dvvDesc, │ │ │ │ │ - 416 stencilTable); │ │ │ │ │ - 417 } else { │ │ │ │ │ - 418 // Create an instance on demand (slow) │ │ │ │ │ - 419 (void)deviceContext; // unused │ │ │ │ │ - 420 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 421 duDesc, dvDesc, │ │ │ │ │ - 422 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 423 if (instance) { │ │ │ │ │ - 424 bool r = instance->EvalStencils(srcBuffer, srcDesc, │ │ │ │ │ - 425 dstBuffer, dstDesc, │ │ │ │ │ - 426 duBuffer, duDesc, │ │ │ │ │ - 427 dvBuffer, dvDesc, │ │ │ │ │ - 428 duuBuffer, duuDesc, │ │ │ │ │ - 429 duvBuffer, duvDesc, │ │ │ │ │ - 430 dvvBuffer, dvvDesc, │ │ │ │ │ - 431 stencilTable); │ │ │ │ │ - 432 delete instance; │ │ │ │ │ - 433 return r; │ │ │ │ │ - 434 } │ │ │ │ │ - 435 return false; │ │ │ │ │ - 436 } │ │ │ │ │ - 437 } │ │ │ │ │ - 438 │ │ │ │ │ - 456 template │ │ │ │ │ -457 bool EvalStencils( │ │ │ │ │ - 458 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 459 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 460 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 461 │ │ │ │ │ - 462 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 463 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 464 0, BufferDescriptor(), │ │ │ │ │ - 465 0, BufferDescriptor(), │ │ │ │ │ - 466 stencilTable->GetSizesTexture(), │ │ │ │ │ - 467 stencilTable->GetOffsetsTexture(), │ │ │ │ │ - 468 stencilTable->GetIndicesTexture(), │ │ │ │ │ - 469 stencilTable->GetWeightsTexture(), │ │ │ │ │ - 470 0, │ │ │ │ │ - 471 0, │ │ │ │ │ - 472 /* start = */ 0, │ │ │ │ │ - 473 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 474 } │ │ │ │ │ - 475 │ │ │ │ │ - 505 template │ │ │ │ │ -506 bool EvalStencils( │ │ │ │ │ - 507 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 508 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 509 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 510 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 511 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 512 │ │ │ │ │ - 513 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 514 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 515 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 516 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 517 stencilTable->GetSizesTexture(), │ │ │ │ │ - 518 stencilTable->GetOffsetsTexture(), │ │ │ │ │ - 519 stencilTable->GetIndicesTexture(), │ │ │ │ │ - 520 stencilTable->GetWeightsTexture(), │ │ │ │ │ - 521 stencilTable->GetDuWeightsTexture(), │ │ │ │ │ - 522 stencilTable->GetDvWeightsTexture(), │ │ │ │ │ - 523 /* start = */ 0, │ │ │ │ │ - 524 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 525 } │ │ │ │ │ - 526 │ │ │ │ │ - 574 template │ │ │ │ │ -575 bool EvalStencils( │ │ │ │ │ - 576 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 577 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 578 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 579 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 580 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 581 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 582 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 583 STENCIL_TABLE const *stencilTable) const { │ │ │ │ │ - 584 │ │ │ │ │ - 585 return EvalStencils(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 586 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 587 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 588 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 589 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 590 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 591 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 592 stencilTable->GetSizesTexture(), │ │ │ │ │ - 593 stencilTable->GetOffsetsTexture(), │ │ │ │ │ - 594 stencilTable->GetIndicesTexture(), │ │ │ │ │ - 595 stencilTable->GetWeightsTexture(), │ │ │ │ │ - 596 stencilTable->GetDuWeightsTexture(), │ │ │ │ │ - 597 stencilTable->GetDvWeightsTexture(), │ │ │ │ │ - 598 stencilTable->GetDuuWeightsTexture(), │ │ │ │ │ - 599 stencilTable->GetDuvWeightsTexture(), │ │ │ │ │ - 600 stencilTable->GetDvvWeightsTexture(), │ │ │ │ │ - 601 /* start = */ 0, │ │ │ │ │ - 602 /* end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 603 } │ │ │ │ │ - 604 │ │ │ │ │ -640 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 641 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 642 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 643 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 644 GLuint sizesBuffer, │ │ │ │ │ - 645 GLuint offsetsBuffer, │ │ │ │ │ - 646 GLuint indicesBuffer, │ │ │ │ │ - 647 GLuint weightsBuffer, │ │ │ │ │ - 648 GLuint duWeightsBuffer, │ │ │ │ │ - 649 GLuint dvWeightsBuffer, │ │ │ │ │ - 650 int start, │ │ │ │ │ - 651 int end) const; │ │ │ │ │ - 652 │ │ │ │ │ -706 bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 707 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 708 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 709 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 710 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 711 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 712 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 713 GLuint sizesBuffer, │ │ │ │ │ - 714 GLuint offsetsBuffer, │ │ │ │ │ - 715 GLuint indicesBuffer, │ │ │ │ │ - 716 GLuint weightsBuffer, │ │ │ │ │ - 717 GLuint duWeightsBuffer, │ │ │ │ │ - 718 GLuint dvWeightsBuffer, │ │ │ │ │ - 719 GLuint duuWeightsBuffer, │ │ │ │ │ - 720 GLuint duvWeightsBuffer, │ │ │ │ │ - 721 GLuint dvvWeightsBuffer, │ │ │ │ │ - 722 int start, │ │ │ │ │ - 723 int end) const; │ │ │ │ │ - 724 │ │ │ │ │ - 730 │ │ │ │ │ - 763 template │ │ │ │ │ -765 static bool EvalPatches( │ │ │ │ │ - 766 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 767 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 768 int numPatchCoords, │ │ │ │ │ - 769 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 770 PATCH_TABLE *patchTable, │ │ │ │ │ - 771 GLXFBEvaluator const *instance, │ │ │ │ │ - 772 void * deviceContext = NULL) { │ │ │ │ │ - 773 │ │ │ │ │ - 774 if (instance) { │ │ │ │ │ - 775 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 776 dstBuffer, dstDesc, │ │ │ │ │ - 777 numPatchCoords, patchCoords, │ │ │ │ │ - 778 patchTable); │ │ │ │ │ - 779 } else { │ │ │ │ │ - 780 // Create an instance on demand (slow) │ │ │ │ │ - 781 (void)deviceContext; // unused │ │ │ │ │ - 782 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 783 BufferDescriptor(), │ │ │ │ │ - 784 BufferDescriptor()); │ │ │ │ │ - 785 if (instance) { │ │ │ │ │ - 786 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 787 dstBuffer, dstDesc, │ │ │ │ │ - 788 numPatchCoords, patchCoords, │ │ │ │ │ - 789 patchTable); │ │ │ │ │ - 790 delete instance; │ │ │ │ │ - 791 return r; │ │ │ │ │ - 792 } │ │ │ │ │ - 793 return false; │ │ │ │ │ - 794 } │ │ │ │ │ - 795 } │ │ │ │ │ - 796 │ │ │ │ │ - 841 template │ │ │ │ │ -843 static bool EvalPatches( │ │ │ │ │ - 844 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 845 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 846 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 847 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 848 int numPatchCoords, │ │ │ │ │ - 849 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 850 PATCH_TABLE *patchTable, │ │ │ │ │ - 851 GLXFBEvaluator const *instance, │ │ │ │ │ - 852 void * deviceContext = NULL) { │ │ │ │ │ - 853 │ │ │ │ │ - 854 if (instance) { │ │ │ │ │ - 855 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 856 dstBuffer, dstDesc, │ │ │ │ │ - 857 duBuffer, duDesc, │ │ │ │ │ - 858 dvBuffer, dvDesc, │ │ │ │ │ - 859 numPatchCoords, patchCoords, │ │ │ │ │ - 860 patchTable); │ │ │ │ │ - 861 } else { │ │ │ │ │ - 862 // Create an instance on demand (slow) │ │ │ │ │ - 863 (void)deviceContext; // unused │ │ │ │ │ - 864 instance = Create(srcDesc, dstDesc, duDesc, dvDesc); │ │ │ │ │ - 865 if (instance) { │ │ │ │ │ - 866 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 867 dstBuffer, dstDesc, │ │ │ │ │ - 868 duBuffer, duDesc, │ │ │ │ │ - 869 dvBuffer, dvDesc, │ │ │ │ │ - 870 numPatchCoords, patchCoords, │ │ │ │ │ - 871 patchTable); │ │ │ │ │ - 872 delete instance; │ │ │ │ │ - 873 return r; │ │ │ │ │ - 874 } │ │ │ │ │ - 875 return false; │ │ │ │ │ - 876 } │ │ │ │ │ - 877 } │ │ │ │ │ - 878 │ │ │ │ │ - 941 template │ │ │ │ │ -943 static bool EvalPatches( │ │ │ │ │ - 944 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 945 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 946 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 947 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 948 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 949 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 950 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 951 int numPatchCoords, │ │ │ │ │ - 952 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 953 PATCH_TABLE *patchTable, │ │ │ │ │ - 954 GLXFBEvaluator const *instance, │ │ │ │ │ - 955 void * deviceContext = NULL) { │ │ │ │ │ - 956 │ │ │ │ │ - 957 if (instance) { │ │ │ │ │ - 958 return instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 959 dstBuffer, dstDesc, │ │ │ │ │ - 960 duBuffer, duDesc, │ │ │ │ │ - 961 dvBuffer, dvDesc, │ │ │ │ │ - 962 duuBuffer, duuDesc, │ │ │ │ │ - 963 duvBuffer, duvDesc, │ │ │ │ │ - 964 dvvBuffer, dvvDesc, │ │ │ │ │ - 965 numPatchCoords, patchCoords, │ │ │ │ │ - 966 patchTable); │ │ │ │ │ - 967 } else { │ │ │ │ │ - 968 // Create an instance on demand (slow) │ │ │ │ │ - 969 (void)deviceContext; // unused │ │ │ │ │ - 970 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 971 duDesc, dvDesc, │ │ │ │ │ - 972 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 973 if (instance) { │ │ │ │ │ - 974 bool r = instance->EvalPatches(srcBuffer, srcDesc, │ │ │ │ │ - 975 dstBuffer, dstDesc, │ │ │ │ │ - 976 duBuffer, duDesc, │ │ │ │ │ - 977 dvBuffer, dvDesc, │ │ │ │ │ - 978 duuBuffer, duuDesc, │ │ │ │ │ - 979 duvBuffer, duvDesc, │ │ │ │ │ - 980 dvvBuffer, dvvDesc, │ │ │ │ │ - 981 numPatchCoords, patchCoords, │ │ │ │ │ - 982 patchTable); │ │ │ │ │ - 983 delete instance; │ │ │ │ │ - 984 return r; │ │ │ │ │ - 985 } │ │ │ │ │ - 986 return false; │ │ │ │ │ - 987 } │ │ │ │ │ - 988 } │ │ │ │ │ - 989 │ │ │ │ │ - 1014 template │ │ │ │ │ -1016 bool EvalPatches( │ │ │ │ │ - 1017 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1018 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1019 int numPatchCoords, │ │ │ │ │ - 1020 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1021 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1022 │ │ │ │ │ - 1023 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1024 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1025 0, BufferDescriptor(), │ │ │ │ │ - 1026 0, BufferDescriptor(), │ │ │ │ │ - 1027 numPatchCoords, │ │ │ │ │ - 1028 patchCoords->BindVBO(), │ │ │ │ │ - 1029 patchTable->GetPatchArrays(), │ │ │ │ │ - 1030 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ - 1031 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1032 } │ │ │ │ │ - 1033 │ │ │ │ │ - 1068 template │ │ │ │ │ -1070 bool EvalPatches( │ │ │ │ │ - 1071 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1072 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1073 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1074 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1075 int numPatchCoords, │ │ │ │ │ - 1076 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1077 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1078 │ │ │ │ │ - 1079 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1080 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1081 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1082 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1083 numPatchCoords, │ │ │ │ │ - 1084 patchCoords->BindVBO(), │ │ │ │ │ - 1085 patchTable->GetPatchArrays(), │ │ │ │ │ - 1086 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ - 1087 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1088 } │ │ │ │ │ - 1089 │ │ │ │ │ - 1142 template │ │ │ │ │ -1144 bool EvalPatches( │ │ │ │ │ - 1145 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1146 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1147 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1148 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1149 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1150 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1151 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1152 int numPatchCoords, │ │ │ │ │ - 1153 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1154 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1155 │ │ │ │ │ - 1156 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1157 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1158 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1159 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1160 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 1161 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 1162 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 1163 numPatchCoords, │ │ │ │ │ - 1164 patchCoords->BindVBO(), │ │ │ │ │ - 1165 patchTable->GetPatchArrays(), │ │ │ │ │ - 1166 patchTable->GetPatchIndexTextureBuffer(), │ │ │ │ │ - 1167 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1168 } │ │ │ │ │ - 1169 │ │ │ │ │ -1170 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1171 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1172 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1173 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1174 int numPatchCoords, │ │ │ │ │ - 1175 GLuint patchCoordsBuffer, │ │ │ │ │ - 1176 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1177 GLuint patchIndexBuffer, │ │ │ │ │ - 1178 GLuint patchParamsBuffer) const; │ │ │ │ │ - 1179 │ │ │ │ │ -1180 bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1181 GLuint dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1182 GLuint duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1183 GLuint dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1184 GLuint duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1185 GLuint duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1186 GLuint dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1187 int numPatchCoords, │ │ │ │ │ - 1188 GLuint patchCoordsBuffer, │ │ │ │ │ - 1189 const PatchArrayVector &patchArrays, │ │ │ │ │ - 1190 GLuint patchIndexBuffer, │ │ │ │ │ - 1191 GLuint patchParamsBuffer) const; │ │ │ │ │ - 1192 │ │ │ │ │ - 1225 template │ │ │ │ │ -1227 static bool EvalPatchesVarying( │ │ │ │ │ - 1228 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1229 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1230 int numPatchCoords, │ │ │ │ │ - 1231 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1232 PATCH_TABLE *patchTable, │ │ │ │ │ - 1233 GLXFBEvaluator const *instance, │ │ │ │ │ - 1234 void * deviceContext = NULL) { │ │ │ │ │ - 1235 │ │ │ │ │ - 1236 if (instance) { │ │ │ │ │ - 1237 return instance->EvalPatchesVarying( │ │ │ │ │ - 1238 srcBuffer, srcDesc, │ │ │ │ │ - 1239 dstBuffer, dstDesc, │ │ │ │ │ - 1240 numPatchCoords, patchCoords, │ │ │ │ │ - 1241 patchTable); │ │ │ │ │ - 1242 } else { │ │ │ │ │ - 1243 // Create an instance on demand (slow) │ │ │ │ │ - 1244 (void)deviceContext; // unused │ │ │ │ │ - 1245 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1246 BufferDescriptor(), │ │ │ │ │ - 1247 BufferDescriptor()); │ │ │ │ │ - 1248 if (instance) { │ │ │ │ │ - 1249 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1250 srcBuffer, srcDesc, │ │ │ │ │ - 1251 dstBuffer, dstDesc, │ │ │ │ │ - 1252 numPatchCoords, patchCoords, │ │ │ │ │ - 1253 patchTable); │ │ │ │ │ - 1254 delete instance; │ │ │ │ │ - 1255 return r; │ │ │ │ │ - 1256 } │ │ │ │ │ - 1257 return false; │ │ │ │ │ - 1258 } │ │ │ │ │ - 1259 } │ │ │ │ │ - 1260 │ │ │ │ │ - 1285 template │ │ │ │ │ -1287 bool EvalPatchesVarying( │ │ │ │ │ - 1288 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1289 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1290 int numPatchCoords, │ │ │ │ │ - 1291 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1292 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1293 │ │ │ │ │ - 1294 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1295 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1296 0, BufferDescriptor(), │ │ │ │ │ - 1297 0, BufferDescriptor(), │ │ │ │ │ - 1298 numPatchCoords, │ │ │ │ │ - 1299 patchCoords->BindVBO(), │ │ │ │ │ - 1300 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1301 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ - 1302 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1303 } │ │ │ │ │ - 1304 │ │ │ │ │ - 1349 template │ │ │ │ │ -1351 static bool EvalPatchesVarying( │ │ │ │ │ - 1352 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1353 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1354 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1355 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1356 int numPatchCoords, │ │ │ │ │ - 1357 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1358 PATCH_TABLE *patchTable, │ │ │ │ │ - 1359 GLXFBEvaluator const *instance, │ │ │ │ │ - 1360 void * deviceContext = NULL) { │ │ │ │ │ - 1361 │ │ │ │ │ - 1362 if (instance) { │ │ │ │ │ - 1363 return instance->EvalPatchesVarying( │ │ │ │ │ - 1364 srcBuffer, srcDesc, │ │ │ │ │ - 1365 dstBuffer, dstDesc, │ │ │ │ │ - 1366 duBuffer, duDesc, │ │ │ │ │ - 1367 dvBuffer, dvDesc, │ │ │ │ │ - 1368 numPatchCoords, patchCoords, │ │ │ │ │ - 1369 patchTable); │ │ │ │ │ - 1370 } else { │ │ │ │ │ - 1371 // Create an instance on demand (slow) │ │ │ │ │ - 1372 (void)deviceContext; // unused │ │ │ │ │ - 1373 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1374 duDesc, dvDesc); │ │ │ │ │ - 1375 if (instance) { │ │ │ │ │ - 1376 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1377 srcBuffer, srcDesc, │ │ │ │ │ - 1378 dstBuffer, dstDesc, │ │ │ │ │ - 1379 duBuffer, duDesc, │ │ │ │ │ - 1380 dvBuffer, dvDesc, │ │ │ │ │ - 1381 numPatchCoords, patchCoords, │ │ │ │ │ - 1382 patchTable); │ │ │ │ │ - 1383 delete instance; │ │ │ │ │ - 1384 return r; │ │ │ │ │ - 1385 } │ │ │ │ │ - 1386 return false; │ │ │ │ │ - 1387 } │ │ │ │ │ - 1388 } │ │ │ │ │ - 1389 │ │ │ │ │ - 1426 template │ │ │ │ │ -1428 bool EvalPatchesVarying( │ │ │ │ │ - 1429 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1430 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1431 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1432 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1433 int numPatchCoords, │ │ │ │ │ - 1434 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1435 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1436 │ │ │ │ │ - 1437 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1438 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1439 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1440 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1441 numPatchCoords, │ │ │ │ │ - 1442 patchCoords->BindVBO(), │ │ │ │ │ - 1443 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1444 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ - 1445 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1446 } │ │ │ │ │ - 1447 │ │ │ │ │ - 1510 template │ │ │ │ │ -1512 static bool EvalPatchesVarying( │ │ │ │ │ - 1513 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1514 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1515 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1516 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1517 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1518 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1519 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1520 int numPatchCoords, │ │ │ │ │ - 1521 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1522 PATCH_TABLE *patchTable, │ │ │ │ │ - 1523 GLXFBEvaluator const *instance, │ │ │ │ │ - 1524 void * deviceContext = NULL) { │ │ │ │ │ - 1525 │ │ │ │ │ - 1526 if (instance) { │ │ │ │ │ - 1527 return instance->EvalPatchesVarying( │ │ │ │ │ - 1528 srcBuffer, srcDesc, │ │ │ │ │ - 1529 dstBuffer, dstDesc, │ │ │ │ │ - 1530 duBuffer, duDesc, │ │ │ │ │ - 1531 dvBuffer, dvDesc, │ │ │ │ │ - 1532 duuBuffer, duuDesc, │ │ │ │ │ - 1533 duvBuffer, duvDesc, │ │ │ │ │ - 1534 dvvBuffer, dvvDesc, │ │ │ │ │ - 1535 numPatchCoords, patchCoords, │ │ │ │ │ - 1536 patchTable); │ │ │ │ │ - 1537 } else { │ │ │ │ │ - 1538 // Create an instance on demand (slow) │ │ │ │ │ - 1539 (void)deviceContext; // unused │ │ │ │ │ - 1540 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1541 duDesc, dvDesc, │ │ │ │ │ - 1542 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 1543 if (instance) { │ │ │ │ │ - 1544 bool r = instance->EvalPatchesVarying( │ │ │ │ │ - 1545 srcBuffer, srcDesc, │ │ │ │ │ - 1546 dstBuffer, dstDesc, │ │ │ │ │ - 1547 duBuffer, duDesc, │ │ │ │ │ - 1548 dvBuffer, dvDesc, │ │ │ │ │ - 1549 duuBuffer, duuDesc, │ │ │ │ │ - 1550 duvBuffer, duvDesc, │ │ │ │ │ - 1551 dvvBuffer, dvvDesc, │ │ │ │ │ - 1552 numPatchCoords, patchCoords, │ │ │ │ │ - 1553 patchTable); │ │ │ │ │ - 1554 delete instance; │ │ │ │ │ - 1555 return r; │ │ │ │ │ - 1556 } │ │ │ │ │ - 1557 return false; │ │ │ │ │ - 1558 } │ │ │ │ │ - 1559 } │ │ │ │ │ - 1560 │ │ │ │ │ - 1615 template │ │ │ │ │ -1617 bool EvalPatchesVarying( │ │ │ │ │ - 1618 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1619 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1620 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1621 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1622 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1623 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1624 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1625 int numPatchCoords, │ │ │ │ │ - 1626 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1627 PATCH_TABLE *patchTable) const { │ │ │ │ │ - 1628 │ │ │ │ │ - 1629 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1630 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1631 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1632 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1633 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 1634 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 1635 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 1636 numPatchCoords, │ │ │ │ │ - 1637 patchCoords->BindVBO(), │ │ │ │ │ - 1638 patchTable->GetVaryingPatchArrays(), │ │ │ │ │ - 1639 patchTable->GetVaryingPatchIndexTextureBuffer(), │ │ │ │ │ - 1640 patchTable->GetPatchParamTextureBuffer()); │ │ │ │ │ - 1641 } │ │ │ │ │ - 1642 │ │ │ │ │ - 1677 template │ │ │ │ │ -1679 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1680 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1681 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1682 int numPatchCoords, │ │ │ │ │ - 1683 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1684 PATCH_TABLE *patchTable, │ │ │ │ │ - 1685 int fvarChannel, │ │ │ │ │ - 1686 GLXFBEvaluator const *instance, │ │ │ │ │ - 1687 void * deviceContext = NULL) { │ │ │ │ │ - 1688 │ │ │ │ │ - 1689 if (instance) { │ │ │ │ │ - 1690 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1691 srcBuffer, srcDesc, │ │ │ │ │ - 1692 dstBuffer, dstDesc, │ │ │ │ │ - 1693 numPatchCoords, patchCoords, │ │ │ │ │ - 1694 patchTable, fvarChannel); │ │ │ │ │ - 1695 } else { │ │ │ │ │ - 1696 // Create an instance on demand (slow) │ │ │ │ │ - 1697 (void)deviceContext; // unused │ │ │ │ │ - 1698 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1699 BufferDescriptor(), │ │ │ │ │ - 1700 BufferDescriptor()); │ │ │ │ │ - 1701 if (instance) { │ │ │ │ │ - 1702 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1703 srcBuffer, srcDesc, │ │ │ │ │ - 1704 dstBuffer, dstDesc, │ │ │ │ │ - 1705 numPatchCoords, patchCoords, │ │ │ │ │ - 1706 patchTable, fvarChannel); │ │ │ │ │ - 1707 delete instance; │ │ │ │ │ - 1708 return r; │ │ │ │ │ - 1709 } │ │ │ │ │ - 1710 return false; │ │ │ │ │ - 1711 } │ │ │ │ │ - 1712 } │ │ │ │ │ - 1713 │ │ │ │ │ - 1740 template │ │ │ │ │ -1742 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1743 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1744 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1745 int numPatchCoords, │ │ │ │ │ - 1746 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1747 PATCH_TABLE *patchTable, │ │ │ │ │ - 1748 int fvarChannel = 0) const { │ │ │ │ │ - 1749 │ │ │ │ │ - 1750 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1751 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1752 0, BufferDescriptor(), │ │ │ │ │ - 1753 0, BufferDescriptor(), │ │ │ │ │ - 1754 numPatchCoords, │ │ │ │ │ - 1755 patchCoords->BindVBO(), │ │ │ │ │ - 1756 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1757 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ - 1758 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ - 1759 } │ │ │ │ │ - 1760 │ │ │ │ │ - 1807 template │ │ │ │ │ -1809 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1810 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1811 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1812 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1813 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1814 int numPatchCoords, │ │ │ │ │ - 1815 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1816 PATCH_TABLE *patchTable, │ │ │ │ │ - 1817 int fvarChannel, │ │ │ │ │ - 1818 GLXFBEvaluator const *instance, │ │ │ │ │ - 1819 void * deviceContext = NULL) { │ │ │ │ │ - 1820 │ │ │ │ │ - 1821 if (instance) { │ │ │ │ │ - 1822 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1823 srcBuffer, srcDesc, │ │ │ │ │ - 1824 dstBuffer, dstDesc, │ │ │ │ │ - 1825 duBuffer, duDesc, │ │ │ │ │ - 1826 dvBuffer, dvDesc, │ │ │ │ │ - 1827 numPatchCoords, patchCoords, │ │ │ │ │ - 1828 patchTable, fvarChannel); │ │ │ │ │ - 1829 } else { │ │ │ │ │ - 1830 // Create an instance on demand (slow) │ │ │ │ │ - 1831 (void)deviceContext; // unused │ │ │ │ │ - 1832 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 1833 duDesc, dvDesc); │ │ │ │ │ - 1834 if (instance) { │ │ │ │ │ - 1835 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1836 srcBuffer, srcDesc, │ │ │ │ │ - 1837 dstBuffer, dstDesc, │ │ │ │ │ - 1838 duBuffer, duDesc, │ │ │ │ │ - 1839 dvBuffer, dvDesc, │ │ │ │ │ - 1840 numPatchCoords, patchCoords, │ │ │ │ │ - 1841 patchTable, fvarChannel); │ │ │ │ │ - 1842 delete instance; │ │ │ │ │ - 1843 return r; │ │ │ │ │ - 1844 } │ │ │ │ │ - 1845 return false; │ │ │ │ │ - 1846 } │ │ │ │ │ - 1847 } │ │ │ │ │ - 1848 │ │ │ │ │ - 1887 template │ │ │ │ │ -1889 bool EvalPatchesFaceVarying( │ │ │ │ │ - 1890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1894 int numPatchCoords, │ │ │ │ │ - 1895 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1896 PATCH_TABLE *patchTable, │ │ │ │ │ - 1897 int fvarChannel = 0) const { │ │ │ │ │ - 1898 │ │ │ │ │ - 1899 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 1900 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 1901 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 1902 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 1903 numPatchCoords, │ │ │ │ │ - 1904 patchCoords->BindVBO(), │ │ │ │ │ - 1905 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 1906 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ - 1907 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ - 1908 } │ │ │ │ │ - 1909 │ │ │ │ │ - 1974 template │ │ │ │ │ -1976 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1977 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1978 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1979 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1980 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1981 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1982 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1983 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1984 int numPatchCoords, │ │ │ │ │ - 1985 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1986 PATCH_TABLE *patchTable, │ │ │ │ │ - 1987 int fvarChannel, │ │ │ │ │ - 1988 GLXFBEvaluator const *instance, │ │ │ │ │ - 1989 void * deviceContext = NULL) { │ │ │ │ │ - 1990 │ │ │ │ │ - 1991 if (instance) { │ │ │ │ │ - 1992 return instance->EvalPatchesFaceVarying( │ │ │ │ │ - 1993 srcBuffer, srcDesc, │ │ │ │ │ - 1994 dstBuffer, dstDesc, │ │ │ │ │ - 1995 duBuffer, duDesc, │ │ │ │ │ - 1996 dvBuffer, dvDesc, │ │ │ │ │ - 1997 duuBuffer, duuDesc, │ │ │ │ │ - 1998 duvBuffer, duvDesc, │ │ │ │ │ - 1999 dvvBuffer, dvvDesc, │ │ │ │ │ - 2000 numPatchCoords, patchCoords, │ │ │ │ │ - 2001 patchTable, fvarChannel); │ │ │ │ │ - 2002 } else { │ │ │ │ │ - 2003 // Create an instance on demand (slow) │ │ │ │ │ - 2004 (void)deviceContext; // unused │ │ │ │ │ - 2005 instance = Create(srcDesc, dstDesc, │ │ │ │ │ - 2006 duDesc, dvDesc, │ │ │ │ │ - 2007 duuDesc, duvDesc, dvvDesc); │ │ │ │ │ - 2008 if (instance) { │ │ │ │ │ - 2009 bool r = instance->EvalPatchesFaceVarying( │ │ │ │ │ - 2010 srcBuffer, srcDesc, │ │ │ │ │ - 2011 dstBuffer, dstDesc, │ │ │ │ │ - 2012 duBuffer, duDesc, │ │ │ │ │ - 2013 dvBuffer, dvDesc, │ │ │ │ │ - 2014 duuBuffer, duuDesc, │ │ │ │ │ - 2015 duvBuffer, duvDesc, │ │ │ │ │ - 2016 dvvBuffer, dvvDesc, │ │ │ │ │ - 2017 numPatchCoords, patchCoords, │ │ │ │ │ - 2018 patchTable, fvarChannel); │ │ │ │ │ - 2019 delete instance; │ │ │ │ │ - 2020 return r; │ │ │ │ │ - 2021 } │ │ │ │ │ - 2022 return false; │ │ │ │ │ - 2023 } │ │ │ │ │ - 2024 } │ │ │ │ │ - 2025 │ │ │ │ │ - 2082 template │ │ │ │ │ -2084 bool EvalPatchesFaceVarying( │ │ │ │ │ - 2085 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 2086 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 2087 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 2088 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 2089 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 2090 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 2091 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2092 int numPatchCoords, │ │ │ │ │ - 2093 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 2094 PATCH_TABLE *patchTable, │ │ │ │ │ - 2095 int fvarChannel = 0) const { │ │ │ │ │ - 2096 │ │ │ │ │ - 2097 return EvalPatches(srcBuffer->BindVBO(), srcDesc, │ │ │ │ │ - 2098 dstBuffer->BindVBO(), dstDesc, │ │ │ │ │ - 2099 duBuffer->BindVBO(), duDesc, │ │ │ │ │ - 2100 dvBuffer->BindVBO(), dvDesc, │ │ │ │ │ - 2101 duuBuffer->BindVBO(), duuDesc, │ │ │ │ │ - 2102 duvBuffer->BindVBO(), duvDesc, │ │ │ │ │ - 2103 dvvBuffer->BindVBO(), dvvDesc, │ │ │ │ │ - 2104 numPatchCoords, │ │ │ │ │ - 2105 patchCoords->BindVBO(), │ │ │ │ │ - 2106 patchTable->GetFVarPatchArrays(fvarChannel), │ │ │ │ │ - 2107 patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel), │ │ │ │ │ - 2108 patchTable->GetFVarPatchParamTextureBuffer(fvarChannel)); │ │ │ │ │ - 2109 } │ │ │ │ │ - 2110 │ │ │ │ │ - 2116 │ │ │ │ │ -2119 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2120 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2121 BufferDescriptor const &duDesc = BufferDescriptor(), │ │ │ │ │ - 2122 BufferDescriptor const &dvDesc = BufferDescriptor(), │ │ │ │ │ - 2123 BufferDescriptor const &duuDesc = BufferDescriptor(), │ │ │ │ │ - 2124 BufferDescriptor const &duvDesc = BufferDescriptor(), │ │ │ │ │ - 2125 BufferDescriptor const &dvvDesc = BufferDescriptor()); │ │ │ │ │ - 2126 │ │ │ │ │ -2128 static void Synchronize(void *kernel); │ │ │ │ │ - 2129 │ │ │ │ │ - 2130private: │ │ │ │ │ - 2131 GLuint _srcBufferTexture; │ │ │ │ │ - 2132 GLuint _patchArraysUBO; │ │ │ │ │ - 2133 bool _interleavedDerivativeBuffers; │ │ │ │ │ - 2134 │ │ │ │ │ - 2135 struct _StencilKernel { │ │ │ │ │ - 2136 _StencilKernel(); │ │ │ │ │ - 2137 ~_StencilKernel(); │ │ │ │ │ - 2138 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2139 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2140 BufferDescriptor const &duDesc, │ │ │ │ │ - 2141 BufferDescriptor const &dvDesc, │ │ │ │ │ - 2142 BufferDescriptor const &duuDesc, │ │ │ │ │ - 2143 BufferDescriptor const &duvDesc, │ │ │ │ │ - 2144 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2145 bool interleavedDerivativeBuffers); │ │ │ │ │ - 2146 GLuint program; │ │ │ │ │ - 2147 GLint uniformSrcBufferTexture; │ │ │ │ │ - 2148 GLint uniformSrcOffset; // src buffer offset (in elements) │ │ │ │ │ - 2149 │ │ │ │ │ - 2150 GLint uniformSizesTexture; │ │ │ │ │ - 2151 GLint uniformOffsetsTexture; │ │ │ │ │ - 2152 GLint uniformIndicesTexture; │ │ │ │ │ - 2153 GLint uniformWeightsTexture; │ │ │ │ │ - 2154 GLint uniformDuWeightsTexture; │ │ │ │ │ - 2155 GLint uniformDvWeightsTexture; │ │ │ │ │ - 2156 GLint uniformDuuWeightsTexture; │ │ │ │ │ - 2157 GLint uniformDuvWeightsTexture; │ │ │ │ │ - 2158 GLint uniformDvvWeightsTexture; │ │ │ │ │ - 2159 GLint uniformStart; // range │ │ │ │ │ - 2160 GLint uniformEnd; │ │ │ │ │ - 2161 } _stencilKernel; │ │ │ │ │ - 2162 │ │ │ │ │ - 2163 struct _PatchKernel { │ │ │ │ │ - 2164 _PatchKernel(); │ │ │ │ │ - 2165 ~_PatchKernel(); │ │ │ │ │ - 2166 bool Compile(BufferDescriptor const &srcDesc, │ │ │ │ │ - 2167 BufferDescriptor const &dstDesc, │ │ │ │ │ - 2168 BufferDescriptor const &duDesc, │ │ │ │ │ - 2169 BufferDescriptor const &dvDesc, │ │ │ │ │ - 2170 BufferDescriptor const &duuDesc, │ │ │ │ │ - 2171 BufferDescriptor const &duvDesc, │ │ │ │ │ - 2172 BufferDescriptor const &dvvDesc, │ │ │ │ │ - 2173 bool interleavedDerivativeBuffers); │ │ │ │ │ - 2174 GLuint program; │ │ │ │ │ - 2175 GLint uniformSrcBufferTexture; │ │ │ │ │ - 2176 GLint uniformSrcOffset; // src buffer offset (in elements) │ │ │ │ │ - 2177 │ │ │ │ │ - 2178 GLint uniformPatchArraysUBOBinding; │ │ │ │ │ - 2179 GLint uniformPatchParamTexture; │ │ │ │ │ - 2180 GLint uniformPatchIndexTexture; │ │ │ │ │ - 2181 } _patchKernel; │ │ │ │ │ - 2182 │ │ │ │ │ - 2183}; │ │ │ │ │ - 2184 │ │ │ │ │ - 2185} // end namespace Osd │ │ │ │ │ - 2186 │ │ │ │ │ - 2187} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 2188using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 2189 │ │ │ │ │ - 2190} // end namespace OpenSubdiv │ │ │ │ │ - 2191 │ │ │ │ │ - 2192 │ │ │ │ │ - 2193#endif // OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H │ │ │ │ │ +73 GLuint BindVBO(void *deviceContext = NULL); │ │ │ │ │ + 74 │ │ │ │ │ + 75protected: │ │ │ │ │ +77 CpuGLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ + 78 │ │ │ │ │ +80 bool allocate(); │ │ │ │ │ + 81 │ │ │ │ │ + 82private: │ │ │ │ │ + 83 int _numElements; │ │ │ │ │ + 84 int _numVertices; │ │ │ │ │ + 85 GLuint _vbo; │ │ │ │ │ + 86 float *_cpuBuffer; │ │ │ │ │ + 87 bool _dataDirty; │ │ │ │ │ + 88}; │ │ │ │ │ + 89 │ │ │ │ │ + 90} // end namespace Osd │ │ │ │ │ + 91 │ │ │ │ │ + 92} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 93using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 94 │ │ │ │ │ + 95} // end namespace OpenSubdiv │ │ │ │ │ + 96 │ │ │ │ │ + 97#endif // OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ -Stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:273 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ -Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ -Definition: stencilTable.h:583 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO │ │ │ │ │ -GL TextureBuffer stencil table. │ │ │ │ │ -Definition: glXFBEvaluator.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetSizesTexture │ │ │ │ │ -GLuint GetSizesTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create │ │ │ │ │ -static GLStencilTableTBO * Create(Far::StencilTable const *stencilTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Definition: glXFBEvaluator.h:54 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvvWeightsTexture │ │ │ │ │ -GLuint GetDvvWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetNumStencils │ │ │ │ │ -int GetNumStencils() const │ │ │ │ │ -Definition: glXFBEvaluator.h:81 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuvWeightsTexture │ │ │ │ │ -GLuint GetDuvWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:79 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuuWeightsTexture │ │ │ │ │ -GLuint GetDuuWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:78 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetIndicesTexture │ │ │ │ │ -GLuint GetIndicesTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:74 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::~GLStencilTableTBO │ │ │ │ │ -~GLStencilTableTBO() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO │ │ │ │ │ -GLStencilTableTBO(Far::StencilTable const *stencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO │ │ │ │ │ -GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetWeightsTexture │ │ │ │ │ -GLuint GetWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create │ │ │ │ │ -static GLStencilTableTBO * Create(Far::LimitStencilTable const │ │ │ │ │ -*limitStencilTable, void *deviceContext=NULL) │ │ │ │ │ -Definition: glXFBEvaluator.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvWeightsTexture │ │ │ │ │ -GLuint GetDvWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:77 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuWeightsTexture │ │ │ │ │ -GLuint GetDuWeightsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetOffsetsTexture │ │ │ │ │ -GLuint GetOffsetsTexture() const │ │ │ │ │ -Definition: glXFBEvaluator.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator │ │ │ │ │ -Definition: glXFBEvaluator.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1287 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, bool interleavedDerivativeBuffers=false) │ │ │ │ │ -Definition: glXFBEvaluator.h:126 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glXFBEvaluator.h:506 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::GLXFBEvaluator │ │ │ │ │ -GLXFBEvaluator(bool interleavedDerivativeBuffers=false) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer │ │ │ │ │ +Concrete vertex buffer class for cpu subdivision and OpenGL drawing. │ │ │ │ │ +Definition: cpuGLVertexBuffer.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::CpuGLVertexBuffer │ │ │ │ │ +CpuGLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glXFBEvaluator.h:575 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Instantiatable │ │ │ │ │ -bool Instantiatable │ │ │ │ │ -Definition: glXFBEvaluator.h:100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ -const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int │ │ │ │ │ -numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ -GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glXFBEvaluator.h:396 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: glXFBEvaluator.h:1144 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, bool │ │ │ │ │ -interleavedDerivativeBuffers=false) │ │ │ │ │ -Definition: glXFBEvaluator.h:170 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, void *deviceContext) │ │ │ │ │ -Specialization to allow creation without a device context. │ │ │ │ │ -Definition: glXFBEvaluator.h:117 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glXFBEvaluator.h:306 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::BindVBO │ │ │ │ │ +GLuint BindVBO(void *deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1351 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor │ │ │ │ │ -const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint │ │ │ │ │ -sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ -GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint │ │ │ │ │ -duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const │ │ │ │ │ -Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compile... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:843 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, │ │ │ │ │ -DEVICE_CONTEXT deviceContext) │ │ │ │ │ -Generic creator template. │ │ │ │ │ -Definition: glXFBEvaluator.h:140 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext) │ │ │ │ │ -Generic creator template. │ │ │ │ │ -Definition: glXFBEvaluator.h:104 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *kernel) │ │ │ │ │ -Wait the dispatched kernel finishes. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1227 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1617 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1889 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:765 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1809 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1016 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::Create │ │ │ │ │ +static CpuGLVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:943 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable) const │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: glXFBEvaluator.h:1070 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const │ │ │ │ │ -*stencilTable) const │ │ │ │ │ -Generic stencil function. │ │ │ │ │ -Definition: glXFBEvaluator.h:457 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches │ │ │ │ │ -bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int │ │ │ │ │ -numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, │ │ │ │ │ -GLuint patchIndexBuffer, GLuint patchParamsBuffer) const │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create │ │ │ │ │ -static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, │ │ │ │ │ -BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, │ │ │ │ │ -BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, │ │ │ │ │ -BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void │ │ │ │ │ -*deviceContext) │ │ │ │ │ -Specialization to allow creation without a device context. │ │ │ │ │ -Definition: glXFBEvaluator.h:157 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) │ │ │ │ │ -const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:2084 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const │ │ │ │ │ -*instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1512 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint │ │ │ │ │ -dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor │ │ │ │ │ -const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint │ │ │ │ │ -sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, │ │ │ │ │ -GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const │ │ │ │ │ -Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the │ │ │ │ │ -kernel hasn't been compile... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1679 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic static stencil function. This function has a same signature as other │ │ │ │ │ -device kernels have so t... │ │ │ │ │ -Definition: glXFBEvaluator.h:238 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::~GLXFBEvaluator │ │ │ │ │ -~GLXFBEvaluator() │ │ │ │ │ -Destructor. note that the GL context must be made current. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Compile │ │ │ │ │ -bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, │ │ │ │ │ -BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), │ │ │ │ │ -BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const │ │ │ │ │ -&dvvDesc=BufferDescriptor()) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying │ │ │ │ │ -bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1428 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel=0) const │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1742 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -GLXFBEvaluator const *instance, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: glXFBEvaluator.h:1976 │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::allocate │ │ │ │ │ +bool allocate() │ │ │ │ │ +Allocates VBO for this buffer. Returns true if success. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::BindCpuBuffer │ │ │ │ │ +float * BindCpuBuffer() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::~CpuGLVertexBuffer │ │ │ │ │ +~CpuGLVertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glXFBEvaluator.h │ │ │ │ │ + * cpuGLVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00854.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glslPatchShaderSource.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/tbbKernel.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,51 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
glslPatchShaderSource.h File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
tbbKernel.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <string>
│ │ │ │ #include "../far/patchDescriptor.h"
│ │ │ │ +#include "../far/patchParam.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  GLSLPatchShaderSource
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
 
void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, int start, int end)
 
void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, float const *duuWeights, float const *duvWeights, float const *dvvWeights, int start, int end)
 
void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
 
void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,62 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -glslPatchShaderSource.h File Reference │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +tbbKernel.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ #include "../far/patchDescriptor.h" │ │ │ │ │ +#include "../far/patchParam.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  GLSLPatchShaderSource │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ + Functions │ │ │ │ │ +void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, int const *sizes, int const │ │ │ │ │ + *offsets, int const *indices, float const *weights, int start, int end) │ │ │ │ │ +  │ │ │ │ │ +void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ + const *sizes, int const *offsets, int const *indices, float const │ │ │ │ │ + *weights, float const *duWeights, float const *dvWeights, int start, int │ │ │ │ │ + end) │ │ │ │ │ +  │ │ │ │ │ +void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ + *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ + BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ + &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, │ │ │ │ │ + float const *weights, float const *duWeights, float const *dvWeights, │ │ │ │ │ + float const *duuWeights, float const *duvWeights, float const │ │ │ │ │ + *dvvWeights, int start, int end) │ │ │ │ │ +  │ │ │ │ │ +void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ + numPatchCoords, const PatchCoord *patchCoords, const PatchArray │ │ │ │ │ + *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam │ │ │ │ │ + *patchParamBuffer) │ │ │ │ │ +  │ │ │ │ │ +void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ + *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ + BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ + &dstDvvDesc, int numPatchCoords, const PatchCoord *patchCoords, const │ │ │ │ │ + PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const │ │ │ │ │ + PatchParam *patchParamBuffer) │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glslPatchShaderSource.h │ │ │ │ │ + * tbbKernel.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00854.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,7 @@ │ │ │ │ │ var a00854 = [ │ │ │ │ │ - ["GLSLPatchShaderSource", "a01233.html", null] │ │ │ │ │ + ["TbbEvalPatches", "a00854.html#aa0c3c264a43eeddc5cb3a58b006d3d32", null], │ │ │ │ │ + ["TbbEvalPatches", "a00854.html#a20e08be34d6183b6943ed7a1586eca4a", null], │ │ │ │ │ + ["TbbEvalStencils", "a00854.html#aa65ed860a2fa5935d99129a898a8f0b6", null], │ │ │ │ │ + ["TbbEvalStencils", "a00854.html#af23c35537952bfdd493441e5c42ff2ed", null], │ │ │ │ │ + ["TbbEvalStencils", "a00854.html#a4a6a0fcc01638f2a0316b32ad158b485", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00854_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glslPatchShaderSource.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/tbbKernel.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glslPatchShaderSource.h
│ │ │ │ +
tbbKernel.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,62 +107,116 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include <string>
│ │ │ │ -
30#include "../far/patchDescriptor.h"
│ │ │ │ +
29#include "../far/patchDescriptor.h"
│ │ │ │ +
30#include "../far/patchParam.h"
│ │ │ │
31
│ │ │ │
32namespace OpenSubdiv {
│ │ │ │
33namespace OPENSUBDIV_VERSION {
│ │ │ │
34
│ │ │ │
35namespace Osd {
│ │ │ │
36
│ │ │ │ - │ │ │ │ -
38public:
│ │ │ │ -
39 static std::string GetCommonShaderSource();
│ │ │ │ -
40
│ │ │ │ -
41 static std::string GetPatchBasisShaderSource();
│ │ │ │ -
42
│ │ │ │ -
43 static std::string GetVertexShaderSource(
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ -
46 static std::string GetTessControlShaderSource(
│ │ │ │ - │ │ │ │ -
48
│ │ │ │ -
49 static std::string GetTessEvalShaderSource(
│ │ │ │ - │ │ │ │ -
51};
│ │ │ │ -
52
│ │ │ │ -
53} // end namespace Osd
│ │ │ │ -
54
│ │ │ │ -
55} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
56using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
57
│ │ │ │ -
58} // end namespace OpenSubdiv
│ │ │ │ -
59
│ │ │ │ -
60#endif // OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE
│ │ │ │ +
37struct PatchArray;
│ │ │ │ +
38struct PatchCoord;
│ │ │ │ +
39struct PatchParam;
│ │ │ │ +
40struct BufferDescriptor;
│ │ │ │ +
41
│ │ │ │ +
42void
│ │ │ │ +
43TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
44 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
45 int const * sizes,
│ │ │ │ +
46 int const * offsets,
│ │ │ │ +
47 int const * indices,
│ │ │ │ +
48 float const * weights,
│ │ │ │ +
49 int start, int end);
│ │ │ │ +
50
│ │ │ │ +
51void
│ │ │ │ +
52TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
53 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
54 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
55 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
56 int const * sizes,
│ │ │ │ +
57 int const * offsets,
│ │ │ │ +
58 int const * indices,
│ │ │ │ +
59 float const * weights,
│ │ │ │ +
60 float const * duWeights,
│ │ │ │ +
61 float const * dvWeights,
│ │ │ │ +
62 int start, int end);
│ │ │ │ +
63
│ │ │ │ +
64void
│ │ │ │ +
65TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
66 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
67 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
68 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
69 float * dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ +
70 float * dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ +
71 float * dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ +
72 int const * sizes,
│ │ │ │ +
73 int const * offsets,
│ │ │ │ +
74 int const * indices,
│ │ │ │ +
75 float const * weights,
│ │ │ │ +
76 float const * duWeights,
│ │ │ │ +
77 float const * dvWeights,
│ │ │ │ +
78 float const * duuWeights,
│ │ │ │ +
79 float const * duvWeights,
│ │ │ │ +
80 float const * dvvWeights,
│ │ │ │ +
81 int start, int end);
│ │ │ │ +
82
│ │ │ │ +
83void
│ │ │ │ +
84TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
85 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
86 float *dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
87 float *dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
88 int numPatchCoords,
│ │ │ │ +
89 const PatchCoord *patchCoords,
│ │ │ │ +
90 const PatchArray *patchArrayBuffer,
│ │ │ │ +
91 const int *patchIndexBuffer,
│ │ │ │ +
92 const PatchParam *patchParamBuffer);
│ │ │ │ +
93
│ │ │ │ +
94void
│ │ │ │ +
95TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
96 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
97 float *dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
98 float *dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
99 float *dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ +
100 float *dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ +
101 float *dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ +
102 int numPatchCoords,
│ │ │ │ +
103 const PatchCoord *patchCoords,
│ │ │ │ +
104 const PatchArray *patchArrayBuffer,
│ │ │ │ +
105 const int *patchIndexBuffer,
│ │ │ │ +
106 const PatchParam *patchParamBuffer);
│ │ │ │ +
107
│ │ │ │ +
108} // end namespace Osd
│ │ │ │ +
109
│ │ │ │ +
110} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
111using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
112
│ │ │ │ +
113} // end namespace OpenSubdiv
│ │ │ │ +
114
│ │ │ │ +
115#endif // OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ -
static std::string GetTessEvalShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static std::string GetTessControlShaderSource(Far::PatchDescriptor::Type type)
│ │ │ │ +
void TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
│ │ │ │ +
void TbbEvalStencils(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ +
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glslPatchShaderSource.h │ │ │ │ │ +tbbKernel.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,69 +30,126 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include "../far/patchDescriptor.h" │ │ │ │ │ + 29#include "../far/patchDescriptor.h" │ │ │ │ │ + 30#include "../far/patchParam.h" │ │ │ │ │ 31 │ │ │ │ │ 32namespace OpenSubdiv { │ │ │ │ │ 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ 34 │ │ │ │ │ 35namespace Osd { │ │ │ │ │ 36 │ │ │ │ │ -37class GLSLPatchShaderSource { │ │ │ │ │ - 38public: │ │ │ │ │ -39 static std::string GetCommonShaderSource(); │ │ │ │ │ - 40 │ │ │ │ │ -41 static std::string GetPatchBasisShaderSource(); │ │ │ │ │ - 42 │ │ │ │ │ -43 static std::string GetVertexShaderSource( │ │ │ │ │ - 44 Far::PatchDescriptor::Type type); │ │ │ │ │ - 45 │ │ │ │ │ -46 static std::string GetTessControlShaderSource( │ │ │ │ │ - 47 Far::PatchDescriptor::Type type); │ │ │ │ │ - 48 │ │ │ │ │ -49 static std::string GetTessEvalShaderSource( │ │ │ │ │ - 50 Far::PatchDescriptor::Type type); │ │ │ │ │ - 51}; │ │ │ │ │ - 52 │ │ │ │ │ - 53} // end namespace Osd │ │ │ │ │ - 54 │ │ │ │ │ - 55} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 56using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 57 │ │ │ │ │ - 58} // end namespace OpenSubdiv │ │ │ │ │ - 59 │ │ │ │ │ - 60#endif // OPENSUBDIV3_OSD_GLSL_PATCH_SHADER_SOURCE │ │ │ │ │ + 37struct PatchArray; │ │ │ │ │ + 38struct PatchCoord; │ │ │ │ │ + 39struct PatchParam; │ │ │ │ │ + 40struct BufferDescriptor; │ │ │ │ │ + 41 │ │ │ │ │ + 42void │ │ │ │ │ +43TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 44 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 45 int const * sizes, │ │ │ │ │ + 46 int const * offsets, │ │ │ │ │ + 47 int const * indices, │ │ │ │ │ + 48 float const * weights, │ │ │ │ │ + 49 int start, int end); │ │ │ │ │ + 50 │ │ │ │ │ + 51void │ │ │ │ │ +52TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 53 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 54 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 55 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 56 int const * sizes, │ │ │ │ │ + 57 int const * offsets, │ │ │ │ │ + 58 int const * indices, │ │ │ │ │ + 59 float const * weights, │ │ │ │ │ + 60 float const * duWeights, │ │ │ │ │ + 61 float const * dvWeights, │ │ │ │ │ + 62 int start, int end); │ │ │ │ │ + 63 │ │ │ │ │ + 64void │ │ │ │ │ +65TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 66 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 67 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 68 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 69 float * dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ + 70 float * dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ + 71 float * dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ + 72 int const * sizes, │ │ │ │ │ + 73 int const * offsets, │ │ │ │ │ + 74 int const * indices, │ │ │ │ │ + 75 float const * weights, │ │ │ │ │ + 76 float const * duWeights, │ │ │ │ │ + 77 float const * dvWeights, │ │ │ │ │ + 78 float const * duuWeights, │ │ │ │ │ + 79 float const * duvWeights, │ │ │ │ │ + 80 float const * dvvWeights, │ │ │ │ │ + 81 int start, int end); │ │ │ │ │ + 82 │ │ │ │ │ + 83void │ │ │ │ │ +84TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 85 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 86 float *dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 87 float *dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 88 int numPatchCoords, │ │ │ │ │ + 89 const PatchCoord *patchCoords, │ │ │ │ │ + 90 const PatchArray *patchArrayBuffer, │ │ │ │ │ + 91 const int *patchIndexBuffer, │ │ │ │ │ + 92 const PatchParam *patchParamBuffer); │ │ │ │ │ + 93 │ │ │ │ │ + 94void │ │ │ │ │ +95TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 96 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 97 float *dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 98 float *dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 99 float *dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ + 100 float *dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ + 101 float *dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ + 102 int numPatchCoords, │ │ │ │ │ + 103 const PatchCoord *patchCoords, │ │ │ │ │ + 104 const PatchArray *patchArrayBuffer, │ │ │ │ │ + 105 const int *patchIndexBuffer, │ │ │ │ │ + 106 const PatchParam *patchParamBuffer); │ │ │ │ │ + 107 │ │ │ │ │ + 108} // end namespace Osd │ │ │ │ │ + 109 │ │ │ │ │ + 110} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 111using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 112 │ │ │ │ │ + 113} // end namespace OpenSubdiv │ │ │ │ │ + 114 │ │ │ │ │ + 115#endif // OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource │ │ │ │ │ -Definition: glslPatchShaderSource.h:37 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ -GetVertexShaderSource │ │ │ │ │ -static std::string GetVertexShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ -GetTessEvalShaderSource │ │ │ │ │ -static std::string GetTessEvalShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ -GetPatchBasisShaderSource │ │ │ │ │ -static std::string GetPatchBasisShaderSource() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ -GetCommonShaderSource │ │ │ │ │ -static std::string GetCommonShaderSource() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLSLPatchShaderSource:: │ │ │ │ │ -GetTessControlShaderSource │ │ │ │ │ -static std::string GetTessControlShaderSource(Far::PatchDescriptor::Type type) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvalPatches │ │ │ │ │ +void TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ +*dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const │ │ │ │ │ +&dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ +numPatchCoords, const PatchCoord *patchCoords, const PatchArray │ │ │ │ │ +*patchArrayBuffer, const int *patchIndexBuffer, const PatchParam │ │ │ │ │ +*patchParamBuffer) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvalStencils │ │ │ │ │ +void TbbEvalStencils(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ +*dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, │ │ │ │ │ +int const *indices, float const *weights, int start, int end) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ +Coordinates set on a patch table. │ │ │ │ │ +Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ +Definition: types.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ +Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glslPatchShaderSource.h │ │ │ │ │ + * tbbKernel.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00857.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glMesh.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/tbbEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Typedefs
│ │ │ │ -
glMesh.h File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
tbbEvaluator.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/mesh.h"
│ │ │ │ -#include "../osd/glPatchTable.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  TbbEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Typedefs

typedef MeshInterface< GLPatchTable > GLMeshInterface
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces | Typedefs │ │ │ │ │ -glMesh.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +tbbEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/mesh.h" │ │ │ │ │ -#include "../osd/glPatchTable.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  TbbEvaluator │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -typedef MeshInterface< GLPatchTable > GLMeshInterface │ │ │ │ │ -  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glMesh.h │ │ │ │ │ + * tbbEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00857.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00857 = [ │ │ │ │ │ - ["GLMeshInterface", "a00857.html#a7f9cf2b729178bdbb847fc4afd91af9e", null] │ │ │ │ │ + ["TbbEvaluator", "a01309.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00857_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glMesh.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/tbbEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glMesh.h
│ │ │ │ +
tbbEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,45 +107,502 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include "../osd/mesh.h"
│ │ │ │ -
31#include "../osd/glPatchTable.h"
│ │ │ │ -
32
│ │ │ │ -
33namespace OpenSubdiv {
│ │ │ │ -
34namespace OPENSUBDIV_VERSION {
│ │ │ │ -
35
│ │ │ │ -
36namespace Osd {
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
39
│ │ │ │ -
40
│ │ │ │ -
41} // end namespace Osd
│ │ │ │ -
42
│ │ │ │ -
43} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
44using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
45
│ │ │ │ -
46} // end namespace OpenSubdiv
│ │ │ │ -
47
│ │ │ │ -
48#endif // OPENSUBDIV3_OSD_GL_MESH_H
│ │ │ │ +
29#include "../osd/bufferDescriptor.h"
│ │ │ │ +
30#include "../osd/types.h"
│ │ │ │ +
31
│ │ │ │ +
32#include <cstddef>
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36
│ │ │ │ +
37namespace Osd {
│ │ │ │ +
38
│ │ │ │ + │ │ │ │ +
40public:
│ │ │ │ +
46
│ │ │ │ +
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
72 static bool EvalStencils(
│ │ │ │ +
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
76 TbbEvaluator const *instance = NULL,
│ │ │ │ +
77 void *deviceContext = NULL) {
│ │ │ │ +
78
│ │ │ │ +
79 (void)instance; // unused
│ │ │ │ +
80 (void)deviceContext; // unused
│ │ │ │ +
81
│ │ │ │ +
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ +
83 return false;
│ │ │ │ +
84
│ │ │ │ +
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
87 &stencilTable->GetSizes()[0],
│ │ │ │ +
88 &stencilTable->GetOffsets()[0],
│ │ │ │ +
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
90 &stencilTable->GetWeights()[0],
│ │ │ │ +
91 /*start = */ 0,
│ │ │ │ +
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
121 static bool EvalStencils(
│ │ │ │ +
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
124 const int * sizes,
│ │ │ │ +
125 const int * offsets,
│ │ │ │ +
126 const int * indices,
│ │ │ │ +
127 const float * weights,
│ │ │ │ +
128 int start, int end);
│ │ │ │ +
129
│ │ │ │ +
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
168 static bool EvalStencils(
│ │ │ │ +
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
174 const TbbEvaluator *instance = NULL,
│ │ │ │ +
175 void * deviceContext = NULL) {
│ │ │ │ +
176
│ │ │ │ +
177 (void)instance; // unused
│ │ │ │ +
178 (void)deviceContext; // unused
│ │ │ │ +
179
│ │ │ │ +
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
184 &stencilTable->GetSizes()[0],
│ │ │ │ +
185 &stencilTable->GetOffsets()[0],
│ │ │ │ +
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
187 &stencilTable->GetWeights()[0],
│ │ │ │ +
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
190 /*start = */ 0,
│ │ │ │ +
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
192 }
│ │ │ │ +
193
│ │ │ │ +
234 static bool EvalStencils(
│ │ │ │ +
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
239 const int * sizes,
│ │ │ │ +
240 const int * offsets,
│ │ │ │ +
241 const int * indices,
│ │ │ │ +
242 const float * weights,
│ │ │ │ +
243 const float * duWeights,
│ │ │ │ +
244 const float * dvWeights,
│ │ │ │ +
245 int start, int end);
│ │ │ │ +
246
│ │ │ │ +
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
303 static bool EvalStencils(
│ │ │ │ +
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
312 const TbbEvaluator *instance = NULL,
│ │ │ │ +
313 void * deviceContext = NULL) {
│ │ │ │ +
314
│ │ │ │ +
315 (void)instance; // unused
│ │ │ │ +
316 (void)deviceContext; // unused
│ │ │ │ +
317
│ │ │ │ +
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
325 &stencilTable->GetSizes()[0],
│ │ │ │ +
326 &stencilTable->GetOffsets()[0],
│ │ │ │ +
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
328 &stencilTable->GetWeights()[0],
│ │ │ │ +
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ +
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ +
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ +
334 /*start = */ 0,
│ │ │ │ +
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
336 }
│ │ │ │ +
337
│ │ │ │ +
399 static bool EvalStencils(
│ │ │ │ +
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
407 const int * sizes,
│ │ │ │ +
408 const int * offsets,
│ │ │ │ +
409 const int * indices,
│ │ │ │ +
410 const float * weights,
│ │ │ │ +
411 const float * duWeights,
│ │ │ │ +
412 const float * dvWeights,
│ │ │ │ +
413 const float * duuWeights,
│ │ │ │ +
414 const float * duvWeights,
│ │ │ │ +
415 const float * dvvWeights,
│ │ │ │ +
416 int start, int end);
│ │ │ │ +
417
│ │ │ │ +
423
│ │ │ │ +
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
454 static bool EvalPatches(
│ │ │ │ +
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
457 int numPatchCoords,
│ │ │ │ +
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
459 PATCH_TABLE *patchTable,
│ │ │ │ +
460 TbbEvaluator const *instance = NULL,
│ │ │ │ +
461 void * deviceContext = NULL) {
│ │ │ │ +
462
│ │ │ │ +
463 (void)instance; // unused
│ │ │ │ +
464 (void)deviceContext; // unused
│ │ │ │ +
465
│ │ │ │ +
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
468 numPatchCoords,
│ │ │ │ +
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
472 patchTable->GetPatchParamBuffer());
│ │ │ │ +
473 }
│ │ │ │ +
474
│ │ │ │ +
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
517 static bool EvalPatches(
│ │ │ │ +
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
522 int numPatchCoords,
│ │ │ │ +
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
524 PATCH_TABLE *patchTable,
│ │ │ │ +
525 TbbEvaluator const *instance = NULL,
│ │ │ │ +
526 void * deviceContext = NULL) {
│ │ │ │ +
527
│ │ │ │ +
528 (void)instance; // unused
│ │ │ │ +
529 (void)deviceContext; // unused
│ │ │ │ +
530
│ │ │ │ +
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
533 // so that downcast isn't needed there.
│ │ │ │ +
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
535 //
│ │ │ │ +
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
540 numPatchCoords,
│ │ │ │ +
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
544 patchTable->GetPatchParamBuffer());
│ │ │ │ +
545 }
│ │ │ │ +
546
│ │ │ │ +
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
607 static bool EvalPatches(
│ │ │ │ +
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
615 int numPatchCoords,
│ │ │ │ +
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
617 PATCH_TABLE *patchTable,
│ │ │ │ +
618 TbbEvaluator const *instance = NULL,
│ │ │ │ +
619 void * deviceContext = NULL) {
│ │ │ │ +
620
│ │ │ │ +
621 (void)instance; // unused
│ │ │ │ +
622 (void)deviceContext; // unused
│ │ │ │ +
623
│ │ │ │ +
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
626 // so that downcast isn't needed there.
│ │ │ │ +
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
628 //
│ │ │ │ +
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
636 numPatchCoords,
│ │ │ │ +
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
640 patchTable->GetPatchParamBuffer());
│ │ │ │ +
641 }
│ │ │ │ +
642
│ │ │ │ +
670 static bool EvalPatches(
│ │ │ │ +
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
673 int numPatchCoords,
│ │ │ │ +
674 const PatchCoord *patchCoords,
│ │ │ │ +
675 const PatchArray *patchArrays,
│ │ │ │ +
676 const int *patchIndexBuffer,
│ │ │ │ +
677 const PatchParam *patchParamBuffer);
│ │ │ │ +
678
│ │ │ │ +
716 static bool EvalPatches(
│ │ │ │ +
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
721 int numPatchCoords,
│ │ │ │ +
722 PatchCoord const *patchCoords,
│ │ │ │ +
723 PatchArray const *patchArrays,
│ │ │ │ +
724 const int *patchIndexBuffer,
│ │ │ │ +
725 PatchParam const *patchParamBuffer);
│ │ │ │ +
726
│ │ │ │ +
779 static bool EvalPatches(
│ │ │ │ +
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
787 int numPatchCoords,
│ │ │ │ +
788 PatchCoord const *patchCoords,
│ │ │ │ +
789 PatchArray const *patchArrays,
│ │ │ │ +
790 const int *patchIndexBuffer,
│ │ │ │ +
791 PatchParam const *patchParamBuffer);
│ │ │ │ +
792
│ │ │ │ +
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
826 int numPatchCoords,
│ │ │ │ +
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
828 PATCH_TABLE *patchTable,
│ │ │ │ +
829 TbbEvaluator const *instance = NULL,
│ │ │ │ +
830 void * deviceContext = NULL) {
│ │ │ │ +
831
│ │ │ │ +
832 (void)instance; // unused
│ │ │ │ +
833 (void)deviceContext; // unused
│ │ │ │ +
834
│ │ │ │ +
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
837 numPatchCoords,
│ │ │ │ +
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
841 patchTable->GetPatchParamBuffer());
│ │ │ │ +
842 }
│ │ │ │ +
843
│ │ │ │ +
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
891 int numPatchCoords,
│ │ │ │ +
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
893 PATCH_TABLE *patchTable,
│ │ │ │ +
894 TbbEvaluator const *instance = NULL,
│ │ │ │ +
895 void * deviceContext = NULL) {
│ │ │ │ +
896
│ │ │ │ +
897 (void)instance; // unused
│ │ │ │ +
898 (void)deviceContext; // unused
│ │ │ │ +
899
│ │ │ │ +
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
904 numPatchCoords,
│ │ │ │ +
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
908 patchTable->GetPatchParamBuffer());
│ │ │ │ +
909 }
│ │ │ │ +
910
│ │ │ │ +
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
979 int numPatchCoords,
│ │ │ │ +
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
981 PATCH_TABLE *patchTable,
│ │ │ │ +
982 TbbEvaluator const *instance = NULL,
│ │ │ │ +
983 void * deviceContext = NULL) {
│ │ │ │ +
984
│ │ │ │ +
985 (void)instance; // unused
│ │ │ │ +
986 (void)deviceContext; // unused
│ │ │ │ +
987
│ │ │ │ +
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
995 numPatchCoords,
│ │ │ │ +
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
999 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1000 }
│ │ │ │ +
1001
│ │ │ │ +
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1037 int numPatchCoords,
│ │ │ │ +
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1039 PATCH_TABLE *patchTable,
│ │ │ │ +
1040 int fvarChannel,
│ │ │ │ +
1041 TbbEvaluator const *instance = NULL,
│ │ │ │ +
1042 void * deviceContext = NULL) {
│ │ │ │ +
1043
│ │ │ │ +
1044 (void)instance; // unused
│ │ │ │ +
1045 (void)deviceContext; // unused
│ │ │ │ +
1046
│ │ │ │ +
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1049 numPatchCoords,
│ │ │ │ +
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1054 }
│ │ │ │ +
1055
│ │ │ │ +
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1105 int numPatchCoords,
│ │ │ │ +
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1107 PATCH_TABLE *patchTable,
│ │ │ │ +
1108 int fvarChannel,
│ │ │ │ +
1109 TbbEvaluator const *instance = NULL,
│ │ │ │ +
1110 void * deviceContext = NULL) {
│ │ │ │ +
1111
│ │ │ │ +
1112 (void)instance; // unused
│ │ │ │ +
1113 (void)deviceContext; // unused
│ │ │ │ +
1114
│ │ │ │ +
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1119 numPatchCoords,
│ │ │ │ +
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1124 }
│ │ │ │ +
1125
│ │ │ │ +
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1196 int numPatchCoords,
│ │ │ │ +
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1198 PATCH_TABLE *patchTable,
│ │ │ │ +
1199 int fvarChannel,
│ │ │ │ +
1200 TbbEvaluator const *instance = NULL,
│ │ │ │ +
1201 void * deviceContext = NULL) {
│ │ │ │ +
1202
│ │ │ │ +
1203 (void)instance; // unused
│ │ │ │ +
1204 (void)deviceContext; // unused
│ │ │ │ +
1205
│ │ │ │ +
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
1213 numPatchCoords,
│ │ │ │ +
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1218 }
│ │ │ │ +
1219
│ │ │ │ +
1225
│ │ │ │ +
1227 static void Synchronize(void *deviceContext = NULL);
│ │ │ │ +
1228
│ │ │ │ +
1234 static void SetNumThreads(int numThreads);
│ │ │ │ +
1235};
│ │ │ │ +
1236
│ │ │ │ +
1237
│ │ │ │ +
1238} // end namespace Osd
│ │ │ │ +
1239
│ │ │ │ +
1240} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
1241using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
1242
│ │ │ │ +
1243} // end namespace OpenSubdiv
│ │ │ │ +
1244
│ │ │ │ +
1245
│ │ │ │ +
1246#endif // OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │ │ │ │ │ -
MeshInterface< GLPatchTable > GLMeshInterface
Definition: glMesh.h:38
│ │ │ │ - │ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: tbbEvaluator.h:72
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:454
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const TbbEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: tbbEvaluator.h:303
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:886
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: tbbEvaluator.h:607
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static void Synchronize(void *deviceContext=NULL)
synchronize all asynchronous computation invoked on this device.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:971
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: tbbEvaluator.h:517
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static void SetNumThreads(int numThreads)
initialize tbb task schedular (optional: client may use tbb::task_scheduler_init)
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const TbbEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: tbbEvaluator.h:168
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:823
│ │ │ │ +
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glMesh.h │ │ │ │ │ +tbbEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,42 +30,660 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include "../osd/mesh.h" │ │ │ │ │ - 31#include "../osd/glPatchTable.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace OpenSubdiv { │ │ │ │ │ - 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace Osd { │ │ │ │ │ - 37 │ │ │ │ │ -38typedef MeshInterface GLMeshInterface; │ │ │ │ │ - 39 │ │ │ │ │ - 40 │ │ │ │ │ - 41} // end namespace Osd │ │ │ │ │ - 42 │ │ │ │ │ - 43} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 44using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 45 │ │ │ │ │ - 46} // end namespace OpenSubdiv │ │ │ │ │ - 47 │ │ │ │ │ - 48#endif // OPENSUBDIV3_OSD_GL_MESH_H │ │ │ │ │ + 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 30#include "../osd/types.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36 │ │ │ │ │ + 37namespace Osd { │ │ │ │ │ + 38 │ │ │ │ │ +39class TbbEvaluator { │ │ │ │ │ + 40public: │ │ │ │ │ + 46 │ │ │ │ │ + 71 template │ │ │ │ │ +72 static bool EvalStencils( │ │ │ │ │ + 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 76 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 77 void *deviceContext = NULL) { │ │ │ │ │ + 78 │ │ │ │ │ + 79 (void)instance; // unused │ │ │ │ │ + 80 (void)deviceContext; // unused │ │ │ │ │ + 81 │ │ │ │ │ + 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ + 83 return false; │ │ │ │ │ + 84 │ │ │ │ │ + 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 87 &stencilTable->GetSizes()[0], │ │ │ │ │ + 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 90 &stencilTable->GetWeights()[0], │ │ │ │ │ + 91 /*start = */ 0, │ │ │ │ │ + 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 93 } │ │ │ │ │ + 94 │ │ │ │ │ +121 static bool EvalStencils( │ │ │ │ │ + 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 124 const int * sizes, │ │ │ │ │ + 125 const int * offsets, │ │ │ │ │ + 126 const int * indices, │ │ │ │ │ + 127 const float * weights, │ │ │ │ │ + 128 int start, int end); │ │ │ │ │ + 129 │ │ │ │ │ + 167 template │ │ │ │ │ +168 static bool EvalStencils( │ │ │ │ │ + 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 174 const TbbEvaluator *instance = NULL, │ │ │ │ │ + 175 void * deviceContext = NULL) { │ │ │ │ │ + 176 │ │ │ │ │ + 177 (void)instance; // unused │ │ │ │ │ + 178 (void)deviceContext; // unused │ │ │ │ │ + 179 │ │ │ │ │ + 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 184 &stencilTable->GetSizes()[0], │ │ │ │ │ + 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 187 &stencilTable->GetWeights()[0], │ │ │ │ │ + 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 190 /*start = */ 0, │ │ │ │ │ + 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 192 } │ │ │ │ │ + 193 │ │ │ │ │ +234 static bool EvalStencils( │ │ │ │ │ + 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 239 const int * sizes, │ │ │ │ │ + 240 const int * offsets, │ │ │ │ │ + 241 const int * indices, │ │ │ │ │ + 242 const float * weights, │ │ │ │ │ + 243 const float * duWeights, │ │ │ │ │ + 244 const float * dvWeights, │ │ │ │ │ + 245 int start, int end); │ │ │ │ │ + 246 │ │ │ │ │ + 302 template │ │ │ │ │ +303 static bool EvalStencils( │ │ │ │ │ + 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 312 const TbbEvaluator *instance = NULL, │ │ │ │ │ + 313 void * deviceContext = NULL) { │ │ │ │ │ + 314 │ │ │ │ │ + 315 (void)instance; // unused │ │ │ │ │ + 316 (void)deviceContext; // unused │ │ │ │ │ + 317 │ │ │ │ │ + 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 325 &stencilTable->GetSizes()[0], │ │ │ │ │ + 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 328 &stencilTable->GetWeights()[0], │ │ │ │ │ + 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ + 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ + 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ + 334 /*start = */ 0, │ │ │ │ │ + 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ +399 static bool EvalStencils( │ │ │ │ │ + 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 407 const int * sizes, │ │ │ │ │ + 408 const int * offsets, │ │ │ │ │ + 409 const int * indices, │ │ │ │ │ + 410 const float * weights, │ │ │ │ │ + 411 const float * duWeights, │ │ │ │ │ + 412 const float * dvWeights, │ │ │ │ │ + 413 const float * duuWeights, │ │ │ │ │ + 414 const float * duvWeights, │ │ │ │ │ + 415 const float * dvvWeights, │ │ │ │ │ + 416 int start, int end); │ │ │ │ │ + 417 │ │ │ │ │ + 423 │ │ │ │ │ + 452 template │ │ │ │ │ +454 static bool EvalPatches( │ │ │ │ │ + 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 457 int numPatchCoords, │ │ │ │ │ + 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 459 PATCH_TABLE *patchTable, │ │ │ │ │ + 460 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 461 void * deviceContext = NULL) { │ │ │ │ │ + 462 │ │ │ │ │ + 463 (void)instance; // unused │ │ │ │ │ + 464 (void)deviceContext; // unused │ │ │ │ │ + 465 │ │ │ │ │ + 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 468 numPatchCoords, │ │ │ │ │ + 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 473 } │ │ │ │ │ + 474 │ │ │ │ │ + 515 template │ │ │ │ │ +517 static bool EvalPatches( │ │ │ │ │ + 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 522 int numPatchCoords, │ │ │ │ │ + 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 524 PATCH_TABLE *patchTable, │ │ │ │ │ + 525 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 526 void * deviceContext = NULL) { │ │ │ │ │ + 527 │ │ │ │ │ + 528 (void)instance; // unused │ │ │ │ │ + 529 (void)deviceContext; // unused │ │ │ │ │ + 530 │ │ │ │ │ + 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 533 // so that downcast isn't needed there. │ │ │ │ │ + 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 535 // │ │ │ │ │ + 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 540 numPatchCoords, │ │ │ │ │ + 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 545 } │ │ │ │ │ + 546 │ │ │ │ │ + 605 template │ │ │ │ │ +607 static bool EvalPatches( │ │ │ │ │ + 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 615 int numPatchCoords, │ │ │ │ │ + 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 617 PATCH_TABLE *patchTable, │ │ │ │ │ + 618 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 619 void * deviceContext = NULL) { │ │ │ │ │ + 620 │ │ │ │ │ + 621 (void)instance; // unused │ │ │ │ │ + 622 (void)deviceContext; // unused │ │ │ │ │ + 623 │ │ │ │ │ + 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 626 // so that downcast isn't needed there. │ │ │ │ │ + 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 628 // │ │ │ │ │ + 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 636 numPatchCoords, │ │ │ │ │ + 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 641 } │ │ │ │ │ + 642 │ │ │ │ │ +670 static bool EvalPatches( │ │ │ │ │ + 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 673 int numPatchCoords, │ │ │ │ │ + 674 const PatchCoord *patchCoords, │ │ │ │ │ + 675 const PatchArray *patchArrays, │ │ │ │ │ + 676 const int *patchIndexBuffer, │ │ │ │ │ + 677 const PatchParam *patchParamBuffer); │ │ │ │ │ + 678 │ │ │ │ │ +716 static bool EvalPatches( │ │ │ │ │ + 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 721 int numPatchCoords, │ │ │ │ │ + 722 PatchCoord const *patchCoords, │ │ │ │ │ + 723 PatchArray const *patchArrays, │ │ │ │ │ + 724 const int *patchIndexBuffer, │ │ │ │ │ + 725 PatchParam const *patchParamBuffer); │ │ │ │ │ + 726 │ │ │ │ │ +779 static bool EvalPatches( │ │ │ │ │ + 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 787 int numPatchCoords, │ │ │ │ │ + 788 PatchCoord const *patchCoords, │ │ │ │ │ + 789 PatchArray const *patchArrays, │ │ │ │ │ + 790 const int *patchIndexBuffer, │ │ │ │ │ + 791 PatchParam const *patchParamBuffer); │ │ │ │ │ + 792 │ │ │ │ │ + 821 template │ │ │ │ │ +823 static bool EvalPatchesVarying( │ │ │ │ │ + 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 826 int numPatchCoords, │ │ │ │ │ + 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 828 PATCH_TABLE *patchTable, │ │ │ │ │ + 829 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 830 void * deviceContext = NULL) { │ │ │ │ │ + 831 │ │ │ │ │ + 832 (void)instance; // unused │ │ │ │ │ + 833 (void)deviceContext; // unused │ │ │ │ │ + 834 │ │ │ │ │ + 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 837 numPatchCoords, │ │ │ │ │ + 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 842 } │ │ │ │ │ + 843 │ │ │ │ │ + 884 template │ │ │ │ │ +886 static bool EvalPatchesVarying( │ │ │ │ │ + 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 891 int numPatchCoords, │ │ │ │ │ + 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 893 PATCH_TABLE *patchTable, │ │ │ │ │ + 894 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 895 void * deviceContext = NULL) { │ │ │ │ │ + 896 │ │ │ │ │ + 897 (void)instance; // unused │ │ │ │ │ + 898 (void)deviceContext; // unused │ │ │ │ │ + 899 │ │ │ │ │ + 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 904 numPatchCoords, │ │ │ │ │ + 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 909 } │ │ │ │ │ + 910 │ │ │ │ │ + 969 template │ │ │ │ │ +971 static bool EvalPatchesVarying( │ │ │ │ │ + 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 979 int numPatchCoords, │ │ │ │ │ + 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 981 PATCH_TABLE *patchTable, │ │ │ │ │ + 982 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 983 void * deviceContext = NULL) { │ │ │ │ │ + 984 │ │ │ │ │ + 985 (void)instance; // unused │ │ │ │ │ + 986 (void)deviceContext; // unused │ │ │ │ │ + 987 │ │ │ │ │ + 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 995 numPatchCoords, │ │ │ │ │ + 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1000 } │ │ │ │ │ + 1001 │ │ │ │ │ + 1032 template │ │ │ │ │ +1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1037 int numPatchCoords, │ │ │ │ │ + 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1039 PATCH_TABLE *patchTable, │ │ │ │ │ + 1040 int fvarChannel, │ │ │ │ │ + 1041 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 1042 void * deviceContext = NULL) { │ │ │ │ │ + 1043 │ │ │ │ │ + 1044 (void)instance; // unused │ │ │ │ │ + 1045 (void)deviceContext; // unused │ │ │ │ │ + 1046 │ │ │ │ │ + 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1049 numPatchCoords, │ │ │ │ │ + 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1054 } │ │ │ │ │ + 1055 │ │ │ │ │ + 1098 template │ │ │ │ │ +1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1105 int numPatchCoords, │ │ │ │ │ + 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1107 PATCH_TABLE *patchTable, │ │ │ │ │ + 1108 int fvarChannel, │ │ │ │ │ + 1109 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 1110 void * deviceContext = NULL) { │ │ │ │ │ + 1111 │ │ │ │ │ + 1112 (void)instance; // unused │ │ │ │ │ + 1113 (void)deviceContext; // unused │ │ │ │ │ + 1114 │ │ │ │ │ + 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1119 numPatchCoords, │ │ │ │ │ + 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1124 } │ │ │ │ │ + 1125 │ │ │ │ │ + 1186 template │ │ │ │ │ +1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1196 int numPatchCoords, │ │ │ │ │ + 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1198 PATCH_TABLE *patchTable, │ │ │ │ │ + 1199 int fvarChannel, │ │ │ │ │ + 1200 TbbEvaluator const *instance = NULL, │ │ │ │ │ + 1201 void * deviceContext = NULL) { │ │ │ │ │ + 1202 │ │ │ │ │ + 1203 (void)instance; // unused │ │ │ │ │ + 1204 (void)deviceContext; // unused │ │ │ │ │ + 1205 │ │ │ │ │ + 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 1213 numPatchCoords, │ │ │ │ │ + 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1218 } │ │ │ │ │ + 1219 │ │ │ │ │ + 1225 │ │ │ │ │ +1227 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ + 1228 │ │ │ │ │ +1234 static void SetNumThreads(int numThreads); │ │ │ │ │ + 1235}; │ │ │ │ │ + 1236 │ │ │ │ │ + 1237 │ │ │ │ │ + 1238} // end namespace Osd │ │ │ │ │ + 1239 │ │ │ │ │ + 1240} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 1241using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 1242 │ │ │ │ │ + 1243} // end namespace OpenSubdiv │ │ │ │ │ + 1244 │ │ │ │ │ + 1245 │ │ │ │ │ + 1246#endif // OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLMeshInterface │ │ │ │ │ -MeshInterface< GLPatchTable > GLMeshInterface │ │ │ │ │ -Definition: glMesh.h:38 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ -Definition: mesh.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator │ │ │ │ │ +Definition: tbbEvaluator.h:39 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function. This function has a same signature as │ │ │ │ │ +other device kernels hav... │ │ │ │ │ +Definition: tbbEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:454 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +const TbbEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: tbbEvaluator.h:303 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ +Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ +output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:886 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: tbbEvaluator.h:607 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ +float *dvvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ +const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ +PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ +synchronize all asynchronous computation invoked on this device. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:971 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:1100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: tbbEvaluator.h:517 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:1034 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ +PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::SetNumThreads │ │ │ │ │ +static void SetNumThreads(int numThreads) │ │ │ │ │ +initialize tbb task schedular (optional: client may use tbb:: │ │ │ │ │ +task_scheduler_init) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ +PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ +TbbEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: tbbEvaluator.h:168 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:1188 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: tbbEvaluator.h:823 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ +Coordinates set on a patch table. │ │ │ │ │ +Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ +Definition: types.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ +Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glMesh.h │ │ │ │ │ + * tbbEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00860.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glVertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/ompKernel.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,44 +81,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
glVertexBuffer.h File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
ompKernel.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ -#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  GLVertexBuffer
 Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
 
void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, int start, int end)
 
void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, float const *duuWeights, float const *duvWeights, float const *dvvWeights, int start, int end)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,29 +4,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -glVertexBuffer.h File Reference │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +ompKernel.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/opengl.h" │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  GLVertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ + Functions │ │ │ │ │ +void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, int const *sizes, int const │ │ │ │ │ + *offsets, int const *indices, float const *weights, int start, int end) │ │ │ │ │ +  │ │ │ │ │ +void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ + const *sizes, int const *offsets, int const *indices, float const │ │ │ │ │ + *weights, float const *duWeights, float const *dvWeights, int start, int │ │ │ │ │ + end) │ │ │ │ │ +  │ │ │ │ │ +void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ + *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ + const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ + *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ + BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ + &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, │ │ │ │ │ + float const *weights, float const *duWeights, float const *dvWeights, │ │ │ │ │ + float const *duuWeights, float const *duvWeights, float const │ │ │ │ │ + *dvvWeights, int start, int end) │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glVertexBuffer.h │ │ │ │ │ + * ompKernel.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00860.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,5 @@ │ │ │ │ │ var a00860 = [ │ │ │ │ │ - ["GLVertexBuffer", "a01237.html", "a01237"] │ │ │ │ │ + ["OmpEvalStencils", "a00860.html#a44a05502feb5015035bc81b93cffb99c", null], │ │ │ │ │ + ["OmpEvalStencils", "a00860.html#a907dc53421460557871ddc35f77751f5", null], │ │ │ │ │ + ["OmpEvalStencils", "a00860.html#a870745ff3e883b32547d4db42b3be2bd", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00860_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/ompKernel.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glVertexBuffer.h
│ │ │ │ +
ompKernel.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,76 +107,82 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include "../osd/opengl.h"
│ │ │ │ -
31#include <cstddef>
│ │ │ │ +
30namespace OpenSubdiv {
│ │ │ │ +
31namespace OPENSUBDIV_VERSION {
│ │ │ │
32
│ │ │ │ -
33namespace OpenSubdiv {
│ │ │ │ -
34namespace OPENSUBDIV_VERSION {
│ │ │ │ -
35
│ │ │ │ -
36namespace Osd {
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
45public:
│ │ │ │ -
47 static GLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
48 void *deviceContext = NULL);
│ │ │ │ -
49
│ │ │ │ - │ │ │ │ -
52
│ │ │ │ -
55 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
56 void *deviceContext = NULL);
│ │ │ │ -
57
│ │ │ │ -
59 int GetNumElements() const;
│ │ │ │ -
60
│ │ │ │ -
62 int GetNumVertices() const;
│ │ │ │ -
63
│ │ │ │ -
65 GLuint BindVBO(void *deviceContext = NULL);
│ │ │ │ -
66
│ │ │ │ -
67protected:
│ │ │ │ -
69 GLVertexBuffer(int numElements, int numVertices);
│ │ │ │ -
70
│ │ │ │ -
73 bool allocate();
│ │ │ │ -
74
│ │ │ │ -
75private:
│ │ │ │ -
76 int _numElements;
│ │ │ │ -
77 int _numVertices;
│ │ │ │ -
78 GLuint _vbo;
│ │ │ │ -
79};
│ │ │ │ -
80
│ │ │ │ -
81} // end namespace Osd
│ │ │ │ +
33namespace Osd {
│ │ │ │ +
34
│ │ │ │ +
35struct BufferDescriptor;
│ │ │ │ +
36
│ │ │ │ +
37void
│ │ │ │ +
38OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
39 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
40 int const * sizes,
│ │ │ │ +
41 int const * offsets,
│ │ │ │ +
42 int const * indices,
│ │ │ │ +
43 float const * weights,
│ │ │ │ +
44 int start, int end);
│ │ │ │ +
45
│ │ │ │ +
46void
│ │ │ │ +
47OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
48 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
49 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
50 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
51 int const * sizes,
│ │ │ │ +
52 int const * offsets,
│ │ │ │ +
53 int const * indices,
│ │ │ │ +
54 float const * weights,
│ │ │ │ +
55 float const * duWeights,
│ │ │ │ +
56 float const * dvWeights,
│ │ │ │ +
57 int start, int end);
│ │ │ │ +
58
│ │ │ │ +
59void
│ │ │ │ +
60OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ +
61 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
62 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ +
63 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ +
64 float * dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ +
65 float * dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ +
66 float * dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ +
67 int const * sizes,
│ │ │ │ +
68 int const * offsets,
│ │ │ │ +
69 int const * indices,
│ │ │ │ +
70 float const * weights,
│ │ │ │ +
71 float const * duWeights,
│ │ │ │ +
72 float const * dvWeights,
│ │ │ │ +
73 float const * duuWeights,
│ │ │ │ +
74 float const * duvWeights,
│ │ │ │ +
75 float const * dvvWeights,
│ │ │ │ +
76 int start, int end);
│ │ │ │ +
77
│ │ │ │ +
78} // end namespace Osd
│ │ │ │ +
79
│ │ │ │ +
80} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
81using namespace OPENSUBDIV_VERSION;
│ │ │ │
82
│ │ │ │ -
83} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
84using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
85
│ │ │ │ -
86} // end namespace OpenSubdiv
│ │ │ │ -
87
│ │ │ │ -
88#endif // OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H
│ │ │ │ +
83} // end namespace OpenSubdiv
│ │ │ │ +
84
│ │ │ │ +
85#endif // OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for GLSL subdivision and OpenGL drawing.
│ │ │ │ - │ │ │ │ -
GLuint BindVBO(void *deviceContext=NULL)
Returns the GL buffer object.
│ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ -
GLVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
static GLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ - │ │ │ │ +
void OmpEvalStencils(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glVertexBuffer.h │ │ │ │ │ +ompKernel.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,88 +30,82 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include "../osd/opengl.h" │ │ │ │ │ - 31#include │ │ │ │ │ + 30namespace OpenSubdiv { │ │ │ │ │ + 31namespace OPENSUBDIV_VERSION { │ │ │ │ │ 32 │ │ │ │ │ - 33namespace OpenSubdiv { │ │ │ │ │ - 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace Osd { │ │ │ │ │ - 37 │ │ │ │ │ -44class GLVertexBuffer { │ │ │ │ │ - 45public: │ │ │ │ │ -47 static GLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 48 void *deviceContext = NULL); │ │ │ │ │ - 49 │ │ │ │ │ -51 ~GLVertexBuffer(); │ │ │ │ │ - 52 │ │ │ │ │ -55 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 56 void *deviceContext = NULL); │ │ │ │ │ - 57 │ │ │ │ │ -59 int GetNumElements() const; │ │ │ │ │ - 60 │ │ │ │ │ -62 int GetNumVertices() const; │ │ │ │ │ - 63 │ │ │ │ │ -65 GLuint BindVBO(void *deviceContext = NULL); │ │ │ │ │ - 66 │ │ │ │ │ - 67protected: │ │ │ │ │ -69 GLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ - 70 │ │ │ │ │ -73 bool allocate(); │ │ │ │ │ - 74 │ │ │ │ │ - 75private: │ │ │ │ │ - 76 int _numElements; │ │ │ │ │ - 77 int _numVertices; │ │ │ │ │ - 78 GLuint _vbo; │ │ │ │ │ - 79}; │ │ │ │ │ - 80 │ │ │ │ │ - 81} // end namespace Osd │ │ │ │ │ + 33namespace Osd { │ │ │ │ │ + 34 │ │ │ │ │ + 35struct BufferDescriptor; │ │ │ │ │ + 36 │ │ │ │ │ + 37void │ │ │ │ │ +38OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 39 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 40 int const * sizes, │ │ │ │ │ + 41 int const * offsets, │ │ │ │ │ + 42 int const * indices, │ │ │ │ │ + 43 float const * weights, │ │ │ │ │ + 44 int start, int end); │ │ │ │ │ + 45 │ │ │ │ │ + 46void │ │ │ │ │ +47OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 48 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 49 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 50 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 51 int const * sizes, │ │ │ │ │ + 52 int const * offsets, │ │ │ │ │ + 53 int const * indices, │ │ │ │ │ + 54 float const * weights, │ │ │ │ │ + 55 float const * duWeights, │ │ │ │ │ + 56 float const * dvWeights, │ │ │ │ │ + 57 int start, int end); │ │ │ │ │ + 58 │ │ │ │ │ + 59void │ │ │ │ │ +60OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 61 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 62 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ + 63 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ + 64 float * dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ + 65 float * dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ + 66 float * dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ + 67 int const * sizes, │ │ │ │ │ + 68 int const * offsets, │ │ │ │ │ + 69 int const * indices, │ │ │ │ │ + 70 float const * weights, │ │ │ │ │ + 71 float const * duWeights, │ │ │ │ │ + 72 float const * dvWeights, │ │ │ │ │ + 73 float const * duuWeights, │ │ │ │ │ + 74 float const * duvWeights, │ │ │ │ │ + 75 float const * dvvWeights, │ │ │ │ │ + 76 int start, int end); │ │ │ │ │ + 77 │ │ │ │ │ + 78} // end namespace Osd │ │ │ │ │ + 79 │ │ │ │ │ + 80} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 81using namespace OPENSUBDIV_VERSION; │ │ │ │ │ 82 │ │ │ │ │ - 83} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 84using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 85 │ │ │ │ │ - 86} // end namespace OpenSubdiv │ │ │ │ │ - 87 │ │ │ │ │ - 88#endif // OPENSUBDIV3_OSD_GL_VERTEX_BUFFER_H │ │ │ │ │ + 83} // end namespace OpenSubdiv │ │ │ │ │ + 84 │ │ │ │ │ + 85#endif // OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer │ │ │ │ │ -Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. │ │ │ │ │ -Definition: glVertexBuffer.h:44 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::~GLVertexBuffer │ │ │ │ │ -~GLVertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::BindVBO │ │ │ │ │ -GLuint BindVBO(void *deviceContext=NULL) │ │ │ │ │ -Returns the GL buffer object. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GLVertexBuffer │ │ │ │ │ -GLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::GetNumVertices │ │ │ │ │ -int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::Create │ │ │ │ │ -static GLVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLVertexBuffer::allocate │ │ │ │ │ -bool allocate() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvalStencils │ │ │ │ │ +void OmpEvalStencils(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ +*dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, │ │ │ │ │ +int const *indices, float const *weights, int start, int end) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glVertexBuffer.h │ │ │ │ │ + * ompKernel.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00863.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glLegacyGregoryPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/ompEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,27 +83,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
glLegacyGregoryPatchTable.h File Reference
│ │ │ │ +
ompEvaluator.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  GLLegacyGregoryPatchTable
class  OmpEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -112,13 +112,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -glLegacyGregoryPatchTable.h File Reference │ │ │ │ │ +ompEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../far/patchTable.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/opengl.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  GLLegacyGregoryPatchTable │ │ │ │ │ +class  OmpEvaluator │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glLegacyGregoryPatchTable.h │ │ │ │ │ + * ompEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00863.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00863 = [ │ │ │ │ │ - ["GLLegacyGregoryPatchTable", "a01225.html", "a01225"] │ │ │ │ │ + ["OmpEvaluator", "a01305.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00863_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glLegacyGregoryPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/ompEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glLegacyGregoryPatchTable.h
│ │ │ │ +
ompEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,93 +107,502 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include "../far/patchTable.h"
│ │ │ │ -
31#include "../osd/nonCopyable.h"
│ │ │ │ -
32#include "../osd/opengl.h"
│ │ │ │ +
29#include "../osd/bufferDescriptor.h"
│ │ │ │ +
30#include "../osd/types.h"
│ │ │ │ +
31
│ │ │ │ +
32#include <cstddef>
│ │ │ │
33
│ │ │ │
34namespace OpenSubdiv {
│ │ │ │
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │
37namespace Osd {
│ │ │ │
38
│ │ │ │ - │ │ │ │ -
40 : private NonCopyable<GLLegacyGregoryPatchTable> {
│ │ │ │ -
41public:
│ │ │ │ - │ │ │ │ -
43
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ -
46 void UpdateVertexBuffer(GLuint vbo);
│ │ │ │ -
47
│ │ │ │ -
48 GLuint GetVertexTextureBuffer() const {
│ │ │ │ -
49 return _vertexTextureBuffer;
│ │ │ │ -
50 }
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ -
53 return _vertexValenceTextureBuffer;
│ │ │ │ -
54 }
│ │ │ │ -
55
│ │ │ │ - │ │ │ │ -
57 return _quadOffsetsTextureBuffer;
│ │ │ │ -
58 }
│ │ │ │ -
59
│ │ │ │ - │ │ │ │ - │ │ │ │ -
62 return _quadOffsetsBase[1];
│ │ │ │ -
63 }
│ │ │ │ -
64 return _quadOffsetsBase[0];
│ │ │ │ -
65 }
│ │ │ │ -
66
│ │ │ │ -
67protected:
│ │ │ │ - │ │ │ │ -
69
│ │ │ │ -
70private:
│ │ │ │ -
71 GLuint _vertexTextureBuffer;
│ │ │ │ -
72 GLuint _vertexValenceTextureBuffer;
│ │ │ │ -
73 GLuint _quadOffsetsTextureBuffer;
│ │ │ │ -
74 GLuint _quadOffsetsBase[2]; // gregory, boundaryGregory
│ │ │ │ -
75};
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ + │ │ │ │ +
40public:
│ │ │ │ +
46
│ │ │ │ +
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
72 static bool EvalStencils(
│ │ │ │ +
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
76 const OmpEvaluator *instance = NULL,
│ │ │ │ +
77 void * deviceContext = NULL) {
│ │ │ │
78
│ │ │ │ -
79} // end namespace Osd
│ │ │ │ -
80
│ │ │ │ -
81} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
82using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
83
│ │ │ │ -
84} // end namespace OpenSubdiv
│ │ │ │ -
85
│ │ │ │ -
86#endif // OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
│ │ │ │ +
79 (void)instance; // unused
│ │ │ │ +
80 (void)deviceContext; // unused
│ │ │ │ +
81
│ │ │ │ +
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ +
83 return false;
│ │ │ │ +
84
│ │ │ │ +
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
87 &stencilTable->GetSizes()[0],
│ │ │ │ +
88 &stencilTable->GetOffsets()[0],
│ │ │ │ +
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
90 &stencilTable->GetWeights()[0],
│ │ │ │ +
91 /*start = */ 0,
│ │ │ │ +
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
121 static bool EvalStencils(
│ │ │ │ +
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
124 const int * sizes,
│ │ │ │ +
125 const int * offsets,
│ │ │ │ +
126 const int * indices,
│ │ │ │ +
127 const float * weights,
│ │ │ │ +
128 int start, int end);
│ │ │ │ +
129
│ │ │ │ +
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
168 static bool EvalStencils(
│ │ │ │ +
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
174 const OmpEvaluator *instance = NULL,
│ │ │ │ +
175 void * deviceContext = NULL) {
│ │ │ │ +
176
│ │ │ │ +
177 (void)instance; // unused
│ │ │ │ +
178 (void)deviceContext; // unused
│ │ │ │ +
179
│ │ │ │ +
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
184 &stencilTable->GetSizes()[0],
│ │ │ │ +
185 &stencilTable->GetOffsets()[0],
│ │ │ │ +
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
187 &stencilTable->GetWeights()[0],
│ │ │ │ +
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
190 /*start = */ 0,
│ │ │ │ +
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
192 }
│ │ │ │ +
193
│ │ │ │ +
234 static bool EvalStencils(
│ │ │ │ +
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
239 const int * sizes,
│ │ │ │ +
240 const int * offsets,
│ │ │ │ +
241 const int * indices,
│ │ │ │ +
242 const float * weights,
│ │ │ │ +
243 const float * duWeights,
│ │ │ │ +
244 const float * dvWeights,
│ │ │ │ +
245 int start, int end);
│ │ │ │ +
246
│ │ │ │ +
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
303 static bool EvalStencils(
│ │ │ │ +
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
312 const OmpEvaluator *instance = NULL,
│ │ │ │ +
313 void * deviceContext = NULL) {
│ │ │ │ +
314
│ │ │ │ +
315 (void)instance; // unused
│ │ │ │ +
316 (void)deviceContext; // unused
│ │ │ │ +
317
│ │ │ │ +
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
325 &stencilTable->GetSizes()[0],
│ │ │ │ +
326 &stencilTable->GetOffsets()[0],
│ │ │ │ +
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
328 &stencilTable->GetWeights()[0],
│ │ │ │ +
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ +
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ +
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ +
334 /*start = */ 0,
│ │ │ │ +
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
336 }
│ │ │ │ +
337
│ │ │ │ +
399 static bool EvalStencils(
│ │ │ │ +
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
407 const int * sizes,
│ │ │ │ +
408 const int * offsets,
│ │ │ │ +
409 const int * indices,
│ │ │ │ +
410 const float * weights,
│ │ │ │ +
411 const float * duWeights,
│ │ │ │ +
412 const float * dvWeights,
│ │ │ │ +
413 const float * duuWeights,
│ │ │ │ +
414 const float * duvWeights,
│ │ │ │ +
415 const float * dvvWeights,
│ │ │ │ +
416 int start, int end);
│ │ │ │ +
417
│ │ │ │ +
423
│ │ │ │ +
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
454 static bool EvalPatches(
│ │ │ │ +
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
457 int numPatchCoords,
│ │ │ │ +
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
459 PATCH_TABLE *patchTable,
│ │ │ │ +
460 OmpEvaluator const *instance = NULL,
│ │ │ │ +
461 void * deviceContext = NULL) {
│ │ │ │ +
462
│ │ │ │ +
463 (void)instance; // unused
│ │ │ │ +
464 (void)deviceContext; // unused
│ │ │ │ +
465
│ │ │ │ +
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
468 numPatchCoords,
│ │ │ │ +
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
472 patchTable->GetPatchParamBuffer());
│ │ │ │ +
473 }
│ │ │ │ +
474
│ │ │ │ +
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
517 static bool EvalPatches(
│ │ │ │ +
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
522 int numPatchCoords,
│ │ │ │ +
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
524 PATCH_TABLE *patchTable,
│ │ │ │ +
525 OmpEvaluator const *instance = NULL,
│ │ │ │ +
526 void * deviceContext = NULL) {
│ │ │ │ +
527
│ │ │ │ +
528 (void)instance; // unused
│ │ │ │ +
529 (void)deviceContext; // unused
│ │ │ │ +
530
│ │ │ │ +
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
533 // so that downcast isn't needed there.
│ │ │ │ +
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
535 //
│ │ │ │ +
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
540 numPatchCoords,
│ │ │ │ +
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
544 patchTable->GetPatchParamBuffer());
│ │ │ │ +
545 }
│ │ │ │ +
546
│ │ │ │ +
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
607 static bool EvalPatches(
│ │ │ │ +
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
615 int numPatchCoords,
│ │ │ │ +
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
617 PATCH_TABLE *patchTable,
│ │ │ │ +
618 OmpEvaluator const *instance = NULL,
│ │ │ │ +
619 void * deviceContext = NULL) {
│ │ │ │ +
620
│ │ │ │ +
621 (void)instance; // unused
│ │ │ │ +
622 (void)deviceContext; // unused
│ │ │ │ +
623
│ │ │ │ +
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
626 // so that downcast isn't needed there.
│ │ │ │ +
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
628 //
│ │ │ │ +
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
636 numPatchCoords,
│ │ │ │ +
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
640 patchTable->GetPatchParamBuffer());
│ │ │ │ +
641 }
│ │ │ │ +
642
│ │ │ │ +
670 static bool EvalPatches(
│ │ │ │ +
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
673 int numPatchCoords,
│ │ │ │ +
674 const PatchCoord *patchCoords,
│ │ │ │ +
675 const PatchArray *patchArrays,
│ │ │ │ +
676 const int *patchIndexBuffer,
│ │ │ │ +
677 const PatchParam *patchParamBuffer);
│ │ │ │ +
678
│ │ │ │ +
716 static bool EvalPatches(
│ │ │ │ +
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
721 int numPatchCoords,
│ │ │ │ +
722 PatchCoord const *patchCoords,
│ │ │ │ +
723 PatchArray const *patchArrays,
│ │ │ │ +
724 const int *patchIndexBuffer,
│ │ │ │ +
725 PatchParam const *patchParamBuffer);
│ │ │ │ +
726
│ │ │ │ +
779 static bool EvalPatches(
│ │ │ │ +
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
787 int numPatchCoords,
│ │ │ │ +
788 PatchCoord const *patchCoords,
│ │ │ │ +
789 PatchArray const *patchArrays,
│ │ │ │ +
790 const int *patchIndexBuffer,
│ │ │ │ +
791 PatchParam const *patchParamBuffer);
│ │ │ │ +
792
│ │ │ │ +
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
826 int numPatchCoords,
│ │ │ │ +
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
828 PATCH_TABLE *patchTable,
│ │ │ │ +
829 OmpEvaluator const *instance = NULL,
│ │ │ │ +
830 void * deviceContext = NULL) {
│ │ │ │ +
831
│ │ │ │ +
832 (void)instance; // unused
│ │ │ │ +
833 (void)deviceContext; // unused
│ │ │ │ +
834
│ │ │ │ +
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
837 numPatchCoords,
│ │ │ │ +
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
841 patchTable->GetPatchParamBuffer());
│ │ │ │ +
842 }
│ │ │ │ +
843
│ │ │ │ +
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
891 int numPatchCoords,
│ │ │ │ +
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
893 PATCH_TABLE *patchTable,
│ │ │ │ +
894 OmpEvaluator const *instance = NULL,
│ │ │ │ +
895 void * deviceContext = NULL) {
│ │ │ │ +
896
│ │ │ │ +
897 (void)instance; // unused
│ │ │ │ +
898 (void)deviceContext; // unused
│ │ │ │ +
899
│ │ │ │ +
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
904 numPatchCoords,
│ │ │ │ +
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
908 patchTable->GetPatchParamBuffer());
│ │ │ │ +
909 }
│ │ │ │ +
910
│ │ │ │ +
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
979 int numPatchCoords,
│ │ │ │ +
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
981 PATCH_TABLE *patchTable,
│ │ │ │ +
982 OmpEvaluator const *instance = NULL,
│ │ │ │ +
983 void * deviceContext = NULL) {
│ │ │ │ +
984
│ │ │ │ +
985 (void)instance; // unused
│ │ │ │ +
986 (void)deviceContext; // unused
│ │ │ │ +
987
│ │ │ │ +
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
995 numPatchCoords,
│ │ │ │ +
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
999 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1000 }
│ │ │ │ +
1001
│ │ │ │ +
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1037 int numPatchCoords,
│ │ │ │ +
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1039 PATCH_TABLE *patchTable,
│ │ │ │ +
1040 int fvarChannel,
│ │ │ │ +
1041 OmpEvaluator const *instance = NULL,
│ │ │ │ +
1042 void * deviceContext = NULL) {
│ │ │ │ +
1043
│ │ │ │ +
1044 (void)instance; // unused
│ │ │ │ +
1045 (void)deviceContext; // unused
│ │ │ │ +
1046
│ │ │ │ +
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1049 numPatchCoords,
│ │ │ │ +
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1054 }
│ │ │ │ +
1055
│ │ │ │ +
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1105 int numPatchCoords,
│ │ │ │ +
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1107 PATCH_TABLE *patchTable,
│ │ │ │ +
1108 int fvarChannel,
│ │ │ │ +
1109 OmpEvaluator const *instance = NULL,
│ │ │ │ +
1110 void * deviceContext = NULL) {
│ │ │ │ +
1111
│ │ │ │ +
1112 (void)instance; // unused
│ │ │ │ +
1113 (void)deviceContext; // unused
│ │ │ │ +
1114
│ │ │ │ +
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1119 numPatchCoords,
│ │ │ │ +
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1124 }
│ │ │ │ +
1125
│ │ │ │ +
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1196 int numPatchCoords,
│ │ │ │ +
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1198 PATCH_TABLE *patchTable,
│ │ │ │ +
1199 int fvarChannel,
│ │ │ │ +
1200 OmpEvaluator const *instance = NULL,
│ │ │ │ +
1201 void * deviceContext = NULL) {
│ │ │ │ +
1202
│ │ │ │ +
1203 (void)instance; // unused
│ │ │ │ +
1204 (void)deviceContext; // unused
│ │ │ │ +
1205
│ │ │ │ +
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
1213 numPatchCoords,
│ │ │ │ +
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1218 }
│ │ │ │ +
1219
│ │ │ │ +
1225
│ │ │ │ +
1226 static void Synchronize(void *deviceContext = NULL);
│ │ │ │ +
1227
│ │ │ │ +
1228 static void SetNumThreads(int numThreads);
│ │ │ │ +
1229};
│ │ │ │ +
1230
│ │ │ │ +
1231
│ │ │ │ +
1232} // end namespace Osd
│ │ │ │ +
1233
│ │ │ │ +
1234} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
1235using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
1236
│ │ │ │ +
1237} // end namespace OpenSubdiv
│ │ │ │ +
1238
│ │ │ │ +
1239
│ │ │ │ +
1240#endif // OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static GLLegacyGregoryPatchTable * Create(Far::PatchTable const *patchTable)
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:971
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: ompEvaluator.h:168
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:823
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: ompEvaluator.h:72
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: ompEvaluator.h:517
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:886
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: ompEvaluator.h:607
│ │ │ │ +
static void Synchronize(void *deviceContext=NULL)
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: ompEvaluator.h:303
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:454
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ + │ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glLegacyGregoryPatchTable.h │ │ │ │ │ +ompEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,113 +30,657 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include "../far/patchTable.h" │ │ │ │ │ - 31#include "../osd/nonCopyable.h" │ │ │ │ │ - 32#include "../osd/opengl.h" │ │ │ │ │ + 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 30#include "../osd/types.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ 33 │ │ │ │ │ 34namespace OpenSubdiv { │ │ │ │ │ 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ 37namespace Osd { │ │ │ │ │ 38 │ │ │ │ │ -39class GLLegacyGregoryPatchTable │ │ │ │ │ - 40 : private NonCopyable { │ │ │ │ │ - 41public: │ │ │ │ │ -42 ~GLLegacyGregoryPatchTable(); │ │ │ │ │ - 43 │ │ │ │ │ -44 static GLLegacyGregoryPatchTable *Create(Far::PatchTable const *patchTable); │ │ │ │ │ - 45 │ │ │ │ │ -46 void UpdateVertexBuffer(GLuint vbo); │ │ │ │ │ - 47 │ │ │ │ │ -48 GLuint GetVertexTextureBuffer() const { │ │ │ │ │ - 49 return _vertexTextureBuffer; │ │ │ │ │ - 50 } │ │ │ │ │ - 51 │ │ │ │ │ -52 GLuint GetVertexValenceTextureBuffer() const { │ │ │ │ │ - 53 return _vertexValenceTextureBuffer; │ │ │ │ │ - 54 } │ │ │ │ │ - 55 │ │ │ │ │ -56 GLuint GetQuadOffsetsTextureBuffer() const { │ │ │ │ │ - 57 return _quadOffsetsTextureBuffer; │ │ │ │ │ - 58 } │ │ │ │ │ - 59 │ │ │ │ │ -60 GLuint GetQuadOffsetsBase(Far::PatchDescriptor::Type type) { │ │ │ │ │ - 61 if (type == Far::PatchDescriptor::GREGORY_BOUNDARY) { │ │ │ │ │ - 62 return _quadOffsetsBase[1]; │ │ │ │ │ - 63 } │ │ │ │ │ - 64 return _quadOffsetsBase[0]; │ │ │ │ │ - 65 } │ │ │ │ │ - 66 │ │ │ │ │ - 67protected: │ │ │ │ │ -68 GLLegacyGregoryPatchTable(); │ │ │ │ │ - 69 │ │ │ │ │ - 70private: │ │ │ │ │ - 71 GLuint _vertexTextureBuffer; │ │ │ │ │ - 72 GLuint _vertexValenceTextureBuffer; │ │ │ │ │ - 73 GLuint _quadOffsetsTextureBuffer; │ │ │ │ │ - 74 GLuint _quadOffsetsBase[2]; // gregory, boundaryGregory │ │ │ │ │ - 75}; │ │ │ │ │ - 76 │ │ │ │ │ - 77 │ │ │ │ │ +39class OmpEvaluator { │ │ │ │ │ + 40public: │ │ │ │ │ + 46 │ │ │ │ │ + 71 template │ │ │ │ │ +72 static bool EvalStencils( │ │ │ │ │ + 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 76 const OmpEvaluator *instance = NULL, │ │ │ │ │ + 77 void * deviceContext = NULL) { │ │ │ │ │ 78 │ │ │ │ │ - 79} // end namespace Osd │ │ │ │ │ - 80 │ │ │ │ │ - 81} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 82using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 83 │ │ │ │ │ - 84} // end namespace OpenSubdiv │ │ │ │ │ - 85 │ │ │ │ │ - 86#endif // OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H │ │ │ │ │ + 79 (void)instance; // unused │ │ │ │ │ + 80 (void)deviceContext; // unused │ │ │ │ │ + 81 │ │ │ │ │ + 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ + 83 return false; │ │ │ │ │ + 84 │ │ │ │ │ + 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 87 &stencilTable->GetSizes()[0], │ │ │ │ │ + 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 90 &stencilTable->GetWeights()[0], │ │ │ │ │ + 91 /*start = */ 0, │ │ │ │ │ + 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 93 } │ │ │ │ │ + 94 │ │ │ │ │ +121 static bool EvalStencils( │ │ │ │ │ + 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 124 const int * sizes, │ │ │ │ │ + 125 const int * offsets, │ │ │ │ │ + 126 const int * indices, │ │ │ │ │ + 127 const float * weights, │ │ │ │ │ + 128 int start, int end); │ │ │ │ │ + 129 │ │ │ │ │ + 167 template │ │ │ │ │ +168 static bool EvalStencils( │ │ │ │ │ + 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 174 const OmpEvaluator *instance = NULL, │ │ │ │ │ + 175 void * deviceContext = NULL) { │ │ │ │ │ + 176 │ │ │ │ │ + 177 (void)instance; // unused │ │ │ │ │ + 178 (void)deviceContext; // unused │ │ │ │ │ + 179 │ │ │ │ │ + 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 184 &stencilTable->GetSizes()[0], │ │ │ │ │ + 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 187 &stencilTable->GetWeights()[0], │ │ │ │ │ + 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 190 /*start = */ 0, │ │ │ │ │ + 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 192 } │ │ │ │ │ + 193 │ │ │ │ │ +234 static bool EvalStencils( │ │ │ │ │ + 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 239 const int * sizes, │ │ │ │ │ + 240 const int * offsets, │ │ │ │ │ + 241 const int * indices, │ │ │ │ │ + 242 const float * weights, │ │ │ │ │ + 243 const float * duWeights, │ │ │ │ │ + 244 const float * dvWeights, │ │ │ │ │ + 245 int start, int end); │ │ │ │ │ + 246 │ │ │ │ │ + 302 template │ │ │ │ │ +303 static bool EvalStencils( │ │ │ │ │ + 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 312 const OmpEvaluator *instance = NULL, │ │ │ │ │ + 313 void * deviceContext = NULL) { │ │ │ │ │ + 314 │ │ │ │ │ + 315 (void)instance; // unused │ │ │ │ │ + 316 (void)deviceContext; // unused │ │ │ │ │ + 317 │ │ │ │ │ + 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 325 &stencilTable->GetSizes()[0], │ │ │ │ │ + 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 328 &stencilTable->GetWeights()[0], │ │ │ │ │ + 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ + 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ + 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ + 334 /*start = */ 0, │ │ │ │ │ + 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ +399 static bool EvalStencils( │ │ │ │ │ + 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 407 const int * sizes, │ │ │ │ │ + 408 const int * offsets, │ │ │ │ │ + 409 const int * indices, │ │ │ │ │ + 410 const float * weights, │ │ │ │ │ + 411 const float * duWeights, │ │ │ │ │ + 412 const float * dvWeights, │ │ │ │ │ + 413 const float * duuWeights, │ │ │ │ │ + 414 const float * duvWeights, │ │ │ │ │ + 415 const float * dvvWeights, │ │ │ │ │ + 416 int start, int end); │ │ │ │ │ + 417 │ │ │ │ │ + 423 │ │ │ │ │ + 452 template │ │ │ │ │ +454 static bool EvalPatches( │ │ │ │ │ + 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 457 int numPatchCoords, │ │ │ │ │ + 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 459 PATCH_TABLE *patchTable, │ │ │ │ │ + 460 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 461 void * deviceContext = NULL) { │ │ │ │ │ + 462 │ │ │ │ │ + 463 (void)instance; // unused │ │ │ │ │ + 464 (void)deviceContext; // unused │ │ │ │ │ + 465 │ │ │ │ │ + 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 468 numPatchCoords, │ │ │ │ │ + 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 473 } │ │ │ │ │ + 474 │ │ │ │ │ + 515 template │ │ │ │ │ +517 static bool EvalPatches( │ │ │ │ │ + 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 522 int numPatchCoords, │ │ │ │ │ + 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 524 PATCH_TABLE *patchTable, │ │ │ │ │ + 525 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 526 void * deviceContext = NULL) { │ │ │ │ │ + 527 │ │ │ │ │ + 528 (void)instance; // unused │ │ │ │ │ + 529 (void)deviceContext; // unused │ │ │ │ │ + 530 │ │ │ │ │ + 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 533 // so that downcast isn't needed there. │ │ │ │ │ + 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 535 // │ │ │ │ │ + 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 540 numPatchCoords, │ │ │ │ │ + 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 545 } │ │ │ │ │ + 546 │ │ │ │ │ + 605 template │ │ │ │ │ +607 static bool EvalPatches( │ │ │ │ │ + 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 615 int numPatchCoords, │ │ │ │ │ + 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 617 PATCH_TABLE *patchTable, │ │ │ │ │ + 618 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 619 void * deviceContext = NULL) { │ │ │ │ │ + 620 │ │ │ │ │ + 621 (void)instance; // unused │ │ │ │ │ + 622 (void)deviceContext; // unused │ │ │ │ │ + 623 │ │ │ │ │ + 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 626 // so that downcast isn't needed there. │ │ │ │ │ + 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 628 // │ │ │ │ │ + 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 636 numPatchCoords, │ │ │ │ │ + 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 641 } │ │ │ │ │ + 642 │ │ │ │ │ +670 static bool EvalPatches( │ │ │ │ │ + 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 673 int numPatchCoords, │ │ │ │ │ + 674 const PatchCoord *patchCoords, │ │ │ │ │ + 675 const PatchArray *patchArrays, │ │ │ │ │ + 676 const int *patchIndexBuffer, │ │ │ │ │ + 677 const PatchParam *patchParamBuffer); │ │ │ │ │ + 678 │ │ │ │ │ +716 static bool EvalPatches( │ │ │ │ │ + 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 721 int numPatchCoords, │ │ │ │ │ + 722 PatchCoord const *patchCoords, │ │ │ │ │ + 723 PatchArray const *patchArrays, │ │ │ │ │ + 724 const int *patchIndexBuffer, │ │ │ │ │ + 725 PatchParam const *patchParamBuffer); │ │ │ │ │ + 726 │ │ │ │ │ +779 static bool EvalPatches( │ │ │ │ │ + 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 787 int numPatchCoords, │ │ │ │ │ + 788 PatchCoord const *patchCoords, │ │ │ │ │ + 789 PatchArray const *patchArrays, │ │ │ │ │ + 790 const int *patchIndexBuffer, │ │ │ │ │ + 791 PatchParam const *patchParamBuffer); │ │ │ │ │ + 792 │ │ │ │ │ + 821 template │ │ │ │ │ +823 static bool EvalPatchesVarying( │ │ │ │ │ + 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 826 int numPatchCoords, │ │ │ │ │ + 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 828 PATCH_TABLE *patchTable, │ │ │ │ │ + 829 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 830 void * deviceContext = NULL) { │ │ │ │ │ + 831 │ │ │ │ │ + 832 (void)instance; // unused │ │ │ │ │ + 833 (void)deviceContext; // unused │ │ │ │ │ + 834 │ │ │ │ │ + 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 837 numPatchCoords, │ │ │ │ │ + 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 842 } │ │ │ │ │ + 843 │ │ │ │ │ + 884 template │ │ │ │ │ +886 static bool EvalPatchesVarying( │ │ │ │ │ + 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 891 int numPatchCoords, │ │ │ │ │ + 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 893 PATCH_TABLE *patchTable, │ │ │ │ │ + 894 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 895 void * deviceContext = NULL) { │ │ │ │ │ + 896 │ │ │ │ │ + 897 (void)instance; // unused │ │ │ │ │ + 898 (void)deviceContext; // unused │ │ │ │ │ + 899 │ │ │ │ │ + 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 904 numPatchCoords, │ │ │ │ │ + 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 909 } │ │ │ │ │ + 910 │ │ │ │ │ + 969 template │ │ │ │ │ +971 static bool EvalPatchesVarying( │ │ │ │ │ + 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 979 int numPatchCoords, │ │ │ │ │ + 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 981 PATCH_TABLE *patchTable, │ │ │ │ │ + 982 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 983 void * deviceContext = NULL) { │ │ │ │ │ + 984 │ │ │ │ │ + 985 (void)instance; // unused │ │ │ │ │ + 986 (void)deviceContext; // unused │ │ │ │ │ + 987 │ │ │ │ │ + 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 995 numPatchCoords, │ │ │ │ │ + 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1000 } │ │ │ │ │ + 1001 │ │ │ │ │ + 1032 template │ │ │ │ │ +1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1037 int numPatchCoords, │ │ │ │ │ + 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1039 PATCH_TABLE *patchTable, │ │ │ │ │ + 1040 int fvarChannel, │ │ │ │ │ + 1041 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 1042 void * deviceContext = NULL) { │ │ │ │ │ + 1043 │ │ │ │ │ + 1044 (void)instance; // unused │ │ │ │ │ + 1045 (void)deviceContext; // unused │ │ │ │ │ + 1046 │ │ │ │ │ + 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1049 numPatchCoords, │ │ │ │ │ + 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1054 } │ │ │ │ │ + 1055 │ │ │ │ │ + 1098 template │ │ │ │ │ +1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1105 int numPatchCoords, │ │ │ │ │ + 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1107 PATCH_TABLE *patchTable, │ │ │ │ │ + 1108 int fvarChannel, │ │ │ │ │ + 1109 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 1110 void * deviceContext = NULL) { │ │ │ │ │ + 1111 │ │ │ │ │ + 1112 (void)instance; // unused │ │ │ │ │ + 1113 (void)deviceContext; // unused │ │ │ │ │ + 1114 │ │ │ │ │ + 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1119 numPatchCoords, │ │ │ │ │ + 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1124 } │ │ │ │ │ + 1125 │ │ │ │ │ + 1186 template │ │ │ │ │ +1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1196 int numPatchCoords, │ │ │ │ │ + 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1198 PATCH_TABLE *patchTable, │ │ │ │ │ + 1199 int fvarChannel, │ │ │ │ │ + 1200 OmpEvaluator const *instance = NULL, │ │ │ │ │ + 1201 void * deviceContext = NULL) { │ │ │ │ │ + 1202 │ │ │ │ │ + 1203 (void)instance; // unused │ │ │ │ │ + 1204 (void)deviceContext; // unused │ │ │ │ │ + 1205 │ │ │ │ │ + 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 1213 numPatchCoords, │ │ │ │ │ + 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1218 } │ │ │ │ │ + 1219 │ │ │ │ │ + 1225 │ │ │ │ │ +1226 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ + 1227 │ │ │ │ │ +1228 static void SetNumThreads(int numThreads); │ │ │ │ │ + 1229}; │ │ │ │ │ + 1230 │ │ │ │ │ + 1231 │ │ │ │ │ + 1232} // end namespace Osd │ │ │ │ │ + 1233 │ │ │ │ │ + 1234} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 1235using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 1236 │ │ │ │ │ + 1237} // end namespace OpenSubdiv │ │ │ │ │ + 1238 │ │ │ │ │ + 1239 │ │ │ │ │ + 1240#endif // OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: patchDescriptor.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY │ │ │ │ │ -@ GREGORY_BOUNDARY │ │ │ │ │ -Definition: patchDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable │ │ │ │ │ -Definition: glLegacyGregoryPatchTable.h:40 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -GetVertexValenceTextureBuffer │ │ │ │ │ -GLuint GetVertexValenceTextureBuffer() const │ │ │ │ │ -Definition: glLegacyGregoryPatchTable.h:52 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsTextureBuffer │ │ │ │ │ -GLuint GetQuadOffsetsTextureBuffer() const │ │ │ │ │ -Definition: glLegacyGregoryPatchTable.h:56 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -~GLLegacyGregoryPatchTable │ │ │ │ │ -~GLLegacyGregoryPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -GLLegacyGregoryPatchTable │ │ │ │ │ -GLLegacyGregoryPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -UpdateVertexBuffer │ │ │ │ │ -void UpdateVertexBuffer(GLuint vbo) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -GetQuadOffsetsBase │ │ │ │ │ -GLuint GetQuadOffsetsBase(Far::PatchDescriptor::Type type) │ │ │ │ │ -Definition: glLegacyGregoryPatchTable.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable:: │ │ │ │ │ -GetVertexTextureBuffer │ │ │ │ │ -GLuint GetVertexTextureBuffer() const │ │ │ │ │ -Definition: glLegacyGregoryPatchTable.h:48 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::Create │ │ │ │ │ -static GLLegacyGregoryPatchTable * Create(Far::PatchTable const *patchTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator │ │ │ │ │ +Definition: ompEvaluator.h:39 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:1034 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ +Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ +output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:971 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ +OmpEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: ompEvaluator.h:168 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:823 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:1100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ +float *dvvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, const OmpEvaluator *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function. This function has a same signature as │ │ │ │ │ +other device kernels hav... │ │ │ │ │ +Definition: ompEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ +const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ +PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: ompEvaluator.h:517 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:886 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: ompEvaluator.h:607 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +const OmpEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: ompEvaluator.h:303 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:454 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ +PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::SetNumThreads │ │ │ │ │ +static void SetNumThreads(int numThreads) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ +PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: ompEvaluator.h:1188 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ +Coordinates set on a patch table. │ │ │ │ │ +Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ +Definition: types.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ +Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glLegacyGregoryPatchTable.h │ │ │ │ │ + * ompEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00866.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/opengl.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,48 +80,24 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
glPatchTable.h File Reference
│ │ │ │ +
opengl.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include "../version.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include <vector>
│ │ │ │ +
#include <GL/gl.h>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  GLPatchTable
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,31 +4,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -glPatchTable.h File Reference │ │ │ │ │ -#include "../version.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/opengl.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include │ │ │ │ │ +opengl.h File Reference │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  GLPatchTable │ │ │ │ │ -  │ │ │ │ │ - Namespaces │ │ │ │ │ -namespace  OpenSubdiv │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ -  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glPatchTable.h │ │ │ │ │ + * opengl.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00866_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/glPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/opengl.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
glPatchTable.h
│ │ │ │ +
opengl.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,172 +107,47 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include "../osd/nonCopyable.h"
│ │ │ │ -
31#include "../osd/opengl.h"
│ │ │ │ -
32#include "../osd/types.h"
│ │ │ │ -
33
│ │ │ │ -
34#include <vector>
│ │ │ │ -
35
│ │ │ │ -
36namespace OpenSubdiv {
│ │ │ │ -
37namespace OPENSUBDIV_VERSION {
│ │ │ │ -
38
│ │ │ │ -
39namespace Far{
│ │ │ │ -
40 class PatchTable;
│ │ │ │ -
41};
│ │ │ │ -
42
│ │ │ │ -
43namespace Osd {
│ │ │ │ -
44
│ │ │ │ -
45class GLPatchTable : private NonCopyable<GLPatchTable> {
│ │ │ │ -
46public:
│ │ │ │ -
47 typedef GLuint VertexBufferBinding;
│ │ │ │ -
48
│ │ │ │ - │ │ │ │ -
50
│ │ │ │ -
51 static GLPatchTable *Create(Far::PatchTable const *farPatchTable,
│ │ │ │ -
52 void *deviceContext = NULL);
│ │ │ │ -
53
│ │ │ │ - │ │ │ │ -
56 return _patchArrays;
│ │ │ │ -
57 }
│ │ │ │ -
58
│ │ │ │ -
60 GLuint GetPatchIndexBuffer() const {
│ │ │ │ -
61 return _patchIndexBuffer;
│ │ │ │ -
62 }
│ │ │ │ -
63
│ │ │ │ -
65 GLuint GetPatchParamBuffer() const {
│ │ │ │ -
66 return _patchParamBuffer;
│ │ │ │ -
67 }
│ │ │ │ -
68
│ │ │ │ - │ │ │ │ -
71 return _patchIndexTexture;
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ - │ │ │ │ -
76 return _patchParamTexture;
│ │ │ │ -
77 }
│ │ │ │ -
78
│ │ │ │ - │ │ │ │ - │ │ │ │ -
82 }
│ │ │ │ -
83
│ │ │ │ - │ │ │ │ - │ │ │ │ -
87 }
│ │ │ │ -
88
│ │ │ │ - │ │ │ │ - │ │ │ │ -
92 }
│ │ │ │ -
93
│ │ │ │ -
95 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); }
│ │ │ │ -
96
│ │ │ │ -
98 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const {
│ │ │ │ -
99 return _fvarPatchArrays[fvarChannel];
│ │ │ │ -
100 }
│ │ │ │ -
101
│ │ │ │ -
103 GLuint GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ -
104 return _fvarIndexBuffers[fvarChannel];
│ │ │ │ -
105 }
│ │ │ │ -
106
│ │ │ │ -
108 GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel = 0) const {
│ │ │ │ -
109 return _fvarIndexTextures[fvarChannel];
│ │ │ │ -
110 }
│ │ │ │ -
111
│ │ │ │ -
113 GLuint GetFVarPatchParamBuffer(int fvarChannel = 0) const {
│ │ │ │ -
114 return _fvarParamBuffers[fvarChannel];
│ │ │ │ -
115 }
│ │ │ │ -
116
│ │ │ │ -
118 GLuint GetFVarPatchParamTextureBuffer(int fvarChannel = 0) const {
│ │ │ │ -
119 return _fvarParamTextures[fvarChannel];
│ │ │ │ -
120 }
│ │ │ │ -
121
│ │ │ │ -
122protected:
│ │ │ │ - │ │ │ │ -
124
│ │ │ │ -
125 // allocate buffers from patchTable
│ │ │ │ -
126 bool allocate(Far::PatchTable const *farPatchTable);
│ │ │ │ -
127
│ │ │ │ - │ │ │ │ -
129
│ │ │ │ - │ │ │ │ - │ │ │ │ -
132
│ │ │ │ - │ │ │ │ - │ │ │ │ -
135
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
139
│ │ │ │ -
140 std::vector<PatchArrayVector> _fvarPatchArrays;
│ │ │ │ -
141 std::vector<GLuint> _fvarIndexBuffers;
│ │ │ │ -
142 std::vector<GLuint> _fvarIndexTextures;
│ │ │ │ -
143
│ │ │ │ -
144 std::vector<GLuint> _fvarParamBuffers;
│ │ │ │ -
145 std::vector<GLuint> _fvarParamTextures;
│ │ │ │ -
146};
│ │ │ │ -
147
│ │ │ │ -
148
│ │ │ │ -
149} // end namespace Osd
│ │ │ │ -
150
│ │ │ │ -
151} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
152using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
153
│ │ │ │ -
154} // end namespace OpenSubdiv
│ │ │ │ -
155
│ │ │ │ -
156#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H
│ │ │ │ - │ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
PatchArrayVector const & GetPatchArrays() const
Returns the patch arrays for vertex index buffer data.
Definition: glPatchTable.h:55
│ │ │ │ -
GLuint GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying control vertices.
Definition: glPatchTable.h:103
│ │ │ │ - │ │ │ │ - │ │ │ │ -
GLuint GetPatchParamTextureBuffer() const
Returns the GL texture buffer containing the patch parameter.
Definition: glPatchTable.h:75
│ │ │ │ - │ │ │ │ -
bool allocate(Far::PatchTable const *farPatchTable)
│ │ │ │ -
static GLPatchTable * Create(Far::PatchTable const *farPatchTable, void *deviceContext=NULL)
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
GLuint GetPatchParamBuffer() const
Returns the GL index buffer containing the patch parameter.
Definition: glPatchTable.h:65
│ │ │ │ -
GLuint GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying patch params.
Definition: glPatchTable.h:113
│ │ │ │ - │ │ │ │ - │ │ │ │ -
GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel=0) const
Returns the GL texture buffer containing face-varying control vertices.
Definition: glPatchTable.h:108
│ │ │ │ -
GLuint GetFVarPatchParamTextureBuffer(int fvarChannel=0) const
Returns the GL texture buffer containing face-varying patch params.
Definition: glPatchTable.h:118
│ │ │ │ -
GLuint GetPatchIndexBuffer() const
Returns the GL index buffer containing the patch control vertices.
Definition: glPatchTable.h:60
│ │ │ │ -
int GetNumFVarChannels() const
Returns the number of face-varying channel buffers.
Definition: glPatchTable.h:95
│ │ │ │ -
PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const
Returns the patch arrays for face-varying index buffer data.
Definition: glPatchTable.h:98
│ │ │ │ - │ │ │ │ - │ │ │ │ -
std::vector< PatchArrayVector > _fvarPatchArrays
Definition: glPatchTable.h:140
│ │ │ │ -
GLuint GetPatchIndexTextureBuffer() const
Returns the GL texture buffer containing the patch control vertices.
Definition: glPatchTable.h:70
│ │ │ │ -
GLuint GetVaryingPatchIndexTextureBuffer() const
Returns the GL texture buffer containing the varying control vertices.
Definition: glPatchTable.h:90
│ │ │ │ - │ │ │ │ -
GLuint GetVaryingPatchIndexBuffer() const
Returns the GL index buffer containing the varying control vertices.
Definition: glPatchTable.h:85
│ │ │ │ -
PatchArrayVector const & GetVaryingPatchArrays() const
Returns the patch arrays for varying index buffer data.
Definition: glPatchTable.h:80
│ │ │ │ - │ │ │ │ +
28#if defined(__APPLE__)
│ │ │ │ +
29 #include "TargetConditionals.h"
│ │ │ │ +
30 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
│ │ │ │ +
31 #include <OpenGLES/ES2/gl.h>
│ │ │ │ +
32 #else
│ │ │ │ +
33 #if defined(OSD_USES_GLEW)
│ │ │ │ +
34 #include <GL/glew.h>
│ │ │ │ +
35 #else
│ │ │ │ +
36 #include <OpenGL/gl3.h>
│ │ │ │ +
37 #endif
│ │ │ │ +
38 #endif
│ │ │ │ +
39#elif defined(ANDROID)
│ │ │ │ +
40 #include <GLES2/gl2.h>
│ │ │ │ +
41#else
│ │ │ │ +
42 #if defined(_WIN32)
│ │ │ │ +
43 #define WIN32_LEAN_AND_MEAN
│ │ │ │ +
44 #include <windows.h>
│ │ │ │ +
45 #endif
│ │ │ │ +
46 #if defined(OSD_USES_GLEW)
│ │ │ │ +
47 #include <GL/glew.h>
│ │ │ │ +
48 #else
│ │ │ │ +
49 #include <GL/gl.h>
│ │ │ │ +
50 #endif
│ │ │ │ +
51#endif
│ │ │ │ +
52
│ │ │ │ +
53#endif // OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -glPatchTable.h │ │ │ │ │ +opengl.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,249 +30,40 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include "../osd/nonCopyable.h" │ │ │ │ │ - 31#include "../osd/opengl.h" │ │ │ │ │ - 32#include "../osd/types.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34#include │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace OpenSubdiv { │ │ │ │ │ - 37namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 38 │ │ │ │ │ - 39namespace Far{ │ │ │ │ │ - 40 class PatchTable; │ │ │ │ │ - 41}; │ │ │ │ │ - 42 │ │ │ │ │ - 43namespace Osd { │ │ │ │ │ - 44 │ │ │ │ │ -45class GLPatchTable : private NonCopyable { │ │ │ │ │ - 46public: │ │ │ │ │ -47 typedef GLuint VertexBufferBinding; │ │ │ │ │ - 48 │ │ │ │ │ -49 ~GLPatchTable(); │ │ │ │ │ - 50 │ │ │ │ │ -51 static GLPatchTable *Create(Far::PatchTable const *farPatchTable, │ │ │ │ │ - 52 void *deviceContext = NULL); │ │ │ │ │ - 53 │ │ │ │ │ -55 PatchArrayVector const &GetPatchArrays() const { │ │ │ │ │ - 56 return _patchArrays; │ │ │ │ │ - 57 } │ │ │ │ │ - 58 │ │ │ │ │ -60 GLuint GetPatchIndexBuffer() const { │ │ │ │ │ - 61 return _patchIndexBuffer; │ │ │ │ │ - 62 } │ │ │ │ │ - 63 │ │ │ │ │ -65 GLuint GetPatchParamBuffer() const { │ │ │ │ │ - 66 return _patchParamBuffer; │ │ │ │ │ - 67 } │ │ │ │ │ - 68 │ │ │ │ │ -70 GLuint GetPatchIndexTextureBuffer() const { │ │ │ │ │ - 71 return _patchIndexTexture; │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ -75 GLuint GetPatchParamTextureBuffer() const { │ │ │ │ │ - 76 return _patchParamTexture; │ │ │ │ │ - 77 } │ │ │ │ │ - 78 │ │ │ │ │ -80 PatchArrayVector const &GetVaryingPatchArrays() const { │ │ │ │ │ - 81 return _varyingPatchArrays; │ │ │ │ │ - 82 } │ │ │ │ │ - 83 │ │ │ │ │ -85 GLuint GetVaryingPatchIndexBuffer() const { │ │ │ │ │ - 86 return _varyingIndexBuffer; │ │ │ │ │ - 87 } │ │ │ │ │ - 88 │ │ │ │ │ -90 GLuint GetVaryingPatchIndexTextureBuffer() const { │ │ │ │ │ - 91 return _varyingIndexTexture; │ │ │ │ │ - 92 } │ │ │ │ │ - 93 │ │ │ │ │ -95 int GetNumFVarChannels() const { return (int)_fvarPatchArrays.size(); } │ │ │ │ │ - 96 │ │ │ │ │ -98 PatchArrayVector const &GetFVarPatchArrays(int fvarChannel = 0) const { │ │ │ │ │ - 99 return _fvarPatchArrays[fvarChannel]; │ │ │ │ │ - 100 } │ │ │ │ │ - 101 │ │ │ │ │ -103 GLuint GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 104 return _fvarIndexBuffers[fvarChannel]; │ │ │ │ │ - 105 } │ │ │ │ │ - 106 │ │ │ │ │ -108 GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 109 return _fvarIndexTextures[fvarChannel]; │ │ │ │ │ - 110 } │ │ │ │ │ - 111 │ │ │ │ │ -113 GLuint GetFVarPatchParamBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 114 return _fvarParamBuffers[fvarChannel]; │ │ │ │ │ - 115 } │ │ │ │ │ - 116 │ │ │ │ │ -118 GLuint GetFVarPatchParamTextureBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 119 return _fvarParamTextures[fvarChannel]; │ │ │ │ │ - 120 } │ │ │ │ │ - 121 │ │ │ │ │ - 122protected: │ │ │ │ │ -123 GLPatchTable(); │ │ │ │ │ - 124 │ │ │ │ │ - 125 // allocate buffers from patchTable │ │ │ │ │ -126 bool allocate(Far::PatchTable const *farPatchTable); │ │ │ │ │ - 127 │ │ │ │ │ -128 PatchArrayVector _patchArrays; │ │ │ │ │ - 129 │ │ │ │ │ -130 GLuint _patchIndexBuffer; │ │ │ │ │ -131 GLuint _patchParamBuffer; │ │ │ │ │ - 132 │ │ │ │ │ -133 GLuint _patchIndexTexture; │ │ │ │ │ -134 GLuint _patchParamTexture; │ │ │ │ │ - 135 │ │ │ │ │ -136 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ -137 GLuint _varyingIndexBuffer; │ │ │ │ │ -138 GLuint _varyingIndexTexture; │ │ │ │ │ - 139 │ │ │ │ │ -140 std::vector _fvarPatchArrays; │ │ │ │ │ -141 std::vector _fvarIndexBuffers; │ │ │ │ │ -142 std::vector _fvarIndexTextures; │ │ │ │ │ - 143 │ │ │ │ │ -144 std::vector _fvarParamBuffers; │ │ │ │ │ -145 std::vector _fvarParamTextures; │ │ │ │ │ - 146}; │ │ │ │ │ - 147 │ │ │ │ │ - 148 │ │ │ │ │ - 149} // end namespace Osd │ │ │ │ │ - 150 │ │ │ │ │ - 151} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 152using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 153 │ │ │ │ │ - 154} // end namespace OpenSubdiv │ │ │ │ │ - 155 │ │ │ │ │ - 156#endif // OPENSUBDIV3_OSD_GL_PATCH_TABLE_H │ │ │ │ │ -OpenSubdiv │ │ │ │ │ -Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable │ │ │ │ │ -Definition: glPatchTable.h:45 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::VertexBufferBinding │ │ │ │ │ -GLuint VertexBufferBinding │ │ │ │ │ -Definition: glPatchTable.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarIndexBuffers │ │ │ │ │ -std::vector< GLuint > _fvarIndexBuffers │ │ │ │ │ -Definition: glPatchTable.h:141 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchArrays │ │ │ │ │ -PatchArrayVector const & GetPatchArrays() const │ │ │ │ │ -Returns the patch arrays for vertex index buffer data. │ │ │ │ │ -Definition: glPatchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ -GLuint GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the GL index buffer containing face-varying control vertices. │ │ │ │ │ -Definition: glPatchTable.h:103 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::~GLPatchTable │ │ │ │ │ -~GLPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarParamBuffers │ │ │ │ │ -std::vector< GLuint > _fvarParamBuffers │ │ │ │ │ -Definition: glPatchTable.h:144 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchParamTextureBuffer │ │ │ │ │ -GLuint GetPatchParamTextureBuffer() const │ │ │ │ │ -Returns the GL texture buffer containing the patch parameter. │ │ │ │ │ -Definition: glPatchTable.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingIndexBuffer │ │ │ │ │ -GLuint _varyingIndexBuffer │ │ │ │ │ -Definition: glPatchTable.h:137 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::allocate │ │ │ │ │ -bool allocate(Far::PatchTable const *farPatchTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::Create │ │ │ │ │ -static GLPatchTable * Create(Far::PatchTable const *farPatchTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingIndexTexture │ │ │ │ │ -GLuint _varyingIndexTexture │ │ │ │ │ -Definition: glPatchTable.h:138 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarParamTextures │ │ │ │ │ -std::vector< GLuint > _fvarParamTextures │ │ │ │ │ -Definition: glPatchTable.h:145 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchArrays │ │ │ │ │ -PatchArrayVector _patchArrays │ │ │ │ │ -Definition: glPatchTable.h:128 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchIndexBuffer │ │ │ │ │ -GLuint _patchIndexBuffer │ │ │ │ │ -Definition: glPatchTable.h:130 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchParamBuffer │ │ │ │ │ -GLuint GetPatchParamBuffer() const │ │ │ │ │ -Returns the GL index buffer containing the patch parameter. │ │ │ │ │ -Definition: glPatchTable.h:65 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ -GLuint GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the GL index buffer containing face-varying patch params. │ │ │ │ │ -Definition: glPatchTable.h:113 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchParamTexture │ │ │ │ │ -GLuint _patchParamTexture │ │ │ │ │ -Definition: glPatchTable.h:134 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GLPatchTable │ │ │ │ │ -GLPatchTable() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ -GetFVarPatchIndexTextureBuffer │ │ │ │ │ -GLuint GetFVarPatchIndexTextureBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the GL texture buffer containing face-varying control vertices. │ │ │ │ │ -Definition: glPatchTable.h:108 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ -GetFVarPatchParamTextureBuffer │ │ │ │ │ -GLuint GetFVarPatchParamTextureBuffer(int fvarChannel=0) const │ │ │ │ │ -Returns the GL texture buffer containing face-varying patch params. │ │ │ │ │ -Definition: glPatchTable.h:118 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchIndexBuffer │ │ │ │ │ -GLuint GetPatchIndexBuffer() const │ │ │ │ │ -Returns the GL index buffer containing the patch control vertices. │ │ │ │ │ -Definition: glPatchTable.h:60 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Returns the number of face-varying channel buffers. │ │ │ │ │ -Definition: glPatchTable.h:95 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetFVarPatchArrays │ │ │ │ │ -PatchArrayVector const & GetFVarPatchArrays(int fvarChannel=0) const │ │ │ │ │ -Returns the patch arrays for face-varying index buffer data. │ │ │ │ │ -Definition: glPatchTable.h:98 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarIndexTextures │ │ │ │ │ -std::vector< GLuint > _fvarIndexTextures │ │ │ │ │ -Definition: glPatchTable.h:142 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchIndexTexture │ │ │ │ │ -GLuint _patchIndexTexture │ │ │ │ │ -Definition: glPatchTable.h:133 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_fvarPatchArrays │ │ │ │ │ -std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ -Definition: glPatchTable.h:140 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetPatchIndexTextureBuffer │ │ │ │ │ -GLuint GetPatchIndexTextureBuffer() const │ │ │ │ │ -Returns the GL texture buffer containing the patch control vertices. │ │ │ │ │ -Definition: glPatchTable.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable:: │ │ │ │ │ -GetVaryingPatchIndexTextureBuffer │ │ │ │ │ -GLuint GetVaryingPatchIndexTextureBuffer() const │ │ │ │ │ -Returns the GL texture buffer containing the varying control vertices. │ │ │ │ │ -Definition: glPatchTable.h:90 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_varyingPatchArrays │ │ │ │ │ -PatchArrayVector _varyingPatchArrays │ │ │ │ │ -Definition: glPatchTable.h:136 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ -GLuint GetVaryingPatchIndexBuffer() const │ │ │ │ │ -Returns the GL index buffer containing the varying control vertices. │ │ │ │ │ -Definition: glPatchTable.h:85 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::GetVaryingPatchArrays │ │ │ │ │ -PatchArrayVector const & GetVaryingPatchArrays() const │ │ │ │ │ -Returns the patch arrays for varying index buffer data. │ │ │ │ │ -Definition: glPatchTable.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLPatchTable::_patchParamBuffer │ │ │ │ │ -GLuint _patchParamBuffer │ │ │ │ │ -Definition: glPatchTable.h:131 │ │ │ │ │ + 28#if defined(__APPLE__) │ │ │ │ │ + 29 #include "TargetConditionals.h" │ │ │ │ │ + 30 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR │ │ │ │ │ + 31 #include │ │ │ │ │ + 32 #else │ │ │ │ │ + 33 #if defined(OSD_USES_GLEW) │ │ │ │ │ + 34 #include │ │ │ │ │ + 35 #else │ │ │ │ │ + 36 #include │ │ │ │ │ + 37 #endif │ │ │ │ │ + 38 #endif │ │ │ │ │ + 39#elif defined(ANDROID) │ │ │ │ │ + 40 #include │ │ │ │ │ + 41#else │ │ │ │ │ + 42 #if defined(_WIN32) │ │ │ │ │ + 43 #define WIN32_LEAN_AND_MEAN │ │ │ │ │ + 44 #include │ │ │ │ │ + 45 #endif │ │ │ │ │ + 46 #if defined(OSD_USES_GLEW) │ │ │ │ │ + 47 #include │ │ │ │ │ + 48 #else │ │ │ │ │ + 49 #include │ │ │ │ │ + 50 #endif │ │ │ │ │ + 51#endif │ │ │ │ │ + 52 │ │ │ │ │ + 53#endif // OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * glPatchTable.h │ │ │ │ │ + * opengl.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00869.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuGLVertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/mesh.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -82,43 +82,108 @@ │ │ │ │ name="MSearchResults" id="MSearchResults"> │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
cpuGLVertexBuffer.h File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Enumerations | │ │ │ │ +Functions
│ │ │ │ +
mesh.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <cstddef>
│ │ │ │ -#include "../osd/opengl.h"
│ │ │ │ +#include <bitset>
│ │ │ │ +#include <cassert>
│ │ │ │ +#include <cstring>
│ │ │ │ +#include <vector>
│ │ │ │ +#include "../far/topologyRefiner.h"
│ │ │ │ +#include "../far/patchTableFactory.h"
│ │ │ │ +#include "../far/stencilTable.h"
│ │ │ │ +#include "../far/stencilTableFactory.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CpuGLVertexBuffer
 Concrete vertex buffer class for cpu subdivision and OpenGL drawing. More...
class  MeshInterface< PATCH_TABLE >
 
class  EvaluatorCacheT< EVALUATOR >
 
struct  EvaluatorCacheT< EVALUATOR >::Entry
 
class  Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

typedef std::bitset< NUM_MESH_BITS > MeshBitset
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Enumerations

enum  MeshBits {
│ │ │ │ +  MeshAdaptive = 0 │ │ │ │ +,
│ │ │ │ +  MeshInterleaveVarying = 1 │ │ │ │ +,
│ │ │ │ +  MeshFVarData = 2 │ │ │ │ +,
│ │ │ │ +  MeshFVarAdaptive = 3 │ │ │ │ +,
│ │ │ │ +  MeshUseSmoothCornerPatch = 4 │ │ │ │ +,
│ │ │ │ +  MeshUseSingleCreasePatch = 5 │ │ │ │ +,
│ │ │ │ +  MeshUseInfSharpPatch = 6 │ │ │ │ +,
│ │ │ │ +  MeshEndCapBilinearBasis = 7 │ │ │ │ +,
│ │ │ │ +  MeshEndCapBSplineBasis = 8 │ │ │ │ +,
│ │ │ │ +  MeshEndCapGregoryBasis = 9 │ │ │ │ +,
│ │ │ │ +  MeshEndCapLegacyGregory = 10 │ │ │ │ +,
│ │ │ │ +  NUM_MESH_BITS = 11 │ │ │ │ +
│ │ │ │ + }
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<typename STENCIL_TABLE , typename SRC_STENCIL_TABLE , typename DEVICE_CONTEXT >
STENCIL_TABLE const * convertToCompatibleStencilTable (SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT *context)
 
template<>
Far::StencilTable const * convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, void > (Far::StencilTable const *table, void *)
 
template<>
Far::LimitStencilTable const * convertToCompatibleStencilTable< Far::LimitStencilTable, Far::LimitStencilTable, void > (Far::LimitStencilTable const *table, void *)
 
template<>
Far::StencilTable const * convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, ID3D11DeviceContext > (Far::StencilTable const *table, ID3D11DeviceContext *)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,29 +4,83 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -cpuGLVertexBuffer.h File Reference │ │ │ │ │ +Classes | Namespaces | Typedefs | Enumerations | Functions │ │ │ │ │ +mesh.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ -#include "../osd/opengl.h" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "../far/topologyRefiner.h" │ │ │ │ │ +#include "../far/patchTableFactory.h" │ │ │ │ │ +#include "../far/stencilTable.h" │ │ │ │ │ +#include "../far/stencilTableFactory.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CpuGLVertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for cpu subdivision and OpenGL drawing. │ │ │ │ │ - More... │ │ │ │ │ + class  MeshInterface<_PATCH_TABLE_> │ │ │ │ │ +  │ │ │ │ │ + class  EvaluatorCacheT<_EVALUATOR_> │ │ │ │ │ +  │ │ │ │ │ +struct  EvaluatorCacheT<_EVALUATOR_>::Entry │ │ │ │ │ +  │ │ │ │ │ + class  Mesh<_VERTEX_BUFFER,_STENCIL_TABLE,_EVALUATOR,_PATCH_TABLE, │ │ │ │ │ + DEVICE_CONTEXT_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ + Typedefs │ │ │ │ │ +typedef std::bitset< NUM_MESH_BITS > MeshBitset │ │ │ │ │ +  │ │ │ │ │ + Enumerations │ │ │ │ │ +enum  MeshBits { │ │ │ │ │ +   MeshAdaptive = 0 , │ │ │ │ │ +   MeshInterleaveVarying = 1 , │ │ │ │ │ +   MeshFVarData = 2 , │ │ │ │ │ +   MeshFVarAdaptive = 3 , │ │ │ │ │ +   MeshUseSmoothCornerPatch = 4 , │ │ │ │ │ +   MeshUseSingleCreasePatch = 5 , │ │ │ │ │ +   MeshUseInfSharpPatch = 6 , │ │ │ │ │ +   MeshEndCapBilinearBasis = 7 , │ │ │ │ │ +   MeshEndCapBSplineBasis = 8 , │ │ │ │ │ +   MeshEndCapGregoryBasis = 9 , │ │ │ │ │ +   MeshEndCapLegacyGregory = 10 , │ │ │ │ │ +   NUM_MESH_BITS = 11 │ │ │ │ │ + } │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ + STENCIL_TABLE const * convertToCompatibleStencilTable │ │ │ │ │ + (SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT │ │ │ │ │ + *context) │ │ │ │ │ +  │ │ │ │ │ + template<> │ │ │ │ │ + Far::StencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ + StencilTable,_Far::StencilTable,_void_> (Far:: │ │ │ │ │ + StencilTable const *table, void *) │ │ │ │ │ +  │ │ │ │ │ + template<> │ │ │ │ │ +Far::LimitStencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ + LimitStencilTable,_Far::LimitStencilTable,_void │ │ │ │ │ + > (Far::LimitStencilTable const *table, void *) │ │ │ │ │ +  │ │ │ │ │ + template<> │ │ │ │ │ + Far::StencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ + StencilTable,_Far::StencilTable, │ │ │ │ │ + ID3D11DeviceContext_> (Far::StencilTable const │ │ │ │ │ + *table, ID3D11DeviceContext *) │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cpuGLVertexBuffer.h │ │ │ │ │ + * mesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00869.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,25 @@ │ │ │ │ │ var a00869 = [ │ │ │ │ │ - ["CpuGLVertexBuffer", "a01161.html", "a01161"] │ │ │ │ │ + ["MeshInterface< PATCH_TABLE >", "a01261.html", "a01261"], │ │ │ │ │ + ["EvaluatorCacheT< EVALUATOR >", "a01265.html", "a01265"], │ │ │ │ │ + ["EvaluatorCacheT< EVALUATOR >::Entry", "a01269.html", "a01269"], │ │ │ │ │ + ["Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >", "a01273.html", "a01273"], │ │ │ │ │ + ["MeshBitset", "a00869.html#a85ba9df501aea9af1ec9da1558c255bc", null], │ │ │ │ │ + ["MeshBits", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492", [ │ │ │ │ │ + ["MeshAdaptive", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492adef344bcbdd50a1a93136eb53183c718", null], │ │ │ │ │ + ["MeshInterleaveVarying", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9313c644b9b2a998bcb55cfcc4582b1a", null], │ │ │ │ │ + ["MeshFVarData", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492ac10e41fef659f3b3a1b730319bdedb45", null], │ │ │ │ │ + ["MeshFVarAdaptive", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9b8a23ab039e120012bc7c622308d603", null], │ │ │ │ │ + ["MeshUseSmoothCornerPatch", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492ab32b8ef595539e14041e2fb0e619e3f9", null], │ │ │ │ │ + ["MeshUseSingleCreasePatch", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9058d69e1089fc77f1974a76c34e2071", null], │ │ │ │ │ + ["MeshUseInfSharpPatch", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a8fab1b3018f94b5b2432c7435e795925", null], │ │ │ │ │ + ["MeshEndCapBilinearBasis", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a4124233e4f787f999c7975afceab34f3", null], │ │ │ │ │ + ["MeshEndCapBSplineBasis", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aa2f41b6ba0393698bb3af283283737f7", null], │ │ │ │ │ + ["MeshEndCapGregoryBasis", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aa2878e1a215530f5f6fb89f1e06f91ee", null], │ │ │ │ │ + ["MeshEndCapLegacyGregory", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aad7b3fb2be609abdbfafaf5b1c834158", null], │ │ │ │ │ + ["NUM_MESH_BITS", "a00869.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a5676712c77d29cfdd330e2802db1c464", null] │ │ │ │ │ + ]], │ │ │ │ │ + ["convertToCompatibleStencilTable", "a00869.html#a06ceddf21c024b341a5b946049cd701a", null], │ │ │ │ │ + ["convertToCompatibleStencilTable< Far::LimitStencilTable, Far::LimitStencilTable, void >", "a00869.html#a4c2520cc1a8a5a03e3f53584629d7318", null], │ │ │ │ │ + ["convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, ID3D11DeviceContext >", "a00869.html#ab5753a2b0a0995c8e2259d2c4765f7df", null], │ │ │ │ │ + ["convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, void >", "a00869.html#a33f9830228f847fae1c30c9dffe02b5a", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00869_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuGLVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/mesh.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cpuGLVertexBuffer.h
│ │ │ │ +
mesh.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,81 +107,822 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_MESH_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_MESH_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │
29
│ │ │ │ -
30#include <cstddef>
│ │ │ │ -
31#include "../osd/opengl.h"
│ │ │ │ -
32
│ │ │ │ -
33namespace OpenSubdiv {
│ │ │ │ -
34namespace OPENSUBDIV_VERSION {
│ │ │ │ -
35
│ │ │ │ -
36namespace Osd {
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
48public:
│ │ │ │ -
50 static CpuGLVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
51 void *deviceContext = NULL);
│ │ │ │ -
52
│ │ │ │ - │ │ │ │ -
55
│ │ │ │ -
58 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
59 void *deviceContext = NULL);
│ │ │ │ -
60
│ │ │ │ -
62 int GetNumElements() const;
│ │ │ │ -
63
│ │ │ │ -
65 int GetNumVertices() const;
│ │ │ │ +
30#include <bitset>
│ │ │ │ +
31#include <cassert>
│ │ │ │ +
32#include <cstring>
│ │ │ │ +
33#include <vector>
│ │ │ │ +
34
│ │ │ │ +
35#include "../far/topologyRefiner.h"
│ │ │ │ +
36#include "../far/patchTableFactory.h"
│ │ │ │ +
37#include "../far/stencilTable.h"
│ │ │ │ +
38#include "../far/stencilTableFactory.h"
│ │ │ │ +
39
│ │ │ │ +
40#include "../osd/bufferDescriptor.h"
│ │ │ │ +
41
│ │ │ │ +
42struct ID3D11DeviceContext;
│ │ │ │ +
43
│ │ │ │ +
44namespace OpenSubdiv {
│ │ │ │ +
45namespace OPENSUBDIV_VERSION {
│ │ │ │ +
46
│ │ │ │ +
47namespace Osd {
│ │ │ │ +
48
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
57 MeshEndCapBilinearBasis = 7, // exclusive
│ │ │ │ +
58 MeshEndCapBSplineBasis = 8, // exclusive
│ │ │ │ +
59 MeshEndCapGregoryBasis = 9, // exclusive
│ │ │ │ +
60 MeshEndCapLegacyGregory = 10, // exclusive
│ │ │ │ + │ │ │ │ +
62};
│ │ │ │ +
63typedef std::bitset<NUM_MESH_BITS> MeshBitset;
│ │ │ │ +
64
│ │ │ │ +
65// ---------------------------------------------------------------------------
│ │ │ │
66
│ │ │ │ -
69 float * BindCpuBuffer();
│ │ │ │ -
70
│ │ │ │ -
73 GLuint BindVBO(void *deviceContext = NULL);
│ │ │ │ -
74
│ │ │ │ -
75protected:
│ │ │ │ -
77 CpuGLVertexBuffer(int numElements, int numVertices);
│ │ │ │ -
78
│ │ │ │ -
80 bool allocate();
│ │ │ │ +
67template <class PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
69public:
│ │ │ │ +
70 typedef PATCH_TABLE PatchTable;
│ │ │ │ +
71 typedef typename PatchTable::VertexBufferBinding VertexBufferBinding;
│ │ │ │ +
72
│ │ │ │ +
73public:
│ │ │ │ + │ │ │ │ +
75
│ │ │ │ +
76 virtual ~MeshInterface() { }
│ │ │ │ +
77
│ │ │ │ +
78 virtual int GetNumVertices() const = 0;
│ │ │ │ +
79
│ │ │ │ +
80 virtual int GetMaxValence() const = 0;
│ │ │ │
81
│ │ │ │ -
82private:
│ │ │ │ -
83 int _numElements;
│ │ │ │ -
84 int _numVertices;
│ │ │ │ -
85 GLuint _vbo;
│ │ │ │ -
86 float *_cpuBuffer;
│ │ │ │ -
87 bool _dataDirty;
│ │ │ │ -
88};
│ │ │ │ +
82 virtual void UpdateVertexBuffer(float const *vertexData,
│ │ │ │ +
83 int startVertex, int numVerts) = 0;
│ │ │ │ +
84
│ │ │ │ +
85 virtual void UpdateVaryingBuffer(float const *varyingData,
│ │ │ │ +
86 int startVertex, int numVerts) = 0;
│ │ │ │ +
87
│ │ │ │ +
88 virtual void Refine() = 0;
│ │ │ │
89
│ │ │ │ -
90} // end namespace Osd
│ │ │ │ +
90 virtual void Synchronize() = 0;
│ │ │ │
91
│ │ │ │ -
92} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
93using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
94
│ │ │ │ -
95} // end namespace OpenSubdiv
│ │ │ │ -
96
│ │ │ │ -
97#endif // OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
│ │ │ │ +
92 virtual PatchTable * GetPatchTable() const = 0;
│ │ │ │ +
93
│ │ │ │ +
94 virtual Far::PatchTable const *GetFarPatchTable() const = 0;
│ │ │ │ +
95
│ │ │ │ + │ │ │ │ +
97
│ │ │ │ + │ │ │ │ +
99
│ │ │ │ +
100protected:
│ │ │ │ +
101 static inline void refineMesh(Far::TopologyRefiner & refiner,
│ │ │ │ +
102 int level, bool adaptive,
│ │ │ │ +
103 bool singleCreasePatch) {
│ │ │ │ +
104 if (adaptive) {
│ │ │ │ + │ │ │ │ +
106 options.useSingleCreasePatch = singleCreasePatch;
│ │ │ │ +
107 refiner.RefineAdaptive(options);
│ │ │ │ +
108 } else {
│ │ │ │ +
109 // This dependency on FVar channels should not be necessary
│ │ │ │ +
110 bool fullTopologyInLastLevel = refiner.GetNumFVarChannels()>0;
│ │ │ │ +
111
│ │ │ │ + │ │ │ │ +
113 options.fullTopologyInLastLevel = fullTopologyInLastLevel;
│ │ │ │ +
114 refiner.RefineUniform(options);
│ │ │ │ +
115 }
│ │ │ │ +
116 }
│ │ │ │ +
117 static inline void refineMesh(Far::TopologyRefiner & refiner,
│ │ │ │ +
118 int level, MeshBitset bits) {
│ │ │ │ +
119 if (bits.test(MeshAdaptive)) {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
122 options.useInfSharpPatch = bits.test(MeshUseInfSharpPatch);
│ │ │ │ +
123 options.considerFVarChannels = bits.test(MeshFVarAdaptive);
│ │ │ │ +
124 refiner.RefineAdaptive(options);
│ │ │ │ +
125 } else {
│ │ │ │ +
126 // This dependency on FVar channels should not be necessary
│ │ │ │ +
127 bool fullTopologyInLastLevel = refiner.GetNumFVarChannels()>0;
│ │ │ │ +
128
│ │ │ │ + │ │ │ │ +
130 options.fullTopologyInLastLevel = fullTopologyInLastLevel;
│ │ │ │ +
131 refiner.RefineUniform(options);
│ │ │ │ +
132 }
│ │ │ │ +
133 }
│ │ │ │ +
134};
│ │ │ │ +
135
│ │ │ │ +
136// ---------------------------------------------------------------------------
│ │ │ │ +
137
│ │ │ │ +
138template <typename STENCIL_TABLE, typename SRC_STENCIL_TABLE,
│ │ │ │ +
139 typename DEVICE_CONTEXT>
│ │ │ │ +
140STENCIL_TABLE const *
│ │ │ │ + │ │ │ │ +
142 SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT *context) {
│ │ │ │ +
143 if (! table) return NULL;
│ │ │ │ +
144 return STENCIL_TABLE::Create(table, context);
│ │ │ │ +
145}
│ │ │ │ +
146
│ │ │ │ +
147template <>
│ │ │ │ +
148inline Far::StencilTable const *
│ │ │ │ +
149convertToCompatibleStencilTable<Far::StencilTable, Far::StencilTable, void>(
│ │ │ │ +
150 Far::StencilTable const *table, void * /*context*/) {
│ │ │ │ +
151 // no need for conversion
│ │ │ │ +
152 // XXX: We don't want to even copy.
│ │ │ │ +
153 if (! table) return NULL;
│ │ │ │ +
154 return new Far::StencilTable(*table);
│ │ │ │ +
155}
│ │ │ │ +
156
│ │ │ │ +
157template <>
│ │ │ │ + │ │ │ │ +
159convertToCompatibleStencilTable<Far::LimitStencilTable, Far::LimitStencilTable, void>(
│ │ │ │ +
160 Far::LimitStencilTable const *table, void * /*context*/) {
│ │ │ │ +
161 // no need for conversion
│ │ │ │ +
162 // XXX: We don't want to even copy.
│ │ │ │ +
163 if (! table) return NULL;
│ │ │ │ +
164 return new Far::LimitStencilTable(*table);
│ │ │ │ +
165}
│ │ │ │ +
166
│ │ │ │ +
167template <>
│ │ │ │ +
168inline Far::StencilTable const *
│ │ │ │ +
169convertToCompatibleStencilTable<Far::StencilTable, Far::StencilTable, ID3D11DeviceContext>(
│ │ │ │ +
170 Far::StencilTable const *table, ID3D11DeviceContext * /*context*/) {
│ │ │ │ +
171 // no need for conversion
│ │ │ │ +
172 // XXX: We don't want to even copy.
│ │ │ │ +
173 if (! table) return NULL;
│ │ │ │ +
174 return new Far::StencilTable(*table);
│ │ │ │ +
175}
│ │ │ │ +
176
│ │ │ │ +
177// ---------------------------------------------------------------------------
│ │ │ │ +
178
│ │ │ │ +
179// Osd evaluator cache: for the GPU backends require compiled instance
│ │ │ │ +
180// (GLXFB, GLCompute, CL)
│ │ │ │ +
181//
│ │ │ │ +
182// note: this is just an example usage and client applications are supposed
│ │ │ │ +
183// to implement their own structure for Evaluator instance.
│ │ │ │ +
184//
│ │ │ │ +
185template <typename EVALUATOR>
│ │ │ │ + │ │ │ │ +
187public:
│ │ │ │ + │ │ │ │ +
189 for(typename Evaluators::iterator it = _evaluators.begin();
│ │ │ │ +
190 it != _evaluators.end(); ++it) {
│ │ │ │ +
191 delete it->evaluator;
│ │ │ │ +
192 }
│ │ │ │ +
193 }
│ │ │ │ +
194
│ │ │ │ +
195 // XXX: FIXME, linear search
│ │ │ │ +
196 struct Entry {
│ │ │ │ +
197 Entry(BufferDescriptor const &srcDescArg,
│ │ │ │ +
198 BufferDescriptor const &dstDescArg,
│ │ │ │ +
199 BufferDescriptor const &duDescArg,
│ │ │ │ +
200 BufferDescriptor const &dvDescArg,
│ │ │ │ +
201 EVALUATOR *evalArg) : srcDesc(srcDescArg), dstDesc(dstDescArg),
│ │ │ │ +
202 duDesc(duDescArg), dvDesc(dvDescArg),
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
206 evaluator(evalArg) {}
│ │ │ │ +
207 Entry(BufferDescriptor const &srcDescArg,
│ │ │ │ +
208 BufferDescriptor const &dstDescArg,
│ │ │ │ +
209 BufferDescriptor const &duDescArg,
│ │ │ │ +
210 BufferDescriptor const &dvDescArg,
│ │ │ │ +
211 BufferDescriptor const &duuDescArg,
│ │ │ │ +
212 BufferDescriptor const &duvDescArg,
│ │ │ │ +
213 BufferDescriptor const &dvvDescArg,
│ │ │ │ +
214 EVALUATOR *evalArg) : srcDesc(srcDescArg), dstDesc(dstDescArg),
│ │ │ │ +
215 duDesc(duDescArg), dvDesc(dvDescArg),
│ │ │ │ +
216 duuDesc(duuDescArg),
│ │ │ │ +
217 duvDesc(duvDescArg),
│ │ │ │ +
218 dvvDesc(dvvDescArg),
│ │ │ │ +
219 evaluator(evalArg) {}
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
223 EVALUATOR *evaluator;
│ │ │ │ +
224 };
│ │ │ │ +
225 typedef std::vector<Entry> Evaluators;
│ │ │ │ +
226
│ │ │ │ +
227 template <typename DEVICE_CONTEXT>
│ │ │ │ +
228 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc,
│ │ │ │ +
229 BufferDescriptor const &dstDesc,
│ │ │ │ +
230 DEVICE_CONTEXT *deviceContext) {
│ │ │ │ +
231 return GetEvaluator(srcDesc, dstDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
237 deviceContext);
│ │ │ │ +
238 }
│ │ │ │ +
239
│ │ │ │ +
240 template <typename DEVICE_CONTEXT>
│ │ │ │ +
241 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc,
│ │ │ │ +
242 BufferDescriptor const &dstDesc,
│ │ │ │ +
243 BufferDescriptor const &duDesc,
│ │ │ │ +
244 BufferDescriptor const &dvDesc,
│ │ │ │ +
245 DEVICE_CONTEXT *deviceContext) {
│ │ │ │ +
246 return GetEvaluator(srcDesc, dstDesc,
│ │ │ │ +
247 duDesc, dvDesc,
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
251 deviceContext);
│ │ │ │ +
252 }
│ │ │ │ +
253
│ │ │ │ +
254 template <typename DEVICE_CONTEXT>
│ │ │ │ +
255 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc,
│ │ │ │ +
256 BufferDescriptor const &dstDesc,
│ │ │ │ +
257 BufferDescriptor const &duDesc,
│ │ │ │ +
258 BufferDescriptor const &dvDesc,
│ │ │ │ +
259 BufferDescriptor const &duuDesc,
│ │ │ │ +
260 BufferDescriptor const &duvDesc,
│ │ │ │ +
261 BufferDescriptor const &dvvDesc,
│ │ │ │ +
262 DEVICE_CONTEXT *deviceContext) {
│ │ │ │ +
263
│ │ │ │ +
264 for(typename Evaluators::iterator it = _evaluators.begin();
│ │ │ │ +
265 it != _evaluators.end(); ++it) {
│ │ │ │ +
266 if (isEqual(srcDesc, it->srcDesc) &&
│ │ │ │ +
267 isEqual(dstDesc, it->dstDesc) &&
│ │ │ │ +
268 isEqual(duDesc, it->duDesc) &&
│ │ │ │ +
269 isEqual(dvDesc, it->dvDesc) &&
│ │ │ │ +
270 isEqual(duuDesc, it->duuDesc) &&
│ │ │ │ +
271 isEqual(duvDesc, it->duvDesc) &&
│ │ │ │ +
272 isEqual(dvvDesc, it->dvvDesc)) {
│ │ │ │ +
273 return it->evaluator;
│ │ │ │ +
274 }
│ │ │ │ +
275 }
│ │ │ │ +
276 EVALUATOR *e = EVALUATOR::Create(srcDesc, dstDesc,
│ │ │ │ +
277 duDesc, dvDesc,
│ │ │ │ +
278 duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
279 deviceContext);
│ │ │ │ +
280 _evaluators.push_back(Entry(srcDesc, dstDesc,
│ │ │ │ +
281 duDesc, dvDesc,
│ │ │ │ +
282 duuDesc, duvDesc, dvvDesc, e));
│ │ │ │ +
283 return e;
│ │ │ │ +
284 }
│ │ │ │ +
285
│ │ │ │ +
286private:
│ │ │ │ +
287 static bool isEqual(BufferDescriptor const &a,
│ │ │ │ +
288 BufferDescriptor const &b) {
│ │ │ │ +
289 int offsetA = a.stride ? (a.offset % a.stride) : 0;
│ │ │ │ +
290 int offsetB = b.stride ? (b.offset % b.stride) : 0;
│ │ │ │ +
291
│ │ │ │ +
292 // Note: XFB kernel needs to be configured with the local offset
│ │ │ │ +
293 // of the dstDesc to skip preceding primvars.
│ │ │ │ +
294 return (offsetA == offsetB &&
│ │ │ │ +
295 a.length == b.length &&
│ │ │ │ +
296 a.stride == b.stride);
│ │ │ │ +
297 }
│ │ │ │ +
298
│ │ │ │ +
299 Evaluators _evaluators;
│ │ │ │ +
300};
│ │ │ │ +
301
│ │ │ │ +
303
│ │ │ │ +
304// template helpers to see if the evaluator is instantiatable or not.
│ │ │ │ +
305template <typename EVALUATOR>
│ │ │ │ +
306struct instantiatable
│ │ │ │ +
307{
│ │ │ │ +
308 typedef char yes[1];
│ │ │ │ +
309 typedef char no[2];
│ │ │ │ +
310 template <typename C> static yes &chk(typename C::Instantiatable *t=0);
│ │ │ │ +
311 template <typename C> static no &chk(...);
│ │ │ │ +
312 static bool const value = sizeof(chk<EVALUATOR>(0)) == sizeof(yes);
│ │ │ │ +
313};
│ │ │ │ +
314template <bool C, typename T=void>
│ │ │ │ +
315struct enable_if { typedef T type; };
│ │ │ │ +
316template <typename T>
│ │ │ │ +
317struct enable_if<false, T> { };
│ │ │ │ +
318
│ │ │ │ +
320
│ │ │ │ +
321// extract a kernel from cache if available
│ │ │ │ +
322template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
323static EVALUATOR *GetEvaluator(
│ │ │ │ +
324 EvaluatorCacheT<EVALUATOR> *cache,
│ │ │ │ +
325 BufferDescriptor const &srcDesc,
│ │ │ │ +
326 BufferDescriptor const &dstDesc,
│ │ │ │ +
327 BufferDescriptor const &duDesc,
│ │ │ │ +
328 BufferDescriptor const &dvDesc,
│ │ │ │ +
329 BufferDescriptor const &duuDesc,
│ │ │ │ +
330 BufferDescriptor const &duvDesc,
│ │ │ │ +
331 BufferDescriptor const &dvvDesc,
│ │ │ │ +
332 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
333 typename enable_if<instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
334 (void)t;
│ │ │ │ +
335 if (cache == NULL) return NULL;
│ │ │ │ +
336 return cache->GetEvaluator(srcDesc, dstDesc,
│ │ │ │ +
337 duDesc, dvDesc, duuDesc, duvDesc, dvvDesc,
│ │ │ │ +
338 deviceContext);
│ │ │ │ +
339}
│ │ │ │ +
340
│ │ │ │ +
341template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
342static EVALUATOR *GetEvaluator(
│ │ │ │ +
343 EvaluatorCacheT<EVALUATOR> *cache,
│ │ │ │ +
344 BufferDescriptor const &srcDesc,
│ │ │ │ +
345 BufferDescriptor const &dstDesc,
│ │ │ │ +
346 BufferDescriptor const &duDesc,
│ │ │ │ +
347 BufferDescriptor const &dvDesc,
│ │ │ │ +
348 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
349 typename enable_if<instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
350 (void)t;
│ │ │ │ +
351 if (cache == NULL) return NULL;
│ │ │ │ +
352 return cache->GetEvaluator(srcDesc, dstDesc, duDesc, dvDesc, deviceContext);
│ │ │ │ +
353}
│ │ │ │ +
354
│ │ │ │ +
355template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
356static EVALUATOR *GetEvaluator(
│ │ │ │ +
357 EvaluatorCacheT<EVALUATOR> *cache,
│ │ │ │ +
358 BufferDescriptor const &srcDesc,
│ │ │ │ +
359 BufferDescriptor const &dstDesc,
│ │ │ │ +
360 DEVICE_CONTEXT deviceContext,
│ │ │ │ +
361 typename enable_if<instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
362 (void)t;
│ │ │ │ +
363 if (cache == NULL) return NULL;
│ │ │ │ +
364 return cache->GetEvaluator(srcDesc, dstDesc,
│ │ │ │ +
365 BufferDescriptor(),
│ │ │ │ +
366 BufferDescriptor(),
│ │ │ │ +
367 deviceContext);
│ │ │ │ +
368}
│ │ │ │ +
369
│ │ │ │ +
370// fallback
│ │ │ │ +
371template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
372static EVALUATOR *GetEvaluator(
│ │ │ │ +
373 EvaluatorCacheT<EVALUATOR> *,
│ │ │ │ +
374 BufferDescriptor const &,
│ │ │ │ +
375 BufferDescriptor const &,
│ │ │ │ +
376 BufferDescriptor const &,
│ │ │ │ +
377 BufferDescriptor const &,
│ │ │ │ +
378 BufferDescriptor const &,
│ │ │ │ +
379 BufferDescriptor const &,
│ │ │ │ +
380 BufferDescriptor const &,
│ │ │ │ +
381 DEVICE_CONTEXT,
│ │ │ │ +
382 typename enable_if<!instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
383 (void)t;
│ │ │ │ +
384 return NULL;
│ │ │ │ +
385}
│ │ │ │ +
386
│ │ │ │ +
387template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
388static EVALUATOR *GetEvaluator(
│ │ │ │ +
389 EvaluatorCacheT<EVALUATOR> *,
│ │ │ │ +
390 BufferDescriptor const &,
│ │ │ │ +
391 BufferDescriptor const &,
│ │ │ │ +
392 BufferDescriptor const &,
│ │ │ │ +
393 BufferDescriptor const &,
│ │ │ │ +
394 DEVICE_CONTEXT,
│ │ │ │ +
395 typename enable_if<!instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
396 (void)t;
│ │ │ │ +
397 return NULL;
│ │ │ │ +
398}
│ │ │ │ +
399
│ │ │ │ +
400template <typename EVALUATOR, typename DEVICE_CONTEXT>
│ │ │ │ +
401static EVALUATOR *GetEvaluator(
│ │ │ │ +
402 EvaluatorCacheT<EVALUATOR> *,
│ │ │ │ +
403 BufferDescriptor const &,
│ │ │ │ +
404 BufferDescriptor const &,
│ │ │ │ +
405 DEVICE_CONTEXT,
│ │ │ │ +
406 typename enable_if<!instantiatable<EVALUATOR>::value, void>::type*t=0) {
│ │ │ │ +
407 (void)t;
│ │ │ │ +
408 return NULL;
│ │ │ │ +
409}
│ │ │ │ +
410
│ │ │ │ +
411// ---------------------------------------------------------------------------
│ │ │ │ +
412
│ │ │ │ +
413template <typename VERTEX_BUFFER,
│ │ │ │ +
414 typename STENCIL_TABLE,
│ │ │ │ +
415 typename EVALUATOR,
│ │ │ │ +
416 typename PATCH_TABLE,
│ │ │ │ +
417 typename DEVICE_CONTEXT = void>
│ │ │ │ +
418class Mesh : public MeshInterface<PATCH_TABLE> {
│ │ │ │ +
419public:
│ │ │ │ +
420 typedef VERTEX_BUFFER VertexBuffer;
│ │ │ │ +
421 typedef EVALUATOR Evaluator;
│ │ │ │ +
422 typedef STENCIL_TABLE StencilTable;
│ │ │ │ +
423 typedef PATCH_TABLE PatchTable;
│ │ │ │ +
424 typedef DEVICE_CONTEXT DeviceContext;
│ │ │ │ + │ │ │ │ +
426 typedef typename PatchTable::VertexBufferBinding VertexBufferBinding;
│ │ │ │ +
427
│ │ │ │ + │ │ │ │ +
429 int numVertexElements,
│ │ │ │ +
430 int numVaryingElements,
│ │ │ │ +
431 int level,
│ │ │ │ +
432 MeshBitset bits = MeshBitset(),
│ │ │ │ +
433 EvaluatorCache * evaluatorCache = NULL,
│ │ │ │ +
434 DeviceContext * deviceContext = NULL) :
│ │ │ │ +
435
│ │ │ │ +
436 _refiner(refiner),
│ │ │ │ +
437 _farPatchTable(NULL),
│ │ │ │ +
438 _numVertices(0),
│ │ │ │ +
439 _maxValence(0),
│ │ │ │ +
440 _vertexBuffer(NULL),
│ │ │ │ +
441 _varyingBuffer(NULL),
│ │ │ │ +
442 _vertexStencilTable(NULL),
│ │ │ │ +
443 _varyingStencilTable(NULL),
│ │ │ │ +
444 _evaluatorCache(evaluatorCache),
│ │ │ │ +
445 _patchTable(NULL),
│ │ │ │ +
446 _deviceContext(deviceContext) {
│ │ │ │ +
447
│ │ │ │ +
448 assert(_refiner);
│ │ │ │ +
449
│ │ │ │ + │ │ │ │ +
451 *_refiner, level, bits);
│ │ │ │ +
452
│ │ │ │ +
453 int vertexBufferStride = numVertexElements +
│ │ │ │ +
454 (bits.test(MeshInterleaveVarying) ? numVaryingElements : 0);
│ │ │ │ +
455 int varyingBufferStride =
│ │ │ │ +
456 (bits.test(MeshInterleaveVarying) ? 0 : numVaryingElements);
│ │ │ │ +
457
│ │ │ │ +
458 initializeContext(numVertexElements,
│ │ │ │ +
459 numVaryingElements,
│ │ │ │ +
460 level, bits);
│ │ │ │ +
461
│ │ │ │ +
462 initializeVertexBuffers(_numVertices,
│ │ │ │ +
463 vertexBufferStride,
│ │ │ │ +
464 varyingBufferStride);
│ │ │ │ +
465
│ │ │ │ +
466 // configure vertex buffer descriptor
│ │ │ │ +
467 _vertexDesc =
│ │ │ │ +
468 BufferDescriptor(0, numVertexElements, vertexBufferStride);
│ │ │ │ +
469 if (bits.test(MeshInterleaveVarying)) {
│ │ │ │ +
470 _varyingDesc = BufferDescriptor(
│ │ │ │ +
471 numVertexElements, numVaryingElements, vertexBufferStride);
│ │ │ │ +
472 } else {
│ │ │ │ +
473 _varyingDesc = BufferDescriptor(
│ │ │ │ +
474 0, numVaryingElements, varyingBufferStride);
│ │ │ │ +
475 }
│ │ │ │ +
476 }
│ │ │ │ +
477
│ │ │ │ +
478 virtual ~Mesh() {
│ │ │ │ +
479 delete _refiner;
│ │ │ │ +
480 delete _farPatchTable;
│ │ │ │ +
481 delete _vertexBuffer;
│ │ │ │ +
482 delete _varyingBuffer;
│ │ │ │ +
483 delete _vertexStencilTable;
│ │ │ │ +
484 delete _varyingStencilTable;
│ │ │ │ +
485 delete _patchTable;
│ │ │ │ +
486 // deviceContext and evaluatorCache are not owned by this class.
│ │ │ │ +
487 }
│ │ │ │ +
488
│ │ │ │ +
489 virtual void UpdateVertexBuffer(float const *vertexData,
│ │ │ │ +
490 int startVertex, int numVerts) {
│ │ │ │ +
491 _vertexBuffer->UpdateData(vertexData, startVertex, numVerts,
│ │ │ │ +
492 _deviceContext);
│ │ │ │ +
493 }
│ │ │ │ +
494
│ │ │ │ +
495 virtual void UpdateVaryingBuffer(float const *varyingData,
│ │ │ │ +
496 int startVertex, int numVerts) {
│ │ │ │ +
497 _varyingBuffer->UpdateData(varyingData, startVertex, numVerts,
│ │ │ │ +
498 _deviceContext);
│ │ │ │ +
499 }
│ │ │ │ +
500
│ │ │ │ +
501 virtual void Refine() {
│ │ │ │ +
502
│ │ │ │ +
503 int numControlVertices = _refiner->GetLevel(0).GetNumVertices();
│ │ │ │ +
504
│ │ │ │ +
505 BufferDescriptor srcDesc = _vertexDesc;
│ │ │ │ +
506 BufferDescriptor dstDesc(srcDesc);
│ │ │ │ +
507 dstDesc.offset += numControlVertices * dstDesc.stride;
│ │ │ │ +
508
│ │ │ │ +
509 // note that the _evaluatorCache can be NULL and thus
│ │ │ │ +
510 // the evaluatorInstance can be NULL
│ │ │ │ +
511 // (for uninstantiatable kernels CPU,TBB etc)
│ │ │ │ +
512 Evaluator const *instance = GetEvaluator<Evaluator>(
│ │ │ │ +
513 _evaluatorCache, srcDesc, dstDesc,
│ │ │ │ +
514 _deviceContext);
│ │ │ │ +
515
│ │ │ │ +
516 Evaluator::EvalStencils(_vertexBuffer, srcDesc,
│ │ │ │ +
517 _vertexBuffer, dstDesc,
│ │ │ │ +
518 _vertexStencilTable,
│ │ │ │ +
519 instance, _deviceContext);
│ │ │ │ +
520
│ │ │ │ +
521 if (_varyingDesc.length > 0) {
│ │ │ │ +
522 BufferDescriptor vSrcDesc = _varyingDesc;
│ │ │ │ +
523 BufferDescriptor vDstDesc(vSrcDesc);
│ │ │ │ +
524 vDstDesc.offset += numControlVertices * vDstDesc.stride;
│ │ │ │ +
525
│ │ │ │ +
526 instance = GetEvaluator<Evaluator>(
│ │ │ │ +
527 _evaluatorCache, vSrcDesc, vDstDesc,
│ │ │ │ +
528 _deviceContext);
│ │ │ │ +
529
│ │ │ │ +
530 if (_varyingBuffer) {
│ │ │ │ +
531 // non-interleaved
│ │ │ │ +
532 Evaluator::EvalStencils(_varyingBuffer, vSrcDesc,
│ │ │ │ +
533 _varyingBuffer, vDstDesc,
│ │ │ │ +
534 _varyingStencilTable,
│ │ │ │ +
535 instance, _deviceContext);
│ │ │ │ +
536 } else {
│ │ │ │ +
537 // interleaved
│ │ │ │ +
538 Evaluator::EvalStencils(_vertexBuffer, vSrcDesc,
│ │ │ │ +
539 _vertexBuffer, vDstDesc,
│ │ │ │ +
540 _varyingStencilTable,
│ │ │ │ +
541 instance, _deviceContext);
│ │ │ │ +
542 }
│ │ │ │ +
543 }
│ │ │ │ +
544 }
│ │ │ │ +
545
│ │ │ │ +
546 virtual void Synchronize() {
│ │ │ │ +
547 Evaluator::Synchronize(_deviceContext);
│ │ │ │ +
548 }
│ │ │ │ +
549
│ │ │ │ +
550 virtual PatchTable * GetPatchTable() const {
│ │ │ │ +
551 return _patchTable;
│ │ │ │ +
552 }
│ │ │ │ +
553
│ │ │ │ +
554 virtual Far::PatchTable const *GetFarPatchTable() const {
│ │ │ │ +
555 return _farPatchTable;
│ │ │ │ +
556 }
│ │ │ │ +
557
│ │ │ │ +
558 virtual int GetNumVertices() const { return _numVertices; }
│ │ │ │ +
559
│ │ │ │ +
560 virtual int GetMaxValence() const { return _maxValence; }
│ │ │ │ +
561
│ │ │ │ + │ │ │ │ +
563 return _vertexBuffer->BindVBO(_deviceContext);
│ │ │ │ +
564 }
│ │ │ │ +
565
│ │ │ │ + │ │ │ │ +
567 return _varyingBuffer->BindVBO(_deviceContext);
│ │ │ │ +
568 }
│ │ │ │ +
569
│ │ │ │ + │ │ │ │ +
571 return _vertexBuffer;
│ │ │ │ +
572 }
│ │ │ │ +
573
│ │ │ │ + │ │ │ │ +
575 return _varyingBuffer;
│ │ │ │ +
576 }
│ │ │ │ +
577
│ │ │ │ +
578 virtual Far::TopologyRefiner const * GetTopologyRefiner() const {
│ │ │ │ +
579 return _refiner;
│ │ │ │ +
580 }
│ │ │ │ +
581
│ │ │ │ +
582private:
│ │ │ │ +
583 void initializeContext(int numVertexElements,
│ │ │ │ +
584 int numVaryingElements,
│ │ │ │ +
585 int level, MeshBitset bits) {
│ │ │ │ +
586 assert(_refiner);
│ │ │ │ +
587
│ │ │ │ +
588 Far::StencilTableFactory::Options options;
│ │ │ │ +
589 options.generateOffsets = true;
│ │ │ │ +
590 options.generateIntermediateLevels =
│ │ │ │ +
591 _refiner->IsUniform() ? false : true;
│ │ │ │ +
592
│ │ │ │ +
593 Far::StencilTable const * vertexStencils = NULL;
│ │ │ │ +
594 Far::StencilTable const * varyingStencils = NULL;
│ │ │ │ +
595
│ │ │ │ +
596 if (numVertexElements>0) {
│ │ │ │ +
597
│ │ │ │ +
598 vertexStencils = Far::StencilTableFactory::Create(*_refiner,
│ │ │ │ +
599 options);
│ │ │ │ +
600 }
│ │ │ │ +
601
│ │ │ │ +
602 if (numVaryingElements>0) {
│ │ │ │ +
603
│ │ │ │ +
604 options.interpolationMode =
│ │ │ │ + │ │ │ │ +
606
│ │ │ │ +
607 varyingStencils = Far::StencilTableFactory::Create(*_refiner,
│ │ │ │ +
608 options);
│ │ │ │ +
609 }
│ │ │ │ +
610
│ │ │ │ +
611 Far::PatchTableFactory::Options poptions(level);
│ │ │ │ +
612 poptions.generateFVarTables = bits.test(MeshFVarData);
│ │ │ │ +
613 poptions.generateFVarLegacyLinearPatches = !bits.test(MeshFVarAdaptive);
│ │ │ │ +
614 poptions.generateLegacySharpCornerPatches = !bits.test(MeshUseSmoothCornerPatch);
│ │ │ │ +
615 poptions.useSingleCreasePatch = bits.test(MeshUseSingleCreasePatch);
│ │ │ │ +
616 poptions.useInfSharpPatch = bits.test(MeshUseInfSharpPatch);
│ │ │ │ +
617
│ │ │ │ +
618 // points on bilinear and gregory basis endcap boundaries can be
│ │ │ │ +
619 // shared among adjacent patches to save some stencils.
│ │ │ │ +
620 if (bits.test(MeshEndCapBilinearBasis)) {
│ │ │ │ +
621 poptions.SetEndCapType(
│ │ │ │ + │ │ │ │ +
623 poptions.shareEndCapPatchPoints = true;
│ │ │ │ +
624 } else if (bits.test(MeshEndCapBSplineBasis)) {
│ │ │ │ +
625 poptions.SetEndCapType(
│ │ │ │ + │ │ │ │ +
627 } else if (bits.test(MeshEndCapGregoryBasis)) {
│ │ │ │ +
628 poptions.SetEndCapType(
│ │ │ │ + │ │ │ │ +
630 poptions.shareEndCapPatchPoints = true;
│ │ │ │ +
631 } else if (bits.test(MeshEndCapLegacyGregory)) {
│ │ │ │ +
632 poptions.SetEndCapType(
│ │ │ │ + │ │ │ │ +
634 }
│ │ │ │ +
635
│ │ │ │ +
636 _farPatchTable = Far::PatchTableFactory::Create(*_refiner, poptions);
│ │ │ │ +
637
│ │ │ │ +
638 // if there's endcap stencils, merge it into regular stencils.
│ │ │ │ +
639 if (_farPatchTable->GetLocalPointStencilTable()) {
│ │ │ │ +
640 // append stencils
│ │ │ │ +
641 if (Far::StencilTable const *vertexStencilsWithLocalPoints =
│ │ │ │ + │ │ │ │ +
643 *_refiner,
│ │ │ │ +
644 vertexStencils,
│ │ │ │ +
645 _farPatchTable->GetLocalPointStencilTable())) {
│ │ │ │ +
646 delete vertexStencils;
│ │ │ │ +
647 vertexStencils = vertexStencilsWithLocalPoints;
│ │ │ │ +
648 }
│ │ │ │ +
649 if (varyingStencils) {
│ │ │ │ +
650 if (Far::StencilTable const *varyingStencilsWithLocalPoints =
│ │ │ │ + │ │ │ │ +
652 *_refiner,
│ │ │ │ +
653 varyingStencils,
│ │ │ │ +
654 _farPatchTable->GetLocalPointVaryingStencilTable())) {
│ │ │ │ +
655 delete varyingStencils;
│ │ │ │ +
656 varyingStencils = varyingStencilsWithLocalPoints;
│ │ │ │ +
657 }
│ │ │ │ +
658 }
│ │ │ │ +
659 }
│ │ │ │ +
660
│ │ │ │ +
661 _maxValence = _farPatchTable->GetMaxValence();
│ │ │ │ +
662 _patchTable = PatchTable::Create(_farPatchTable, _deviceContext);
│ │ │ │ +
663
│ │ │ │ +
664 // numvertices = coarse verts + refined verts + gregory basis verts
│ │ │ │ +
665 _numVertices = vertexStencils->GetNumControlVertices()
│ │ │ │ +
666 + vertexStencils->GetNumStencils();
│ │ │ │ +
667
│ │ │ │ +
668 // convert to device stenciltable if necessary.
│ │ │ │ +
669 _vertexStencilTable =
│ │ │ │ +
670 convertToCompatibleStencilTable<StencilTable>(
│ │ │ │ +
671 vertexStencils, _deviceContext);
│ │ │ │ +
672 _varyingStencilTable =
│ │ │ │ +
673 convertToCompatibleStencilTable<StencilTable>(
│ │ │ │ +
674 varyingStencils, _deviceContext);
│ │ │ │ +
675
│ │ │ │ +
676 // FIXME: we do extra copyings for Far::Stencils.
│ │ │ │ +
677 delete vertexStencils;
│ │ │ │ +
678 delete varyingStencils;
│ │ │ │ +
679 }
│ │ │ │ +
680
│ │ │ │ +
681 void initializeVertexBuffers(int numVertices,
│ │ │ │ +
682 int numVertexElements,
│ │ │ │ +
683 int numVaryingElements) {
│ │ │ │ +
684
│ │ │ │ +
685 if (numVertexElements) {
│ │ │ │ +
686 _vertexBuffer = VertexBuffer::Create(numVertexElements,
│ │ │ │ +
687 numVertices, _deviceContext);
│ │ │ │ +
688 }
│ │ │ │ +
689
│ │ │ │ +
690 if (numVaryingElements) {
│ │ │ │ +
691 _varyingBuffer = VertexBuffer::Create(numVaryingElements,
│ │ │ │ +
692 numVertices, _deviceContext);
│ │ │ │ +
693 }
│ │ │ │ +
694 }
│ │ │ │ +
695
│ │ │ │ +
696 Far::TopologyRefiner * _refiner;
│ │ │ │ +
697 Far::PatchTable * _farPatchTable;
│ │ │ │ +
698
│ │ │ │ +
699 int _numVertices;
│ │ │ │ +
700 int _maxValence;
│ │ │ │ +
701
│ │ │ │ +
702 VertexBuffer * _vertexBuffer;
│ │ │ │ +
703 VertexBuffer * _varyingBuffer;
│ │ │ │ +
704
│ │ │ │ +
705 BufferDescriptor _vertexDesc;
│ │ │ │ +
706 BufferDescriptor _varyingDesc;
│ │ │ │ +
707
│ │ │ │ +
708 StencilTable const * _vertexStencilTable;
│ │ │ │ +
709 StencilTable const * _varyingStencilTable;
│ │ │ │ +
710 EvaluatorCache * _evaluatorCache;
│ │ │ │ +
711
│ │ │ │ +
712 PatchTable *_patchTable;
│ │ │ │ +
713 DeviceContext *_deviceContext;
│ │ │ │ +
714};
│ │ │ │ +
715
│ │ │ │ +
716} // end namespace Osd
│ │ │ │ +
717
│ │ │ │ +
718} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
719using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
720
│ │ │ │ +
721} // end namespace OpenSubdiv
│ │ │ │ +
722
│ │ │ │ +
723#endif // OPENSUBDIV3_OSD_MESH_H
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for cpu subdivision and OpenGL drawing.
│ │ │ │ -
CpuGLVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ - │ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
static CpuGLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ -
bool allocate()
Allocates VBO for this buffer. Returns true if success.
│ │ │ │ - │ │ │ │ - │ │ │ │ +
STENCIL_TABLE const * convertToCompatibleStencilTable(SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT *context)
Definition: mesh.h:141
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
std::bitset< NUM_MESH_BITS > MeshBitset
Definition: mesh.h:63
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ +
int GetMaxValence() const
Returns max vertex valence.
Definition: patchTable.h:92
│ │ │ │ +
StencilTable const * GetLocalPointStencilTable() const
Returns the stencil table to compute local point vertex values.
Definition: patchTable.h:730
│ │ │ │ +
StencilTable const * GetLocalPointVaryingStencilTable() const
Returns the stencil table to compute local point varying values.
Definition: patchTable.h:735
│ │ │ │ +
static PatchTable * Create(TopologyRefiner const &refiner, Options options=Options(), ConstIndexArray selectedFaces=ConstIndexArray())
Instantiates a PatchTable from a client-provided TopologyRefiner.
│ │ │ │ + │ │ │ │ +
@ ENDCAP_LEGACY_GREGORY
legacy option for 2.x style Gregory patches (Catmark only)
│ │ │ │ +
@ ENDCAP_GREGORY_BASIS
use Gregory patches (highest quality, recommended default)
│ │ │ │ +
@ ENDCAP_BILINEAR_BASIS
use linear patches (simple quads or tris)
│ │ │ │ +
@ ENDCAP_BSPLINE_BASIS
use BSpline-like patches (same patch type as regular)
│ │ │ │ + │ │ │ │ +
int GetNumControlVertices() const
Returns the number of control vertices indexed in the table.
Definition: stencilTable.h:161
│ │ │ │ +
int GetNumStencils() const
Returns the number of stencils in the table.
Definition: stencilTable.h:156
│ │ │ │ +
Stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:273
│ │ │ │ +
Limit stencil table class wrapping the template for compatibility.
Definition: stencilTable.h:583
│ │ │ │ +
static StencilTable const * Create(TopologyRefiner const &refiner, Options options=Options())
│ │ │ │ +
static StencilTable const * AppendLocalPointStencilTable(TopologyRefiner const &refiner, StencilTable const *baseStencilTable, StencilTable const *localPointStencilTable, bool factorize=true)
│ │ │ │ +
int GetNumVertices() const
Return the number of vertices in this level.
Definition: topologyLevel.h:62
│ │ │ │ +
Stores topology data for a specified set of refinement options.
│ │ │ │ +
bool IsUniform() const
Returns true if uniform refinement has been applied.
│ │ │ │ +
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
│ │ │ │ +
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
│ │ │ │ +
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
│ │ │ │ +
void RefineAdaptive(AdaptiveOptions options, ConstIndexArray selectedFaces=ConstIndexArray())
Feature Adaptive topology refinement.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
virtual Far::PatchTable const * GetFarPatchTable() const =0
│ │ │ │ +
static void refineMesh(Far::TopologyRefiner &refiner, int level, MeshBitset bits)
Definition: mesh.h:117
│ │ │ │ + │ │ │ │ + │ │ │ │ +
virtual void UpdateVaryingBuffer(float const *varyingData, int startVertex, int numVerts)=0
│ │ │ │ +
static void refineMesh(Far::TopologyRefiner &refiner, int level, bool adaptive, bool singleCreasePatch)
Definition: mesh.h:101
│ │ │ │ +
virtual void UpdateVertexBuffer(float const *vertexData, int startVertex, int numVerts)=0
│ │ │ │ +
virtual PatchTable * GetPatchTable() const =0
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
PatchTable::VertexBufferBinding VertexBufferBinding
Definition: mesh.h:71
│ │ │ │ +
virtual VertexBufferBinding BindVertexBuffer()=0
│ │ │ │ +
virtual VertexBufferBinding BindVaryingBuffer()=0
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT *deviceContext)
Definition: mesh.h:241
│ │ │ │ +
EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT *deviceContext)
Definition: mesh.h:255
│ │ │ │ +
EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, DEVICE_CONTEXT *deviceContext)
Definition: mesh.h:228
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Entry(BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, BufferDescriptor const &duuDescArg, BufferDescriptor const &duvDescArg, BufferDescriptor const &dvvDescArg, EVALUATOR *evalArg)
Definition: mesh.h:207
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Entry(BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, EVALUATOR *evalArg)
Definition: mesh.h:197
│ │ │ │ + │ │ │ │ + │ │ │ │ +
virtual Far::TopologyRefiner const * GetTopologyRefiner() const
Definition: mesh.h:578
│ │ │ │ +
virtual VertexBuffer * GetVertexBuffer()
Definition: mesh.h:570
│ │ │ │ +
virtual void UpdateVaryingBuffer(float const *varyingData, int startVertex, int numVerts)
Definition: mesh.h:495
│ │ │ │ +
virtual VertexBuffer * GetVaryingBuffer()
Definition: mesh.h:574
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
virtual VertexBufferBinding BindVertexBuffer()
Definition: mesh.h:562
│ │ │ │ +
virtual int GetNumVertices() const
Definition: mesh.h:558
│ │ │ │ +
Mesh(Far::TopologyRefiner *refiner, int numVertexElements, int numVaryingElements, int level, MeshBitset bits=MeshBitset(), EvaluatorCache *evaluatorCache=NULL, DeviceContext *deviceContext=NULL)
Definition: mesh.h:428
│ │ │ │ + │ │ │ │ + │ │ │ │ +
EvaluatorCacheT< Evaluator > EvaluatorCache
Definition: mesh.h:425
│ │ │ │ +
virtual VertexBufferBinding BindVaryingBuffer()
Definition: mesh.h:566
│ │ │ │ + │ │ │ │ +
PatchTable::VertexBufferBinding VertexBufferBinding
Definition: mesh.h:426
│ │ │ │ +
virtual void UpdateVertexBuffer(float const *vertexData, int startVertex, int numVerts)
Definition: mesh.h:489
│ │ │ │ + │ │ │ │ +
virtual PatchTable * GetPatchTable() const
Definition: mesh.h:550
│ │ │ │ +
virtual Far::PatchTable const * GetFarPatchTable() const
Definition: mesh.h:554
│ │ │ │ + │ │ │ │ +
virtual int GetMaxValence() const
Definition: mesh.h:560
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cpuGLVertexBuffer.h │ │ │ │ │ +mesh.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,94 +30,1077 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_MESH_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_MESH_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include "../osd/opengl.h" │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace OpenSubdiv { │ │ │ │ │ - 34namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 35 │ │ │ │ │ - 36namespace Osd { │ │ │ │ │ - 37 │ │ │ │ │ -47class CpuGLVertexBuffer { │ │ │ │ │ - 48public: │ │ │ │ │ -50 static CpuGLVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 51 void *deviceContext = NULL); │ │ │ │ │ - 52 │ │ │ │ │ -54 ~CpuGLVertexBuffer(); │ │ │ │ │ - 55 │ │ │ │ │ -58 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 59 void *deviceContext = NULL); │ │ │ │ │ - 60 │ │ │ │ │ -62 int GetNumElements() const; │ │ │ │ │ - 63 │ │ │ │ │ -65 int GetNumVertices() const; │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include │ │ │ │ │ + 32#include │ │ │ │ │ + 33#include │ │ │ │ │ + 34 │ │ │ │ │ + 35#include "../far/topologyRefiner.h" │ │ │ │ │ + 36#include "../far/patchTableFactory.h" │ │ │ │ │ + 37#include "../far/stencilTable.h" │ │ │ │ │ + 38#include "../far/stencilTableFactory.h" │ │ │ │ │ + 39 │ │ │ │ │ + 40#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 41 │ │ │ │ │ + 42struct ID3D11DeviceContext; │ │ │ │ │ + 43 │ │ │ │ │ + 44namespace OpenSubdiv { │ │ │ │ │ + 45namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 46 │ │ │ │ │ + 47namespace Osd { │ │ │ │ │ + 48 │ │ │ │ │ +49enum MeshBits { │ │ │ │ │ +50 MeshAdaptive = 0, │ │ │ │ │ +51 MeshInterleaveVarying = 1, │ │ │ │ │ +52 MeshFVarData = 2, │ │ │ │ │ +53 MeshFVarAdaptive = 3, │ │ │ │ │ +54 MeshUseSmoothCornerPatch = 4, │ │ │ │ │ +55 MeshUseSingleCreasePatch = 5, │ │ │ │ │ +56 MeshUseInfSharpPatch = 6, │ │ │ │ │ +57 MeshEndCapBilinearBasis = 7, // exclusive │ │ │ │ │ +58 MeshEndCapBSplineBasis = 8, // exclusive │ │ │ │ │ +59 MeshEndCapGregoryBasis = 9, // exclusive │ │ │ │ │ +60 MeshEndCapLegacyGregory = 10, // exclusive │ │ │ │ │ +61 NUM_MESH_BITS = 11, │ │ │ │ │ + 62}; │ │ │ │ │ +63typedef std::bitset MeshBitset; │ │ │ │ │ + 64 │ │ │ │ │ + 65// ------------------------------------------------------------------------- │ │ │ │ │ +-- │ │ │ │ │ 66 │ │ │ │ │ -69 float * BindCpuBuffer(); │ │ │ │ │ - 70 │ │ │ │ │ -73 GLuint BindVBO(void *deviceContext = NULL); │ │ │ │ │ - 74 │ │ │ │ │ - 75protected: │ │ │ │ │ -77 CpuGLVertexBuffer(int numElements, int numVertices); │ │ │ │ │ - 78 │ │ │ │ │ -80 bool allocate(); │ │ │ │ │ + 67template │ │ │ │ │ +68class MeshInterface { │ │ │ │ │ + 69public: │ │ │ │ │ +70 typedef PATCH_TABLE PatchTable; │ │ │ │ │ +71 typedef typename PatchTable::VertexBufferBinding VertexBufferBinding; │ │ │ │ │ + 72 │ │ │ │ │ + 73public: │ │ │ │ │ +74 MeshInterface() { } │ │ │ │ │ + 75 │ │ │ │ │ +76 virtual ~MeshInterface() { } │ │ │ │ │ + 77 │ │ │ │ │ +78 virtual int GetNumVertices() const = 0; │ │ │ │ │ + 79 │ │ │ │ │ +80 virtual int GetMaxValence() const = 0; │ │ │ │ │ 81 │ │ │ │ │ - 82private: │ │ │ │ │ - 83 int _numElements; │ │ │ │ │ - 84 int _numVertices; │ │ │ │ │ - 85 GLuint _vbo; │ │ │ │ │ - 86 float *_cpuBuffer; │ │ │ │ │ - 87 bool _dataDirty; │ │ │ │ │ - 88}; │ │ │ │ │ +82 virtual void UpdateVertexBuffer(float const *vertexData, │ │ │ │ │ + 83 int startVertex, int numVerts) = 0; │ │ │ │ │ + 84 │ │ │ │ │ +85 virtual void UpdateVaryingBuffer(float const *varyingData, │ │ │ │ │ + 86 int startVertex, int numVerts) = 0; │ │ │ │ │ + 87 │ │ │ │ │ +88 virtual void Refine() = 0; │ │ │ │ │ 89 │ │ │ │ │ - 90} // end namespace Osd │ │ │ │ │ +90 virtual void Synchronize() = 0; │ │ │ │ │ 91 │ │ │ │ │ - 92} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 93using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 94 │ │ │ │ │ - 95} // end namespace OpenSubdiv │ │ │ │ │ - 96 │ │ │ │ │ - 97#endif // OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H │ │ │ │ │ +92 virtual PatchTable * GetPatchTable() const = 0; │ │ │ │ │ + 93 │ │ │ │ │ +94 virtual Far::PatchTable const *GetFarPatchTable() const = 0; │ │ │ │ │ + 95 │ │ │ │ │ +96 virtual VertexBufferBinding BindVertexBuffer() = 0; │ │ │ │ │ + 97 │ │ │ │ │ +98 virtual VertexBufferBinding BindVaryingBuffer() = 0; │ │ │ │ │ + 99 │ │ │ │ │ + 100protected: │ │ │ │ │ +101 static inline void refineMesh(Far::TopologyRefiner & refiner, │ │ │ │ │ + 102 int level, bool adaptive, │ │ │ │ │ + 103 bool singleCreasePatch) { │ │ │ │ │ + 104 if (adaptive) { │ │ │ │ │ + 105 Far::TopologyRefiner::AdaptiveOptions options(level); │ │ │ │ │ + 106 options.useSingleCreasePatch = singleCreasePatch; │ │ │ │ │ + 107 refiner.RefineAdaptive(options); │ │ │ │ │ + 108 } else { │ │ │ │ │ + 109 // This dependency on FVar channels should not be necessary │ │ │ │ │ + 110 bool fullTopologyInLastLevel = refiner.GetNumFVarChannels()>0; │ │ │ │ │ + 111 │ │ │ │ │ + 112 Far::TopologyRefiner::UniformOptions options(level); │ │ │ │ │ + 113 options.fullTopologyInLastLevel = fullTopologyInLastLevel; │ │ │ │ │ + 114 refiner.RefineUniform(options); │ │ │ │ │ + 115 } │ │ │ │ │ + 116 } │ │ │ │ │ +117 static inline void refineMesh(Far::TopologyRefiner & refiner, │ │ │ │ │ + 118 int level, MeshBitset bits) { │ │ │ │ │ + 119 if (bits.test(MeshAdaptive)) { │ │ │ │ │ + 120 Far::TopologyRefiner::AdaptiveOptions options(level); │ │ │ │ │ + 121 options.useSingleCreasePatch = bits.test(MeshUseSingleCreasePatch); │ │ │ │ │ + 122 options.useInfSharpPatch = bits.test(MeshUseInfSharpPatch); │ │ │ │ │ + 123 options.considerFVarChannels = bits.test(MeshFVarAdaptive); │ │ │ │ │ + 124 refiner.RefineAdaptive(options); │ │ │ │ │ + 125 } else { │ │ │ │ │ + 126 // This dependency on FVar channels should not be necessary │ │ │ │ │ + 127 bool fullTopologyInLastLevel = refiner.GetNumFVarChannels()>0; │ │ │ │ │ + 128 │ │ │ │ │ + 129 Far::TopologyRefiner::UniformOptions options(level); │ │ │ │ │ + 130 options.fullTopologyInLastLevel = fullTopologyInLastLevel; │ │ │ │ │ + 131 refiner.RefineUniform(options); │ │ │ │ │ + 132 } │ │ │ │ │ + 133 } │ │ │ │ │ + 134}; │ │ │ │ │ + 135 │ │ │ │ │ + 136// ------------------------------------------------------------------------ │ │ │ │ │ +--- │ │ │ │ │ + 137 │ │ │ │ │ + 138template │ │ │ │ │ + 140STENCIL_TABLE const * │ │ │ │ │ +141convertToCompatibleStencilTable( │ │ │ │ │ + 142 SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT *context) { │ │ │ │ │ + 143 if (! table) return NULL; │ │ │ │ │ + 144 return STENCIL_TABLE::Create(table, context); │ │ │ │ │ + 145} │ │ │ │ │ + 146 │ │ │ │ │ + 147template <> │ │ │ │ │ +148inline Far::StencilTable const * │ │ │ │ │ + 149convertToCompatibleStencilTable │ │ │ │ │ +( │ │ │ │ │ + 150 Far::StencilTable const *table, void * /*context*/) { │ │ │ │ │ + 151 // no need for conversion │ │ │ │ │ + 152 // XXX: We don't want to even copy. │ │ │ │ │ + 153 if (! table) return NULL; │ │ │ │ │ + 154 return new Far::StencilTable(*table); │ │ │ │ │ + 155} │ │ │ │ │ + 156 │ │ │ │ │ + 157template <> │ │ │ │ │ +158inline Far::LimitStencilTable const * │ │ │ │ │ + 159convertToCompatibleStencilTable( │ │ │ │ │ + 160 Far::LimitStencilTable const *table, void * /*context*/) { │ │ │ │ │ + 161 // no need for conversion │ │ │ │ │ + 162 // XXX: We don't want to even copy. │ │ │ │ │ + 163 if (! table) return NULL; │ │ │ │ │ + 164 return new Far::LimitStencilTable(*table); │ │ │ │ │ + 165} │ │ │ │ │ + 166 │ │ │ │ │ + 167template <> │ │ │ │ │ +168inline Far::StencilTable const * │ │ │ │ │ + 169convertToCompatibleStencilTable( │ │ │ │ │ + 170 Far::StencilTable const *table, ID3D11DeviceContext * /*context*/) { │ │ │ │ │ + 171 // no need for conversion │ │ │ │ │ + 172 // XXX: We don't want to even copy. │ │ │ │ │ + 173 if (! table) return NULL; │ │ │ │ │ + 174 return new Far::StencilTable(*table); │ │ │ │ │ + 175} │ │ │ │ │ + 176 │ │ │ │ │ + 177// ------------------------------------------------------------------------ │ │ │ │ │ +--- │ │ │ │ │ + 178 │ │ │ │ │ + 179// Osd evaluator cache: for the GPU backends require compiled instance │ │ │ │ │ + 180// (GLXFB, GLCompute, CL) │ │ │ │ │ + 181// │ │ │ │ │ + 182// note: this is just an example usage and client applications are supposed │ │ │ │ │ + 183// to implement their own structure for Evaluator instance. │ │ │ │ │ + 184// │ │ │ │ │ + 185template │ │ │ │ │ +186class EvaluatorCacheT { │ │ │ │ │ + 187public: │ │ │ │ │ +188 ~EvaluatorCacheT() { │ │ │ │ │ + 189 for(typename Evaluators::iterator it = _evaluators.begin(); │ │ │ │ │ + 190 it != _evaluators.end(); ++it) { │ │ │ │ │ + 191 delete it->evaluator; │ │ │ │ │ + 192 } │ │ │ │ │ + 193 } │ │ │ │ │ + 194 │ │ │ │ │ + 195 // XXX: FIXME, linear search │ │ │ │ │ +196 struct Entry { │ │ │ │ │ +197 Entry(BufferDescriptor const &srcDescArg, │ │ │ │ │ + 198 BufferDescriptor const &dstDescArg, │ │ │ │ │ + 199 BufferDescriptor const &duDescArg, │ │ │ │ │ + 200 BufferDescriptor const &dvDescArg, │ │ │ │ │ + 201 EVALUATOR *evalArg) : srcDesc(srcDescArg), dstDesc(dstDescArg), │ │ │ │ │ + 202 duDesc(duDescArg), dvDesc(dvDescArg), │ │ │ │ │ + 203 duuDesc(BufferDescriptor()), │ │ │ │ │ + 204 duvDesc(BufferDescriptor()), │ │ │ │ │ + 205 dvvDesc(BufferDescriptor()), │ │ │ │ │ + 206 evaluator(evalArg) {} │ │ │ │ │ +207 Entry(BufferDescriptor const &srcDescArg, │ │ │ │ │ + 208 BufferDescriptor const &dstDescArg, │ │ │ │ │ + 209 BufferDescriptor const &duDescArg, │ │ │ │ │ + 210 BufferDescriptor const &dvDescArg, │ │ │ │ │ + 211 BufferDescriptor const &duuDescArg, │ │ │ │ │ + 212 BufferDescriptor const &duvDescArg, │ │ │ │ │ + 213 BufferDescriptor const &dvvDescArg, │ │ │ │ │ + 214 EVALUATOR *evalArg) : srcDesc(srcDescArg), dstDesc(dstDescArg), │ │ │ │ │ + 215 duDesc(duDescArg), dvDesc(dvDescArg), │ │ │ │ │ + 216 duuDesc(duuDescArg), │ │ │ │ │ + 217 duvDesc(duvDescArg), │ │ │ │ │ + 218 dvvDesc(dvvDescArg), │ │ │ │ │ + 219 evaluator(evalArg) {} │ │ │ │ │ +220 BufferDescriptor srcDesc, dstDesc; │ │ │ │ │ +221 BufferDescriptor duDesc, dvDesc; │ │ │ │ │ +222 BufferDescriptor duuDesc, duvDesc, dvvDesc; │ │ │ │ │ +223 EVALUATOR *evaluator; │ │ │ │ │ + 224 }; │ │ │ │ │ +225 typedef std::vector Evaluators; │ │ │ │ │ + 226 │ │ │ │ │ + 227 template │ │ │ │ │ +228 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc, │ │ │ │ │ + 229 BufferDescriptor const &dstDesc, │ │ │ │ │ + 230 DEVICE_CONTEXT *deviceContext) { │ │ │ │ │ + 231 return GetEvaluator(srcDesc, dstDesc, │ │ │ │ │ + 232 BufferDescriptor(), │ │ │ │ │ + 233 BufferDescriptor(), │ │ │ │ │ + 234 BufferDescriptor(), │ │ │ │ │ + 235 BufferDescriptor(), │ │ │ │ │ + 236 BufferDescriptor(), │ │ │ │ │ + 237 deviceContext); │ │ │ │ │ + 238 } │ │ │ │ │ + 239 │ │ │ │ │ + 240 template │ │ │ │ │ +241 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc, │ │ │ │ │ + 242 BufferDescriptor const &dstDesc, │ │ │ │ │ + 243 BufferDescriptor const &duDesc, │ │ │ │ │ + 244 BufferDescriptor const &dvDesc, │ │ │ │ │ + 245 DEVICE_CONTEXT *deviceContext) { │ │ │ │ │ + 246 return GetEvaluator(srcDesc, dstDesc, │ │ │ │ │ + 247 duDesc, dvDesc, │ │ │ │ │ + 248 BufferDescriptor(), │ │ │ │ │ + 249 BufferDescriptor(), │ │ │ │ │ + 250 BufferDescriptor(), │ │ │ │ │ + 251 deviceContext); │ │ │ │ │ + 252 } │ │ │ │ │ + 253 │ │ │ │ │ + 254 template │ │ │ │ │ +255 EVALUATOR *GetEvaluator(BufferDescriptor const &srcDesc, │ │ │ │ │ + 256 BufferDescriptor const &dstDesc, │ │ │ │ │ + 257 BufferDescriptor const &duDesc, │ │ │ │ │ + 258 BufferDescriptor const &dvDesc, │ │ │ │ │ + 259 BufferDescriptor const &duuDesc, │ │ │ │ │ + 260 BufferDescriptor const &duvDesc, │ │ │ │ │ + 261 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 262 DEVICE_CONTEXT *deviceContext) { │ │ │ │ │ + 263 │ │ │ │ │ + 264 for(typename Evaluators::iterator it = _evaluators.begin(); │ │ │ │ │ + 265 it != _evaluators.end(); ++it) { │ │ │ │ │ + 266 if (isEqual(srcDesc, it->srcDesc) && │ │ │ │ │ + 267 isEqual(dstDesc, it->dstDesc) && │ │ │ │ │ + 268 isEqual(duDesc, it->duDesc) && │ │ │ │ │ + 269 isEqual(dvDesc, it->dvDesc) && │ │ │ │ │ + 270 isEqual(duuDesc, it->duuDesc) && │ │ │ │ │ + 271 isEqual(duvDesc, it->duvDesc) && │ │ │ │ │ + 272 isEqual(dvvDesc, it->dvvDesc)) { │ │ │ │ │ + 273 return it->evaluator; │ │ │ │ │ + 274 } │ │ │ │ │ + 275 } │ │ │ │ │ + 276 EVALUATOR *e = EVALUATOR::Create(srcDesc, dstDesc, │ │ │ │ │ + 277 duDesc, dvDesc, │ │ │ │ │ + 278 duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 279 deviceContext); │ │ │ │ │ + 280 _evaluators.push_back(Entry(srcDesc, dstDesc, │ │ │ │ │ + 281 duDesc, dvDesc, │ │ │ │ │ + 282 duuDesc, duvDesc, dvvDesc, e)); │ │ │ │ │ + 283 return e; │ │ │ │ │ + 284 } │ │ │ │ │ + 285 │ │ │ │ │ + 286private: │ │ │ │ │ + 287 static bool isEqual(BufferDescriptor const &a, │ │ │ │ │ + 288 BufferDescriptor const &b) { │ │ │ │ │ + 289 int offsetA = a.stride ? (a.offset % a.stride) : 0; │ │ │ │ │ + 290 int offsetB = b.stride ? (b.offset % b.stride) : 0; │ │ │ │ │ + 291 │ │ │ │ │ + 292 // Note: XFB kernel needs to be configured with the local offset │ │ │ │ │ + 293 // of the dstDesc to skip preceding primvars. │ │ │ │ │ + 294 return (offsetA == offsetB && │ │ │ │ │ + 295 a.length == b.length && │ │ │ │ │ + 296 a.stride == b.stride); │ │ │ │ │ + 297 } │ │ │ │ │ + 298 │ │ │ │ │ + 299 Evaluators _evaluators; │ │ │ │ │ + 300}; │ │ │ │ │ + 301 │ │ │ │ │ + 303 │ │ │ │ │ + 304// template helpers to see if the evaluator is instantiatable or not. │ │ │ │ │ + 305template │ │ │ │ │ + 306struct instantiatable │ │ │ │ │ + 307{ │ │ │ │ │ + 308 typedef char yes[1]; │ │ │ │ │ + 309 typedef char no[2]; │ │ │ │ │ + 310 template static yes &chk(typename C::Instantiatable *t=0); │ │ │ │ │ + 311 template static no &chk(...); │ │ │ │ │ + 312 static bool const value = sizeof(chk(0)) == sizeof(yes); │ │ │ │ │ + 313}; │ │ │ │ │ + 314template │ │ │ │ │ + 315struct enable_if { typedef T type; }; │ │ │ │ │ + 316template │ │ │ │ │ + 317struct enable_if { }; │ │ │ │ │ + 318 │ │ │ │ │ + 320 │ │ │ │ │ + 321// extract a kernel from cache if available │ │ │ │ │ + 322template │ │ │ │ │ + 323static EVALUATOR *GetEvaluator( │ │ │ │ │ + 324 EvaluatorCacheT *cache, │ │ │ │ │ + 325 BufferDescriptor const &srcDesc, │ │ │ │ │ + 326 BufferDescriptor const &dstDesc, │ │ │ │ │ + 327 BufferDescriptor const &duDesc, │ │ │ │ │ + 328 BufferDescriptor const &dvDesc, │ │ │ │ │ + 329 BufferDescriptor const &duuDesc, │ │ │ │ │ + 330 BufferDescriptor const &duvDesc, │ │ │ │ │ + 331 BufferDescriptor const &dvvDesc, │ │ │ │ │ + 332 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 333 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 334 (void)t; │ │ │ │ │ + 335 if (cache == NULL) return NULL; │ │ │ │ │ + 336 return cache->GetEvaluator(srcDesc, dstDesc, │ │ │ │ │ + 337 duDesc, dvDesc, duuDesc, duvDesc, dvvDesc, │ │ │ │ │ + 338 deviceContext); │ │ │ │ │ + 339} │ │ │ │ │ + 340 │ │ │ │ │ + 341template │ │ │ │ │ + 342static EVALUATOR *GetEvaluator( │ │ │ │ │ + 343 EvaluatorCacheT *cache, │ │ │ │ │ + 344 BufferDescriptor const &srcDesc, │ │ │ │ │ + 345 BufferDescriptor const &dstDesc, │ │ │ │ │ + 346 BufferDescriptor const &duDesc, │ │ │ │ │ + 347 BufferDescriptor const &dvDesc, │ │ │ │ │ + 348 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 349 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 350 (void)t; │ │ │ │ │ + 351 if (cache == NULL) return NULL; │ │ │ │ │ + 352 return cache->GetEvaluator(srcDesc, dstDesc, duDesc, dvDesc, │ │ │ │ │ +deviceContext); │ │ │ │ │ + 353} │ │ │ │ │ + 354 │ │ │ │ │ + 355template │ │ │ │ │ + 356static EVALUATOR *GetEvaluator( │ │ │ │ │ + 357 EvaluatorCacheT *cache, │ │ │ │ │ + 358 BufferDescriptor const &srcDesc, │ │ │ │ │ + 359 BufferDescriptor const &dstDesc, │ │ │ │ │ + 360 DEVICE_CONTEXT deviceContext, │ │ │ │ │ + 361 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 362 (void)t; │ │ │ │ │ + 363 if (cache == NULL) return NULL; │ │ │ │ │ + 364 return cache->GetEvaluator(srcDesc, dstDesc, │ │ │ │ │ + 365 BufferDescriptor(), │ │ │ │ │ + 366 BufferDescriptor(), │ │ │ │ │ + 367 deviceContext); │ │ │ │ │ + 368} │ │ │ │ │ + 369 │ │ │ │ │ + 370// fallback │ │ │ │ │ + 371template │ │ │ │ │ + 372static EVALUATOR *GetEvaluator( │ │ │ │ │ + 373 EvaluatorCacheT *, │ │ │ │ │ + 374 BufferDescriptor const &, │ │ │ │ │ + 375 BufferDescriptor const &, │ │ │ │ │ + 376 BufferDescriptor const &, │ │ │ │ │ + 377 BufferDescriptor const &, │ │ │ │ │ + 378 BufferDescriptor const &, │ │ │ │ │ + 379 BufferDescriptor const &, │ │ │ │ │ + 380 BufferDescriptor const &, │ │ │ │ │ + 381 DEVICE_CONTEXT, │ │ │ │ │ + 382 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 383 (void)t; │ │ │ │ │ + 384 return NULL; │ │ │ │ │ + 385} │ │ │ │ │ + 386 │ │ │ │ │ + 387template │ │ │ │ │ + 388static EVALUATOR *GetEvaluator( │ │ │ │ │ + 389 EvaluatorCacheT *, │ │ │ │ │ + 390 BufferDescriptor const &, │ │ │ │ │ + 391 BufferDescriptor const &, │ │ │ │ │ + 392 BufferDescriptor const &, │ │ │ │ │ + 393 BufferDescriptor const &, │ │ │ │ │ + 394 DEVICE_CONTEXT, │ │ │ │ │ + 395 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 396 (void)t; │ │ │ │ │ + 397 return NULL; │ │ │ │ │ + 398} │ │ │ │ │ + 399 │ │ │ │ │ + 400template │ │ │ │ │ + 401static EVALUATOR *GetEvaluator( │ │ │ │ │ + 402 EvaluatorCacheT *, │ │ │ │ │ + 403 BufferDescriptor const &, │ │ │ │ │ + 404 BufferDescriptor const &, │ │ │ │ │ + 405 DEVICE_CONTEXT, │ │ │ │ │ + 406 typename enable_if::value, void>::type*t=0) { │ │ │ │ │ + 407 (void)t; │ │ │ │ │ + 408 return NULL; │ │ │ │ │ + 409} │ │ │ │ │ + 410 │ │ │ │ │ + 411// ------------------------------------------------------------------------ │ │ │ │ │ +--- │ │ │ │ │ + 412 │ │ │ │ │ + 413template │ │ │ │ │ +418class Mesh : public MeshInterface { │ │ │ │ │ + 419public: │ │ │ │ │ +420 typedef VERTEX_BUFFER VertexBuffer; │ │ │ │ │ +421 typedef EVALUATOR Evaluator; │ │ │ │ │ +422 typedef STENCIL_TABLE StencilTable; │ │ │ │ │ +423 typedef PATCH_TABLE PatchTable; │ │ │ │ │ +424 typedef DEVICE_CONTEXT DeviceContext; │ │ │ │ │ +425 typedef EvaluatorCacheT EvaluatorCache; │ │ │ │ │ +426 typedef typename PatchTable::VertexBufferBinding VertexBufferBinding; │ │ │ │ │ + 427 │ │ │ │ │ +428 Mesh(Far::TopologyRefiner * refiner, │ │ │ │ │ + 429 int numVertexElements, │ │ │ │ │ + 430 int numVaryingElements, │ │ │ │ │ + 431 int level, │ │ │ │ │ + 432 MeshBitset bits = MeshBitset(), │ │ │ │ │ + 433 EvaluatorCache * evaluatorCache = NULL, │ │ │ │ │ + 434 DeviceContext * deviceContext = NULL) : │ │ │ │ │ + 435 │ │ │ │ │ + 436 _refiner(refiner), │ │ │ │ │ + 437 _farPatchTable(NULL), │ │ │ │ │ + 438 _numVertices(0), │ │ │ │ │ + 439 _maxValence(0), │ │ │ │ │ + 440 _vertexBuffer(NULL), │ │ │ │ │ + 441 _varyingBuffer(NULL), │ │ │ │ │ + 442 _vertexStencilTable(NULL), │ │ │ │ │ + 443 _varyingStencilTable(NULL), │ │ │ │ │ + 444 _evaluatorCache(evaluatorCache), │ │ │ │ │ + 445 _patchTable(NULL), │ │ │ │ │ + 446 _deviceContext(deviceContext) { │ │ │ │ │ + 447 │ │ │ │ │ + 448 assert(_refiner); │ │ │ │ │ + 449 │ │ │ │ │ + 450 MeshInterface::refineMesh( │ │ │ │ │ + 451 *_refiner, level, bits); │ │ │ │ │ + 452 │ │ │ │ │ + 453 int vertexBufferStride = numVertexElements + │ │ │ │ │ + 454 (bits.test(MeshInterleaveVarying) ? numVaryingElements : 0); │ │ │ │ │ + 455 int varyingBufferStride = │ │ │ │ │ + 456 (bits.test(MeshInterleaveVarying) ? 0 : numVaryingElements); │ │ │ │ │ + 457 │ │ │ │ │ + 458 initializeContext(numVertexElements, │ │ │ │ │ + 459 numVaryingElements, │ │ │ │ │ + 460 level, bits); │ │ │ │ │ + 461 │ │ │ │ │ + 462 initializeVertexBuffers(_numVertices, │ │ │ │ │ + 463 vertexBufferStride, │ │ │ │ │ + 464 varyingBufferStride); │ │ │ │ │ + 465 │ │ │ │ │ + 466 // configure vertex buffer descriptor │ │ │ │ │ + 467 _vertexDesc = │ │ │ │ │ + 468 BufferDescriptor(0, numVertexElements, vertexBufferStride); │ │ │ │ │ + 469 if (bits.test(MeshInterleaveVarying)) { │ │ │ │ │ + 470 _varyingDesc = BufferDescriptor( │ │ │ │ │ + 471 numVertexElements, numVaryingElements, vertexBufferStride); │ │ │ │ │ + 472 } else { │ │ │ │ │ + 473 _varyingDesc = BufferDescriptor( │ │ │ │ │ + 474 0, numVaryingElements, varyingBufferStride); │ │ │ │ │ + 475 } │ │ │ │ │ + 476 } │ │ │ │ │ + 477 │ │ │ │ │ +478 virtual ~Mesh() { │ │ │ │ │ + 479 delete _refiner; │ │ │ │ │ + 480 delete _farPatchTable; │ │ │ │ │ + 481 delete _vertexBuffer; │ │ │ │ │ + 482 delete _varyingBuffer; │ │ │ │ │ + 483 delete _vertexStencilTable; │ │ │ │ │ + 484 delete _varyingStencilTable; │ │ │ │ │ + 485 delete _patchTable; │ │ │ │ │ + 486 // deviceContext and evaluatorCache are not owned by this class. │ │ │ │ │ + 487 } │ │ │ │ │ + 488 │ │ │ │ │ +489 virtual void UpdateVertexBuffer(float const *vertexData, │ │ │ │ │ + 490 int startVertex, int numVerts) { │ │ │ │ │ + 491 _vertexBuffer->UpdateData(vertexData, startVertex, numVerts, │ │ │ │ │ + 492 _deviceContext); │ │ │ │ │ + 493 } │ │ │ │ │ + 494 │ │ │ │ │ +495 virtual void UpdateVaryingBuffer(float const *varyingData, │ │ │ │ │ + 496 int startVertex, int numVerts) { │ │ │ │ │ + 497 _varyingBuffer->UpdateData(varyingData, startVertex, numVerts, │ │ │ │ │ + 498 _deviceContext); │ │ │ │ │ + 499 } │ │ │ │ │ + 500 │ │ │ │ │ +501 virtual void Refine() { │ │ │ │ │ + 502 │ │ │ │ │ + 503 int numControlVertices = _refiner->GetLevel(0).GetNumVertices(); │ │ │ │ │ + 504 │ │ │ │ │ + 505 BufferDescriptor srcDesc = _vertexDesc; │ │ │ │ │ + 506 BufferDescriptor dstDesc(srcDesc); │ │ │ │ │ + 507 dstDesc.offset += numControlVertices * dstDesc.stride; │ │ │ │ │ + 508 │ │ │ │ │ + 509 // note that the _evaluatorCache can be NULL and thus │ │ │ │ │ + 510 // the evaluatorInstance can be NULL │ │ │ │ │ + 511 // (for uninstantiatable kernels CPU,TBB etc) │ │ │ │ │ + 512 Evaluator const *instance = GetEvaluator( │ │ │ │ │ + 513 _evaluatorCache, srcDesc, dstDesc, │ │ │ │ │ + 514 _deviceContext); │ │ │ │ │ + 515 │ │ │ │ │ + 516 Evaluator::EvalStencils(_vertexBuffer, srcDesc, │ │ │ │ │ + 517 _vertexBuffer, dstDesc, │ │ │ │ │ + 518 _vertexStencilTable, │ │ │ │ │ + 519 instance, _deviceContext); │ │ │ │ │ + 520 │ │ │ │ │ + 521 if (_varyingDesc.length > 0) { │ │ │ │ │ + 522 BufferDescriptor vSrcDesc = _varyingDesc; │ │ │ │ │ + 523 BufferDescriptor vDstDesc(vSrcDesc); │ │ │ │ │ + 524 vDstDesc.offset += numControlVertices * vDstDesc.stride; │ │ │ │ │ + 525 │ │ │ │ │ + 526 instance = GetEvaluator( │ │ │ │ │ + 527 _evaluatorCache, vSrcDesc, vDstDesc, │ │ │ │ │ + 528 _deviceContext); │ │ │ │ │ + 529 │ │ │ │ │ + 530 if (_varyingBuffer) { │ │ │ │ │ + 531 // non-interleaved │ │ │ │ │ + 532 Evaluator::EvalStencils(_varyingBuffer, vSrcDesc, │ │ │ │ │ + 533 _varyingBuffer, vDstDesc, │ │ │ │ │ + 534 _varyingStencilTable, │ │ │ │ │ + 535 instance, _deviceContext); │ │ │ │ │ + 536 } else { │ │ │ │ │ + 537 // interleaved │ │ │ │ │ + 538 Evaluator::EvalStencils(_vertexBuffer, vSrcDesc, │ │ │ │ │ + 539 _vertexBuffer, vDstDesc, │ │ │ │ │ + 540 _varyingStencilTable, │ │ │ │ │ + 541 instance, _deviceContext); │ │ │ │ │ + 542 } │ │ │ │ │ + 543 } │ │ │ │ │ + 544 } │ │ │ │ │ + 545 │ │ │ │ │ +546 virtual void Synchronize() { │ │ │ │ │ + 547 Evaluator::Synchronize(_deviceContext); │ │ │ │ │ + 548 } │ │ │ │ │ + 549 │ │ │ │ │ +550 virtual PatchTable * GetPatchTable() const { │ │ │ │ │ + 551 return _patchTable; │ │ │ │ │ + 552 } │ │ │ │ │ + 553 │ │ │ │ │ +554 virtual Far::PatchTable const *GetFarPatchTable() const { │ │ │ │ │ + 555 return _farPatchTable; │ │ │ │ │ + 556 } │ │ │ │ │ + 557 │ │ │ │ │ +558 virtual int GetNumVertices() const { return _numVertices; } │ │ │ │ │ + 559 │ │ │ │ │ +560 virtual int GetMaxValence() const { return _maxValence; } │ │ │ │ │ + 561 │ │ │ │ │ +562 virtual VertexBufferBinding BindVertexBuffer() { │ │ │ │ │ + 563 return _vertexBuffer->BindVBO(_deviceContext); │ │ │ │ │ + 564 } │ │ │ │ │ + 565 │ │ │ │ │ +566 virtual VertexBufferBinding BindVaryingBuffer() { │ │ │ │ │ + 567 return _varyingBuffer->BindVBO(_deviceContext); │ │ │ │ │ + 568 } │ │ │ │ │ + 569 │ │ │ │ │ +570 virtual VertexBuffer * GetVertexBuffer() { │ │ │ │ │ + 571 return _vertexBuffer; │ │ │ │ │ + 572 } │ │ │ │ │ + 573 │ │ │ │ │ +574 virtual VertexBuffer * GetVaryingBuffer() { │ │ │ │ │ + 575 return _varyingBuffer; │ │ │ │ │ + 576 } │ │ │ │ │ + 577 │ │ │ │ │ +578 virtual Far::TopologyRefiner const * GetTopologyRefiner() const { │ │ │ │ │ + 579 return _refiner; │ │ │ │ │ + 580 } │ │ │ │ │ + 581 │ │ │ │ │ + 582private: │ │ │ │ │ + 583 void initializeContext(int numVertexElements, │ │ │ │ │ + 584 int numVaryingElements, │ │ │ │ │ + 585 int level, MeshBitset bits) { │ │ │ │ │ + 586 assert(_refiner); │ │ │ │ │ + 587 │ │ │ │ │ + 588 Far::StencilTableFactory::Options options; │ │ │ │ │ + 589 options.generateOffsets = true; │ │ │ │ │ + 590 options.generateIntermediateLevels = │ │ │ │ │ + 591 _refiner->IsUniform() ? false : true; │ │ │ │ │ + 592 │ │ │ │ │ + 593 Far::StencilTable const * vertexStencils = NULL; │ │ │ │ │ + 594 Far::StencilTable const * varyingStencils = NULL; │ │ │ │ │ + 595 │ │ │ │ │ + 596 if (numVertexElements>0) { │ │ │ │ │ + 597 │ │ │ │ │ + 598 vertexStencils = Far::StencilTableFactory::Create(*_refiner, │ │ │ │ │ + 599 options); │ │ │ │ │ + 600 } │ │ │ │ │ + 601 │ │ │ │ │ + 602 if (numVaryingElements>0) { │ │ │ │ │ + 603 │ │ │ │ │ + 604 options.interpolationMode = │ │ │ │ │ + 605 Far::StencilTableFactory::INTERPOLATE_VARYING; │ │ │ │ │ + 606 │ │ │ │ │ + 607 varyingStencils = Far::StencilTableFactory::Create(*_refiner, │ │ │ │ │ + 608 options); │ │ │ │ │ + 609 } │ │ │ │ │ + 610 │ │ │ │ │ + 611 Far::PatchTableFactory::Options poptions(level); │ │ │ │ │ + 612 poptions.generateFVarTables = bits.test(MeshFVarData); │ │ │ │ │ + 613 poptions.generateFVarLegacyLinearPatches = !bits.test(MeshFVarAdaptive); │ │ │ │ │ + 614 poptions.generateLegacySharpCornerPatches = !bits.test │ │ │ │ │ +(MeshUseSmoothCornerPatch); │ │ │ │ │ + 615 poptions.useSingleCreasePatch = bits.test(MeshUseSingleCreasePatch); │ │ │ │ │ + 616 poptions.useInfSharpPatch = bits.test(MeshUseInfSharpPatch); │ │ │ │ │ + 617 │ │ │ │ │ + 618 // points on bilinear and gregory basis endcap boundaries can be │ │ │ │ │ + 619 // shared among adjacent patches to save some stencils. │ │ │ │ │ + 620 if (bits.test(MeshEndCapBilinearBasis)) { │ │ │ │ │ + 621 poptions.SetEndCapType( │ │ │ │ │ + 622 Far::PatchTableFactory::Options::ENDCAP_BILINEAR_BASIS); │ │ │ │ │ + 623 poptions.shareEndCapPatchPoints = true; │ │ │ │ │ + 624 } else if (bits.test(MeshEndCapBSplineBasis)) { │ │ │ │ │ + 625 poptions.SetEndCapType( │ │ │ │ │ + 626 Far::PatchTableFactory::Options::ENDCAP_BSPLINE_BASIS); │ │ │ │ │ + 627 } else if (bits.test(MeshEndCapGregoryBasis)) { │ │ │ │ │ + 628 poptions.SetEndCapType( │ │ │ │ │ + 629 Far::PatchTableFactory::Options::ENDCAP_GREGORY_BASIS); │ │ │ │ │ + 630 poptions.shareEndCapPatchPoints = true; │ │ │ │ │ + 631 } else if (bits.test(MeshEndCapLegacyGregory)) { │ │ │ │ │ + 632 poptions.SetEndCapType( │ │ │ │ │ + 633 Far::PatchTableFactory::Options::ENDCAP_LEGACY_GREGORY); │ │ │ │ │ + 634 } │ │ │ │ │ + 635 │ │ │ │ │ + 636 _farPatchTable = Far::PatchTableFactory::Create(*_refiner, poptions); │ │ │ │ │ + 637 │ │ │ │ │ + 638 // if there's endcap stencils, merge it into regular stencils. │ │ │ │ │ + 639 if (_farPatchTable->GetLocalPointStencilTable()) { │ │ │ │ │ + 640 // append stencils │ │ │ │ │ + 641 if (Far::StencilTable const *vertexStencilsWithLocalPoints = │ │ │ │ │ + 642 Far::StencilTableFactory::AppendLocalPointStencilTable( │ │ │ │ │ + 643 *_refiner, │ │ │ │ │ + 644 vertexStencils, │ │ │ │ │ + 645 _farPatchTable->GetLocalPointStencilTable())) { │ │ │ │ │ + 646 delete vertexStencils; │ │ │ │ │ + 647 vertexStencils = vertexStencilsWithLocalPoints; │ │ │ │ │ + 648 } │ │ │ │ │ + 649 if (varyingStencils) { │ │ │ │ │ + 650 if (Far::StencilTable const *varyingStencilsWithLocalPoints = │ │ │ │ │ + 651 Far::StencilTableFactory::AppendLocalPointStencilTable( │ │ │ │ │ + 652 *_refiner, │ │ │ │ │ + 653 varyingStencils, │ │ │ │ │ + 654 _farPatchTable->GetLocalPointVaryingStencilTable())) { │ │ │ │ │ + 655 delete varyingStencils; │ │ │ │ │ + 656 varyingStencils = varyingStencilsWithLocalPoints; │ │ │ │ │ + 657 } │ │ │ │ │ + 658 } │ │ │ │ │ + 659 } │ │ │ │ │ + 660 │ │ │ │ │ + 661 _maxValence = _farPatchTable->GetMaxValence(); │ │ │ │ │ + 662 _patchTable = PatchTable::Create(_farPatchTable, _deviceContext); │ │ │ │ │ + 663 │ │ │ │ │ + 664 // numvertices = coarse verts + refined verts + gregory basis verts │ │ │ │ │ + 665 _numVertices = vertexStencils->GetNumControlVertices() │ │ │ │ │ + 666 + vertexStencils->GetNumStencils(); │ │ │ │ │ + 667 │ │ │ │ │ + 668 // convert to device stenciltable if necessary. │ │ │ │ │ + 669 _vertexStencilTable = │ │ │ │ │ + 670 convertToCompatibleStencilTable( │ │ │ │ │ + 671 vertexStencils, _deviceContext); │ │ │ │ │ + 672 _varyingStencilTable = │ │ │ │ │ + 673 convertToCompatibleStencilTable( │ │ │ │ │ + 674 varyingStencils, _deviceContext); │ │ │ │ │ + 675 │ │ │ │ │ + 676 // FIXME: we do extra copyings for Far::Stencils. │ │ │ │ │ + 677 delete vertexStencils; │ │ │ │ │ + 678 delete varyingStencils; │ │ │ │ │ + 679 } │ │ │ │ │ + 680 │ │ │ │ │ + 681 void initializeVertexBuffers(int numVertices, │ │ │ │ │ + 682 int numVertexElements, │ │ │ │ │ + 683 int numVaryingElements) { │ │ │ │ │ + 684 │ │ │ │ │ + 685 if (numVertexElements) { │ │ │ │ │ + 686 _vertexBuffer = VertexBuffer::Create(numVertexElements, │ │ │ │ │ + 687 numVertices, _deviceContext); │ │ │ │ │ + 688 } │ │ │ │ │ + 689 │ │ │ │ │ + 690 if (numVaryingElements) { │ │ │ │ │ + 691 _varyingBuffer = VertexBuffer::Create(numVaryingElements, │ │ │ │ │ + 692 numVertices, _deviceContext); │ │ │ │ │ + 693 } │ │ │ │ │ + 694 } │ │ │ │ │ + 695 │ │ │ │ │ + 696 Far::TopologyRefiner * _refiner; │ │ │ │ │ + 697 Far::PatchTable * _farPatchTable; │ │ │ │ │ + 698 │ │ │ │ │ + 699 int _numVertices; │ │ │ │ │ + 700 int _maxValence; │ │ │ │ │ + 701 │ │ │ │ │ + 702 VertexBuffer * _vertexBuffer; │ │ │ │ │ + 703 VertexBuffer * _varyingBuffer; │ │ │ │ │ + 704 │ │ │ │ │ + 705 BufferDescriptor _vertexDesc; │ │ │ │ │ + 706 BufferDescriptor _varyingDesc; │ │ │ │ │ + 707 │ │ │ │ │ + 708 StencilTable const * _vertexStencilTable; │ │ │ │ │ + 709 StencilTable const * _varyingStencilTable; │ │ │ │ │ + 710 EvaluatorCache * _evaluatorCache; │ │ │ │ │ + 711 │ │ │ │ │ + 712 PatchTable *_patchTable; │ │ │ │ │ + 713 DeviceContext *_deviceContext; │ │ │ │ │ + 714}; │ │ │ │ │ + 715 │ │ │ │ │ + 716} // end namespace Osd │ │ │ │ │ + 717 │ │ │ │ │ + 718} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 719using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 720 │ │ │ │ │ + 721} // end namespace OpenSubdiv │ │ │ │ │ + 722 │ │ │ │ │ + 723#endif // OPENSUBDIV3_OSD_MESH_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer │ │ │ │ │ -Concrete vertex buffer class for cpu subdivision and OpenGL drawing. │ │ │ │ │ -Definition: cpuGLVertexBuffer.h:47 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::CpuGLVertexBuffer │ │ │ │ │ -CpuGLVertexBuffer(int numElements, int numVertices) │ │ │ │ │ -Constructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::BindVBO │ │ │ │ │ -GLuint BindVBO(void *deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::GetNumVertices │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::convertToCompatibleStencilTable │ │ │ │ │ +STENCIL_TABLE const * convertToCompatibleStencilTable(SRC_STENCIL_TABLE const │ │ │ │ │ +*table, DEVICE_CONTEXT *context) │ │ │ │ │ +Definition: mesh.h:141 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshBits │ │ │ │ │ +MeshBits │ │ │ │ │ +Definition: mesh.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshEndCapBilinearBasis │ │ │ │ │ +@ MeshEndCapBilinearBasis │ │ │ │ │ +Definition: mesh.h:57 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::NUM_MESH_BITS │ │ │ │ │ +@ NUM_MESH_BITS │ │ │ │ │ +Definition: mesh.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshUseInfSharpPatch │ │ │ │ │ +@ MeshUseInfSharpPatch │ │ │ │ │ +Definition: mesh.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshUseSingleCreasePatch │ │ │ │ │ +@ MeshUseSingleCreasePatch │ │ │ │ │ +Definition: mesh.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterleaveVarying │ │ │ │ │ +@ MeshInterleaveVarying │ │ │ │ │ +Definition: mesh.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshFVarAdaptive │ │ │ │ │ +@ MeshFVarAdaptive │ │ │ │ │ +Definition: mesh.h:53 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshEndCapGregoryBasis │ │ │ │ │ +@ MeshEndCapGregoryBasis │ │ │ │ │ +Definition: mesh.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshEndCapBSplineBasis │ │ │ │ │ +@ MeshEndCapBSplineBasis │ │ │ │ │ +Definition: mesh.h:58 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshEndCapLegacyGregory │ │ │ │ │ +@ MeshEndCapLegacyGregory │ │ │ │ │ +Definition: mesh.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshUseSmoothCornerPatch │ │ │ │ │ +@ MeshUseSmoothCornerPatch │ │ │ │ │ +Definition: mesh.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshFVarData │ │ │ │ │ +@ MeshFVarData │ │ │ │ │ +Definition: mesh.h:52 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshAdaptive │ │ │ │ │ +@ MeshAdaptive │ │ │ │ │ +Definition: mesh.h:50 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshBitset │ │ │ │ │ +std::bitset< NUM_MESH_BITS > MeshBitset │ │ │ │ │ +Definition: mesh.h:63 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetMaxValence │ │ │ │ │ +int GetMaxValence() const │ │ │ │ │ +Returns max vertex valence. │ │ │ │ │ +Definition: patchTable.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable::GetLocalPointStencilTable │ │ │ │ │ +StencilTable const * GetLocalPointStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point vertex values. │ │ │ │ │ +Definition: patchTable.h:730 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable:: │ │ │ │ │ +GetLocalPointVaryingStencilTable │ │ │ │ │ +StencilTable const * GetLocalPointVaryingStencilTable() const │ │ │ │ │ +Returns the stencil table to compute local point varying values. │ │ │ │ │ +Definition: patchTable.h:735 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Create │ │ │ │ │ +static PatchTable * Create(TopologyRefiner const &refiner, Options │ │ │ │ │ +options=Options(), ConstIndexArray selectedFaces=ConstIndexArray()) │ │ │ │ │ +Instantiates a PatchTable from a client-provided TopologyRefiner. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Options │ │ │ │ │ +Public options for the PatchTable factory. │ │ │ │ │ +Definition: patchTableFactory.h:45 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Options:: │ │ │ │ │ +ENDCAP_LEGACY_GREGORY │ │ │ │ │ +@ ENDCAP_LEGACY_GREGORY │ │ │ │ │ +legacy option for 2.x style Gregory patches (Catmark only) │ │ │ │ │ +Definition: patchTableFactory.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Options:: │ │ │ │ │ +ENDCAP_GREGORY_BASIS │ │ │ │ │ +@ ENDCAP_GREGORY_BASIS │ │ │ │ │ +use Gregory patches (highest quality, recommended default) │ │ │ │ │ +Definition: patchTableFactory.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Options:: │ │ │ │ │ +ENDCAP_BILINEAR_BASIS │ │ │ │ │ +@ ENDCAP_BILINEAR_BASIS │ │ │ │ │ +use linear patches (simple quads or tris) │ │ │ │ │ +Definition: patchTableFactory.h:57 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTableFactory::Options:: │ │ │ │ │ +ENDCAP_BSPLINE_BASIS │ │ │ │ │ +@ ENDCAP_BSPLINE_BASIS │ │ │ │ │ +use BSpline-like patches (same patch type as regular) │ │ │ │ │ +Definition: patchTableFactory.h:58 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableFactoryReal<_float_>:: │ │ │ │ │ +INTERPOLATE_VARYING │ │ │ │ │ +@ INTERPOLATE_VARYING │ │ │ │ │ +varying primvar stencils │ │ │ │ │ +Definition: stencilTableFactory.h:57 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal::GetNumControlVertices │ │ │ │ │ +int GetNumControlVertices() const │ │ │ │ │ +Returns the number of control vertices indexed in the table. │ │ │ │ │ +Definition: stencilTable.h:161 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableReal::GetNumStencils │ │ │ │ │ +int GetNumStencils() const │ │ │ │ │ +Returns the number of stencils in the table. │ │ │ │ │ +Definition: stencilTable.h:156 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable │ │ │ │ │ +Stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:273 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable │ │ │ │ │ +Limit stencil table class wrapping the template for compatibility. │ │ │ │ │ +Definition: stencilTable.h:583 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableFactory::Create │ │ │ │ │ +static StencilTable const * Create(TopologyRefiner const &refiner, Options │ │ │ │ │ +options=Options()) │ │ │ │ │ +Definition: stencilTableFactory.h:293 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTableFactory:: │ │ │ │ │ +AppendLocalPointStencilTable │ │ │ │ │ +static StencilTable const * AppendLocalPointStencilTable(TopologyRefiner const │ │ │ │ │ +&refiner, StencilTable const *baseStencilTable, StencilTable const │ │ │ │ │ +*localPointStencilTable, bool factorize=true) │ │ │ │ │ +Definition: stencilTableFactory.h:308 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyLevel::GetNumVertices │ │ │ │ │ int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::Create │ │ │ │ │ -static CpuGLVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::allocate │ │ │ │ │ -bool allocate() │ │ │ │ │ -Allocates VBO for this buffer. Returns true if success. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::BindCpuBuffer │ │ │ │ │ -float * BindCpuBuffer() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuGLVertexBuffer::~CpuGLVertexBuffer │ │ │ │ │ -~CpuGLVertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ +Return the number of vertices in this level. │ │ │ │ │ +Definition: topologyLevel.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner │ │ │ │ │ +Stores topology data for a specified set of refinement options. │ │ │ │ │ +Definition: topologyRefiner.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::IsUniform │ │ │ │ │ +bool IsUniform() const │ │ │ │ │ +Returns true if uniform refinement has been applied. │ │ │ │ │ +Definition: topologyRefiner.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Returns the number of face-varying channels in the tables. │ │ │ │ │ +Definition: topologyRefiner.h:293 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineUniform │ │ │ │ │ +void RefineUniform(UniformOptions options) │ │ │ │ │ +Refine the topology uniformly. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::GetLevel │ │ │ │ │ +TopologyLevel const & GetLevel(int level) const │ │ │ │ │ +Returns a handle to access data specific to a particular level. │ │ │ │ │ +Definition: topologyRefiner.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::RefineAdaptive │ │ │ │ │ +void RefineAdaptive(AdaptiveOptions options, ConstIndexArray │ │ │ │ │ +selectedFaces=ConstIndexArray()) │ │ │ │ │ +Feature Adaptive topology refinement. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions │ │ │ │ │ +Uniform refinement options. │ │ │ │ │ +Definition: topologyRefiner.h:118 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::UniformOptions:: │ │ │ │ │ +fullTopologyInLastLevel │ │ │ │ │ +unsigned int fullTopologyInLastLevel │ │ │ │ │ +Definition: topologyRefiner.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions │ │ │ │ │ +Adaptive refinement options. │ │ │ │ │ +Definition: topologyRefiner.h:156 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +useSingleCreasePatch │ │ │ │ │ +unsigned int useSingleCreasePatch │ │ │ │ │ +Definition: topologyRefiner.h:176 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +useInfSharpPatch │ │ │ │ │ +unsigned int useInfSharpPatch │ │ │ │ │ +Definition: topologyRefiner.h:178 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner::AdaptiveOptions:: │ │ │ │ │ +considerFVarChannels │ │ │ │ │ +unsigned int considerFVarChannels │ │ │ │ │ +Definition: topologyRefiner.h:180 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ +BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ +data buffers.... │ │ │ │ │ +Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::stride │ │ │ │ │ +int stride │ │ │ │ │ +stride to the next element │ │ │ │ │ +Definition: bufferDescriptor.h:102 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::length │ │ │ │ │ +int length │ │ │ │ │ +number or length of the data │ │ │ │ │ +Definition: bufferDescriptor.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::offset │ │ │ │ │ +int offset │ │ │ │ │ +offset to desired element data │ │ │ │ │ +Definition: bufferDescriptor.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface │ │ │ │ │ +Definition: mesh.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::GetFarPatchTable │ │ │ │ │ +virtual Far::PatchTable const * GetFarPatchTable() const =0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::refineMesh │ │ │ │ │ +static void refineMesh(Far::TopologyRefiner &refiner, int level, MeshBitset │ │ │ │ │ +bits) │ │ │ │ │ +Definition: mesh.h:117 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::GetMaxValence │ │ │ │ │ +virtual int GetMaxValence() const =0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::GetNumVertices │ │ │ │ │ +virtual int GetNumVertices() const =0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::UpdateVaryingBuffer │ │ │ │ │ +virtual void UpdateVaryingBuffer(float const *varyingData, int startVertex, int │ │ │ │ │ +numVerts)=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::refineMesh │ │ │ │ │ +static void refineMesh(Far::TopologyRefiner &refiner, int level, bool adaptive, │ │ │ │ │ +bool singleCreasePatch) │ │ │ │ │ +Definition: mesh.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::UpdateVertexBuffer │ │ │ │ │ +virtual void UpdateVertexBuffer(float const *vertexData, int startVertex, int │ │ │ │ │ +numVerts)=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::GetPatchTable │ │ │ │ │ +virtual PatchTable * GetPatchTable() const =0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::~MeshInterface │ │ │ │ │ +virtual ~MeshInterface() │ │ │ │ │ +Definition: mesh.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::MeshInterface │ │ │ │ │ +MeshInterface() │ │ │ │ │ +Definition: mesh.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::Refine │ │ │ │ │ +virtual void Refine()=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::VertexBufferBinding │ │ │ │ │ +PatchTable::VertexBufferBinding VertexBufferBinding │ │ │ │ │ +Definition: mesh.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::BindVertexBuffer │ │ │ │ │ +virtual VertexBufferBinding BindVertexBuffer()=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::BindVaryingBuffer │ │ │ │ │ +virtual VertexBufferBinding BindVaryingBuffer()=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::PatchTable │ │ │ │ │ +PATCH_TABLE PatchTable │ │ │ │ │ +Definition: mesh.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface::Synchronize │ │ │ │ │ +virtual void Synchronize()=0 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT │ │ │ │ │ +Definition: mesh.h:186 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::GetEvaluator │ │ │ │ │ +EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +DEVICE_CONTEXT *deviceContext) │ │ │ │ │ +Definition: mesh.h:241 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::GetEvaluator │ │ │ │ │ +EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, │ │ │ │ │ +BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, │ │ │ │ │ +BufferDescriptor const &dvvDesc, DEVICE_CONTEXT *deviceContext) │ │ │ │ │ +Definition: mesh.h:255 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::GetEvaluator │ │ │ │ │ +EVALUATOR * GetEvaluator(BufferDescriptor const &srcDesc, BufferDescriptor │ │ │ │ │ +const &dstDesc, DEVICE_CONTEXT *deviceContext) │ │ │ │ │ +Definition: mesh.h:228 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::~EvaluatorCacheT │ │ │ │ │ +~EvaluatorCacheT() │ │ │ │ │ +Definition: mesh.h:188 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Evaluators │ │ │ │ │ +std::vector< Entry > Evaluators │ │ │ │ │ +Definition: mesh.h:225 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry │ │ │ │ │ +Definition: mesh.h:196 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::Entry │ │ │ │ │ +Entry(BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, │ │ │ │ │ +BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, │ │ │ │ │ +BufferDescriptor const &duuDescArg, BufferDescriptor const &duvDescArg, │ │ │ │ │ +BufferDescriptor const &dvvDescArg, EVALUATOR *evalArg) │ │ │ │ │ +Definition: mesh.h:207 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::dvvDesc │ │ │ │ │ +BufferDescriptor dvvDesc │ │ │ │ │ +Definition: mesh.h:222 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::duvDesc │ │ │ │ │ +BufferDescriptor duvDesc │ │ │ │ │ +Definition: mesh.h:222 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::dstDesc │ │ │ │ │ +BufferDescriptor dstDesc │ │ │ │ │ +Definition: mesh.h:220 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::duDesc │ │ │ │ │ +BufferDescriptor duDesc │ │ │ │ │ +Definition: mesh.h:221 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::srcDesc │ │ │ │ │ +BufferDescriptor srcDesc │ │ │ │ │ +Definition: mesh.h:220 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::duuDesc │ │ │ │ │ +BufferDescriptor duuDesc │ │ │ │ │ +Definition: mesh.h:222 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::evaluator │ │ │ │ │ +EVALUATOR * evaluator │ │ │ │ │ +Definition: mesh.h:223 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::Entry │ │ │ │ │ +Entry(BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, │ │ │ │ │ +BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, EVALUATOR │ │ │ │ │ +*evalArg) │ │ │ │ │ +Definition: mesh.h:197 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT::Entry::dvDesc │ │ │ │ │ +BufferDescriptor dvDesc │ │ │ │ │ +Definition: mesh.h:221 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh │ │ │ │ │ +Definition: mesh.h:418 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetTopologyRefiner │ │ │ │ │ +virtual Far::TopologyRefiner const * GetTopologyRefiner() const │ │ │ │ │ +Definition: mesh.h:578 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetVertexBuffer │ │ │ │ │ +virtual VertexBuffer * GetVertexBuffer() │ │ │ │ │ +Definition: mesh.h:570 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::UpdateVaryingBuffer │ │ │ │ │ +virtual void UpdateVaryingBuffer(float const *varyingData, int startVertex, int │ │ │ │ │ +numVerts) │ │ │ │ │ +Definition: mesh.h:495 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetVaryingBuffer │ │ │ │ │ +virtual VertexBuffer * GetVaryingBuffer() │ │ │ │ │ +Definition: mesh.h:574 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::Refine │ │ │ │ │ +virtual void Refine() │ │ │ │ │ +Definition: mesh.h:501 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::DeviceContext │ │ │ │ │ +DEVICE_CONTEXT DeviceContext │ │ │ │ │ +Definition: mesh.h:424 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::Evaluator │ │ │ │ │ +EVALUATOR Evaluator │ │ │ │ │ +Definition: mesh.h:421 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::BindVertexBuffer │ │ │ │ │ +virtual VertexBufferBinding BindVertexBuffer() │ │ │ │ │ +Definition: mesh.h:562 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetNumVertices │ │ │ │ │ +virtual int GetNumVertices() const │ │ │ │ │ +Definition: mesh.h:558 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::Mesh │ │ │ │ │ +Mesh(Far::TopologyRefiner *refiner, int numVertexElements, int │ │ │ │ │ +numVaryingElements, int level, MeshBitset bits=MeshBitset(), EvaluatorCache │ │ │ │ │ +*evaluatorCache=NULL, DeviceContext *deviceContext=NULL) │ │ │ │ │ +Definition: mesh.h:428 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::StencilTable │ │ │ │ │ +STENCIL_TABLE StencilTable │ │ │ │ │ +Definition: mesh.h:422 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::VertexBuffer │ │ │ │ │ +VERTEX_BUFFER VertexBuffer │ │ │ │ │ +Definition: mesh.h:420 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::EvaluatorCache │ │ │ │ │ +EvaluatorCacheT< Evaluator > EvaluatorCache │ │ │ │ │ +Definition: mesh.h:425 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::BindVaryingBuffer │ │ │ │ │ +virtual VertexBufferBinding BindVaryingBuffer() │ │ │ │ │ +Definition: mesh.h:566 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::~Mesh │ │ │ │ │ +virtual ~Mesh() │ │ │ │ │ +Definition: mesh.h:478 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::VertexBufferBinding │ │ │ │ │ +PatchTable::VertexBufferBinding VertexBufferBinding │ │ │ │ │ +Definition: mesh.h:426 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::UpdateVertexBuffer │ │ │ │ │ +virtual void UpdateVertexBuffer(float const *vertexData, int startVertex, int │ │ │ │ │ +numVerts) │ │ │ │ │ +Definition: mesh.h:489 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::Synchronize │ │ │ │ │ +virtual void Synchronize() │ │ │ │ │ +Definition: mesh.h:546 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetPatchTable │ │ │ │ │ +virtual PatchTable * GetPatchTable() const │ │ │ │ │ +Definition: mesh.h:550 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetFarPatchTable │ │ │ │ │ +virtual Far::PatchTable const * GetFarPatchTable() const │ │ │ │ │ +Definition: mesh.h:554 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::PatchTable │ │ │ │ │ +PATCH_TABLE PatchTable │ │ │ │ │ +Definition: mesh.h:423 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh::GetMaxValence │ │ │ │ │ +virtual int GetMaxValence() const │ │ │ │ │ +Definition: mesh.h:560 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * cpuGLVertexBuffer.h │ │ │ │ │ + * mesh.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00872.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/tbbKernel.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuPatchTable.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,51 +81,48 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
tbbKernel.h File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
cpuPatchTable.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include <vector>
│ │ │ │ #include "../far/patchDescriptor.h"
│ │ │ │ -#include "../far/patchParam.h"
│ │ │ │ +#include "../osd/nonCopyable.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CpuPatchTable
 Cpu patch table. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
 
void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, int start, int end)
 
void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, float const *duuWeights, float const *duvWeights, float const *dvvWeights, int start, int end)
 
void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
 
void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,62 +4,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -tbbKernel.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +cpuPatchTable.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include │ │ │ │ │ #include "../far/patchDescriptor.h" │ │ │ │ │ -#include "../far/patchParam.h" │ │ │ │ │ +#include "../osd/nonCopyable.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CpuPatchTable │ │ │ │ │ +  Cpu patch table. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, int const *sizes, int const │ │ │ │ │ - *offsets, int const *indices, float const *weights, int start, int end) │ │ │ │ │ -  │ │ │ │ │ -void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ - const *sizes, int const *offsets, int const *indices, float const │ │ │ │ │ - *weights, float const *duWeights, float const *dvWeights, int start, int │ │ │ │ │ - end) │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │   │ │ │ │ │ -void TbbEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ - *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ - BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ - &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, │ │ │ │ │ - float const *weights, float const *duWeights, float const *dvWeights, │ │ │ │ │ - float const *duuWeights, float const *duvWeights, float const │ │ │ │ │ - *dvvWeights, int start, int end) │ │ │ │ │ -  │ │ │ │ │ -void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ - numPatchCoords, const PatchCoord *patchCoords, const PatchArray │ │ │ │ │ - *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam │ │ │ │ │ - *patchParamBuffer) │ │ │ │ │ -  │ │ │ │ │ -void TbbEvalPatches (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ - *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ - BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ - &dstDvvDesc, int numPatchCoords, const PatchCoord *patchCoords, const │ │ │ │ │ - PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const │ │ │ │ │ - PatchParam *patchParamBuffer) │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * tbbKernel.h │ │ │ │ │ + * cpuPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00872.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,7 +1,3 @@ │ │ │ │ │ var a00872 = [ │ │ │ │ │ - ["TbbEvalPatches", "a00872.html#aa0c3c264a43eeddc5cb3a58b006d3d32", null], │ │ │ │ │ - ["TbbEvalPatches", "a00872.html#a20e08be34d6183b6943ed7a1586eca4a", null], │ │ │ │ │ - ["TbbEvalStencils", "a00872.html#aa65ed860a2fa5935d99129a898a8f0b6", null], │ │ │ │ │ - ["TbbEvalStencils", "a00872.html#af23c35537952bfdd493441e5c42ff2ed", null], │ │ │ │ │ - ["TbbEvalStencils", "a00872.html#a4a6a0fcc01638f2a0316b32ad158b485", null] │ │ │ │ │ + ["CpuPatchTable", "a01165.html", "a01165"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00872_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/tbbKernel.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuPatchTable.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
tbbKernel.h
│ │ │ │ +
cpuPatchTable.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,116 +107,159 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../far/patchDescriptor.h"
│ │ │ │ -
30#include "../far/patchParam.h"
│ │ │ │ -
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
29
│ │ │ │ +
30#include <vector>
│ │ │ │ +
31#include "../far/patchDescriptor.h"
│ │ │ │ +
32#include "../osd/nonCopyable.h"
│ │ │ │ +
33#include "../osd/types.h"
│ │ │ │
34
│ │ │ │ -
35namespace Osd {
│ │ │ │ +
35#include <vector>
│ │ │ │
36
│ │ │ │ -
37struct PatchArray;
│ │ │ │ -
38struct PatchCoord;
│ │ │ │ -
39struct PatchParam;
│ │ │ │ -
40struct BufferDescriptor;
│ │ │ │ -
41
│ │ │ │ -
42void
│ │ │ │ -
43TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
44 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
45 int const * sizes,
│ │ │ │ -
46 int const * offsets,
│ │ │ │ -
47 int const * indices,
│ │ │ │ -
48 float const * weights,
│ │ │ │ -
49 int start, int end);
│ │ │ │ -
50
│ │ │ │ -
51void
│ │ │ │ -
52TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
53 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
54 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
55 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
56 int const * sizes,
│ │ │ │ -
57 int const * offsets,
│ │ │ │ -
58 int const * indices,
│ │ │ │ -
59 float const * weights,
│ │ │ │ -
60 float const * duWeights,
│ │ │ │ -
61 float const * dvWeights,
│ │ │ │ -
62 int start, int end);
│ │ │ │ -
63
│ │ │ │ -
64void
│ │ │ │ -
65TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
66 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
67 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
68 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
69 float * dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ -
70 float * dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ -
71 float * dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ -
72 int const * sizes,
│ │ │ │ -
73 int const * offsets,
│ │ │ │ -
74 int const * indices,
│ │ │ │ -
75 float const * weights,
│ │ │ │ -
76 float const * duWeights,
│ │ │ │ -
77 float const * dvWeights,
│ │ │ │ -
78 float const * duuWeights,
│ │ │ │ -
79 float const * duvWeights,
│ │ │ │ -
80 float const * dvvWeights,
│ │ │ │ -
81 int start, int end);
│ │ │ │ -
82
│ │ │ │ -
83void
│ │ │ │ -
84TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
85 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
86 float *dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
87 float *dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
88 int numPatchCoords,
│ │ │ │ -
89 const PatchCoord *patchCoords,
│ │ │ │ -
90 const PatchArray *patchArrayBuffer,
│ │ │ │ -
91 const int *patchIndexBuffer,
│ │ │ │ -
92 const PatchParam *patchParamBuffer);
│ │ │ │ -
93
│ │ │ │ -
94void
│ │ │ │ -
95TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
96 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
97 float *dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
98 float *dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
99 float *dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ -
100 float *dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ -
101 float *dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ -
102 int numPatchCoords,
│ │ │ │ -
103 const PatchCoord *patchCoords,
│ │ │ │ -
104 const PatchArray *patchArrayBuffer,
│ │ │ │ -
105 const int *patchIndexBuffer,
│ │ │ │ -
106 const PatchParam *patchParamBuffer);
│ │ │ │ -
107
│ │ │ │ -
108} // end namespace Osd
│ │ │ │ -
109
│ │ │ │ -
110} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
111using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
112
│ │ │ │ -
113} // end namespace OpenSubdiv
│ │ │ │ -
114
│ │ │ │ -
115#endif // OPENSUBDIV3_OSD_TBB_KERNEL_H
│ │ │ │ +
37namespace OpenSubdiv {
│ │ │ │ +
38namespace OPENSUBDIV_VERSION {
│ │ │ │ +
39
│ │ │ │ +
40namespace Far{
│ │ │ │ +
41 class PatchTable;
│ │ │ │ +
42};
│ │ │ │ +
43
│ │ │ │ +
44namespace Osd {
│ │ │ │ +
45
│ │ │ │ + │ │ │ │ +
60public:
│ │ │ │ +
61 static CpuPatchTable *Create(const Far::PatchTable *patchTable,
│ │ │ │ +
62 void *deviceContext = NULL) {
│ │ │ │ +
63 (void)deviceContext; // unused
│ │ │ │ +
64 return new CpuPatchTable(patchTable);
│ │ │ │ +
65 }
│ │ │ │ +
66
│ │ │ │ +
67 explicit CpuPatchTable(const Far::PatchTable *patchTable);
│ │ │ │ + │ │ │ │ +
69
│ │ │ │ + │ │ │ │ +
71 return &_patchArrays[0];
│ │ │ │ +
72 }
│ │ │ │ +
73 const int *GetPatchIndexBuffer() const {
│ │ │ │ +
74 return &_indexBuffer[0];
│ │ │ │ +
75 }
│ │ │ │ + │ │ │ │ +
77 return &_patchParamBuffer[0];
│ │ │ │ +
78 }
│ │ │ │ +
79
│ │ │ │ +
80 size_t GetNumPatchArrays() const {
│ │ │ │ +
81 return _patchArrays.size();
│ │ │ │ +
82 }
│ │ │ │ +
83 size_t GetPatchIndexSize() const {
│ │ │ │ +
84 return _indexBuffer.size();
│ │ │ │ +
85 }
│ │ │ │ +
86 size_t GetPatchParamSize() const {
│ │ │ │ +
87 return _patchParamBuffer.size();
│ │ │ │ +
88 }
│ │ │ │ +
89
│ │ │ │ + │ │ │ │ +
91 if (_varyingPatchArrays.empty()) {
│ │ │ │ +
92 return NULL;
│ │ │ │ +
93 }
│ │ │ │ +
94 return &_varyingPatchArrays[0];
│ │ │ │ +
95 }
│ │ │ │ +
96 const int *GetVaryingPatchIndexBuffer() const {
│ │ │ │ +
97 if (_varyingIndexBuffer.empty()) {
│ │ │ │ +
98 return NULL;
│ │ │ │ +
99 }
│ │ │ │ +
100 return &_varyingIndexBuffer[0];
│ │ │ │ +
101 }
│ │ │ │ + │ │ │ │ +
103 return _varyingIndexBuffer.size();
│ │ │ │ +
104 }
│ │ │ │ +
105
│ │ │ │ +
106 int GetNumFVarChannels() const {
│ │ │ │ +
107 return (int)_fvarPatchArrays.size();
│ │ │ │ +
108 }
│ │ │ │ +
109 const PatchArray *GetFVarPatchArrayBuffer(int fvarChannel = 0) const {
│ │ │ │ +
110 return &_fvarPatchArrays[fvarChannel][0];
│ │ │ │ +
111 }
│ │ │ │ +
112 const int *GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ +
113 return &_fvarIndexBuffers[fvarChannel][0];
│ │ │ │ +
114 }
│ │ │ │ +
115 size_t GetFVarPatchIndexSize(int fvarChannel = 0) const {
│ │ │ │ +
116 return _fvarIndexBuffers[fvarChannel].size();
│ │ │ │ +
117 }
│ │ │ │ +
118 const PatchParam *GetFVarPatchParamBuffer(int fvarChannel= 0) const {
│ │ │ │ +
119 return &_fvarParamBuffers[fvarChannel][0];
│ │ │ │ +
120 }
│ │ │ │ +
121 size_t GetFVarPatchParamSize(int fvarChannel = 0) const {
│ │ │ │ +
122 return _fvarParamBuffers[fvarChannel].size();
│ │ │ │ +
123 }
│ │ │ │ +
124
│ │ │ │ +
125protected:
│ │ │ │ + │ │ │ │ +
127 std::vector<int> _indexBuffer;
│ │ │ │ + │ │ │ │ +
129
│ │ │ │ + │ │ │ │ +
131 std::vector<int> _varyingIndexBuffer;
│ │ │ │ +
132
│ │ │ │ +
133 std::vector< PatchArrayVector > _fvarPatchArrays;
│ │ │ │ +
134 std::vector< std::vector<int> > _fvarIndexBuffers;
│ │ │ │ +
135 std::vector< PatchParamVector > _fvarParamBuffers;
│ │ │ │ +
136};
│ │ │ │ +
137
│ │ │ │ +
138} // end namespace Osd
│ │ │ │ +
139
│ │ │ │ +
140} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
141using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
142
│ │ │ │ +
143} // end namespace OpenSubdiv
│ │ │ │ +
144
│ │ │ │ +
145#endif // OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │ │ │ │ │ -
void TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrayBuffer, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
│ │ │ │ -
void TbbEvalStencils(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ -
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ +
std::vector< PatchParam > PatchParamVector
Definition: types.h:133
│ │ │ │ +
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ +
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ + │ │ │ │ +
const PatchArray * GetFVarPatchArrayBuffer(int fvarChannel=0) const
│ │ │ │ + │ │ │ │ + │ │ │ │ +
size_t GetFVarPatchParamSize(int fvarChannel=0) const
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static CpuPatchTable * Create(const Far::PatchTable *patchTable, void *deviceContext=NULL)
Definition: cpuPatchTable.h:61
│ │ │ │ +
std::vector< PatchParamVector > _fvarParamBuffers
│ │ │ │ +
CpuPatchTable(const Far::PatchTable *patchTable)
│ │ │ │ +
std::vector< std::vector< int > > _fvarIndexBuffers
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
size_t GetFVarPatchIndexSize(int fvarChannel=0) const
│ │ │ │ +
const int * GetFVarPatchIndexBuffer(int fvarChannel=0) const
│ │ │ │ +
const PatchParam * GetFVarPatchParamBuffer(int fvarChannel=0) const
│ │ │ │ + │ │ │ │ + │ │ │ │ +
const PatchArray * GetVaryingPatchArrayBuffer() const
Definition: cpuPatchTable.h:90
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
std::vector< PatchArrayVector > _fvarPatchArrays
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -tbbKernel.h │ │ │ │ │ +cpuPatchTable.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,126 +30,215 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../far/patchDescriptor.h" │ │ │ │ │ - 30#include "../far/patchParam.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include "../far/patchDescriptor.h" │ │ │ │ │ + 32#include "../osd/nonCopyable.h" │ │ │ │ │ + 33#include "../osd/types.h" │ │ │ │ │ 34 │ │ │ │ │ - 35namespace Osd { │ │ │ │ │ + 35#include │ │ │ │ │ 36 │ │ │ │ │ - 37struct PatchArray; │ │ │ │ │ - 38struct PatchCoord; │ │ │ │ │ - 39struct PatchParam; │ │ │ │ │ - 40struct BufferDescriptor; │ │ │ │ │ - 41 │ │ │ │ │ - 42void │ │ │ │ │ -43TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 44 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 45 int const * sizes, │ │ │ │ │ - 46 int const * offsets, │ │ │ │ │ - 47 int const * indices, │ │ │ │ │ - 48 float const * weights, │ │ │ │ │ - 49 int start, int end); │ │ │ │ │ - 50 │ │ │ │ │ - 51void │ │ │ │ │ -52TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 53 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 54 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 55 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 56 int const * sizes, │ │ │ │ │ - 57 int const * offsets, │ │ │ │ │ - 58 int const * indices, │ │ │ │ │ - 59 float const * weights, │ │ │ │ │ - 60 float const * duWeights, │ │ │ │ │ - 61 float const * dvWeights, │ │ │ │ │ - 62 int start, int end); │ │ │ │ │ - 63 │ │ │ │ │ - 64void │ │ │ │ │ -65TbbEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 66 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 67 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 68 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 69 float * dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ - 70 float * dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ - 71 float * dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ - 72 int const * sizes, │ │ │ │ │ - 73 int const * offsets, │ │ │ │ │ - 74 int const * indices, │ │ │ │ │ - 75 float const * weights, │ │ │ │ │ - 76 float const * duWeights, │ │ │ │ │ - 77 float const * dvWeights, │ │ │ │ │ - 78 float const * duuWeights, │ │ │ │ │ - 79 float const * duvWeights, │ │ │ │ │ - 80 float const * dvvWeights, │ │ │ │ │ - 81 int start, int end); │ │ │ │ │ - 82 │ │ │ │ │ - 83void │ │ │ │ │ -84TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 85 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 86 float *dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 87 float *dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 88 int numPatchCoords, │ │ │ │ │ - 89 const PatchCoord *patchCoords, │ │ │ │ │ - 90 const PatchArray *patchArrayBuffer, │ │ │ │ │ - 91 const int *patchIndexBuffer, │ │ │ │ │ - 92 const PatchParam *patchParamBuffer); │ │ │ │ │ - 93 │ │ │ │ │ - 94void │ │ │ │ │ -95TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 96 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 97 float *dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 98 float *dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 99 float *dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ - 100 float *dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ - 101 float *dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ - 102 int numPatchCoords, │ │ │ │ │ - 103 const PatchCoord *patchCoords, │ │ │ │ │ - 104 const PatchArray *patchArrayBuffer, │ │ │ │ │ - 105 const int *patchIndexBuffer, │ │ │ │ │ - 106 const PatchParam *patchParamBuffer); │ │ │ │ │ - 107 │ │ │ │ │ - 108} // end namespace Osd │ │ │ │ │ - 109 │ │ │ │ │ - 110} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 111using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 112 │ │ │ │ │ - 113} // end namespace OpenSubdiv │ │ │ │ │ - 114 │ │ │ │ │ - 115#endif // OPENSUBDIV3_OSD_TBB_KERNEL_H │ │ │ │ │ + 37namespace OpenSubdiv { │ │ │ │ │ + 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 39 │ │ │ │ │ + 40namespace Far{ │ │ │ │ │ + 41 class PatchTable; │ │ │ │ │ + 42}; │ │ │ │ │ + 43 │ │ │ │ │ + 44namespace Osd { │ │ │ │ │ + 45 │ │ │ │ │ +59class CpuPatchTable { │ │ │ │ │ + 60public: │ │ │ │ │ +61 static CpuPatchTable *Create(const Far::PatchTable *patchTable, │ │ │ │ │ + 62 void *deviceContext = NULL) { │ │ │ │ │ + 63 (void)deviceContext; // unused │ │ │ │ │ + 64 return new CpuPatchTable(patchTable); │ │ │ │ │ + 65 } │ │ │ │ │ + 66 │ │ │ │ │ +67 explicit CpuPatchTable(const Far::PatchTable *patchTable); │ │ │ │ │ +68 ~CpuPatchTable() {} │ │ │ │ │ + 69 │ │ │ │ │ +70 const PatchArray *GetPatchArrayBuffer() const { │ │ │ │ │ + 71 return &_patchArrays[0]; │ │ │ │ │ + 72 } │ │ │ │ │ +73 const int *GetPatchIndexBuffer() const { │ │ │ │ │ + 74 return &_indexBuffer[0]; │ │ │ │ │ + 75 } │ │ │ │ │ +76 const PatchParam *GetPatchParamBuffer() const { │ │ │ │ │ + 77 return &_patchParamBuffer[0]; │ │ │ │ │ + 78 } │ │ │ │ │ + 79 │ │ │ │ │ +80 size_t GetNumPatchArrays() const { │ │ │ │ │ + 81 return _patchArrays.size(); │ │ │ │ │ + 82 } │ │ │ │ │ +83 size_t GetPatchIndexSize() const { │ │ │ │ │ + 84 return _indexBuffer.size(); │ │ │ │ │ + 85 } │ │ │ │ │ +86 size_t GetPatchParamSize() const { │ │ │ │ │ + 87 return _patchParamBuffer.size(); │ │ │ │ │ + 88 } │ │ │ │ │ + 89 │ │ │ │ │ +90 const PatchArray *GetVaryingPatchArrayBuffer() const { │ │ │ │ │ + 91 if (_varyingPatchArrays.empty()) { │ │ │ │ │ + 92 return NULL; │ │ │ │ │ + 93 } │ │ │ │ │ + 94 return &_varyingPatchArrays[0]; │ │ │ │ │ + 95 } │ │ │ │ │ +96 const int *GetVaryingPatchIndexBuffer() const { │ │ │ │ │ + 97 if (_varyingIndexBuffer.empty()) { │ │ │ │ │ + 98 return NULL; │ │ │ │ │ + 99 } │ │ │ │ │ + 100 return &_varyingIndexBuffer[0]; │ │ │ │ │ + 101 } │ │ │ │ │ +102 size_t GetVaryingPatchIndexSize() const { │ │ │ │ │ + 103 return _varyingIndexBuffer.size(); │ │ │ │ │ + 104 } │ │ │ │ │ + 105 │ │ │ │ │ +106 int GetNumFVarChannels() const { │ │ │ │ │ + 107 return (int)_fvarPatchArrays.size(); │ │ │ │ │ + 108 } │ │ │ │ │ +109 const PatchArray *GetFVarPatchArrayBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 110 return &_fvarPatchArrays[fvarChannel][0]; │ │ │ │ │ + 111 } │ │ │ │ │ +112 const int *GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ + 113 return &_fvarIndexBuffers[fvarChannel][0]; │ │ │ │ │ + 114 } │ │ │ │ │ +115 size_t GetFVarPatchIndexSize(int fvarChannel = 0) const { │ │ │ │ │ + 116 return _fvarIndexBuffers[fvarChannel].size(); │ │ │ │ │ + 117 } │ │ │ │ │ +118 const PatchParam *GetFVarPatchParamBuffer(int fvarChannel= 0) const { │ │ │ │ │ + 119 return &_fvarParamBuffers[fvarChannel][0]; │ │ │ │ │ + 120 } │ │ │ │ │ +121 size_t GetFVarPatchParamSize(int fvarChannel = 0) const { │ │ │ │ │ + 122 return _fvarParamBuffers[fvarChannel].size(); │ │ │ │ │ + 123 } │ │ │ │ │ + 124 │ │ │ │ │ + 125protected: │ │ │ │ │ +126 PatchArrayVector _patchArrays; │ │ │ │ │ +127 std::vector _indexBuffer; │ │ │ │ │ +128 PatchParamVector _patchParamBuffer; │ │ │ │ │ + 129 │ │ │ │ │ +130 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ +131 std::vector _varyingIndexBuffer; │ │ │ │ │ + 132 │ │ │ │ │ +133 std::vector< PatchArrayVector > _fvarPatchArrays; │ │ │ │ │ +134 std::vector< std::vector > _fvarIndexBuffers; │ │ │ │ │ +135 std::vector< PatchParamVector > _fvarParamBuffers; │ │ │ │ │ + 136}; │ │ │ │ │ + 137 │ │ │ │ │ + 138} // end namespace Osd │ │ │ │ │ + 139 │ │ │ │ │ + 140} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 141using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 142 │ │ │ │ │ + 143} // end namespace OpenSubdiv │ │ │ │ │ + 144 │ │ │ │ │ + 145#endif // OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvalPatches │ │ │ │ │ -void TbbEvalPatches(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ -*dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const │ │ │ │ │ -&dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ -numPatchCoords, const PatchCoord *patchCoords, const PatchArray │ │ │ │ │ -*patchArrayBuffer, const int *patchIndexBuffer, const PatchParam │ │ │ │ │ -*patchParamBuffer) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvalStencils │ │ │ │ │ -void TbbEvalStencils(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ -*dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, │ │ │ │ │ -int const *indices, float const *weights, int start, int end) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ -Coordinates set on a patch table. │ │ │ │ │ -Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParamVector │ │ │ │ │ +std::vector< PatchParam > PatchParamVector │ │ │ │ │ +Definition: types.h:133 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ +std::vector< PatchArray > PatchArrayVector │ │ │ │ │ +Definition: types.h:132 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ +Container for arrays of parametric patches. │ │ │ │ │ +Definition: patchTable.h:55 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable │ │ │ │ │ +Cpu patch table. │ │ │ │ │ +Definition: cpuPatchTable.h:59 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ +const PatchArray * GetFVarPatchArrayBuffer(int fvarChannel=0) const │ │ │ │ │ +Definition: cpuPatchTable.h:109 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ +const int * GetVaryingPatchIndexBuffer() const │ │ │ │ │ +Definition: cpuPatchTable.h:96 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_varyingIndexBuffer │ │ │ │ │ +std::vector< int > _varyingIndexBuffer │ │ │ │ │ +Definition: cpuPatchTable.h:131 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchParamSize │ │ │ │ │ +size_t GetFVarPatchParamSize(int fvarChannel=0) const │ │ │ │ │ +Definition: cpuPatchTable.h:121 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::~CpuPatchTable │ │ │ │ │ +~CpuPatchTable() │ │ │ │ │ +Definition: cpuPatchTable.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_patchParamBuffer │ │ │ │ │ +PatchParamVector _patchParamBuffer │ │ │ │ │ +Definition: cpuPatchTable.h:128 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchIndexBuffer │ │ │ │ │ +const int * GetPatchIndexBuffer() const │ │ │ │ │ +Definition: cpuPatchTable.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::Create │ │ │ │ │ +static CpuPatchTable * Create(const Far::PatchTable *patchTable, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Definition: cpuPatchTable.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarParamBuffers │ │ │ │ │ +std::vector< PatchParamVector > _fvarParamBuffers │ │ │ │ │ +Definition: cpuPatchTable.h:135 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::CpuPatchTable │ │ │ │ │ +CpuPatchTable(const Far::PatchTable *patchTable) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarIndexBuffers │ │ │ │ │ +std::vector< std::vector< int > > _fvarIndexBuffers │ │ │ │ │ +Definition: cpuPatchTable.h:134 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchIndexSize │ │ │ │ │ +size_t GetPatchIndexSize() const │ │ │ │ │ +Definition: cpuPatchTable.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_patchArrays │ │ │ │ │ +PatchArrayVector _patchArrays │ │ │ │ │ +Definition: cpuPatchTable.h:126 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchParamBuffer │ │ │ │ │ +const PatchParam * GetPatchParamBuffer() const │ │ │ │ │ +Definition: cpuPatchTable.h:76 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_indexBuffer │ │ │ │ │ +std::vector< int > _indexBuffer │ │ │ │ │ +Definition: cpuPatchTable.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchIndexSize │ │ │ │ │ +size_t GetFVarPatchIndexSize(int fvarChannel=0) const │ │ │ │ │ +Definition: cpuPatchTable.h:115 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ +const int * GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ +Definition: cpuPatchTable.h:112 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ +const PatchParam * GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ +Definition: cpuPatchTable.h:118 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchParamSize │ │ │ │ │ +size_t GetPatchParamSize() const │ │ │ │ │ +Definition: cpuPatchTable.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchIndexSize │ │ │ │ │ +size_t GetVaryingPatchIndexSize() const │ │ │ │ │ +Definition: cpuPatchTable.h:102 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ +const PatchArray * GetVaryingPatchArrayBuffer() const │ │ │ │ │ +Definition: cpuPatchTable.h:90 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetNumFVarChannels │ │ │ │ │ +int GetNumFVarChannels() const │ │ │ │ │ +Definition: cpuPatchTable.h:106 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetNumPatchArrays │ │ │ │ │ +size_t GetNumPatchArrays() const │ │ │ │ │ +Definition: cpuPatchTable.h:80 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchArrayBuffer │ │ │ │ │ +const PatchArray * GetPatchArrayBuffer() const │ │ │ │ │ +Definition: cpuPatchTable.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_varyingPatchArrays │ │ │ │ │ +PatchArrayVector _varyingPatchArrays │ │ │ │ │ +Definition: cpuPatchTable.h:130 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarPatchArrays │ │ │ │ │ +std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ +Definition: cpuPatchTable.h:133 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ Definition: types.h:66 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * tbbKernel.h │ │ │ │ │ + * cpuPatchTable.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00875.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/tbbEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,27 +83,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
tbbEvaluator.h File Reference
│ │ │ │ +
cpuVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ #include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  TbbEvaluator
class  CpuVertexBuffer
 Concrete vertex buffer class for CPU subdivision. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -112,13 +111,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -tbbEvaluator.h File Reference │ │ │ │ │ +cpuVertexBuffer.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ #include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  TbbEvaluator │ │ │ │ │ +class  CpuVertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for CPU subdivision. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * tbbEvaluator.h │ │ │ │ │ + * cpuVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00875.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00875 = [ │ │ │ │ │ - ["TbbEvaluator", "a01309.html", null] │ │ │ │ │ + ["CpuVertexBuffer", "a01169.html", "a01169"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00875_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/tbbEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
tbbEvaluator.h
│ │ │ │ +
cpuVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,502 +107,73 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../osd/bufferDescriptor.h"
│ │ │ │ -
30#include "../osd/types.h"
│ │ │ │ +
29
│ │ │ │ +
30#include <cstddef>
│ │ │ │
31
│ │ │ │ -
32#include <cstddef>
│ │ │ │ -
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
34
│ │ │ │ +
35namespace Osd {
│ │ │ │
36
│ │ │ │ -
37namespace Osd {
│ │ │ │ -
38
│ │ │ │ - │ │ │ │ -
40public:
│ │ │ │ -
46
│ │ │ │ -
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
72 static bool EvalStencils(
│ │ │ │ -
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
76 TbbEvaluator const *instance = NULL,
│ │ │ │ -
77 void *deviceContext = NULL) {
│ │ │ │ -
78
│ │ │ │ -
79 (void)instance; // unused
│ │ │ │ -
80 (void)deviceContext; // unused
│ │ │ │ -
81
│ │ │ │ -
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ -
83 return false;
│ │ │ │ -
84
│ │ │ │ -
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
87 &stencilTable->GetSizes()[0],
│ │ │ │ -
88 &stencilTable->GetOffsets()[0],
│ │ │ │ -
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
90 &stencilTable->GetWeights()[0],
│ │ │ │ -
91 /*start = */ 0,
│ │ │ │ -
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
121 static bool EvalStencils(
│ │ │ │ -
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
124 const int * sizes,
│ │ │ │ -
125 const int * offsets,
│ │ │ │ -
126 const int * indices,
│ │ │ │ -
127 const float * weights,
│ │ │ │ -
128 int start, int end);
│ │ │ │ -
129
│ │ │ │ -
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
168 static bool EvalStencils(
│ │ │ │ -
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
174 const TbbEvaluator *instance = NULL,
│ │ │ │ -
175 void * deviceContext = NULL) {
│ │ │ │ -
176
│ │ │ │ -
177 (void)instance; // unused
│ │ │ │ -
178 (void)deviceContext; // unused
│ │ │ │ -
179
│ │ │ │ -
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
184 &stencilTable->GetSizes()[0],
│ │ │ │ -
185 &stencilTable->GetOffsets()[0],
│ │ │ │ -
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
187 &stencilTable->GetWeights()[0],
│ │ │ │ -
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
190 /*start = */ 0,
│ │ │ │ -
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
192 }
│ │ │ │ -
193
│ │ │ │ -
234 static bool EvalStencils(
│ │ │ │ -
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
239 const int * sizes,
│ │ │ │ -
240 const int * offsets,
│ │ │ │ -
241 const int * indices,
│ │ │ │ -
242 const float * weights,
│ │ │ │ -
243 const float * duWeights,
│ │ │ │ -
244 const float * dvWeights,
│ │ │ │ -
245 int start, int end);
│ │ │ │ -
246
│ │ │ │ -
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
303 static bool EvalStencils(
│ │ │ │ -
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
312 const TbbEvaluator *instance = NULL,
│ │ │ │ -
313 void * deviceContext = NULL) {
│ │ │ │ -
314
│ │ │ │ -
315 (void)instance; // unused
│ │ │ │ -
316 (void)deviceContext; // unused
│ │ │ │ -
317
│ │ │ │ -
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
325 &stencilTable->GetSizes()[0],
│ │ │ │ -
326 &stencilTable->GetOffsets()[0],
│ │ │ │ -
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
328 &stencilTable->GetWeights()[0],
│ │ │ │ -
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ -
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ -
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ -
334 /*start = */ 0,
│ │ │ │ -
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
336 }
│ │ │ │ -
337
│ │ │ │ -
399 static bool EvalStencils(
│ │ │ │ -
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
407 const int * sizes,
│ │ │ │ -
408 const int * offsets,
│ │ │ │ -
409 const int * indices,
│ │ │ │ -
410 const float * weights,
│ │ │ │ -
411 const float * duWeights,
│ │ │ │ -
412 const float * dvWeights,
│ │ │ │ -
413 const float * duuWeights,
│ │ │ │ -
414 const float * duvWeights,
│ │ │ │ -
415 const float * dvvWeights,
│ │ │ │ -
416 int start, int end);
│ │ │ │ -
417
│ │ │ │ -
423
│ │ │ │ -
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
454 static bool EvalPatches(
│ │ │ │ -
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
457 int numPatchCoords,
│ │ │ │ -
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
459 PATCH_TABLE *patchTable,
│ │ │ │ -
460 TbbEvaluator const *instance = NULL,
│ │ │ │ -
461 void * deviceContext = NULL) {
│ │ │ │ -
462
│ │ │ │ -
463 (void)instance; // unused
│ │ │ │ -
464 (void)deviceContext; // unused
│ │ │ │ -
465
│ │ │ │ -
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
468 numPatchCoords,
│ │ │ │ -
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
472 patchTable->GetPatchParamBuffer());
│ │ │ │ -
473 }
│ │ │ │ -
474
│ │ │ │ -
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
517 static bool EvalPatches(
│ │ │ │ -
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
522 int numPatchCoords,
│ │ │ │ -
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
524 PATCH_TABLE *patchTable,
│ │ │ │ -
525 TbbEvaluator const *instance = NULL,
│ │ │ │ -
526 void * deviceContext = NULL) {
│ │ │ │ -
527
│ │ │ │ -
528 (void)instance; // unused
│ │ │ │ -
529 (void)deviceContext; // unused
│ │ │ │ -
530
│ │ │ │ -
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
533 // so that downcast isn't needed there.
│ │ │ │ -
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
535 //
│ │ │ │ -
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
540 numPatchCoords,
│ │ │ │ -
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
544 patchTable->GetPatchParamBuffer());
│ │ │ │ -
545 }
│ │ │ │ -
546
│ │ │ │ -
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
607 static bool EvalPatches(
│ │ │ │ -
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
615 int numPatchCoords,
│ │ │ │ -
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
617 PATCH_TABLE *patchTable,
│ │ │ │ -
618 TbbEvaluator const *instance = NULL,
│ │ │ │ -
619 void * deviceContext = NULL) {
│ │ │ │ -
620
│ │ │ │ -
621 (void)instance; // unused
│ │ │ │ -
622 (void)deviceContext; // unused
│ │ │ │ -
623
│ │ │ │ -
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
626 // so that downcast isn't needed there.
│ │ │ │ -
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
628 //
│ │ │ │ -
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
636 numPatchCoords,
│ │ │ │ -
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
640 patchTable->GetPatchParamBuffer());
│ │ │ │ -
641 }
│ │ │ │ -
642
│ │ │ │ -
670 static bool EvalPatches(
│ │ │ │ -
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
673 int numPatchCoords,
│ │ │ │ -
674 const PatchCoord *patchCoords,
│ │ │ │ -
675 const PatchArray *patchArrays,
│ │ │ │ -
676 const int *patchIndexBuffer,
│ │ │ │ -
677 const PatchParam *patchParamBuffer);
│ │ │ │ -
678
│ │ │ │ -
716 static bool EvalPatches(
│ │ │ │ -
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
721 int numPatchCoords,
│ │ │ │ -
722 PatchCoord const *patchCoords,
│ │ │ │ -
723 PatchArray const *patchArrays,
│ │ │ │ -
724 const int *patchIndexBuffer,
│ │ │ │ -
725 PatchParam const *patchParamBuffer);
│ │ │ │ -
726
│ │ │ │ -
779 static bool EvalPatches(
│ │ │ │ -
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
787 int numPatchCoords,
│ │ │ │ -
788 PatchCoord const *patchCoords,
│ │ │ │ -
789 PatchArray const *patchArrays,
│ │ │ │ -
790 const int *patchIndexBuffer,
│ │ │ │ -
791 PatchParam const *patchParamBuffer);
│ │ │ │ -
792
│ │ │ │ -
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
826 int numPatchCoords,
│ │ │ │ -
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
828 PATCH_TABLE *patchTable,
│ │ │ │ -
829 TbbEvaluator const *instance = NULL,
│ │ │ │ -
830 void * deviceContext = NULL) {
│ │ │ │ -
831
│ │ │ │ -
832 (void)instance; // unused
│ │ │ │ -
833 (void)deviceContext; // unused
│ │ │ │ -
834
│ │ │ │ -
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
837 numPatchCoords,
│ │ │ │ -
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
841 patchTable->GetPatchParamBuffer());
│ │ │ │ -
842 }
│ │ │ │ -
843
│ │ │ │ -
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
891 int numPatchCoords,
│ │ │ │ -
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
893 PATCH_TABLE *patchTable,
│ │ │ │ -
894 TbbEvaluator const *instance = NULL,
│ │ │ │ -
895 void * deviceContext = NULL) {
│ │ │ │ -
896
│ │ │ │ -
897 (void)instance; // unused
│ │ │ │ -
898 (void)deviceContext; // unused
│ │ │ │ -
899
│ │ │ │ -
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
904 numPatchCoords,
│ │ │ │ -
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
908 patchTable->GetPatchParamBuffer());
│ │ │ │ -
909 }
│ │ │ │ -
910
│ │ │ │ -
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
979 int numPatchCoords,
│ │ │ │ -
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
981 PATCH_TABLE *patchTable,
│ │ │ │ -
982 TbbEvaluator const *instance = NULL,
│ │ │ │ -
983 void * deviceContext = NULL) {
│ │ │ │ -
984
│ │ │ │ -
985 (void)instance; // unused
│ │ │ │ -
986 (void)deviceContext; // unused
│ │ │ │ -
987
│ │ │ │ -
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
995 numPatchCoords,
│ │ │ │ -
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
999 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1000 }
│ │ │ │ -
1001
│ │ │ │ -
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1037 int numPatchCoords,
│ │ │ │ -
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1039 PATCH_TABLE *patchTable,
│ │ │ │ -
1040 int fvarChannel,
│ │ │ │ -
1041 TbbEvaluator const *instance = NULL,
│ │ │ │ -
1042 void * deviceContext = NULL) {
│ │ │ │ -
1043
│ │ │ │ -
1044 (void)instance; // unused
│ │ │ │ -
1045 (void)deviceContext; // unused
│ │ │ │ -
1046
│ │ │ │ -
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1049 numPatchCoords,
│ │ │ │ -
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1054 }
│ │ │ │ -
1055
│ │ │ │ -
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1105 int numPatchCoords,
│ │ │ │ -
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1107 PATCH_TABLE *patchTable,
│ │ │ │ -
1108 int fvarChannel,
│ │ │ │ -
1109 TbbEvaluator const *instance = NULL,
│ │ │ │ -
1110 void * deviceContext = NULL) {
│ │ │ │ -
1111
│ │ │ │ -
1112 (void)instance; // unused
│ │ │ │ -
1113 (void)deviceContext; // unused
│ │ │ │ -
1114
│ │ │ │ -
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1119 numPatchCoords,
│ │ │ │ -
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1124 }
│ │ │ │ -
1125
│ │ │ │ -
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1196 int numPatchCoords,
│ │ │ │ -
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1198 PATCH_TABLE *patchTable,
│ │ │ │ -
1199 int fvarChannel,
│ │ │ │ -
1200 TbbEvaluator const *instance = NULL,
│ │ │ │ -
1201 void * deviceContext = NULL) {
│ │ │ │ -
1202
│ │ │ │ -
1203 (void)instance; // unused
│ │ │ │ -
1204 (void)deviceContext; // unused
│ │ │ │ -
1205
│ │ │ │ -
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
1213 numPatchCoords,
│ │ │ │ -
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1218 }
│ │ │ │ -
1219
│ │ │ │ -
1225
│ │ │ │ -
1227 static void Synchronize(void *deviceContext = NULL);
│ │ │ │ -
1228
│ │ │ │ -
1234 static void SetNumThreads(int numThreads);
│ │ │ │ -
1235};
│ │ │ │ -
1236
│ │ │ │ -
1237
│ │ │ │ -
1238} // end namespace Osd
│ │ │ │ -
1239
│ │ │ │ -
1240} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
1241using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
1242
│ │ │ │ -
1243} // end namespace OpenSubdiv
│ │ │ │ -
1244
│ │ │ │ -
1245
│ │ │ │ -
1246#endif // OPENSUBDIV3_OSD_TBB_EVALUATOR_H
│ │ │ │ + │ │ │ │ +
43public:
│ │ │ │ +
45 static CpuVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
46 void *deviceContext = NULL);
│ │ │ │ +
47
│ │ │ │ + │ │ │ │ +
50
│ │ │ │ +
53 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
54 void *deviceContext = NULL);
│ │ │ │ +
55
│ │ │ │ +
57 int GetNumElements() const;
│ │ │ │ +
58
│ │ │ │ +
60 int GetNumVertices() const;
│ │ │ │ +
61
│ │ │ │ +
63 float * BindCpuBuffer();
│ │ │ │ +
64
│ │ │ │ +
65protected:
│ │ │ │ +
67 CpuVertexBuffer(int numElements, int numVertices);
│ │ │ │ +
68
│ │ │ │ +
69private:
│ │ │ │ +
70 int _numElements;
│ │ │ │ +
71 int _numVertices;
│ │ │ │ +
72 float *_cpuBuffer;
│ │ │ │ +
73};
│ │ │ │ +
74
│ │ │ │ +
75
│ │ │ │ +
76} // end namespace Osd
│ │ │ │ +
77
│ │ │ │ +
78} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
79using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
80
│ │ │ │ +
81} // end namespace OpenSubdiv
│ │ │ │ +
82
│ │ │ │ +
83#endif // OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │ │ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: tbbEvaluator.h:72
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:454
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const TbbEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: tbbEvaluator.h:303
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:886
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: tbbEvaluator.h:607
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static void Synchronize(void *deviceContext=NULL)
synchronize all asynchronous computation invoked on this device.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:971
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: tbbEvaluator.h:517
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static void SetNumThreads(int numThreads)
initialize tbb task schedular (optional: client may use tbb::task_scheduler_init)
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const TbbEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: tbbEvaluator.h:168
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: tbbEvaluator.h:823
│ │ │ │ -
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ - │ │ │ │ - │ │ │ │ +
Concrete vertex buffer class for CPU subdivision.
│ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
static CpuVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ + │ │ │ │ +
float * BindCpuBuffer()
Returns the address of CPU buffer.
│ │ │ │ +
CpuVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -tbbEvaluator.h │ │ │ │ │ +cpuVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,660 +30,84 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 30#include "../osd/types.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ 31 │ │ │ │ │ - 32#include │ │ │ │ │ - 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Osd { │ │ │ │ │ 36 │ │ │ │ │ - 37namespace Osd { │ │ │ │ │ - 38 │ │ │ │ │ -39class TbbEvaluator { │ │ │ │ │ - 40public: │ │ │ │ │ - 46 │ │ │ │ │ - 71 template │ │ │ │ │ -72 static bool EvalStencils( │ │ │ │ │ - 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 76 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 77 void *deviceContext = NULL) { │ │ │ │ │ - 78 │ │ │ │ │ - 79 (void)instance; // unused │ │ │ │ │ - 80 (void)deviceContext; // unused │ │ │ │ │ - 81 │ │ │ │ │ - 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ - 83 return false; │ │ │ │ │ - 84 │ │ │ │ │ - 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 87 &stencilTable->GetSizes()[0], │ │ │ │ │ - 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 90 &stencilTable->GetWeights()[0], │ │ │ │ │ - 91 /*start = */ 0, │ │ │ │ │ - 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 93 } │ │ │ │ │ - 94 │ │ │ │ │ -121 static bool EvalStencils( │ │ │ │ │ - 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 124 const int * sizes, │ │ │ │ │ - 125 const int * offsets, │ │ │ │ │ - 126 const int * indices, │ │ │ │ │ - 127 const float * weights, │ │ │ │ │ - 128 int start, int end); │ │ │ │ │ - 129 │ │ │ │ │ - 167 template │ │ │ │ │ -168 static bool EvalStencils( │ │ │ │ │ - 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 174 const TbbEvaluator *instance = NULL, │ │ │ │ │ - 175 void * deviceContext = NULL) { │ │ │ │ │ - 176 │ │ │ │ │ - 177 (void)instance; // unused │ │ │ │ │ - 178 (void)deviceContext; // unused │ │ │ │ │ - 179 │ │ │ │ │ - 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 184 &stencilTable->GetSizes()[0], │ │ │ │ │ - 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 187 &stencilTable->GetWeights()[0], │ │ │ │ │ - 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 190 /*start = */ 0, │ │ │ │ │ - 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 │ │ │ │ │ -234 static bool EvalStencils( │ │ │ │ │ - 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 239 const int * sizes, │ │ │ │ │ - 240 const int * offsets, │ │ │ │ │ - 241 const int * indices, │ │ │ │ │ - 242 const float * weights, │ │ │ │ │ - 243 const float * duWeights, │ │ │ │ │ - 244 const float * dvWeights, │ │ │ │ │ - 245 int start, int end); │ │ │ │ │ - 246 │ │ │ │ │ - 302 template │ │ │ │ │ -303 static bool EvalStencils( │ │ │ │ │ - 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 312 const TbbEvaluator *instance = NULL, │ │ │ │ │ - 313 void * deviceContext = NULL) { │ │ │ │ │ - 314 │ │ │ │ │ - 315 (void)instance; // unused │ │ │ │ │ - 316 (void)deviceContext; // unused │ │ │ │ │ - 317 │ │ │ │ │ - 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 325 &stencilTable->GetSizes()[0], │ │ │ │ │ - 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 328 &stencilTable->GetWeights()[0], │ │ │ │ │ - 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ - 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ - 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ - 334 /*start = */ 0, │ │ │ │ │ - 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ -399 static bool EvalStencils( │ │ │ │ │ - 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 407 const int * sizes, │ │ │ │ │ - 408 const int * offsets, │ │ │ │ │ - 409 const int * indices, │ │ │ │ │ - 410 const float * weights, │ │ │ │ │ - 411 const float * duWeights, │ │ │ │ │ - 412 const float * dvWeights, │ │ │ │ │ - 413 const float * duuWeights, │ │ │ │ │ - 414 const float * duvWeights, │ │ │ │ │ - 415 const float * dvvWeights, │ │ │ │ │ - 416 int start, int end); │ │ │ │ │ - 417 │ │ │ │ │ - 423 │ │ │ │ │ - 452 template │ │ │ │ │ -454 static bool EvalPatches( │ │ │ │ │ - 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 457 int numPatchCoords, │ │ │ │ │ - 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 459 PATCH_TABLE *patchTable, │ │ │ │ │ - 460 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 461 void * deviceContext = NULL) { │ │ │ │ │ - 462 │ │ │ │ │ - 463 (void)instance; // unused │ │ │ │ │ - 464 (void)deviceContext; // unused │ │ │ │ │ - 465 │ │ │ │ │ - 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 468 numPatchCoords, │ │ │ │ │ - 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 473 } │ │ │ │ │ - 474 │ │ │ │ │ - 515 template │ │ │ │ │ -517 static bool EvalPatches( │ │ │ │ │ - 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 522 int numPatchCoords, │ │ │ │ │ - 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 524 PATCH_TABLE *patchTable, │ │ │ │ │ - 525 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 526 void * deviceContext = NULL) { │ │ │ │ │ - 527 │ │ │ │ │ - 528 (void)instance; // unused │ │ │ │ │ - 529 (void)deviceContext; // unused │ │ │ │ │ - 530 │ │ │ │ │ - 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 533 // so that downcast isn't needed there. │ │ │ │ │ - 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 535 // │ │ │ │ │ - 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 540 numPatchCoords, │ │ │ │ │ - 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 545 } │ │ │ │ │ - 546 │ │ │ │ │ - 605 template │ │ │ │ │ -607 static bool EvalPatches( │ │ │ │ │ - 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 615 int numPatchCoords, │ │ │ │ │ - 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 617 PATCH_TABLE *patchTable, │ │ │ │ │ - 618 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 619 void * deviceContext = NULL) { │ │ │ │ │ - 620 │ │ │ │ │ - 621 (void)instance; // unused │ │ │ │ │ - 622 (void)deviceContext; // unused │ │ │ │ │ - 623 │ │ │ │ │ - 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 626 // so that downcast isn't needed there. │ │ │ │ │ - 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 628 // │ │ │ │ │ - 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 636 numPatchCoords, │ │ │ │ │ - 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 641 } │ │ │ │ │ - 642 │ │ │ │ │ -670 static bool EvalPatches( │ │ │ │ │ - 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 673 int numPatchCoords, │ │ │ │ │ - 674 const PatchCoord *patchCoords, │ │ │ │ │ - 675 const PatchArray *patchArrays, │ │ │ │ │ - 676 const int *patchIndexBuffer, │ │ │ │ │ - 677 const PatchParam *patchParamBuffer); │ │ │ │ │ - 678 │ │ │ │ │ -716 static bool EvalPatches( │ │ │ │ │ - 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 721 int numPatchCoords, │ │ │ │ │ - 722 PatchCoord const *patchCoords, │ │ │ │ │ - 723 PatchArray const *patchArrays, │ │ │ │ │ - 724 const int *patchIndexBuffer, │ │ │ │ │ - 725 PatchParam const *patchParamBuffer); │ │ │ │ │ - 726 │ │ │ │ │ -779 static bool EvalPatches( │ │ │ │ │ - 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 787 int numPatchCoords, │ │ │ │ │ - 788 PatchCoord const *patchCoords, │ │ │ │ │ - 789 PatchArray const *patchArrays, │ │ │ │ │ - 790 const int *patchIndexBuffer, │ │ │ │ │ - 791 PatchParam const *patchParamBuffer); │ │ │ │ │ - 792 │ │ │ │ │ - 821 template │ │ │ │ │ -823 static bool EvalPatchesVarying( │ │ │ │ │ - 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 826 int numPatchCoords, │ │ │ │ │ - 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 828 PATCH_TABLE *patchTable, │ │ │ │ │ - 829 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 830 void * deviceContext = NULL) { │ │ │ │ │ - 831 │ │ │ │ │ - 832 (void)instance; // unused │ │ │ │ │ - 833 (void)deviceContext; // unused │ │ │ │ │ - 834 │ │ │ │ │ - 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 837 numPatchCoords, │ │ │ │ │ - 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 842 } │ │ │ │ │ - 843 │ │ │ │ │ - 884 template │ │ │ │ │ -886 static bool EvalPatchesVarying( │ │ │ │ │ - 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 891 int numPatchCoords, │ │ │ │ │ - 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 893 PATCH_TABLE *patchTable, │ │ │ │ │ - 894 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 895 void * deviceContext = NULL) { │ │ │ │ │ - 896 │ │ │ │ │ - 897 (void)instance; // unused │ │ │ │ │ - 898 (void)deviceContext; // unused │ │ │ │ │ - 899 │ │ │ │ │ - 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 904 numPatchCoords, │ │ │ │ │ - 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 909 } │ │ │ │ │ - 910 │ │ │ │ │ - 969 template │ │ │ │ │ -971 static bool EvalPatchesVarying( │ │ │ │ │ - 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 979 int numPatchCoords, │ │ │ │ │ - 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 981 PATCH_TABLE *patchTable, │ │ │ │ │ - 982 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 983 void * deviceContext = NULL) { │ │ │ │ │ - 984 │ │ │ │ │ - 985 (void)instance; // unused │ │ │ │ │ - 986 (void)deviceContext; // unused │ │ │ │ │ - 987 │ │ │ │ │ - 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 995 numPatchCoords, │ │ │ │ │ - 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1000 } │ │ │ │ │ - 1001 │ │ │ │ │ - 1032 template │ │ │ │ │ -1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1037 int numPatchCoords, │ │ │ │ │ - 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1039 PATCH_TABLE *patchTable, │ │ │ │ │ - 1040 int fvarChannel, │ │ │ │ │ - 1041 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 1042 void * deviceContext = NULL) { │ │ │ │ │ - 1043 │ │ │ │ │ - 1044 (void)instance; // unused │ │ │ │ │ - 1045 (void)deviceContext; // unused │ │ │ │ │ - 1046 │ │ │ │ │ - 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1049 numPatchCoords, │ │ │ │ │ - 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1054 } │ │ │ │ │ - 1055 │ │ │ │ │ - 1098 template │ │ │ │ │ -1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1105 int numPatchCoords, │ │ │ │ │ - 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1107 PATCH_TABLE *patchTable, │ │ │ │ │ - 1108 int fvarChannel, │ │ │ │ │ - 1109 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 1110 void * deviceContext = NULL) { │ │ │ │ │ - 1111 │ │ │ │ │ - 1112 (void)instance; // unused │ │ │ │ │ - 1113 (void)deviceContext; // unused │ │ │ │ │ - 1114 │ │ │ │ │ - 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1119 numPatchCoords, │ │ │ │ │ - 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1124 } │ │ │ │ │ - 1125 │ │ │ │ │ - 1186 template │ │ │ │ │ -1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1196 int numPatchCoords, │ │ │ │ │ - 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1198 PATCH_TABLE *patchTable, │ │ │ │ │ - 1199 int fvarChannel, │ │ │ │ │ - 1200 TbbEvaluator const *instance = NULL, │ │ │ │ │ - 1201 void * deviceContext = NULL) { │ │ │ │ │ - 1202 │ │ │ │ │ - 1203 (void)instance; // unused │ │ │ │ │ - 1204 (void)deviceContext; // unused │ │ │ │ │ - 1205 │ │ │ │ │ - 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 1213 numPatchCoords, │ │ │ │ │ - 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1218 } │ │ │ │ │ - 1219 │ │ │ │ │ - 1225 │ │ │ │ │ -1227 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ - 1228 │ │ │ │ │ -1234 static void SetNumThreads(int numThreads); │ │ │ │ │ - 1235}; │ │ │ │ │ - 1236 │ │ │ │ │ - 1237 │ │ │ │ │ - 1238} // end namespace Osd │ │ │ │ │ - 1239 │ │ │ │ │ - 1240} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 1241using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 1242 │ │ │ │ │ - 1243} // end namespace OpenSubdiv │ │ │ │ │ - 1244 │ │ │ │ │ - 1245 │ │ │ │ │ - 1246#endif // OPENSUBDIV3_OSD_TBB_EVALUATOR_H │ │ │ │ │ +42class CpuVertexBuffer { │ │ │ │ │ + 43public: │ │ │ │ │ +45 static CpuVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 46 void *deviceContext = NULL); │ │ │ │ │ + 47 │ │ │ │ │ +49 ~CpuVertexBuffer(); │ │ │ │ │ + 50 │ │ │ │ │ +53 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 54 void *deviceContext = NULL); │ │ │ │ │ + 55 │ │ │ │ │ +57 int GetNumElements() const; │ │ │ │ │ + 58 │ │ │ │ │ +60 int GetNumVertices() const; │ │ │ │ │ + 61 │ │ │ │ │ +63 float * BindCpuBuffer(); │ │ │ │ │ + 64 │ │ │ │ │ + 65protected: │ │ │ │ │ +67 CpuVertexBuffer(int numElements, int numVertices); │ │ │ │ │ + 68 │ │ │ │ │ + 69private: │ │ │ │ │ + 70 int _numElements; │ │ │ │ │ + 71 int _numVertices; │ │ │ │ │ + 72 float *_cpuBuffer; │ │ │ │ │ + 73}; │ │ │ │ │ + 74 │ │ │ │ │ + 75 │ │ │ │ │ + 76} // end namespace Osd │ │ │ │ │ + 77 │ │ │ │ │ + 78} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 79using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 80 │ │ │ │ │ + 81} // end namespace OpenSubdiv │ │ │ │ │ + 82 │ │ │ │ │ + 83#endif // OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator │ │ │ │ │ -Definition: tbbEvaluator.h:39 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer │ │ │ │ │ +Concrete vertex buffer class for CPU subdivision. │ │ │ │ │ +Definition: cpuVertexBuffer.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::Create │ │ │ │ │ +static CpuVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function. This function has a same signature as │ │ │ │ │ -other device kernels hav... │ │ │ │ │ -Definition: tbbEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:454 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -const TbbEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: tbbEvaluator.h:303 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ -Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ -output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:886 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: tbbEvaluator.h:607 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ -float *dvvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ -const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ -PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ -synchronize all asynchronous computation invoked on this device. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:971 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, TbbEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:1100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: tbbEvaluator.h:517 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:1034 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ -PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::SetNumThreads │ │ │ │ │ -static void SetNumThreads(int numThreads) │ │ │ │ │ -initialize tbb task schedular (optional: client may use tbb:: │ │ │ │ │ -task_scheduler_init) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ -PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ -TbbEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: tbbEvaluator.h:168 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:1188 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::TbbEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -TbbEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: tbbEvaluator.h:823 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ -Coordinates set on a patch table. │ │ │ │ │ -Definition: types.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ -Definition: types.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ -Definition: types.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::~CpuVertexBuffer │ │ │ │ │ +~CpuVertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::BindCpuBuffer │ │ │ │ │ +float * BindCpuBuffer() │ │ │ │ │ +Returns the address of CPU buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::CpuVertexBuffer │ │ │ │ │ +CpuVertexBuffer(int numElements, int numVertices) │ │ │ │ │ +Constructor. │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * tbbEvaluator.h │ │ │ │ │ + * cpuVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00878.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/ompKernel.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuEvaluator.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,45 +81,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
ompKernel.h File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
cpuEvaluator.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ +#include "../osd/bufferDescriptor.h"
│ │ │ │ +#include "../osd/types.h"
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CpuEvaluator
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
 
void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, int start, int end)
 
void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, float const *duWeights, float const *dvWeights, float const *duuWeights, float const *duvWeights, float const *dvvWeights, int start, int end)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,44 +4,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -ompKernel.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +cpuEvaluator.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ +#include "../osd/bufferDescriptor.h" │ │ │ │ │ +#include "../osd/types.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CpuEvaluator │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, int const *sizes, int const │ │ │ │ │ - *offsets, int const *indices, float const *weights, int start, int end) │ │ │ │ │ -  │ │ │ │ │ -void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, int │ │ │ │ │ - const *sizes, int const *offsets, int const *indices, float const │ │ │ │ │ - *weights, float const *duWeights, float const *dvWeights, int start, int │ │ │ │ │ - end) │ │ │ │ │ -  │ │ │ │ │ -void OmpEvalStencils (float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ - *dst, BufferDescriptor const &dstDesc, float *dstDu, BufferDescriptor │ │ │ │ │ - const &dstDuDesc, float *dstDv, BufferDescriptor const &dstDvDesc, float │ │ │ │ │ - *dstDuu, BufferDescriptor const &dstDuuDesc, float *dstDuv, │ │ │ │ │ - BufferDescriptor const &dstDuvDesc, float *dstDvv, BufferDescriptor const │ │ │ │ │ - &dstDvvDesc, int const *sizes, int const *offsets, int const *indices, │ │ │ │ │ - float const *weights, float const *duWeights, float const *dvWeights, │ │ │ │ │ - float const *duuWeights, float const *duvWeights, float const │ │ │ │ │ - *dvvWeights, int start, int end) │ │ │ │ │ -  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * ompKernel.h │ │ │ │ │ + * cpuEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00878.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,5 +1,3 @@ │ │ │ │ │ var a00878 = [ │ │ │ │ │ - ["OmpEvalStencils", "a00878.html#a44a05502feb5015035bc81b93cffb99c", null], │ │ │ │ │ - ["OmpEvalStencils", "a00878.html#a907dc53421460557871ddc35f77751f5", null], │ │ │ │ │ - ["OmpEvalStencils", "a00878.html#a870745ff3e883b32547d4db42b3be2bd", null] │ │ │ │ │ + ["CpuEvaluator", "a01157.html", null] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00878_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/ompKernel.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cpuEvaluator.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
ompKernel.h
│ │ │ │ +
cpuEvaluator.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -107,82 +107,501 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30namespace OpenSubdiv {
│ │ │ │ -
31namespace OPENSUBDIV_VERSION {
│ │ │ │ -
32
│ │ │ │ -
33namespace Osd {
│ │ │ │ -
34
│ │ │ │ -
35struct BufferDescriptor;
│ │ │ │ +
29#include "../osd/bufferDescriptor.h"
│ │ │ │ +
30#include "../osd/types.h"
│ │ │ │ +
31
│ │ │ │ +
32#include <cstddef>
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │ -
37void
│ │ │ │ -
38OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
39 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
40 int const * sizes,
│ │ │ │ -
41 int const * offsets,
│ │ │ │ -
42 int const * indices,
│ │ │ │ -
43 float const * weights,
│ │ │ │ -
44 int start, int end);
│ │ │ │ -
45
│ │ │ │ -
46void
│ │ │ │ -
47OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
48 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
49 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
50 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
51 int const * sizes,
│ │ │ │ -
52 int const * offsets,
│ │ │ │ -
53 int const * indices,
│ │ │ │ -
54 float const * weights,
│ │ │ │ -
55 float const * duWeights,
│ │ │ │ -
56 float const * dvWeights,
│ │ │ │ -
57 int start, int end);
│ │ │ │ -
58
│ │ │ │ -
59void
│ │ │ │ -
60OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc,
│ │ │ │ -
61 float * dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
62 float * dstDu, BufferDescriptor const &dstDuDesc,
│ │ │ │ -
63 float * dstDv, BufferDescriptor const &dstDvDesc,
│ │ │ │ -
64 float * dstDuu, BufferDescriptor const &dstDuuDesc,
│ │ │ │ -
65 float * dstDuv, BufferDescriptor const &dstDuvDesc,
│ │ │ │ -
66 float * dstDvv, BufferDescriptor const &dstDvvDesc,
│ │ │ │ -
67 int const * sizes,
│ │ │ │ -
68 int const * offsets,
│ │ │ │ -
69 int const * indices,
│ │ │ │ -
70 float const * weights,
│ │ │ │ -
71 float const * duWeights,
│ │ │ │ -
72 float const * dvWeights,
│ │ │ │ -
73 float const * duuWeights,
│ │ │ │ -
74 float const * duvWeights,
│ │ │ │ -
75 float const * dvvWeights,
│ │ │ │ -
76 int start, int end);
│ │ │ │ -
77
│ │ │ │ -
78} // end namespace Osd
│ │ │ │ -
79
│ │ │ │ -
80} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
81using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
82
│ │ │ │ -
83} // end namespace OpenSubdiv
│ │ │ │ +
37namespace Osd {
│ │ │ │ +
38
│ │ │ │ + │ │ │ │ +
40public:
│ │ │ │ +
46
│ │ │ │ +
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
72 static bool EvalStencils(
│ │ │ │ +
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
76 const CpuEvaluator *instance = NULL,
│ │ │ │ +
77 void * deviceContext = NULL) {
│ │ │ │ +
78
│ │ │ │ +
79 (void)instance; // unused
│ │ │ │ +
80 (void)deviceContext; // unused
│ │ │ │ +
81
│ │ │ │ +
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ +
83 return false;
│ │ │ │
84
│ │ │ │ -
85#endif // OPENSUBDIV3_OSD_OMP_KERNEL_H
│ │ │ │ +
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
87 &stencilTable->GetSizes()[0],
│ │ │ │ +
88 &stencilTable->GetOffsets()[0],
│ │ │ │ +
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
90 &stencilTable->GetWeights()[0],
│ │ │ │ +
91 /*start = */ 0,
│ │ │ │ +
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
121 static bool EvalStencils(
│ │ │ │ +
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
124 const int * sizes,
│ │ │ │ +
125 const int * offsets,
│ │ │ │ +
126 const int * indices,
│ │ │ │ +
127 const float * weights,
│ │ │ │ +
128 int start, int end);
│ │ │ │ +
129
│ │ │ │ +
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
168 static bool EvalStencils(
│ │ │ │ +
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
174 const CpuEvaluator *instance = NULL,
│ │ │ │ +
175 void * deviceContext = NULL) {
│ │ │ │ +
176
│ │ │ │ +
177 (void)instance; // unused
│ │ │ │ +
178 (void)deviceContext; // unused
│ │ │ │ +
179
│ │ │ │ +
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
184 &stencilTable->GetSizes()[0],
│ │ │ │ +
185 &stencilTable->GetOffsets()[0],
│ │ │ │ +
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
187 &stencilTable->GetWeights()[0],
│ │ │ │ +
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
190 /*start = */ 0,
│ │ │ │ +
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
192 }
│ │ │ │ +
193
│ │ │ │ +
234 static bool EvalStencils(
│ │ │ │ +
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
239 const int * sizes,
│ │ │ │ +
240 const int * offsets,
│ │ │ │ +
241 const int * indices,
│ │ │ │ +
242 const float * weights,
│ │ │ │ +
243 const float * duWeights,
│ │ │ │ +
244 const float * dvWeights,
│ │ │ │ +
245 int start, int end);
│ │ │ │ +
246
│ │ │ │ +
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ +
303 static bool EvalStencils(
│ │ │ │ +
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ +
312 const CpuEvaluator *instance = NULL,
│ │ │ │ +
313 void * deviceContext = NULL) {
│ │ │ │ +
314
│ │ │ │ +
315 (void)instance; // unused
│ │ │ │ +
316 (void)deviceContext; // unused
│ │ │ │ +
317
│ │ │ │ +
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
325 &stencilTable->GetSizes()[0],
│ │ │ │ +
326 &stencilTable->GetOffsets()[0],
│ │ │ │ +
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ +
328 &stencilTable->GetWeights()[0],
│ │ │ │ +
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ +
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ +
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ +
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ +
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ +
334 /*start = */ 0,
│ │ │ │ +
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ +
336 }
│ │ │ │ +
337
│ │ │ │ +
399 static bool EvalStencils(
│ │ │ │ +
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
407 const int * sizes,
│ │ │ │ +
408 const int * offsets,
│ │ │ │ +
409 const int * indices,
│ │ │ │ +
410 const float * weights,
│ │ │ │ +
411 const float * duWeights,
│ │ │ │ +
412 const float * dvWeights,
│ │ │ │ +
413 const float * duuWeights,
│ │ │ │ +
414 const float * duvWeights,
│ │ │ │ +
415 const float * dvvWeights,
│ │ │ │ +
416 int start, int end);
│ │ │ │ +
417
│ │ │ │ +
423
│ │ │ │ +
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
454 static bool EvalPatches(
│ │ │ │ +
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
457 int numPatchCoords,
│ │ │ │ +
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
459 PATCH_TABLE *patchTable,
│ │ │ │ +
460 CpuEvaluator const *instance = NULL,
│ │ │ │ +
461 void * deviceContext = NULL) {
│ │ │ │ +
462
│ │ │ │ +
463 (void)instance; // unused
│ │ │ │ +
464 (void)deviceContext; // unused
│ │ │ │ +
465
│ │ │ │ +
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
468 numPatchCoords,
│ │ │ │ +
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
472 patchTable->GetPatchParamBuffer());
│ │ │ │ +
473 }
│ │ │ │ +
474
│ │ │ │ +
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
517 static bool EvalPatches(
│ │ │ │ +
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
522 int numPatchCoords,
│ │ │ │ +
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
524 PATCH_TABLE *patchTable,
│ │ │ │ +
525 CpuEvaluator const *instance = NULL,
│ │ │ │ +
526 void * deviceContext = NULL) {
│ │ │ │ +
527
│ │ │ │ +
528 (void)instance; // unused
│ │ │ │ +
529 (void)deviceContext; // unused
│ │ │ │ +
530
│ │ │ │ +
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
533 // so that downcast isn't needed there.
│ │ │ │ +
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
535 //
│ │ │ │ +
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
540 numPatchCoords,
│ │ │ │ +
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
544 patchTable->GetPatchParamBuffer());
│ │ │ │ +
545 }
│ │ │ │ +
546
│ │ │ │ +
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ +
607 static bool EvalPatches(
│ │ │ │ +
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
615 int numPatchCoords,
│ │ │ │ +
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
617 PATCH_TABLE *patchTable,
│ │ │ │ +
618 CpuEvaluator const *instance = NULL,
│ │ │ │ +
619 void * deviceContext = NULL) {
│ │ │ │ +
620
│ │ │ │ +
621 (void)instance; // unused
│ │ │ │ +
622 (void)deviceContext; // unused
│ │ │ │ +
623
│ │ │ │ +
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ +
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ +
626 // so that downcast isn't needed there.
│ │ │ │ +
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ +
628 //
│ │ │ │ +
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
636 numPatchCoords,
│ │ │ │ +
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ +
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ +
640 patchTable->GetPatchParamBuffer());
│ │ │ │ +
641 }
│ │ │ │ +
642
│ │ │ │ +
670 static bool EvalPatches(
│ │ │ │ +
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
673 int numPatchCoords,
│ │ │ │ +
674 const PatchCoord *patchCoords,
│ │ │ │ +
675 const PatchArray *patchArrays,
│ │ │ │ +
676 const int *patchIndexBuffer,
│ │ │ │ +
677 const PatchParam *patchParamBuffer);
│ │ │ │ +
678
│ │ │ │ +
716 static bool EvalPatches(
│ │ │ │ +
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
721 int numPatchCoords,
│ │ │ │ +
722 PatchCoord const *patchCoords,
│ │ │ │ +
723 PatchArray const *patchArrays,
│ │ │ │ +
724 const int *patchIndexBuffer,
│ │ │ │ +
725 PatchParam const *patchParamBuffer);
│ │ │ │ +
726
│ │ │ │ +
779 static bool EvalPatches(
│ │ │ │ +
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ +
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ +
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ +
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ +
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ +
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ +
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ +
787 int numPatchCoords,
│ │ │ │ +
788 PatchCoord const *patchCoords,
│ │ │ │ +
789 PatchArray const *patchArrays,
│ │ │ │ +
790 const int *patchIndexBuffer,
│ │ │ │ +
791 PatchParam const *patchParamBuffer);
│ │ │ │ +
792
│ │ │ │ +
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
826 int numPatchCoords,
│ │ │ │ +
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
828 PATCH_TABLE *patchTable,
│ │ │ │ +
829 CpuEvaluator const *instance = NULL,
│ │ │ │ +
830 void * deviceContext = NULL) {
│ │ │ │ +
831
│ │ │ │ +
832 (void)instance; // unused
│ │ │ │ +
833 (void)deviceContext; // unused
│ │ │ │ +
834
│ │ │ │ +
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
837 numPatchCoords,
│ │ │ │ +
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
841 patchTable->GetPatchParamBuffer());
│ │ │ │ +
842 }
│ │ │ │ +
843
│ │ │ │ +
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
891 int numPatchCoords,
│ │ │ │ +
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
893 PATCH_TABLE *patchTable,
│ │ │ │ +
894 CpuEvaluator const *instance = NULL,
│ │ │ │ +
895 void * deviceContext = NULL) {
│ │ │ │ +
896
│ │ │ │ +
897 (void)instance; // unused
│ │ │ │ +
898 (void)deviceContext; // unused
│ │ │ │ +
899
│ │ │ │ +
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
904 numPatchCoords,
│ │ │ │ +
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
908 patchTable->GetPatchParamBuffer());
│ │ │ │ +
909 }
│ │ │ │ +
910
│ │ │ │ +
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
979 int numPatchCoords,
│ │ │ │ +
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
981 PATCH_TABLE *patchTable,
│ │ │ │ +
982 CpuEvaluator const *instance = NULL,
│ │ │ │ +
983 void * deviceContext = NULL) {
│ │ │ │ +
984
│ │ │ │ +
985 (void)instance; // unused
│ │ │ │ +
986 (void)deviceContext; // unused
│ │ │ │ +
987
│ │ │ │ +
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
995 numPatchCoords,
│ │ │ │ +
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ +
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ +
999 patchTable->GetPatchParamBuffer());
│ │ │ │ +
1000 }
│ │ │ │ +
1001
│ │ │ │ +
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1037 int numPatchCoords,
│ │ │ │ +
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1039 PATCH_TABLE *patchTable,
│ │ │ │ +
1040 int fvarChannel,
│ │ │ │ +
1041 CpuEvaluator const *instance = NULL,
│ │ │ │ +
1042 void * deviceContext = NULL) {
│ │ │ │ +
1043
│ │ │ │ +
1044 (void)instance; // unused
│ │ │ │ +
1045 (void)deviceContext; // unused
│ │ │ │ +
1046
│ │ │ │ +
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1049 numPatchCoords,
│ │ │ │ +
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1054 }
│ │ │ │ +
1055
│ │ │ │ +
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1105 int numPatchCoords,
│ │ │ │ +
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1107 PATCH_TABLE *patchTable,
│ │ │ │ +
1108 int fvarChannel,
│ │ │ │ +
1109 CpuEvaluator const *instance = NULL,
│ │ │ │ +
1110 void * deviceContext = NULL) {
│ │ │ │ +
1111
│ │ │ │ +
1112 (void)instance; // unused
│ │ │ │ +
1113 (void)deviceContext; // unused
│ │ │ │ +
1114
│ │ │ │ +
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1119 numPatchCoords,
│ │ │ │ +
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1124 }
│ │ │ │ +
1125
│ │ │ │ +
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ +
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ + │ │ │ │ +
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ +
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ +
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ +
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ +
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ +
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ +
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ +
1196 int numPatchCoords,
│ │ │ │ +
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ +
1198 PATCH_TABLE *patchTable,
│ │ │ │ +
1199 int fvarChannel,
│ │ │ │ +
1200 CpuEvaluator const *instance = NULL,
│ │ │ │ +
1201 void * deviceContext = NULL) {
│ │ │ │ +
1202
│ │ │ │ +
1203 (void)instance; // unused
│ │ │ │ +
1204 (void)deviceContext; // unused
│ │ │ │ +
1205
│ │ │ │ +
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ +
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ +
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ +
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ +
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ +
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ +
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ +
1213 numPatchCoords,
│ │ │ │ +
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ +
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ +
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ +
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ +
1218 }
│ │ │ │ +
1219
│ │ │ │ +
1225
│ │ │ │ +
1227 static void Synchronize(void * /*deviceContext = NULL*/) {
│ │ │ │ +
1228 // nothing.
│ │ │ │ +
1229 }
│ │ │ │ +
1230};
│ │ │ │ +
1231
│ │ │ │ +
1232
│ │ │ │ +
1233} // end namespace Osd
│ │ │ │ +
1234
│ │ │ │ +
1235} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
1236using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
1237
│ │ │ │ +
1238} // end namespace OpenSubdiv
│ │ │ │ +
1239
│ │ │ │ +
1240
│ │ │ │ +
1241#endif // OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │ │ │ │ │ -
void OmpEvalStencils(float const *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, int const *indices, float const *weights, int start, int end)
│ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:971
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:454
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: cpuEvaluator.h:517
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: cpuEvaluator.h:303
│ │ │ │ +
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:886
│ │ │ │ +
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:823
│ │ │ │ +
static void Synchronize(void *)
synchronize all asynchronous computation invoked on this device.
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: cpuEvaluator.h:72
│ │ │ │ +
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: cpuEvaluator.h:607
│ │ │ │ +
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: cpuEvaluator.h:168
│ │ │ │ +
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -ompKernel.h │ │ │ │ │ +cpuEvaluator.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -30,82 +30,657 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30namespace OpenSubdiv { │ │ │ │ │ - 31namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace Osd { │ │ │ │ │ - 34 │ │ │ │ │ - 35struct BufferDescriptor; │ │ │ │ │ + 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ + 30#include "../osd/types.h" │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ - 37void │ │ │ │ │ -38OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 39 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 40 int const * sizes, │ │ │ │ │ - 41 int const * offsets, │ │ │ │ │ - 42 int const * indices, │ │ │ │ │ - 43 float const * weights, │ │ │ │ │ - 44 int start, int end); │ │ │ │ │ - 45 │ │ │ │ │ - 46void │ │ │ │ │ -47OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 48 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 49 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 50 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 51 int const * sizes, │ │ │ │ │ - 52 int const * offsets, │ │ │ │ │ - 53 int const * indices, │ │ │ │ │ - 54 float const * weights, │ │ │ │ │ - 55 float const * duWeights, │ │ │ │ │ - 56 float const * dvWeights, │ │ │ │ │ - 57 int start, int end); │ │ │ │ │ - 58 │ │ │ │ │ - 59void │ │ │ │ │ -60OmpEvalStencils(float const * src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 61 float * dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 62 float * dstDu, BufferDescriptor const &dstDuDesc, │ │ │ │ │ - 63 float * dstDv, BufferDescriptor const &dstDvDesc, │ │ │ │ │ - 64 float * dstDuu, BufferDescriptor const &dstDuuDesc, │ │ │ │ │ - 65 float * dstDuv, BufferDescriptor const &dstDuvDesc, │ │ │ │ │ - 66 float * dstDvv, BufferDescriptor const &dstDvvDesc, │ │ │ │ │ - 67 int const * sizes, │ │ │ │ │ - 68 int const * offsets, │ │ │ │ │ - 69 int const * indices, │ │ │ │ │ - 70 float const * weights, │ │ │ │ │ - 71 float const * duWeights, │ │ │ │ │ - 72 float const * dvWeights, │ │ │ │ │ - 73 float const * duuWeights, │ │ │ │ │ - 74 float const * duvWeights, │ │ │ │ │ - 75 float const * dvvWeights, │ │ │ │ │ - 76 int start, int end); │ │ │ │ │ - 77 │ │ │ │ │ - 78} // end namespace Osd │ │ │ │ │ - 79 │ │ │ │ │ - 80} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 81using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 82 │ │ │ │ │ - 83} // end namespace OpenSubdiv │ │ │ │ │ + 37namespace Osd { │ │ │ │ │ + 38 │ │ │ │ │ +39class CpuEvaluator { │ │ │ │ │ + 40public: │ │ │ │ │ + 46 │ │ │ │ │ + 71 template │ │ │ │ │ +72 static bool EvalStencils( │ │ │ │ │ + 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 76 const CpuEvaluator *instance = NULL, │ │ │ │ │ + 77 void * deviceContext = NULL) { │ │ │ │ │ + 78 │ │ │ │ │ + 79 (void)instance; // unused │ │ │ │ │ + 80 (void)deviceContext; // unused │ │ │ │ │ + 81 │ │ │ │ │ + 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ + 83 return false; │ │ │ │ │ 84 │ │ │ │ │ - 85#endif // OPENSUBDIV3_OSD_OMP_KERNEL_H │ │ │ │ │ + 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 87 &stencilTable->GetSizes()[0], │ │ │ │ │ + 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 90 &stencilTable->GetWeights()[0], │ │ │ │ │ + 91 /*start = */ 0, │ │ │ │ │ + 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 93 } │ │ │ │ │ + 94 │ │ │ │ │ +121 static bool EvalStencils( │ │ │ │ │ + 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 124 const int * sizes, │ │ │ │ │ + 125 const int * offsets, │ │ │ │ │ + 126 const int * indices, │ │ │ │ │ + 127 const float * weights, │ │ │ │ │ + 128 int start, int end); │ │ │ │ │ + 129 │ │ │ │ │ + 167 template │ │ │ │ │ +168 static bool EvalStencils( │ │ │ │ │ + 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 174 const CpuEvaluator *instance = NULL, │ │ │ │ │ + 175 void * deviceContext = NULL) { │ │ │ │ │ + 176 │ │ │ │ │ + 177 (void)instance; // unused │ │ │ │ │ + 178 (void)deviceContext; // unused │ │ │ │ │ + 179 │ │ │ │ │ + 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 184 &stencilTable->GetSizes()[0], │ │ │ │ │ + 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 187 &stencilTable->GetWeights()[0], │ │ │ │ │ + 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 190 /*start = */ 0, │ │ │ │ │ + 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 192 } │ │ │ │ │ + 193 │ │ │ │ │ +234 static bool EvalStencils( │ │ │ │ │ + 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 239 const int * sizes, │ │ │ │ │ + 240 const int * offsets, │ │ │ │ │ + 241 const int * indices, │ │ │ │ │ + 242 const float * weights, │ │ │ │ │ + 243 const float * duWeights, │ │ │ │ │ + 244 const float * dvWeights, │ │ │ │ │ + 245 int start, int end); │ │ │ │ │ + 246 │ │ │ │ │ + 302 template │ │ │ │ │ +303 static bool EvalStencils( │ │ │ │ │ + 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ + 312 const CpuEvaluator *instance = NULL, │ │ │ │ │ + 313 void * deviceContext = NULL) { │ │ │ │ │ + 314 │ │ │ │ │ + 315 (void)instance; // unused │ │ │ │ │ + 316 (void)deviceContext; // unused │ │ │ │ │ + 317 │ │ │ │ │ + 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 325 &stencilTable->GetSizes()[0], │ │ │ │ │ + 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ + 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ + 328 &stencilTable->GetWeights()[0], │ │ │ │ │ + 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ + 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ + 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ + 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ + 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ + 334 /*start = */ 0, │ │ │ │ │ + 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ +399 static bool EvalStencils( │ │ │ │ │ + 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 407 const int * sizes, │ │ │ │ │ + 408 const int * offsets, │ │ │ │ │ + 409 const int * indices, │ │ │ │ │ + 410 const float * weights, │ │ │ │ │ + 411 const float * duWeights, │ │ │ │ │ + 412 const float * dvWeights, │ │ │ │ │ + 413 const float * duuWeights, │ │ │ │ │ + 414 const float * duvWeights, │ │ │ │ │ + 415 const float * dvvWeights, │ │ │ │ │ + 416 int start, int end); │ │ │ │ │ + 417 │ │ │ │ │ + 423 │ │ │ │ │ + 452 template │ │ │ │ │ +454 static bool EvalPatches( │ │ │ │ │ + 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 457 int numPatchCoords, │ │ │ │ │ + 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 459 PATCH_TABLE *patchTable, │ │ │ │ │ + 460 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 461 void * deviceContext = NULL) { │ │ │ │ │ + 462 │ │ │ │ │ + 463 (void)instance; // unused │ │ │ │ │ + 464 (void)deviceContext; // unused │ │ │ │ │ + 465 │ │ │ │ │ + 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 468 numPatchCoords, │ │ │ │ │ + 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 473 } │ │ │ │ │ + 474 │ │ │ │ │ + 515 template │ │ │ │ │ +517 static bool EvalPatches( │ │ │ │ │ + 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 522 int numPatchCoords, │ │ │ │ │ + 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 524 PATCH_TABLE *patchTable, │ │ │ │ │ + 525 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 526 void * deviceContext = NULL) { │ │ │ │ │ + 527 │ │ │ │ │ + 528 (void)instance; // unused │ │ │ │ │ + 529 (void)deviceContext; // unused │ │ │ │ │ + 530 │ │ │ │ │ + 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 533 // so that downcast isn't needed there. │ │ │ │ │ + 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 535 // │ │ │ │ │ + 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 540 numPatchCoords, │ │ │ │ │ + 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 545 } │ │ │ │ │ + 546 │ │ │ │ │ + 605 template │ │ │ │ │ +607 static bool EvalPatches( │ │ │ │ │ + 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 615 int numPatchCoords, │ │ │ │ │ + 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 617 PATCH_TABLE *patchTable, │ │ │ │ │ + 618 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 619 void * deviceContext = NULL) { │ │ │ │ │ + 620 │ │ │ │ │ + 621 (void)instance; // unused │ │ │ │ │ + 622 (void)deviceContext; // unused │ │ │ │ │ + 623 │ │ │ │ │ + 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ + 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ + 626 // so that downcast isn't needed there. │ │ │ │ │ + 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ + 628 // │ │ │ │ │ + 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 636 numPatchCoords, │ │ │ │ │ + 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ + 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ + 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 641 } │ │ │ │ │ + 642 │ │ │ │ │ +670 static bool EvalPatches( │ │ │ │ │ + 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 673 int numPatchCoords, │ │ │ │ │ + 674 const PatchCoord *patchCoords, │ │ │ │ │ + 675 const PatchArray *patchArrays, │ │ │ │ │ + 676 const int *patchIndexBuffer, │ │ │ │ │ + 677 const PatchParam *patchParamBuffer); │ │ │ │ │ + 678 │ │ │ │ │ +716 static bool EvalPatches( │ │ │ │ │ + 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 721 int numPatchCoords, │ │ │ │ │ + 722 PatchCoord const *patchCoords, │ │ │ │ │ + 723 PatchArray const *patchArrays, │ │ │ │ │ + 724 const int *patchIndexBuffer, │ │ │ │ │ + 725 PatchParam const *patchParamBuffer); │ │ │ │ │ + 726 │ │ │ │ │ +779 static bool EvalPatches( │ │ │ │ │ + 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ + 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ + 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ + 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ + 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ + 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ + 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 787 int numPatchCoords, │ │ │ │ │ + 788 PatchCoord const *patchCoords, │ │ │ │ │ + 789 PatchArray const *patchArrays, │ │ │ │ │ + 790 const int *patchIndexBuffer, │ │ │ │ │ + 791 PatchParam const *patchParamBuffer); │ │ │ │ │ + 792 │ │ │ │ │ + 821 template │ │ │ │ │ +823 static bool EvalPatchesVarying( │ │ │ │ │ + 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 826 int numPatchCoords, │ │ │ │ │ + 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 828 PATCH_TABLE *patchTable, │ │ │ │ │ + 829 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 830 void * deviceContext = NULL) { │ │ │ │ │ + 831 │ │ │ │ │ + 832 (void)instance; // unused │ │ │ │ │ + 833 (void)deviceContext; // unused │ │ │ │ │ + 834 │ │ │ │ │ + 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 837 numPatchCoords, │ │ │ │ │ + 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 842 } │ │ │ │ │ + 843 │ │ │ │ │ + 884 template │ │ │ │ │ +886 static bool EvalPatchesVarying( │ │ │ │ │ + 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 891 int numPatchCoords, │ │ │ │ │ + 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 893 PATCH_TABLE *patchTable, │ │ │ │ │ + 894 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 895 void * deviceContext = NULL) { │ │ │ │ │ + 896 │ │ │ │ │ + 897 (void)instance; // unused │ │ │ │ │ + 898 (void)deviceContext; // unused │ │ │ │ │ + 899 │ │ │ │ │ + 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 904 numPatchCoords, │ │ │ │ │ + 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 909 } │ │ │ │ │ + 910 │ │ │ │ │ + 969 template │ │ │ │ │ +971 static bool EvalPatchesVarying( │ │ │ │ │ + 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 979 int numPatchCoords, │ │ │ │ │ + 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 981 PATCH_TABLE *patchTable, │ │ │ │ │ + 982 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 983 void * deviceContext = NULL) { │ │ │ │ │ + 984 │ │ │ │ │ + 985 (void)instance; // unused │ │ │ │ │ + 986 (void)deviceContext; // unused │ │ │ │ │ + 987 │ │ │ │ │ + 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 995 numPatchCoords, │ │ │ │ │ + 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ + 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ + 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ + 1000 } │ │ │ │ │ + 1001 │ │ │ │ │ + 1032 template │ │ │ │ │ +1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1037 int numPatchCoords, │ │ │ │ │ + 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1039 PATCH_TABLE *patchTable, │ │ │ │ │ + 1040 int fvarChannel, │ │ │ │ │ + 1041 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 1042 void * deviceContext = NULL) { │ │ │ │ │ + 1043 │ │ │ │ │ + 1044 (void)instance; // unused │ │ │ │ │ + 1045 (void)deviceContext; // unused │ │ │ │ │ + 1046 │ │ │ │ │ + 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1049 numPatchCoords, │ │ │ │ │ + 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1054 } │ │ │ │ │ + 1055 │ │ │ │ │ + 1098 template │ │ │ │ │ +1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1105 int numPatchCoords, │ │ │ │ │ + 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1107 PATCH_TABLE *patchTable, │ │ │ │ │ + 1108 int fvarChannel, │ │ │ │ │ + 1109 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 1110 void * deviceContext = NULL) { │ │ │ │ │ + 1111 │ │ │ │ │ + 1112 (void)instance; // unused │ │ │ │ │ + 1113 (void)deviceContext; // unused │ │ │ │ │ + 1114 │ │ │ │ │ + 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1119 numPatchCoords, │ │ │ │ │ + 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1124 } │ │ │ │ │ + 1125 │ │ │ │ │ + 1186 template │ │ │ │ │ +1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ + 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ + 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ + 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ + 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ + 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ + 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ + 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ + 1196 int numPatchCoords, │ │ │ │ │ + 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ + 1198 PATCH_TABLE *patchTable, │ │ │ │ │ + 1199 int fvarChannel, │ │ │ │ │ + 1200 CpuEvaluator const *instance = NULL, │ │ │ │ │ + 1201 void * deviceContext = NULL) { │ │ │ │ │ + 1202 │ │ │ │ │ + 1203 (void)instance; // unused │ │ │ │ │ + 1204 (void)deviceContext; // unused │ │ │ │ │ + 1205 │ │ │ │ │ + 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ + 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ + 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ + 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ + 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ + 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ + 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ + 1213 numPatchCoords, │ │ │ │ │ + 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ + 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ + 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ + 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ + 1218 } │ │ │ │ │ + 1219 │ │ │ │ │ + 1225 │ │ │ │ │ +1227 static void Synchronize(void * /*deviceContext = NULL*/) { │ │ │ │ │ + 1228 // nothing. │ │ │ │ │ + 1229 } │ │ │ │ │ + 1230}; │ │ │ │ │ + 1231 │ │ │ │ │ + 1232 │ │ │ │ │ + 1233} // end namespace Osd │ │ │ │ │ + 1234 │ │ │ │ │ + 1235} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 1236using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 1237 │ │ │ │ │ + 1238} // end namespace OpenSubdiv │ │ │ │ │ + 1239 │ │ │ │ │ + 1240 │ │ │ │ │ + 1241#endif // OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvalStencils │ │ │ │ │ -void OmpEvalStencils(float const *src, BufferDescriptor const &srcDesc, float │ │ │ │ │ -*dst, BufferDescriptor const &dstDesc, int const *sizes, int const *offsets, │ │ │ │ │ -int const *indices, float const *weights, int start, int end) │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ data buffers.... │ │ │ │ │ Definition: bufferDescriptor.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator │ │ │ │ │ +Definition: cpuEvaluator.h:39 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ +fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:1034 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:1100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ +Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ +output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ +static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ +const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ +DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ +CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:1188 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:971 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ +*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ +const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ +float *dvvWeights, int start, int end) │ │ │ │ │ +Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ +for input and output. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ +BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ +float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ +const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ +PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ +PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const │ │ │ │ │ +*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:454 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ +*patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: cpuEvaluator.h:517 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ +&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ +PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ +&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ +*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ +const CpuEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: cpuEvaluator.h:303 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ +float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ +PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ +*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ +Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ +values on given PatchT... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:886 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ +static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ +numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ +CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic limit eval function. This function has a same signature as other device │ │ │ │ │ +kernels have so that ... │ │ │ │ │ +Definition: cpuEvaluator.h:823 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::Synchronize │ │ │ │ │ +static void Synchronize(void *) │ │ │ │ │ +synchronize all asynchronous computation invoked on this device. │ │ │ │ │ +Definition: cpuEvaluator.h:1227 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ +const *stencilTable, const CpuEvaluator *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function. This function has a same signature as │ │ │ │ │ +other device kernels hav... │ │ │ │ │ +Definition: cpuEvaluator.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ +static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ +DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ +BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ +&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ +*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ +BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ +*patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Generic limit eval function with derivatives. This function has a same │ │ │ │ │ +signature as other device kern... │ │ │ │ │ +Definition: cpuEvaluator.h:607 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ +static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ +&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ +*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ +BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ +CpuEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ +Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ +same signature as other d... │ │ │ │ │ +Definition: cpuEvaluator.h:168 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ +Coordinates set on a patch table. │ │ │ │ │ +Definition: types.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ +Definition: types.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ +Definition: types.h:127 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * ompKernel.h │ │ │ │ │ + * cpuEvaluator.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00881.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/ompEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/bufferDescriptor.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,27 +83,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
ompEvaluator.h File Reference
│ │ │ │ +
bufferDescriptor.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include <cstddef>
│ │ │ │ +#include <string.h>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  OmpEvaluator
struct  BufferDescriptor
 BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -112,13 +111,13 @@ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -ompEvaluator.h File Reference │ │ │ │ │ +bufferDescriptor.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  OmpEvaluator │ │ │ │ │ +struct  BufferDescriptor │ │ │ │ │ + BufferDescriptor is a struct which describes buffer elements in │ │ │ │ │ +  interleaved data buffers. Almost all Osd Evaluator APIs take │ │ │ │ │ + BufferDescriptors along with device-specific buffer objects. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * ompEvaluator.h │ │ │ │ │ + * bufferDescriptor.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00881.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00881 = [ │ │ │ │ │ - ["OmpEvaluator", "a01305.html", null] │ │ │ │ │ + ["BufferDescriptor", "a01133.html", "a01133"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00881_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/ompEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/bufferDescriptor.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
ompEvaluator.h
│ │ │ │ +
bufferDescriptor.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2015 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,502 +107,98 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │
27
│ │ │ │
28#include "../version.h"
│ │ │ │ -
29#include "../osd/bufferDescriptor.h"
│ │ │ │ -
30#include "../osd/types.h"
│ │ │ │ -
31
│ │ │ │ -
32#include <cstddef>
│ │ │ │ +
29#include <string.h>
│ │ │ │ +
30
│ │ │ │ +
31namespace OpenSubdiv {
│ │ │ │ +
32namespace OPENSUBDIV_VERSION {
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Osd {
│ │ │ │ -
38
│ │ │ │ - │ │ │ │ -
40public:
│ │ │ │ +
34namespace Osd {
│ │ │ │ +
35
│ │ │ │
46
│ │ │ │ -
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
72 static bool EvalStencils(
│ │ │ │ -
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
76 const OmpEvaluator *instance = NULL,
│ │ │ │ -
77 void * deviceContext = NULL) {
│ │ │ │ -
78
│ │ │ │ -
79 (void)instance; // unused
│ │ │ │ -
80 (void)deviceContext; // unused
│ │ │ │ -
81
│ │ │ │ -
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ -
83 return false;
│ │ │ │ +
47// example:
│ │ │ │ +
48// n
│ │ │ │ +
49// -----+----------------------------------------+-------------------------
│ │ │ │ +
50// | vertex 0 |
│ │ │ │ +
51// -----+----------------------------------------+-------------------------
│ │ │ │ +
52// | X Y Z R G B A Xu Yu Zu Xv Yv Zv |
│ │ │ │ +
53// -----+----------------------------------------+-------------------------
│ │ │ │ +
54// <------------- stride = 13 -------------->
│ │ │ │ +
55//
│ │ │ │ +
56// - XYZ (offset = n+0, length = 3, stride = 13)
│ │ │ │ +
57// - RGBA (offset = n+3, length = 4, stride = 13)
│ │ │ │ +
58// - uTangent (offset = n+7, length = 3, stride = 13)
│ │ │ │ +
59// - vTangent (offset = n+10, length = 3, stride = 13)
│ │ │ │ +
60//
│ │ │ │ + │ │ │ │ +
62
│ │ │ │ + │ │ │ │ +
65
│ │ │ │ +
67 BufferDescriptor(int o, int l, int s) : offset(o), length(l), stride(s) { }
│ │ │ │ +
68
│ │ │ │ +
70 int GetLocalOffset() const {
│ │ │ │ +
71 return stride > 0 ? offset % stride : 0;
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ +
75 bool IsValid() const {
│ │ │ │ +
76 return ((length > 0) &&
│ │ │ │ + │ │ │ │ +
78 }
│ │ │ │ +
79
│ │ │ │ +
81 void Reset() {
│ │ │ │ +
82 offset = length = stride = 0;
│ │ │ │ +
83 }
│ │ │ │
84
│ │ │ │ -
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
87 &stencilTable->GetSizes()[0],
│ │ │ │ -
88 &stencilTable->GetOffsets()[0],
│ │ │ │ -
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
90 &stencilTable->GetWeights()[0],
│ │ │ │ -
91 /*start = */ 0,
│ │ │ │ -
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
121 static bool EvalStencils(
│ │ │ │ -
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
124 const int * sizes,
│ │ │ │ -
125 const int * offsets,
│ │ │ │ -
126 const int * indices,
│ │ │ │ -
127 const float * weights,
│ │ │ │ -
128 int start, int end);
│ │ │ │ -
129
│ │ │ │ -
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
168 static bool EvalStencils(
│ │ │ │ -
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
174 const OmpEvaluator *instance = NULL,
│ │ │ │ -
175 void * deviceContext = NULL) {
│ │ │ │ -
176
│ │ │ │ -
177 (void)instance; // unused
│ │ │ │ -
178 (void)deviceContext; // unused
│ │ │ │ -
179
│ │ │ │ -
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
184 &stencilTable->GetSizes()[0],
│ │ │ │ -
185 &stencilTable->GetOffsets()[0],
│ │ │ │ -
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
187 &stencilTable->GetWeights()[0],
│ │ │ │ -
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
190 /*start = */ 0,
│ │ │ │ -
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
192 }
│ │ │ │ -
193
│ │ │ │ -
234 static bool EvalStencils(
│ │ │ │ -
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
239 const int * sizes,
│ │ │ │ -
240 const int * offsets,
│ │ │ │ -
241 const int * indices,
│ │ │ │ -
242 const float * weights,
│ │ │ │ -
243 const float * duWeights,
│ │ │ │ -
244 const float * dvWeights,
│ │ │ │ -
245 int start, int end);
│ │ │ │ -
246
│ │ │ │ -
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
303 static bool EvalStencils(
│ │ │ │ -
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
312 const OmpEvaluator *instance = NULL,
│ │ │ │ -
313 void * deviceContext = NULL) {
│ │ │ │ -
314
│ │ │ │ -
315 (void)instance; // unused
│ │ │ │ -
316 (void)deviceContext; // unused
│ │ │ │ -
317
│ │ │ │ -
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
325 &stencilTable->GetSizes()[0],
│ │ │ │ -
326 &stencilTable->GetOffsets()[0],
│ │ │ │ -
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
328 &stencilTable->GetWeights()[0],
│ │ │ │ -
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ -
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ -
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ -
334 /*start = */ 0,
│ │ │ │ -
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
336 }
│ │ │ │ -
337
│ │ │ │ -
399 static bool EvalStencils(
│ │ │ │ -
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
407 const int * sizes,
│ │ │ │ -
408 const int * offsets,
│ │ │ │ -
409 const int * indices,
│ │ │ │ -
410 const float * weights,
│ │ │ │ -
411 const float * duWeights,
│ │ │ │ -
412 const float * dvWeights,
│ │ │ │ -
413 const float * duuWeights,
│ │ │ │ -
414 const float * duvWeights,
│ │ │ │ -
415 const float * dvvWeights,
│ │ │ │ -
416 int start, int end);
│ │ │ │ -
417
│ │ │ │ -
423
│ │ │ │ -
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
454 static bool EvalPatches(
│ │ │ │ -
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
457 int numPatchCoords,
│ │ │ │ -
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
459 PATCH_TABLE *patchTable,
│ │ │ │ -
460 OmpEvaluator const *instance = NULL,
│ │ │ │ -
461 void * deviceContext = NULL) {
│ │ │ │ -
462
│ │ │ │ -
463 (void)instance; // unused
│ │ │ │ -
464 (void)deviceContext; // unused
│ │ │ │ -
465
│ │ │ │ -
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
468 numPatchCoords,
│ │ │ │ -
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
472 patchTable->GetPatchParamBuffer());
│ │ │ │ -
473 }
│ │ │ │ -
474
│ │ │ │ -
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
517 static bool EvalPatches(
│ │ │ │ -
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
522 int numPatchCoords,
│ │ │ │ -
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
524 PATCH_TABLE *patchTable,
│ │ │ │ -
525 OmpEvaluator const *instance = NULL,
│ │ │ │ -
526 void * deviceContext = NULL) {
│ │ │ │ -
527
│ │ │ │ -
528 (void)instance; // unused
│ │ │ │ -
529 (void)deviceContext; // unused
│ │ │ │ -
530
│ │ │ │ -
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
533 // so that downcast isn't needed there.
│ │ │ │ -
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
535 //
│ │ │ │ -
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
540 numPatchCoords,
│ │ │ │ -
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
544 patchTable->GetPatchParamBuffer());
│ │ │ │ -
545 }
│ │ │ │ -
546
│ │ │ │ -
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
607 static bool EvalPatches(
│ │ │ │ -
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
615 int numPatchCoords,
│ │ │ │ -
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
617 PATCH_TABLE *patchTable,
│ │ │ │ -
618 OmpEvaluator const *instance = NULL,
│ │ │ │ -
619 void * deviceContext = NULL) {
│ │ │ │ -
620
│ │ │ │ -
621 (void)instance; // unused
│ │ │ │ -
622 (void)deviceContext; // unused
│ │ │ │ -
623
│ │ │ │ -
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
626 // so that downcast isn't needed there.
│ │ │ │ -
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
628 //
│ │ │ │ -
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
636 numPatchCoords,
│ │ │ │ -
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
640 patchTable->GetPatchParamBuffer());
│ │ │ │ -
641 }
│ │ │ │ -
642
│ │ │ │ -
670 static bool EvalPatches(
│ │ │ │ -
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
673 int numPatchCoords,
│ │ │ │ -
674 const PatchCoord *patchCoords,
│ │ │ │ -
675 const PatchArray *patchArrays,
│ │ │ │ -
676 const int *patchIndexBuffer,
│ │ │ │ -
677 const PatchParam *patchParamBuffer);
│ │ │ │ -
678
│ │ │ │ -
716 static bool EvalPatches(
│ │ │ │ -
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
721 int numPatchCoords,
│ │ │ │ -
722 PatchCoord const *patchCoords,
│ │ │ │ -
723 PatchArray const *patchArrays,
│ │ │ │ -
724 const int *patchIndexBuffer,
│ │ │ │ -
725 PatchParam const *patchParamBuffer);
│ │ │ │ -
726
│ │ │ │ -
779 static bool EvalPatches(
│ │ │ │ -
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
787 int numPatchCoords,
│ │ │ │ -
788 PatchCoord const *patchCoords,
│ │ │ │ -
789 PatchArray const *patchArrays,
│ │ │ │ -
790 const int *patchIndexBuffer,
│ │ │ │ -
791 PatchParam const *patchParamBuffer);
│ │ │ │ -
792
│ │ │ │ -
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
826 int numPatchCoords,
│ │ │ │ -
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
828 PATCH_TABLE *patchTable,
│ │ │ │ -
829 OmpEvaluator const *instance = NULL,
│ │ │ │ -
830 void * deviceContext = NULL) {
│ │ │ │ -
831
│ │ │ │ -
832 (void)instance; // unused
│ │ │ │ -
833 (void)deviceContext; // unused
│ │ │ │ -
834
│ │ │ │ -
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
837 numPatchCoords,
│ │ │ │ -
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
841 patchTable->GetPatchParamBuffer());
│ │ │ │ -
842 }
│ │ │ │ -
843
│ │ │ │ -
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
891 int numPatchCoords,
│ │ │ │ -
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
893 PATCH_TABLE *patchTable,
│ │ │ │ -
894 OmpEvaluator const *instance = NULL,
│ │ │ │ -
895 void * deviceContext = NULL) {
│ │ │ │ -
896
│ │ │ │ -
897 (void)instance; // unused
│ │ │ │ -
898 (void)deviceContext; // unused
│ │ │ │ -
899
│ │ │ │ -
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
904 numPatchCoords,
│ │ │ │ -
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
908 patchTable->GetPatchParamBuffer());
│ │ │ │ -
909 }
│ │ │ │ -
910
│ │ │ │ -
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
979 int numPatchCoords,
│ │ │ │ -
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
981 PATCH_TABLE *patchTable,
│ │ │ │ -
982 OmpEvaluator const *instance = NULL,
│ │ │ │ -
983 void * deviceContext = NULL) {
│ │ │ │ -
984
│ │ │ │ -
985 (void)instance; // unused
│ │ │ │ -
986 (void)deviceContext; // unused
│ │ │ │ -
987
│ │ │ │ -
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
995 numPatchCoords,
│ │ │ │ -
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
999 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1000 }
│ │ │ │ -
1001
│ │ │ │ -
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1037 int numPatchCoords,
│ │ │ │ -
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1039 PATCH_TABLE *patchTable,
│ │ │ │ -
1040 int fvarChannel,
│ │ │ │ -
1041 OmpEvaluator const *instance = NULL,
│ │ │ │ -
1042 void * deviceContext = NULL) {
│ │ │ │ -
1043
│ │ │ │ -
1044 (void)instance; // unused
│ │ │ │ -
1045 (void)deviceContext; // unused
│ │ │ │ -
1046
│ │ │ │ -
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1049 numPatchCoords,
│ │ │ │ -
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1054 }
│ │ │ │ -
1055
│ │ │ │ -
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1105 int numPatchCoords,
│ │ │ │ -
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1107 PATCH_TABLE *patchTable,
│ │ │ │ -
1108 int fvarChannel,
│ │ │ │ -
1109 OmpEvaluator const *instance = NULL,
│ │ │ │ -
1110 void * deviceContext = NULL) {
│ │ │ │ -
1111
│ │ │ │ -
1112 (void)instance; // unused
│ │ │ │ -
1113 (void)deviceContext; // unused
│ │ │ │ -
1114
│ │ │ │ -
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1119 numPatchCoords,
│ │ │ │ -
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1124 }
│ │ │ │ -
1125
│ │ │ │ -
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1196 int numPatchCoords,
│ │ │ │ -
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1198 PATCH_TABLE *patchTable,
│ │ │ │ -
1199 int fvarChannel,
│ │ │ │ -
1200 OmpEvaluator const *instance = NULL,
│ │ │ │ -
1201 void * deviceContext = NULL) {
│ │ │ │ -
1202
│ │ │ │ -
1203 (void)instance; // unused
│ │ │ │ -
1204 (void)deviceContext; // unused
│ │ │ │ -
1205
│ │ │ │ -
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
1213 numPatchCoords,
│ │ │ │ -
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1218 }
│ │ │ │ -
1219
│ │ │ │ -
1225
│ │ │ │ -
1226 static void Synchronize(void *deviceContext = NULL);
│ │ │ │ -
1227
│ │ │ │ -
1228 static void SetNumThreads(int numThreads);
│ │ │ │ -
1229};
│ │ │ │ -
1230
│ │ │ │ -
1231
│ │ │ │ -
1232} // end namespace Osd
│ │ │ │ -
1233
│ │ │ │ -
1234} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
1235using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
1236
│ │ │ │ -
1237} // end namespace OpenSubdiv
│ │ │ │ -
1238
│ │ │ │ -
1239
│ │ │ │ -
1240#endif // OPENSUBDIV3_OSD_OMP_EVALUATOR_H
│ │ │ │ +
86 bool operator == (BufferDescriptor const &other) const {
│ │ │ │ +
87 return (offset == other.offset &&
│ │ │ │ +
88 length == other.length &&
│ │ │ │ +
89 stride == other.stride);
│ │ │ │ +
90 }
│ │ │ │ +
91
│ │ │ │ +
93 bool operator != (BufferDescriptor const &other) const {
│ │ │ │ +
94 return !(this->operator==(other));
│ │ │ │ +
95 }
│ │ │ │ +
96
│ │ │ │ +
98 int offset;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
103};
│ │ │ │ +
104
│ │ │ │ +
105} // end namespace Osd
│ │ │ │ +
106
│ │ │ │ +
107} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
108using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
109
│ │ │ │ +
110} // end namespace OpenSubdiv
│ │ │ │ +
111
│ │ │ │ +
112#endif // OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │ │ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:971
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: ompEvaluator.h:168
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:823
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: ompEvaluator.h:72
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: ompEvaluator.h:517
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:886
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: ompEvaluator.h:607
│ │ │ │ -
static void Synchronize(void *deviceContext=NULL)
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: ompEvaluator.h:303
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: ompEvaluator.h:454
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ - │ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ - │ │ │ │ - │ │ │ │ +
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ + │ │ │ │ +
void Reset()
Resets the descriptor to default.
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
bool operator!=(BufferDescriptor const &other) const
True if the descriptors are not identical.
│ │ │ │ +
bool operator==(BufferDescriptor const &other) const
True if the descriptors are identical.
│ │ │ │ +
bool IsValid() const
True if the descriptor values are internally consistent.
│ │ │ │ +
int GetLocalOffset() const
Returns the relative offset within a stride.
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -ompEvaluator.h │ │ │ │ │ +bufferDescriptor.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2015 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,657 +30,125 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ 27 │ │ │ │ │ 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 30#include "../osd/types.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32#include │ │ │ │ │ + 29#include │ │ │ │ │ + 30 │ │ │ │ │ + 31namespace OpenSubdiv { │ │ │ │ │ + 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Osd { │ │ │ │ │ - 38 │ │ │ │ │ -39class OmpEvaluator { │ │ │ │ │ - 40public: │ │ │ │ │ +34namespace Osd { │ │ │ │ │ + 35 │ │ │ │ │ 46 │ │ │ │ │ - 71 template │ │ │ │ │ -72 static bool EvalStencils( │ │ │ │ │ - 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 76 const OmpEvaluator *instance = NULL, │ │ │ │ │ - 77 void * deviceContext = NULL) { │ │ │ │ │ - 78 │ │ │ │ │ - 79 (void)instance; // unused │ │ │ │ │ - 80 (void)deviceContext; // unused │ │ │ │ │ - 81 │ │ │ │ │ - 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ - 83 return false; │ │ │ │ │ + 47// example: │ │ │ │ │ + 48// n │ │ │ │ │ + 49// -----+----------------------------------------+------------------------- │ │ │ │ │ + 50// | vertex 0 | │ │ │ │ │ + 51// -----+----------------------------------------+------------------------- │ │ │ │ │ + 52// | X Y Z R G B A Xu Yu Zu Xv Yv Zv | │ │ │ │ │ + 53// -----+----------------------------------------+------------------------- │ │ │ │ │ + 54// <------------- stride = 13 --------------> │ │ │ │ │ + 55// │ │ │ │ │ + 56// - XYZ (offset = n+0, length = 3, stride = 13) │ │ │ │ │ + 57// - RGBA (offset = n+3, length = 4, stride = 13) │ │ │ │ │ + 58// - uTangent (offset = n+7, length = 3, stride = 13) │ │ │ │ │ + 59// - vTangent (offset = n+10, length = 3, stride = 13) │ │ │ │ │ + 60// │ │ │ │ │ +61struct BufferDescriptor { │ │ │ │ │ + 62 │ │ │ │ │ +64 BufferDescriptor() : offset(0), length(0), stride(0) { } │ │ │ │ │ + 65 │ │ │ │ │ +67 BufferDescriptor(int o, int l, int s) : offset(o), length(l), stride(s) { } │ │ │ │ │ + 68 │ │ │ │ │ +70 int GetLocalOffset() const { │ │ │ │ │ + 71 return stride > 0 ? offset % stride : 0; │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ +75 bool IsValid() const { │ │ │ │ │ + 76 return ((length > 0) && │ │ │ │ │ + 77 (length <= stride - GetLocalOffset())); │ │ │ │ │ + 78 } │ │ │ │ │ + 79 │ │ │ │ │ +81 void Reset() { │ │ │ │ │ + 82 offset = length = stride = 0; │ │ │ │ │ + 83 } │ │ │ │ │ 84 │ │ │ │ │ - 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 87 &stencilTable->GetSizes()[0], │ │ │ │ │ - 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 90 &stencilTable->GetWeights()[0], │ │ │ │ │ - 91 /*start = */ 0, │ │ │ │ │ - 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 93 } │ │ │ │ │ - 94 │ │ │ │ │ -121 static bool EvalStencils( │ │ │ │ │ - 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 124 const int * sizes, │ │ │ │ │ - 125 const int * offsets, │ │ │ │ │ - 126 const int * indices, │ │ │ │ │ - 127 const float * weights, │ │ │ │ │ - 128 int start, int end); │ │ │ │ │ - 129 │ │ │ │ │ - 167 template │ │ │ │ │ -168 static bool EvalStencils( │ │ │ │ │ - 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 174 const OmpEvaluator *instance = NULL, │ │ │ │ │ - 175 void * deviceContext = NULL) { │ │ │ │ │ - 176 │ │ │ │ │ - 177 (void)instance; // unused │ │ │ │ │ - 178 (void)deviceContext; // unused │ │ │ │ │ - 179 │ │ │ │ │ - 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 184 &stencilTable->GetSizes()[0], │ │ │ │ │ - 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 187 &stencilTable->GetWeights()[0], │ │ │ │ │ - 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 190 /*start = */ 0, │ │ │ │ │ - 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 │ │ │ │ │ -234 static bool EvalStencils( │ │ │ │ │ - 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 239 const int * sizes, │ │ │ │ │ - 240 const int * offsets, │ │ │ │ │ - 241 const int * indices, │ │ │ │ │ - 242 const float * weights, │ │ │ │ │ - 243 const float * duWeights, │ │ │ │ │ - 244 const float * dvWeights, │ │ │ │ │ - 245 int start, int end); │ │ │ │ │ - 246 │ │ │ │ │ - 302 template │ │ │ │ │ -303 static bool EvalStencils( │ │ │ │ │ - 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 312 const OmpEvaluator *instance = NULL, │ │ │ │ │ - 313 void * deviceContext = NULL) { │ │ │ │ │ - 314 │ │ │ │ │ - 315 (void)instance; // unused │ │ │ │ │ - 316 (void)deviceContext; // unused │ │ │ │ │ - 317 │ │ │ │ │ - 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 325 &stencilTable->GetSizes()[0], │ │ │ │ │ - 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 328 &stencilTable->GetWeights()[0], │ │ │ │ │ - 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ - 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ - 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ - 334 /*start = */ 0, │ │ │ │ │ - 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ -399 static bool EvalStencils( │ │ │ │ │ - 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 407 const int * sizes, │ │ │ │ │ - 408 const int * offsets, │ │ │ │ │ - 409 const int * indices, │ │ │ │ │ - 410 const float * weights, │ │ │ │ │ - 411 const float * duWeights, │ │ │ │ │ - 412 const float * dvWeights, │ │ │ │ │ - 413 const float * duuWeights, │ │ │ │ │ - 414 const float * duvWeights, │ │ │ │ │ - 415 const float * dvvWeights, │ │ │ │ │ - 416 int start, int end); │ │ │ │ │ - 417 │ │ │ │ │ - 423 │ │ │ │ │ - 452 template │ │ │ │ │ -454 static bool EvalPatches( │ │ │ │ │ - 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 457 int numPatchCoords, │ │ │ │ │ - 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 459 PATCH_TABLE *patchTable, │ │ │ │ │ - 460 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 461 void * deviceContext = NULL) { │ │ │ │ │ - 462 │ │ │ │ │ - 463 (void)instance; // unused │ │ │ │ │ - 464 (void)deviceContext; // unused │ │ │ │ │ - 465 │ │ │ │ │ - 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 468 numPatchCoords, │ │ │ │ │ - 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 473 } │ │ │ │ │ - 474 │ │ │ │ │ - 515 template │ │ │ │ │ -517 static bool EvalPatches( │ │ │ │ │ - 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 522 int numPatchCoords, │ │ │ │ │ - 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 524 PATCH_TABLE *patchTable, │ │ │ │ │ - 525 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 526 void * deviceContext = NULL) { │ │ │ │ │ - 527 │ │ │ │ │ - 528 (void)instance; // unused │ │ │ │ │ - 529 (void)deviceContext; // unused │ │ │ │ │ - 530 │ │ │ │ │ - 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 533 // so that downcast isn't needed there. │ │ │ │ │ - 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 535 // │ │ │ │ │ - 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 540 numPatchCoords, │ │ │ │ │ - 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 545 } │ │ │ │ │ - 546 │ │ │ │ │ - 605 template │ │ │ │ │ -607 static bool EvalPatches( │ │ │ │ │ - 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 615 int numPatchCoords, │ │ │ │ │ - 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 617 PATCH_TABLE *patchTable, │ │ │ │ │ - 618 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 619 void * deviceContext = NULL) { │ │ │ │ │ - 620 │ │ │ │ │ - 621 (void)instance; // unused │ │ │ │ │ - 622 (void)deviceContext; // unused │ │ │ │ │ - 623 │ │ │ │ │ - 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 626 // so that downcast isn't needed there. │ │ │ │ │ - 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 628 // │ │ │ │ │ - 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 636 numPatchCoords, │ │ │ │ │ - 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 641 } │ │ │ │ │ - 642 │ │ │ │ │ -670 static bool EvalPatches( │ │ │ │ │ - 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 673 int numPatchCoords, │ │ │ │ │ - 674 const PatchCoord *patchCoords, │ │ │ │ │ - 675 const PatchArray *patchArrays, │ │ │ │ │ - 676 const int *patchIndexBuffer, │ │ │ │ │ - 677 const PatchParam *patchParamBuffer); │ │ │ │ │ - 678 │ │ │ │ │ -716 static bool EvalPatches( │ │ │ │ │ - 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 721 int numPatchCoords, │ │ │ │ │ - 722 PatchCoord const *patchCoords, │ │ │ │ │ - 723 PatchArray const *patchArrays, │ │ │ │ │ - 724 const int *patchIndexBuffer, │ │ │ │ │ - 725 PatchParam const *patchParamBuffer); │ │ │ │ │ - 726 │ │ │ │ │ -779 static bool EvalPatches( │ │ │ │ │ - 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 787 int numPatchCoords, │ │ │ │ │ - 788 PatchCoord const *patchCoords, │ │ │ │ │ - 789 PatchArray const *patchArrays, │ │ │ │ │ - 790 const int *patchIndexBuffer, │ │ │ │ │ - 791 PatchParam const *patchParamBuffer); │ │ │ │ │ - 792 │ │ │ │ │ - 821 template │ │ │ │ │ -823 static bool EvalPatchesVarying( │ │ │ │ │ - 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 826 int numPatchCoords, │ │ │ │ │ - 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 828 PATCH_TABLE *patchTable, │ │ │ │ │ - 829 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 830 void * deviceContext = NULL) { │ │ │ │ │ - 831 │ │ │ │ │ - 832 (void)instance; // unused │ │ │ │ │ - 833 (void)deviceContext; // unused │ │ │ │ │ - 834 │ │ │ │ │ - 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 837 numPatchCoords, │ │ │ │ │ - 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 842 } │ │ │ │ │ - 843 │ │ │ │ │ - 884 template │ │ │ │ │ -886 static bool EvalPatchesVarying( │ │ │ │ │ - 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 891 int numPatchCoords, │ │ │ │ │ - 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 893 PATCH_TABLE *patchTable, │ │ │ │ │ - 894 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 895 void * deviceContext = NULL) { │ │ │ │ │ - 896 │ │ │ │ │ - 897 (void)instance; // unused │ │ │ │ │ - 898 (void)deviceContext; // unused │ │ │ │ │ - 899 │ │ │ │ │ - 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 904 numPatchCoords, │ │ │ │ │ - 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 909 } │ │ │ │ │ - 910 │ │ │ │ │ - 969 template │ │ │ │ │ -971 static bool EvalPatchesVarying( │ │ │ │ │ - 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 979 int numPatchCoords, │ │ │ │ │ - 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 981 PATCH_TABLE *patchTable, │ │ │ │ │ - 982 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 983 void * deviceContext = NULL) { │ │ │ │ │ - 984 │ │ │ │ │ - 985 (void)instance; // unused │ │ │ │ │ - 986 (void)deviceContext; // unused │ │ │ │ │ - 987 │ │ │ │ │ - 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 995 numPatchCoords, │ │ │ │ │ - 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1000 } │ │ │ │ │ - 1001 │ │ │ │ │ - 1032 template │ │ │ │ │ -1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1037 int numPatchCoords, │ │ │ │ │ - 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1039 PATCH_TABLE *patchTable, │ │ │ │ │ - 1040 int fvarChannel, │ │ │ │ │ - 1041 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 1042 void * deviceContext = NULL) { │ │ │ │ │ - 1043 │ │ │ │ │ - 1044 (void)instance; // unused │ │ │ │ │ - 1045 (void)deviceContext; // unused │ │ │ │ │ - 1046 │ │ │ │ │ - 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1049 numPatchCoords, │ │ │ │ │ - 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1054 } │ │ │ │ │ - 1055 │ │ │ │ │ - 1098 template │ │ │ │ │ -1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1105 int numPatchCoords, │ │ │ │ │ - 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1107 PATCH_TABLE *patchTable, │ │ │ │ │ - 1108 int fvarChannel, │ │ │ │ │ - 1109 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 1110 void * deviceContext = NULL) { │ │ │ │ │ - 1111 │ │ │ │ │ - 1112 (void)instance; // unused │ │ │ │ │ - 1113 (void)deviceContext; // unused │ │ │ │ │ - 1114 │ │ │ │ │ - 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1119 numPatchCoords, │ │ │ │ │ - 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1124 } │ │ │ │ │ - 1125 │ │ │ │ │ - 1186 template │ │ │ │ │ -1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1196 int numPatchCoords, │ │ │ │ │ - 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1198 PATCH_TABLE *patchTable, │ │ │ │ │ - 1199 int fvarChannel, │ │ │ │ │ - 1200 OmpEvaluator const *instance = NULL, │ │ │ │ │ - 1201 void * deviceContext = NULL) { │ │ │ │ │ - 1202 │ │ │ │ │ - 1203 (void)instance; // unused │ │ │ │ │ - 1204 (void)deviceContext; // unused │ │ │ │ │ - 1205 │ │ │ │ │ - 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 1213 numPatchCoords, │ │ │ │ │ - 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1218 } │ │ │ │ │ - 1219 │ │ │ │ │ - 1225 │ │ │ │ │ -1226 static void Synchronize(void *deviceContext = NULL); │ │ │ │ │ - 1227 │ │ │ │ │ -1228 static void SetNumThreads(int numThreads); │ │ │ │ │ - 1229}; │ │ │ │ │ - 1230 │ │ │ │ │ - 1231 │ │ │ │ │ - 1232} // end namespace Osd │ │ │ │ │ - 1233 │ │ │ │ │ - 1234} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 1235using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 1236 │ │ │ │ │ - 1237} // end namespace OpenSubdiv │ │ │ │ │ - 1238 │ │ │ │ │ - 1239 │ │ │ │ │ - 1240#endif // OPENSUBDIV3_OSD_OMP_EVALUATOR_H │ │ │ │ │ +86 bool operator_==(BufferDescriptor const &other) const { │ │ │ │ │ + 87 return (offset == other.offset && │ │ │ │ │ + 88 length == other.length && │ │ │ │ │ + 89 stride == other.stride); │ │ │ │ │ + 90 } │ │ │ │ │ + 91 │ │ │ │ │ +93 bool operator_!=(BufferDescriptor const &other) const { │ │ │ │ │ + 94 return !(this->operator==(other)); │ │ │ │ │ + 95 } │ │ │ │ │ + 96 │ │ │ │ │ +98 int offset; │ │ │ │ │ +100 int length; │ │ │ │ │ +102 int stride; │ │ │ │ │ + 103}; │ │ │ │ │ + 104 │ │ │ │ │ + 105} // end namespace Osd │ │ │ │ │ + 106 │ │ │ │ │ + 107} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 108using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 109 │ │ │ │ │ + 110} // end namespace OpenSubdiv │ │ │ │ │ + 111 │ │ │ │ │ + 112#endif // OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ data buffers.... │ │ │ │ │ Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator │ │ │ │ │ -Definition: ompEvaluator.h:39 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:1034 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ -Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ -output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:971 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ -OmpEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: ompEvaluator.h:168 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:823 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, OmpEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:1100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ -float *dvvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, const OmpEvaluator *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function. This function has a same signature as │ │ │ │ │ -other device kernels hav... │ │ │ │ │ -Definition: ompEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ -const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ -PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: ompEvaluator.h:517 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:886 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: ompEvaluator.h:607 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -const OmpEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: ompEvaluator.h:303 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:454 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ -PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::SetNumThreads │ │ │ │ │ -static void SetNumThreads(int numThreads) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ -PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::OmpEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -OmpEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: ompEvaluator.h:1188 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ -Coordinates set on a patch table. │ │ │ │ │ -Definition: types.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ -Definition: types.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ -Definition: types.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::stride │ │ │ │ │ +int stride │ │ │ │ │ +stride to the next element │ │ │ │ │ +Definition: bufferDescriptor.h:102 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::Reset │ │ │ │ │ +void Reset() │ │ │ │ │ +Resets the descriptor to default. │ │ │ │ │ +Definition: bufferDescriptor.h:81 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::BufferDescriptor │ │ │ │ │ +BufferDescriptor() │ │ │ │ │ +Default Constructor. │ │ │ │ │ +Definition: bufferDescriptor.h:64 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::BufferDescriptor │ │ │ │ │ +BufferDescriptor(int o, int l, int s) │ │ │ │ │ +Constructor. │ │ │ │ │ +Definition: bufferDescriptor.h:67 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::length │ │ │ │ │ +int length │ │ │ │ │ +number or length of the data │ │ │ │ │ +Definition: bufferDescriptor.h:100 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::operator!= │ │ │ │ │ +bool operator!=(BufferDescriptor const &other) const │ │ │ │ │ +True if the descriptors are not identical. │ │ │ │ │ +Definition: bufferDescriptor.h:93 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::operator== │ │ │ │ │ +bool operator==(BufferDescriptor const &other) const │ │ │ │ │ +True if the descriptors are identical. │ │ │ │ │ +Definition: bufferDescriptor.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::IsValid │ │ │ │ │ +bool IsValid() const │ │ │ │ │ +True if the descriptor values are internally consistent. │ │ │ │ │ +Definition: bufferDescriptor.h:75 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::GetLocalOffset │ │ │ │ │ +int GetLocalOffset() const │ │ │ │ │ +Returns the relative offset within a stride. │ │ │ │ │ +Definition: bufferDescriptor.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::offset │ │ │ │ │ +int offset │ │ │ │ │ +offset to desired element data │ │ │ │ │ +Definition: bufferDescriptor.h:98 │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * ompEvaluator.h │ │ │ │ │ + * bufferDescriptor.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00884.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/opengl.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/osd/cudaVertexBuffer.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,24 +80,44 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
opengl.h File Reference
│ │ │ │ +
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
cudaVertexBuffer.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <GL/gl.h>
│ │ │ │ +
#include "../version.h"
│ │ │ │ +#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  CudaVertexBuffer
 Concrete vertex buffer class for Cuda subdivision. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,14 +4,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -opengl.h File Reference │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +cudaVertexBuffer.h File Reference │ │ │ │ │ +#include "../version.h" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  CudaVertexBuffer │ │ │ │ │ +  Concrete vertex buffer class for Cuda subdivision. More... │ │ │ │ │ +  │ │ │ │ │ + Namespaces │ │ │ │ │ +namespace  OpenSubdiv │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │ +  │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +  │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * opengl.h │ │ │ │ │ + * cudaVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00884_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/opengl.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/osd/cudaVertexBuffer.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
opengl.h
│ │ │ │ +
cudaVertexBuffer.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │
2// Copyright 2013 Pixar
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │ @@ -107,47 +107,77 @@ │ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │ +
25#ifndef OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │ +
26#define OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │
27
│ │ │ │ -
28#if defined(__APPLE__)
│ │ │ │ -
29 #include "TargetConditionals.h"
│ │ │ │ -
30 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
│ │ │ │ -
31 #include <OpenGLES/ES2/gl.h>
│ │ │ │ -
32 #else
│ │ │ │ -
33 #if defined(OSD_USES_GLEW)
│ │ │ │ -
34 #include <GL/glew.h>
│ │ │ │ -
35 #else
│ │ │ │ -
36 #include <OpenGL/gl3.h>
│ │ │ │ -
37 #endif
│ │ │ │ -
38 #endif
│ │ │ │ -
39#elif defined(ANDROID)
│ │ │ │ -
40 #include <GLES2/gl2.h>
│ │ │ │ -
41#else
│ │ │ │ -
42 #if defined(_WIN32)
│ │ │ │ -
43 #define WIN32_LEAN_AND_MEAN
│ │ │ │ -
44 #include <windows.h>
│ │ │ │ -
45 #endif
│ │ │ │ -
46 #if defined(OSD_USES_GLEW)
│ │ │ │ -
47 #include <GL/glew.h>
│ │ │ │ -
48 #else
│ │ │ │ -
49 #include <GL/gl.h>
│ │ │ │ -
50 #endif
│ │ │ │ -
51#endif
│ │ │ │ -
52
│ │ │ │ -
53#endif // OPENSUBDIV3_OSD_OPENGL_H
│ │ │ │ +
28#include "../version.h"
│ │ │ │ +
29
│ │ │ │ +
30#include <cstddef>
│ │ │ │ +
31
│ │ │ │ +
32namespace OpenSubdiv {
│ │ │ │ +
33namespace OPENSUBDIV_VERSION {
│ │ │ │ +
34
│ │ │ │ +
35namespace Osd {
│ │ │ │ +
36
│ │ │ │ + │ │ │ │ +
43
│ │ │ │ +
44public:
│ │ │ │ +
46 static CudaVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ +
47 void *deviceContext = NULL);
│ │ │ │ +
48
│ │ │ │ + │ │ │ │ +
51
│ │ │ │ +
54 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ +
55 void *deviceContext=NULL);
│ │ │ │ +
56
│ │ │ │ +
58 int GetNumElements() const;
│ │ │ │ +
59
│ │ │ │ +
61 int GetNumVertices() const;
│ │ │ │ +
62
│ │ │ │ +
64 float * BindCudaBuffer();
│ │ │ │ +
65
│ │ │ │ +
66protected:
│ │ │ │ +
68 CudaVertexBuffer(int numElements, int numVertices);
│ │ │ │ +
69
│ │ │ │ +
72 bool allocate();
│ │ │ │ +
73
│ │ │ │ +
74private:
│ │ │ │ +
75 int _numElements;
│ │ │ │ +
76 int _numVertices;
│ │ │ │ +
77 void *_cudaMem;
│ │ │ │ +
78
│ │ │ │ +
79};
│ │ │ │ +
80
│ │ │ │ +
81} // end namespace Osd
│ │ │ │ +
82
│ │ │ │ +
83} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
84using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
85
│ │ │ │ +
86} // end namespace OpenSubdiv
│ │ │ │ +
87
│ │ │ │ +
88#endif // OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │ + │ │ │ │ +
Concrete vertex buffer class for Cuda subdivision.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ +
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ +
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ +
static CudaVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ + │ │ │ │ +
CudaVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,15 +4,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -opengl.h │ │ │ │ │ +cudaVertexBuffer.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ 2// Copyright 2013 Pixar │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ @@ -30,40 +30,89 @@ │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ + 25#ifndef OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ + 26#define OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ 27 │ │ │ │ │ - 28#if defined(__APPLE__) │ │ │ │ │ - 29 #include "TargetConditionals.h" │ │ │ │ │ - 30 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR │ │ │ │ │ - 31 #include │ │ │ │ │ - 32 #else │ │ │ │ │ - 33 #if defined(OSD_USES_GLEW) │ │ │ │ │ - 34 #include │ │ │ │ │ - 35 #else │ │ │ │ │ - 36 #include │ │ │ │ │ - 37 #endif │ │ │ │ │ - 38 #endif │ │ │ │ │ - 39#elif defined(ANDROID) │ │ │ │ │ - 40 #include │ │ │ │ │ - 41#else │ │ │ │ │ - 42 #if defined(_WIN32) │ │ │ │ │ - 43 #define WIN32_LEAN_AND_MEAN │ │ │ │ │ - 44 #include │ │ │ │ │ - 45 #endif │ │ │ │ │ - 46 #if defined(OSD_USES_GLEW) │ │ │ │ │ - 47 #include │ │ │ │ │ - 48 #else │ │ │ │ │ - 49 #include │ │ │ │ │ - 50 #endif │ │ │ │ │ - 51#endif │ │ │ │ │ - 52 │ │ │ │ │ - 53#endif // OPENSUBDIV3_OSD_OPENGL_H │ │ │ │ │ + 28#include "../version.h" │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ + 31 │ │ │ │ │ + 32namespace OpenSubdiv { │ │ │ │ │ + 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Osd { │ │ │ │ │ + 36 │ │ │ │ │ +42class CudaVertexBuffer { │ │ │ │ │ + 43 │ │ │ │ │ + 44public: │ │ │ │ │ +46 static CudaVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ + 47 void *deviceContext = NULL); │ │ │ │ │ + 48 │ │ │ │ │ +50 ~CudaVertexBuffer(); │ │ │ │ │ + 51 │ │ │ │ │ +54 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ + 55 void *deviceContext=NULL); │ │ │ │ │ + 56 │ │ │ │ │ +58 int GetNumElements() const; │ │ │ │ │ + 59 │ │ │ │ │ +61 int GetNumVertices() const; │ │ │ │ │ + 62 │ │ │ │ │ +64 float * BindCudaBuffer(); │ │ │ │ │ + 65 │ │ │ │ │ + 66protected: │ │ │ │ │ +68 CudaVertexBuffer(int numElements, int numVertices); │ │ │ │ │ + 69 │ │ │ │ │ +72 bool allocate(); │ │ │ │ │ + 73 │ │ │ │ │ + 74private: │ │ │ │ │ + 75 int _numElements; │ │ │ │ │ + 76 int _numVertices; │ │ │ │ │ + 77 void *_cudaMem; │ │ │ │ │ + 78 │ │ │ │ │ + 79}; │ │ │ │ │ + 80 │ │ │ │ │ + 81} // end namespace Osd │ │ │ │ │ + 82 │ │ │ │ │ + 83} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 84using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 85 │ │ │ │ │ + 86} // end namespace OpenSubdiv │ │ │ │ │ + 87 │ │ │ │ │ + 88#endif // OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ +OpenSubdiv │ │ │ │ │ +Definition: limits.h:32 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer │ │ │ │ │ +Concrete vertex buffer class for Cuda subdivision. │ │ │ │ │ +Definition: cudaVertexBuffer.h:42 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::BindCudaBuffer │ │ │ │ │ +float * BindCudaBuffer() │ │ │ │ │ +Returns cuda memory. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::~CudaVertexBuffer │ │ │ │ │ +~CudaVertexBuffer() │ │ │ │ │ +Destructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::GetNumElements │ │ │ │ │ +int GetNumElements() const │ │ │ │ │ +Returns how many elements defined in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::UpdateData │ │ │ │ │ +void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::GetNumVertices │ │ │ │ │ +int GetNumVertices() const │ │ │ │ │ +Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::Create │ │ │ │ │ +static CudaVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ +*deviceContext=NULL) │ │ │ │ │ +Creator. Returns NULL if error. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::allocate │ │ │ │ │ +bool allocate() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::CudaVertexBuffer │ │ │ │ │ +CudaVertexBuffer(int numElements, int numVertices) │ │ │ │ │ +Constructor. │ │ │ │ │ * opensubdiv │ │ │ │ │ * osd │ │ │ │ │ - * opengl.h │ │ │ │ │ + * cudaVertexBuffer.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00887.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/mesh.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/sdc/scheme.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -82,108 +82,50 @@ │ │ │ │ name="MSearchResults" id="MSearchResults"> │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Enumerations | │ │ │ │ -Functions
│ │ │ │ -
mesh.h File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
scheme.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <bitset>
│ │ │ │ +#include "../sdc/types.h"
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │ +#include "../sdc/crease.h"
│ │ │ │ #include <cassert>
│ │ │ │ -#include <cstring>
│ │ │ │ +#include <cstdlib>
│ │ │ │ #include <vector>
│ │ │ │ -#include "../far/topologyRefiner.h"
│ │ │ │ -#include "../far/patchTableFactory.h"
│ │ │ │ -#include "../far/stencilTable.h"
│ │ │ │ -#include "../far/stencilTableFactory.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  MeshInterface< PATCH_TABLE >
class  Scheme< SCHEME_TYPE >
 Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
│ │ │ │ + More...
 
class  EvaluatorCacheT< EVALUATOR >
 
struct  EvaluatorCacheT< EVALUATOR >::Entry
 
class  Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >
class  Scheme< SCHEME_TYPE >::LocalMask< WEIGHT >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

typedef std::bitset< NUM_MESH_BITS > MeshBitset
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Enumerations

enum  MeshBits {
│ │ │ │ -  MeshAdaptive = 0 │ │ │ │ -,
│ │ │ │ -  MeshInterleaveVarying = 1 │ │ │ │ -,
│ │ │ │ -  MeshFVarData = 2 │ │ │ │ -,
│ │ │ │ -  MeshFVarAdaptive = 3 │ │ │ │ -,
│ │ │ │ -  MeshUseSmoothCornerPatch = 4 │ │ │ │ -,
│ │ │ │ -  MeshUseSingleCreasePatch = 5 │ │ │ │ -,
│ │ │ │ -  MeshUseInfSharpPatch = 6 │ │ │ │ -,
│ │ │ │ -  MeshEndCapBilinearBasis = 7 │ │ │ │ -,
│ │ │ │ -  MeshEndCapBSplineBasis = 8 │ │ │ │ -,
│ │ │ │ -  MeshEndCapGregoryBasis = 9 │ │ │ │ -,
│ │ │ │ -  MeshEndCapLegacyGregory = 10 │ │ │ │ -,
│ │ │ │ -  NUM_MESH_BITS = 11 │ │ │ │ -
│ │ │ │ - }
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<typename STENCIL_TABLE , typename SRC_STENCIL_TABLE , typename DEVICE_CONTEXT >
STENCIL_TABLE const * convertToCompatibleStencilTable (SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT *context)
 
template<>
Far::StencilTable const * convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, void > (Far::StencilTable const *table, void *)
 
template<>
Far::LimitStencilTable const * convertToCompatibleStencilTable< Far::LimitStencilTable, Far::LimitStencilTable, void > (Far::LimitStencilTable const *table, void *)
 
template<>
Far::StencilTable const * convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, ID3D11DeviceContext > (Far::StencilTable const *table, ID3D11DeviceContext *)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,83 +4,38 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces | Typedefs | Enumerations | Functions │ │ │ │ │ -mesh.h File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +scheme.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../sdc/types.h" │ │ │ │ │ +#include "../sdc/options.h" │ │ │ │ │ +#include "../sdc/crease.h" │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include "../far/topologyRefiner.h" │ │ │ │ │ -#include "../far/patchTableFactory.h" │ │ │ │ │ -#include "../far/stencilTable.h" │ │ │ │ │ -#include "../far/stencilTableFactory.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  MeshInterface<_PATCH_TABLE_> │ │ │ │ │ +class  Scheme<_SCHEME_TYPE_> │ │ │ │ │ + Scheme is a class template which provides all implementation for the │ │ │ │ │ + subdivision schemes supported by OpenSubdiv through specializations of │ │ │ │ │ +  the methods of each. An instance of Scheme includes a set │ │ │ │ │ + of Options that will dictate the variable aspects of its behavior. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ - class  EvaluatorCacheT<_EVALUATOR_> │ │ │ │ │ -  │ │ │ │ │ -struct  EvaluatorCacheT<_EVALUATOR_>::Entry │ │ │ │ │ -  │ │ │ │ │ - class  Mesh<_VERTEX_BUFFER,_STENCIL_TABLE,_EVALUATOR,_PATCH_TABLE, │ │ │ │ │ - DEVICE_CONTEXT_> │ │ │ │ │ +class  Scheme<_SCHEME_TYPE_>::LocalMask<_WEIGHT_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ -  │ │ │ │ │ - Typedefs │ │ │ │ │ -typedef std::bitset< NUM_MESH_BITS > MeshBitset │ │ │ │ │ -  │ │ │ │ │ - Enumerations │ │ │ │ │ -enum  MeshBits { │ │ │ │ │ -   MeshAdaptive = 0 , │ │ │ │ │ -   MeshInterleaveVarying = 1 , │ │ │ │ │ -   MeshFVarData = 2 , │ │ │ │ │ -   MeshFVarAdaptive = 3 , │ │ │ │ │ -   MeshUseSmoothCornerPatch = 4 , │ │ │ │ │ -   MeshUseSingleCreasePatch = 5 , │ │ │ │ │ -   MeshUseInfSharpPatch = 6 , │ │ │ │ │ -   MeshEndCapBilinearBasis = 7 , │ │ │ │ │ -   MeshEndCapBSplineBasis = 8 , │ │ │ │ │ -   MeshEndCapGregoryBasis = 9 , │ │ │ │ │ -   MeshEndCapLegacyGregory = 10 , │ │ │ │ │ -   NUM_MESH_BITS = 11 │ │ │ │ │ - } │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ - STENCIL_TABLE const * convertToCompatibleStencilTable │ │ │ │ │ - (SRC_STENCIL_TABLE const *table, DEVICE_CONTEXT │ │ │ │ │ - *context) │ │ │ │ │ -  │ │ │ │ │ - template<> │ │ │ │ │ - Far::StencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ - StencilTable,_Far::StencilTable,_void_> (Far:: │ │ │ │ │ - StencilTable const *table, void *) │ │ │ │ │ -  │ │ │ │ │ - template<> │ │ │ │ │ -Far::LimitStencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ - LimitStencilTable,_Far::LimitStencilTable,_void │ │ │ │ │ - > (Far::LimitStencilTable const *table, void *) │ │ │ │ │ -  │ │ │ │ │ - template<> │ │ │ │ │ - Far::StencilTable const * convertToCompatibleStencilTable<_Far:: │ │ │ │ │ - StencilTable,_Far::StencilTable, │ │ │ │ │ - ID3D11DeviceContext_> (Far::StencilTable const │ │ │ │ │ - *table, ID3D11DeviceContext *) │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * mesh.h │ │ │ │ │ + * sdc │ │ │ │ │ + * scheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00887.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,25 +1,4 @@ │ │ │ │ │ var a00887 = [ │ │ │ │ │ - ["MeshInterface< PATCH_TABLE >", "a01261.html", "a01261"], │ │ │ │ │ - ["EvaluatorCacheT< EVALUATOR >", "a01265.html", "a01265"], │ │ │ │ │ - ["EvaluatorCacheT< EVALUATOR >::Entry", "a01269.html", "a01269"], │ │ │ │ │ - ["Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >", "a01273.html", "a01273"], │ │ │ │ │ - ["MeshBitset", "a00887.html#a85ba9df501aea9af1ec9da1558c255bc", null], │ │ │ │ │ - ["MeshBits", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492", [ │ │ │ │ │ - ["MeshAdaptive", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492adef344bcbdd50a1a93136eb53183c718", null], │ │ │ │ │ - ["MeshInterleaveVarying", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9313c644b9b2a998bcb55cfcc4582b1a", null], │ │ │ │ │ - ["MeshFVarData", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492ac10e41fef659f3b3a1b730319bdedb45", null], │ │ │ │ │ - ["MeshFVarAdaptive", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9b8a23ab039e120012bc7c622308d603", null], │ │ │ │ │ - ["MeshUseSmoothCornerPatch", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492ab32b8ef595539e14041e2fb0e619e3f9", null], │ │ │ │ │ - ["MeshUseSingleCreasePatch", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a9058d69e1089fc77f1974a76c34e2071", null], │ │ │ │ │ - ["MeshUseInfSharpPatch", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a8fab1b3018f94b5b2432c7435e795925", null], │ │ │ │ │ - ["MeshEndCapBilinearBasis", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a4124233e4f787f999c7975afceab34f3", null], │ │ │ │ │ - ["MeshEndCapBSplineBasis", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aa2f41b6ba0393698bb3af283283737f7", null], │ │ │ │ │ - ["MeshEndCapGregoryBasis", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aa2878e1a215530f5f6fb89f1e06f91ee", null], │ │ │ │ │ - ["MeshEndCapLegacyGregory", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492aad7b3fb2be609abdbfafaf5b1c834158", null], │ │ │ │ │ - ["NUM_MESH_BITS", "a00887.html#a1af6b50e9f8ae13d3d2f9d5b03b35492a5676712c77d29cfdd330e2802db1c464", null] │ │ │ │ │ - ]], │ │ │ │ │ - ["convertToCompatibleStencilTable", "a00887.html#a06ceddf21c024b341a5b946049cd701a", null], │ │ │ │ │ - ["convertToCompatibleStencilTable< Far::LimitStencilTable, Far::LimitStencilTable, void >", "a00887.html#a4c2520cc1a8a5a03e3f53584629d7318", null], │ │ │ │ │ - ["convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, ID3D11DeviceContext >", "a00887.html#ab5753a2b0a0995c8e2259d2c4765f7df", null], │ │ │ │ │ - ["convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, void >", "a00887.html#a33f9830228f847fae1c30c9dffe02b5a", null] │ │ │ │ │ + ["Scheme< SCHEME_TYPE >", "a01333.html", "a01333"], │ │ │ │ │ + ["Scheme< SCHEME_TYPE >::LocalMask< WEIGHT >", "a01337.html", "a01337"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00887_source.html │ │ │ │ @@ -21,11096 +21,8403 @@ │ │ │ │ 00000140: 6f6e 7465 6e74 3d22 446f 7879 6765 6e20 ontent="Doxygen │ │ │ │ 00000150: 312e 392e 3422 2f3e 0a3c 6d65 7461 206e 1.9.4"/>..< │ │ │ │ 000001a0: 7469 746c 653e 4f70 656e 5375 6264 6976 title>OpenSubdiv │ │ │ │ -000001b0: 3a20 6f70 656e 7375 6264 6976 2f6f 7364 : opensubdiv/osd │ │ │ │ -000001c0: 2f6d 6573 682e 6820 536f 7572 6365 2046 /mesh.h Source F │ │ │ │ -000001d0: 696c 653c 2f74 6974 6c65 3e0a 3c6c 696e ile..... │ │ │ │ -00000300: 0a3c 7363 7269 7074 2074 7970 653d 2274 ..< │ │ │ │ -00000340: 7363 7269 7074 2074 7970 653d 2274 6578 script type="tex │ │ │ │ -00000350: 742f 6a61 7661 7363 7269 7074 2220 7372 t/javascript" sr │ │ │ │ -00000360: 633d 226e 6176 7472 6565 2e6a 7322 3e3c c="navtree.js">< │ │ │ │ -00000370: 2f73 6372 6970 743e 0a3c 6c69 6e6b 2068 /script>...< │ │ │ │ -00000400: 7363 7269 7074 2074 7970 653d 2274 6578 script type="tex │ │ │ │ -00000410: 742f 6a61 7661 7363 7269 7074 2220 7372 t/javascript" sr │ │ │ │ -00000420: 633d 2273 6561 7263 682f 7365 6172 6368 c="search/search │ │ │ │ -00000430: 2e6a 7322 3e3c 2f73 6372 6970 743e 0a3c .js">.< │ │ │ │ -00000440: 6c69 6e6b 2068 7265 663d 2264 6f78 7967 link href="doxyg │ │ │ │ -00000450: 656e 2e63 7373 2220 7265 6c3d 2273 7479 en.css" rel="sty │ │ │ │ -00000460: 6c65 7368 6565 7422 2074 7970 653d 2274 lesheet" type="t │ │ │ │ -00000470: 6578 742f 6373 7322 202f 3e0a 3c6c 696e ext/css" />....
.
│ │ │ │ -00000520: 0a3c 7461 626c 6520 6365 6c6c 7370 6163 .. . . . . . .
< │ │ │ │ -00000580: 696d 6720 616c 743d 224c 6f67 6f22 2073 img alt="Logo" s │ │ │ │ -00000590: 7263 3d22 6f70 656e 7375 6264 6976 5f6c rc="opensubdiv_l │ │ │ │ -000005a0: 6f67 6f5f 6865 6164 6572 2e70 6e67 222f ogo_header.png"/ │ │ │ │ -000005b0: 3e3c 2f74 643e 0a20 203c 7464 2069 643d >. │ │ │ │ -000005d0: 2020 203c 6469 7620 6964 3d22 7072 6f6a
OpenSub │ │ │ │ -000005f0: 6469 760a 2020 203c 2f64 6976 3e0a 2020 div.
. │ │ │ │ -00000600: 3c2f 7464 3e0a 203c 2f74 723e 0a20 3c2f
. │ │ │ │ -00000620: 3c2f 6469 763e 0a3c 212d 2d20 656e 6420
.. │ │ │ │ -00000640: 3c21 2d2d 2047 656e 6572 6174 6564 2062 .../* @l │ │ │ │ -000007e0: 6963 656e 7365 206d 6167 6e65 743a 3f78 icense magnet:?x │ │ │ │ -000007f0: 743d 7572 6e3a 6274 6968 3a64 3364 3961 t=urn:btih:d3d9a │ │ │ │ -00000800: 3961 3635 3935 3532 3166 3936 3636 6135 9a6595521f9666a5 │ │ │ │ -00000810: 6539 3463 6338 3330 6461 6238 3362 3635 e94cc830dab83b65 │ │ │ │ -00000820: 3639 3926 616d 703b 646e 3d65 7870 6174 699&dn=expat │ │ │ │ -00000830: 2e74 7874 204d 4954 202a 2f0a 2428 6675 .txt MIT */.$(fu │ │ │ │ -00000840: 6e63 7469 6f6e 2829 207b 0a20 2069 6e69 nction() {. ini │ │ │ │ -00000850: 744d 656e 7528 2727 2c74 7275 652c 6661 tMenu('',true,fa │ │ │ │ -00000860: 6c73 652c 2773 6561 7263 682e 7068 7027 lse,'search.php' │ │ │ │ -00000870: 2c27 5365 6172 6368 2729 3b0a 2020 2428 ,'Search');. $( │ │ │ │ -00000880: 646f 6375 6d65 6e74 292e 7265 6164 7928 document).ready( │ │ │ │ -00000890: 6675 6e63 7469 6f6e 2829 207b 2069 6e69 function() { ini │ │ │ │ -000008a0: 745f 7365 6172 6368 2829 3b20 7d29 3b0a t_search(); });. │ │ │ │ -000008b0: 7d29 3b0a 2f2a 2040 6c69 6365 6e73 652d });./* @license- │ │ │ │ -000008c0: 656e 6420 2a2f 0a3c 2f73 6372 6970 743e end */. │ │ │ │ -000008d0: 0a3c 6469 7620 6964 3d22 6d61 696e 2d6e .
.
.. .
. .
../* @l │ │ │ │ -00000a40: 6963 656e 7365 206d 6167 6e65 743a 3f78 icense magnet:?x │ │ │ │ -00000a50: 743d 7572 6e3a 6274 6968 3a64 3364 3961 t=urn:btih:d3d9a │ │ │ │ -00000a60: 3961 3635 3935 3532 3166 3936 3636 6135 9a6595521f9666a5 │ │ │ │ -00000a70: 6539 3463 6338 3330 6461 6238 3362 3635 e94cc830dab83b65 │ │ │ │ -00000a80: 3639 3926 616d 703b 646e 3d65 7870 6174 699&dn=expat │ │ │ │ -00000a90: 2e74 7874 204d 4954 202a 2f0a 2428 646f .txt MIT */.$(do │ │ │ │ -00000aa0: 6375 6d65 6e74 292e 7265 6164 7928 6675 cument).ready(fu │ │ │ │ -00000ab0: 6e63 7469 6f6e 2829 7b69 6e69 744e 6176 nction(){initNav │ │ │ │ -00000ac0: 5472 6565 2827 6130 3038 3837 5f73 6f75 Tree('a00887_sou │ │ │ │ -00000ad0: 7263 652e 6874 6d6c 272c 2727 293b 2069 rce.html',''); i │ │ │ │ -00000ae0: 6e69 7452 6573 697a 6162 6c65 2829 3b20 nitResizable(); │ │ │ │ -00000af0: 7d29 3b0a 2f2a 2040 6c69 6365 6e73 652d });./* @license- │ │ │ │ -00000b00: 656e 6420 2a2f 0a3c 2f73 6372 6970 743e end */. │ │ │ │ -00000b10: 0a3c 6469 7620 6964 3d22 646f 632d 636f .
..
. │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
cpuVertexBuffer.h File Reference
│ │ │ │ +
options.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <cstddef>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CpuVertexBuffer
 Concrete vertex buffer class for CPU subdivision. More...
class  Options
 All supported options applying to subdivision scheme. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,26 +5,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -cpuVertexBuffer.h File Reference │ │ │ │ │ +options.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CpuVertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for CPU subdivision. More... │ │ │ │ │ +class  Options │ │ │ │ │ +  All supported options applying to subdivision scheme. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuVertexBuffer.h │ │ │ │ │ + * sdc │ │ │ │ │ + * options.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00890.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00890 = [ │ │ │ │ │ - ["CpuVertexBuffer", "a01169.html", "a01169"] │ │ │ │ │ + ["Options", "a01329.html", "a01329"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00890_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/sdc/options.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cpuVertexBuffer.h
│ │ │ │ +
options.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,74 +106,125 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │ -
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <cstddef>
│ │ │ │ +
24#ifndef OPENSUBDIV3_SDC_OPTIONS_H
│ │ │ │ +
25#define OPENSUBDIV3_SDC_OPTIONS_H
│ │ │ │ +
26
│ │ │ │ +
27#include "../version.h"
│ │ │ │ +
28
│ │ │ │ +
29namespace OpenSubdiv {
│ │ │ │ +
30namespace OPENSUBDIV_VERSION {
│ │ │ │
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ -
34
│ │ │ │ -
35namespace Osd {
│ │ │ │ -
36
│ │ │ │ - │ │ │ │ -
43public:
│ │ │ │ -
45 static CpuVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
46 void *deviceContext = NULL);
│ │ │ │ -
47
│ │ │ │ - │ │ │ │ +
32namespace Sdc {
│ │ │ │ +
33
│ │ │ │
50
│ │ │ │ -
53 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
54 void *deviceContext = NULL);
│ │ │ │ -
55
│ │ │ │ -
57 int GetNumElements() const;
│ │ │ │ -
58
│ │ │ │ -
60 int GetNumVertices() const;
│ │ │ │ -
61
│ │ │ │ -
63 float * BindCpuBuffer();
│ │ │ │ -
64
│ │ │ │ -
65protected:
│ │ │ │ -
67 CpuVertexBuffer(int numElements, int numVertices);
│ │ │ │ -
68
│ │ │ │ -
69private:
│ │ │ │ -
70 int _numElements;
│ │ │ │ -
71 int _numVertices;
│ │ │ │ -
72 float *_cpuBuffer;
│ │ │ │ -
73};
│ │ │ │ -
74
│ │ │ │ -
75
│ │ │ │ -
76} // end namespace Osd
│ │ │ │ -
77
│ │ │ │ -
78} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
79using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
80
│ │ │ │ -
81} // end namespace OpenSubdiv
│ │ │ │ -
82
│ │ │ │ -
83#endif // OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H
│ │ │ │ +
51class Options {
│ │ │ │ +
52public:
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
59 };
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
67 };
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
71 };
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
75 };
│ │ │ │ +
76
│ │ │ │ +
77public:
│ │ │ │ +
78
│ │ │ │ +
79 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
│ │ │ │ +
80 _fvarLinInterp(FVAR_LINEAR_ALL),
│ │ │ │ +
81 _creasingMethod(CREASE_UNIFORM),
│ │ │ │ +
82 _triangleSub(TRI_SUB_CATMARK) { }
│ │ │ │ +
83
│ │ │ │ +
84 //
│ │ │ │ +
85 // Trivial get/set methods:
│ │ │ │ +
86 //
│ │ │ │ +
87
│ │ │ │ + │ │ │ │ +
90
│ │ │ │ +
92 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = (EnumIntType) b; }
│ │ │ │ +
93
│ │ │ │ + │ │ │ │ +
96
│ │ │ │ +
98 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = (EnumIntType) b; }
│ │ │ │ +
99
│ │ │ │ +
101 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
│ │ │ │ +
102
│ │ │ │ +
104 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) c; }
│ │ │ │ +
105
│ │ │ │ + │ │ │ │ +
108
│ │ │ │ +
110 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = (EnumIntType) t; }
│ │ │ │ +
111
│ │ │ │ +
112private:
│ │ │ │ +
113 // Use a small integer type to pack these rather than bitfields:
│ │ │ │ +
114 typedef unsigned char EnumIntType;
│ │ │ │ +
115
│ │ │ │ +
116 EnumIntType _vtxBoundInterp;
│ │ │ │ +
117 EnumIntType _fvarLinInterp;
│ │ │ │ +
118 EnumIntType _creasingMethod;
│ │ │ │ +
119 EnumIntType _triangleSub;
│ │ │ │ +
120};
│ │ │ │ +
121
│ │ │ │ +
122} // end namespace sdc
│ │ │ │ +
123
│ │ │ │ +
124} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
125using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
126} // end namespace OpenSubdiv
│ │ │ │ +
127
│ │ │ │ +
128#endif /* OPENSUBDIV3_SDC_OPTIONS_H */
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for CPU subdivision.
│ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
static CpuVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ - │ │ │ │ -
float * BindCpuBuffer()
Returns the address of CPU buffer.
│ │ │ │ -
CpuVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ +
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ + │ │ │ │ +
@ TRI_SUB_CATMARK
Catmark weights (Catmark scheme only)
Definition: options.h:73
│ │ │ │ +
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:74
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:107
│ │ │ │ +
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:101
│ │ │ │ + │ │ │ │ +
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:98
│ │ │ │ +
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:110
│ │ │ │ +
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:89
│ │ │ │ + │ │ │ │ +
@ FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition: options.h:62
│ │ │ │ +
@ FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition: options.h:65
│ │ │ │ +
@ FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition: options.h:64
│ │ │ │ + │ │ │ │ +
@ FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition: options.h:66
│ │ │ │ +
@ FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition: options.h:61
│ │ │ │ +
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition: options.h:92
│ │ │ │ +
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:95
│ │ │ │ + │ │ │ │ + │ │ │ │ +
@ VTX_BOUNDARY_EDGE_ONLY
all boundary edges sharpened and interpolated
Definition: options.h:56
│ │ │ │ + │ │ │ │ +
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition: options.h:104
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cpuVertexBuffer.h │ │ │ │ │ +options.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,85 +29,200 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ + 24#ifndef OPENSUBDIV3_SDC_OPTIONS_H │ │ │ │ │ + 25#define OPENSUBDIV3_SDC_OPTIONS_H │ │ │ │ │ + 26 │ │ │ │ │ + 27#include "../version.h" │ │ │ │ │ + 28 │ │ │ │ │ + 29namespace OpenSubdiv { │ │ │ │ │ + 30namespace OPENSUBDIV_VERSION { │ │ │ │ │ 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace Osd { │ │ │ │ │ - 36 │ │ │ │ │ -42class CpuVertexBuffer { │ │ │ │ │ - 43public: │ │ │ │ │ -45 static CpuVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 46 void *deviceContext = NULL); │ │ │ │ │ - 47 │ │ │ │ │ -49 ~CpuVertexBuffer(); │ │ │ │ │ + 32namespace Sdc { │ │ │ │ │ + 33 │ │ │ │ │ 50 │ │ │ │ │ -53 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 54 void *deviceContext = NULL); │ │ │ │ │ - 55 │ │ │ │ │ -57 int GetNumElements() const; │ │ │ │ │ - 58 │ │ │ │ │ -60 int GetNumVertices() const; │ │ │ │ │ - 61 │ │ │ │ │ -63 float * BindCpuBuffer(); │ │ │ │ │ - 64 │ │ │ │ │ - 65protected: │ │ │ │ │ -67 CpuVertexBuffer(int numElements, int numVertices); │ │ │ │ │ - 68 │ │ │ │ │ - 69private: │ │ │ │ │ - 70 int _numElements; │ │ │ │ │ - 71 int _numVertices; │ │ │ │ │ - 72 float *_cpuBuffer; │ │ │ │ │ - 73}; │ │ │ │ │ - 74 │ │ │ │ │ - 75 │ │ │ │ │ - 76} // end namespace Osd │ │ │ │ │ - 77 │ │ │ │ │ - 78} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 79using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 80 │ │ │ │ │ - 81} // end namespace OpenSubdiv │ │ │ │ │ - 82 │ │ │ │ │ - 83#endif // OPENSUBDIV3_OSD_CPU_VERTEX_BUFFER_H │ │ │ │ │ +51class Options { │ │ │ │ │ + 52public: │ │ │ │ │ +53 enum VtxBoundaryInterpolation { │ │ │ │ │ + 54 VTX_BOUNDARY_NONE = 0, │ │ │ │ │ +56 VTX_BOUNDARY_EDGE_ONLY, │ │ │ │ │ + 57 VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ +59 }; │ │ │ │ │ +60 enum FVarLinearInterpolation { │ │ │ │ │ +61 FVAR_LINEAR_NONE = 0, │ │ │ │ │ +62 FVAR_LINEAR_CORNERS_ONLY, │ │ │ │ │ +63 FVAR_LINEAR_CORNERS_PLUS1, │ │ │ │ │ +64 FVAR_LINEAR_CORNERS_PLUS2, │ │ │ │ │ +65 FVAR_LINEAR_BOUNDARIES, │ │ │ │ │ + 66 FVAR_LINEAR_ALL │ │ │ │ │ +67 }; │ │ │ │ │ +68 enum CreasingMethod { │ │ │ │ │ +69 CREASE_UNIFORM = 0, │ │ │ │ │ + 70 CREASE_CHAIKIN │ │ │ │ │ +71 }; │ │ │ │ │ +72 enum TriangleSubdivision { │ │ │ │ │ +73 TRI_SUB_CATMARK = 0, │ │ │ │ │ + 74 TRI_SUB_SMOOTH │ │ │ │ │ +75 }; │ │ │ │ │ + 76 │ │ │ │ │ + 77public: │ │ │ │ │ + 78 │ │ │ │ │ +79 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE), │ │ │ │ │ + 80 _fvarLinInterp(FVAR_LINEAR_ALL), │ │ │ │ │ + 81 _creasingMethod(CREASE_UNIFORM), │ │ │ │ │ + 82 _triangleSub(TRI_SUB_CATMARK) { } │ │ │ │ │ + 83 │ │ │ │ │ + 84 // │ │ │ │ │ + 85 // Trivial get/set methods: │ │ │ │ │ + 86 // │ │ │ │ │ + 87 │ │ │ │ │ +89 VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const { return │ │ │ │ │ +(VtxBoundaryInterpolation) _vtxBoundInterp; } │ │ │ │ │ + 90 │ │ │ │ │ +92 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) │ │ │ │ │ +{ _vtxBoundInterp = (EnumIntType) b; } │ │ │ │ │ + 93 │ │ │ │ │ +95 FVarLinearInterpolation GetFVarLinearInterpolation() const { return │ │ │ │ │ +(FVarLinearInterpolation) _fvarLinInterp; } │ │ │ │ │ + 96 │ │ │ │ │ +98 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp │ │ │ │ │ += (EnumIntType) b; } │ │ │ │ │ + 99 │ │ │ │ │ +101 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) │ │ │ │ │ +_creasingMethod; } │ │ │ │ │ + 102 │ │ │ │ │ +104 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) │ │ │ │ │ +c; } │ │ │ │ │ + 105 │ │ │ │ │ +107 TriangleSubdivision GetTriangleSubdivision() const { return │ │ │ │ │ +(TriangleSubdivision) _triangleSub; } │ │ │ │ │ + 108 │ │ │ │ │ +110 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = │ │ │ │ │ +(EnumIntType) t; } │ │ │ │ │ + 111 │ │ │ │ │ + 112private: │ │ │ │ │ + 113 // Use a small integer type to pack these rather than bitfields: │ │ │ │ │ + 114 typedef unsigned char EnumIntType; │ │ │ │ │ + 115 │ │ │ │ │ + 116 EnumIntType _vtxBoundInterp; │ │ │ │ │ + 117 EnumIntType _fvarLinInterp; │ │ │ │ │ + 118 EnumIntType _creasingMethod; │ │ │ │ │ + 119 EnumIntType _triangleSub; │ │ │ │ │ + 120}; │ │ │ │ │ + 121 │ │ │ │ │ + 122} // end namespace sdc │ │ │ │ │ + 123 │ │ │ │ │ + 124} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 125using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 126} // end namespace OpenSubdiv │ │ │ │ │ + 127 │ │ │ │ │ + 128#endif /* OPENSUBDIV3_SDC_OPTIONS_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer │ │ │ │ │ -Concrete vertex buffer class for CPU subdivision. │ │ │ │ │ -Definition: cpuVertexBuffer.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::Create │ │ │ │ │ -static CpuVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::GetNumVertices │ │ │ │ │ -int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::~CpuVertexBuffer │ │ │ │ │ -~CpuVertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::BindCpuBuffer │ │ │ │ │ -float * BindCpuBuffer() │ │ │ │ │ -Returns the address of CPU buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuVertexBuffer::CpuVertexBuffer │ │ │ │ │ -CpuVertexBuffer(int numElements, int numVertices) │ │ │ │ │ -Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ +All supported options applying to subdivision scheme. │ │ │ │ │ +Definition: options.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TriangleSubdivision │ │ │ │ │ +TriangleSubdivision │ │ │ │ │ +Definition: options.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_CATMARK │ │ │ │ │ +@ TRI_SUB_CATMARK │ │ │ │ │ +Catmark weights (Catmark scheme only) │ │ │ │ │ +Definition: options.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH │ │ │ │ │ +@ TRI_SUB_SMOOTH │ │ │ │ │ +"smooth triangle" weights (Catmark scheme only) │ │ │ │ │ +Definition: options.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CreasingMethod │ │ │ │ │ +CreasingMethod │ │ │ │ │ +Definition: options.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM │ │ │ │ │ +@ CREASE_UNIFORM │ │ │ │ │ +Catmark rule. │ │ │ │ │ +Definition: options.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_CHAIKIN │ │ │ │ │ +@ CREASE_CHAIKIN │ │ │ │ │ +Chaikin rule. │ │ │ │ │ +Definition: options.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetTriangleSubdivision │ │ │ │ │ +TriangleSubdivision GetTriangleSubdivision() const │ │ │ │ │ +Get triangle subdivision weights rule (Catmark scheme only !) │ │ │ │ │ +Definition: options.h:107 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod │ │ │ │ │ +CreasingMethod GetCreasingMethod() const │ │ │ │ │ +Get edge crease rule. │ │ │ │ │ +Definition: options.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::Options │ │ │ │ │ +Options() │ │ │ │ │ +Definition: options.h:79 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation │ │ │ │ │ +void SetFVarLinearInterpolation(FVarLinearInterpolation b) │ │ │ │ │ +Set face-varying interpolation rule. │ │ │ │ │ +Definition: options.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetTriangleSubdivision │ │ │ │ │ +void SetTriangleSubdivision(TriangleSubdivision t) │ │ │ │ │ +Set triangle subdivision weights rule (Catmark scheme only !) │ │ │ │ │ +Definition: options.h:110 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation │ │ │ │ │ +VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const │ │ │ │ │ +Get vertex boundary interpolation rule. │ │ │ │ │ +Definition: options.h:89 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation │ │ │ │ │ +FVarLinearInterpolation │ │ │ │ │ +Definition: options.h:60 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_ONLY │ │ │ │ │ +@ FVAR_LINEAR_CORNERS_ONLY │ │ │ │ │ +sharpen corners only │ │ │ │ │ +Definition: options.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_BOUNDARIES │ │ │ │ │ +@ FVAR_LINEAR_BOUNDARIES │ │ │ │ │ +sharpen all boundaries ("always sharp") │ │ │ │ │ +Definition: options.h:65 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2 │ │ │ │ │ +@ FVAR_LINEAR_CORNERS_PLUS2 │ │ │ │ │ +("edge and corner + propagate corner") │ │ │ │ │ +Definition: options.h:64 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1 │ │ │ │ │ +@ FVAR_LINEAR_CORNERS_PLUS1 │ │ │ │ │ +("edge corner") │ │ │ │ │ +Definition: options.h:63 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_ALL │ │ │ │ │ +@ FVAR_LINEAR_ALL │ │ │ │ │ +bilinear interpolation ("bilinear") │ │ │ │ │ +Definition: options.h:66 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_NONE │ │ │ │ │ +@ FVAR_LINEAR_NONE │ │ │ │ │ +smooth everywhere ("edge only") │ │ │ │ │ +Definition: options.h:61 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetVtxBoundaryInterpolation │ │ │ │ │ +void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) │ │ │ │ │ +Set vertex boundary interpolation rule. │ │ │ │ │ +Definition: options.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation │ │ │ │ │ +FVarLinearInterpolation GetFVarLinearInterpolation() const │ │ │ │ │ +Get face-varying interpolation rule. │ │ │ │ │ +Definition: options.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VtxBoundaryInterpolation │ │ │ │ │ +VtxBoundaryInterpolation │ │ │ │ │ +Definition: options.h:53 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_NONE │ │ │ │ │ +@ VTX_BOUNDARY_NONE │ │ │ │ │ +Definition: options.h:54 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_ONLY │ │ │ │ │ +@ VTX_BOUNDARY_EDGE_ONLY │ │ │ │ │ +all boundary edges sharpened and interpolated │ │ │ │ │ +Definition: options.h:56 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ +@ VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ +Definition: options.h:57 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetCreasingMethod │ │ │ │ │ +void SetCreasingMethod(CreasingMethod c) │ │ │ │ │ +Set edge crease rule. │ │ │ │ │ +Definition: options.h:104 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuVertexBuffer.h │ │ │ │ │ + * sdc │ │ │ │ │ + * options.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00893.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuPatchTable.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/sdc/loopScheme.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,48 +81,38 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces
│ │ │ │ -
cpuPatchTable.h File Reference
│ │ │ │ +
loopScheme.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <vector>
│ │ │ │ -#include "../far/patchDescriptor.h"
│ │ │ │ -#include "../osd/nonCopyable.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ +#include "../sdc/scheme.h"
│ │ │ │ +#include <cassert>
│ │ │ │ +#include <cmath>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  CpuPatchTable
 Cpu patch table. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,32 +4,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -cpuPatchTable.h File Reference │ │ │ │ │ +Namespaces │ │ │ │ │ +loopScheme.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ -#include "../far/patchDescriptor.h" │ │ │ │ │ -#include "../osd/nonCopyable.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ +#include "../sdc/scheme.h" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  CpuPatchTable │ │ │ │ │ -  Cpu patch table. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Far │ │ │ │ │ -  │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuPatchTable.h │ │ │ │ │ + * sdc │ │ │ │ │ + * loopScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00893_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuPatchTable.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/sdc/loopScheme.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cpuPatchTable.h
│ │ │ │ +
loopScheme.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,160 +106,596 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │ -
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <vector>
│ │ │ │ -
31#include "../far/patchDescriptor.h"
│ │ │ │ -
32#include "../osd/nonCopyable.h"
│ │ │ │ -
33#include "../osd/types.h"
│ │ │ │ -
34
│ │ │ │ -
35#include <vector>
│ │ │ │ -
36
│ │ │ │ -
37namespace OpenSubdiv {
│ │ │ │ -
38namespace OPENSUBDIV_VERSION {
│ │ │ │ -
39
│ │ │ │ -
40namespace Far{
│ │ │ │ -
41 class PatchTable;
│ │ │ │ -
42};
│ │ │ │ +
24#ifndef OPENSUBDIV3_SDC_LOOP_SCHEME_H
│ │ │ │ +
25#define OPENSUBDIV3_SDC_LOOP_SCHEME_H
│ │ │ │ +
26
│ │ │ │ +
27#include "../version.h"
│ │ │ │ +
28
│ │ │ │ +
29#include "../sdc/scheme.h"
│ │ │ │ +
30
│ │ │ │ +
31#include <cassert>
│ │ │ │ +
32#include <cmath>
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │ +
36namespace Sdc {
│ │ │ │ +
37
│ │ │ │ +
38
│ │ │ │ +
39//
│ │ │ │ +
40// Specializations for Sdc::Scheme<SCHEME_LOOP>:
│ │ │ │ +
41//
│ │ │ │ +
42//
│ │ │ │
43
│ │ │ │ -
44namespace Osd {
│ │ │ │ -
45
│ │ │ │ - │ │ │ │ -
60public:
│ │ │ │ -
61 static CpuPatchTable *Create(const Far::PatchTable *patchTable,
│ │ │ │ -
62 void *deviceContext = NULL) {
│ │ │ │ -
63 (void)deviceContext; // unused
│ │ │ │ -
64 return new CpuPatchTable(patchTable);
│ │ │ │ -
65 }
│ │ │ │ -
66
│ │ │ │ -
67 explicit CpuPatchTable(const Far::PatchTable *patchTable);
│ │ │ │ - │ │ │ │ -
69
│ │ │ │ - │ │ │ │ -
71 return &_patchArrays[0];
│ │ │ │ -
72 }
│ │ │ │ -
73 const int *GetPatchIndexBuffer() const {
│ │ │ │ -
74 return &_indexBuffer[0];
│ │ │ │ -
75 }
│ │ │ │ - │ │ │ │ -
77 return &_patchParamBuffer[0];
│ │ │ │ -
78 }
│ │ │ │ -
79
│ │ │ │ -
80 size_t GetNumPatchArrays() const {
│ │ │ │ -
81 return _patchArrays.size();
│ │ │ │ -
82 }
│ │ │ │ -
83 size_t GetPatchIndexSize() const {
│ │ │ │ -
84 return _indexBuffer.size();
│ │ │ │ -
85 }
│ │ │ │ -
86 size_t GetPatchParamSize() const {
│ │ │ │ -
87 return _patchParamBuffer.size();
│ │ │ │ -
88 }
│ │ │ │ -
89
│ │ │ │ - │ │ │ │ -
91 if (_varyingPatchArrays.empty()) {
│ │ │ │ -
92 return NULL;
│ │ │ │ -
93 }
│ │ │ │ -
94 return &_varyingPatchArrays[0];
│ │ │ │ -
95 }
│ │ │ │ -
96 const int *GetVaryingPatchIndexBuffer() const {
│ │ │ │ -
97 if (_varyingIndexBuffer.empty()) {
│ │ │ │ -
98 return NULL;
│ │ │ │ -
99 }
│ │ │ │ -
100 return &_varyingIndexBuffer[0];
│ │ │ │ -
101 }
│ │ │ │ - │ │ │ │ -
103 return _varyingIndexBuffer.size();
│ │ │ │ -
104 }
│ │ │ │ -
105
│ │ │ │ -
106 int GetNumFVarChannels() const {
│ │ │ │ -
107 return (int)_fvarPatchArrays.size();
│ │ │ │ -
108 }
│ │ │ │ -
109 const PatchArray *GetFVarPatchArrayBuffer(int fvarChannel = 0) const {
│ │ │ │ -
110 return &_fvarPatchArrays[fvarChannel][0];
│ │ │ │ -
111 }
│ │ │ │ -
112 const int *GetFVarPatchIndexBuffer(int fvarChannel = 0) const {
│ │ │ │ -
113 return &_fvarIndexBuffers[fvarChannel][0];
│ │ │ │ -
114 }
│ │ │ │ -
115 size_t GetFVarPatchIndexSize(int fvarChannel = 0) const {
│ │ │ │ -
116 return _fvarIndexBuffers[fvarChannel].size();
│ │ │ │ -
117 }
│ │ │ │ -
118 const PatchParam *GetFVarPatchParamBuffer(int fvarChannel= 0) const {
│ │ │ │ -
119 return &_fvarParamBuffers[fvarChannel][0];
│ │ │ │ -
120 }
│ │ │ │ -
121 size_t GetFVarPatchParamSize(int fvarChannel = 0) const {
│ │ │ │ -
122 return _fvarParamBuffers[fvarChannel].size();
│ │ │ │ -
123 }
│ │ │ │ -
124
│ │ │ │ -
125protected:
│ │ │ │ - │ │ │ │ -
127 std::vector<int> _indexBuffer;
│ │ │ │ - │ │ │ │ -
129
│ │ │ │ - │ │ │ │ -
131 std::vector<int> _varyingIndexBuffer;
│ │ │ │ -
132
│ │ │ │ -
133 std::vector< PatchArrayVector > _fvarPatchArrays;
│ │ │ │ -
134 std::vector< std::vector<int> > _fvarIndexBuffers;
│ │ │ │ -
135 std::vector< PatchParamVector > _fvarParamBuffers;
│ │ │ │ -
136};
│ │ │ │ -
137
│ │ │ │ -
138} // end namespace Osd
│ │ │ │ -
139
│ │ │ │ -
140} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
141using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
142
│ │ │ │ -
143} // end namespace OpenSubdiv
│ │ │ │ -
144
│ │ │ │ -
145#endif // OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H
│ │ │ │ +
44//
│ │ │ │ +
45// Loop traits:
│ │ │ │ +
46//
│ │ │ │ +
47template <>
│ │ │ │ + │ │ │ │ +
49
│ │ │ │ +
50template <>
│ │ │ │ + │ │ │ │ +
52
│ │ │ │ +
53template <>
│ │ │ │ + │ │ │ │ +
55
│ │ │ │ +
56template <>
│ │ │ │ + │ │ │ │ +
58
│ │ │ │ +
59
│ │ │ │ +
60//
│ │ │ │ +
61// Protected methods to assign the two types of masks for an edge-vertex --
│ │ │ │ +
62// Crease and Smooth.
│ │ │ │ +
63//
│ │ │ │ +
64// The Crease case does not really need to be specialized, though it may be
│ │ │ │ +
65// preferable to define all explicitly here.
│ │ │ │ +
66//
│ │ │ │ +
67template <>
│ │ │ │ +
68template <typename EDGE, typename MASK>
│ │ │ │ +
69inline void
│ │ │ │ + │ │ │ │ +
71{
│ │ │ │ +
72 mask.SetNumVertexWeights(2);
│ │ │ │ +
73 mask.SetNumEdgeWeights(0);
│ │ │ │ +
74 mask.SetNumFaceWeights(0);
│ │ │ │ +
75 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
76
│ │ │ │ +
77 mask.VertexWeight(0) = 0.5f;
│ │ │ │ +
78 mask.VertexWeight(1) = 0.5f;
│ │ │ │ +
79}
│ │ │ │ +
80
│ │ │ │ +
81template <>
│ │ │ │ +
82template <typename EDGE, typename MASK>
│ │ │ │ +
83inline void
│ │ │ │ +
84Scheme<SCHEME_LOOP>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const
│ │ │ │ +
85{
│ │ │ │ +
86 int faceCount = edge.GetNumFaces();
│ │ │ │ +
87
│ │ │ │ +
88 mask.SetNumVertexWeights(2);
│ │ │ │ +
89 mask.SetNumEdgeWeights(0);
│ │ │ │ +
90 mask.SetNumFaceWeights(faceCount);
│ │ │ │ +
91 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
92
│ │ │ │ +
93 //
│ │ │ │ +
94 // This is where we run into the issue of "face weights" -- we want to weight the
│ │ │ │ +
95 // face-centers for Catmark, but face-centers are not generated for Loop. So do
│ │ │ │ +
96 // we make assumptions on how the mask is used, assign some property to the mask
│ │ │ │ +
97 // to indicate how they were assigned, or take input from the mask itself?
│ │ │ │ +
98 //
│ │ │ │ +
99 // Regardless, we have two choices:
│ │ │ │ +
100 // - face-weights are for the vertices opposite the edge (as in Hbr):
│ │ │ │ +
101 // vertex weights = 0.375f;
│ │ │ │ +
102 // face weights = 0.125f;
│ │ │ │ +
103 //
│ │ │ │ +
104 // - face-weights are for the face centers:
│ │ │ │ +
105 // vertex weights = 0.125f;
│ │ │ │ +
106 // face weights = 0.375f;
│ │ │ │ +
107 //
│ │ │ │ +
108 // Coincidentally the coefficients are the same but reversed.
│ │ │ │ +
109 //
│ │ │ │ +
110 typedef typename MASK::Weight Weight;
│ │ │ │ +
111
│ │ │ │ +
112 Weight vWeight = mask.AreFaceWeightsForFaceCenters() ? 0.125f : 0.375f;
│ │ │ │ +
113 Weight fWeight = mask.AreFaceWeightsForFaceCenters() ? 0.375f : 0.125f;
│ │ │ │ +
114
│ │ │ │ +
115 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
116 mask.VertexWeight(1) = vWeight;
│ │ │ │ +
117
│ │ │ │ +
118 if (faceCount == 2) {
│ │ │ │ +
119 mask.FaceWeight(0) = fWeight;
│ │ │ │ +
120 mask.FaceWeight(1) = fWeight;
│ │ │ │ +
121 } else {
│ │ │ │ +
122 // The non-manifold case is not clearly defined -- we adjust the above
│ │ │ │ +
123 // face-weight to preserve the ratio of edge-center and face-centers:
│ │ │ │ +
124 fWeight *= 2.0f / (Weight) faceCount;
│ │ │ │ +
125 for (int i = 0; i < faceCount; ++i) {
│ │ │ │ +
126 mask.FaceWeight(i) = fWeight;
│ │ │ │ +
127 }
│ │ │ │ +
128 }
│ │ │ │ +
129}
│ │ │ │ +
130
│ │ │ │ +
131
│ │ │ │ +
132//
│ │ │ │ +
133// Protected methods to assign the three types of masks for a vertex-vertex --
│ │ │ │ +
134// Corner, Crease and Smooth (Dart is the same as Smooth).
│ │ │ │ +
135//
│ │ │ │ +
136// Corner and Crease do not really need to be specialized, though it may be
│ │ │ │ +
137// preferable to define all explicitly here.
│ │ │ │ +
138//
│ │ │ │ +
139template <>
│ │ │ │ +
140template <typename VERTEX, typename MASK>
│ │ │ │ +
141inline void
│ │ │ │ + │ │ │ │ +
143{
│ │ │ │ +
144 mask.SetNumVertexWeights(1);
│ │ │ │ +
145 mask.SetNumEdgeWeights(0);
│ │ │ │ +
146 mask.SetNumFaceWeights(0);
│ │ │ │ +
147 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
148
│ │ │ │ +
149 mask.VertexWeight(0) = 1.0f;
│ │ │ │ +
150}
│ │ │ │ +
151
│ │ │ │ +
152template <>
│ │ │ │ +
153template <typename VERTEX, typename MASK>
│ │ │ │ +
154inline void
│ │ │ │ +
155Scheme<SCHEME_LOOP>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask,
│ │ │ │ +
156 int const creaseEnds[2]) const {
│ │ │ │ +
157 typedef typename MASK::Weight Weight;
│ │ │ │ +
158
│ │ │ │ +
159 int valence = vertex.GetNumEdges();
│ │ │ │ +
160
│ │ │ │ +
161 mask.SetNumVertexWeights(1);
│ │ │ │ +
162 mask.SetNumEdgeWeights(valence);
│ │ │ │ +
163 mask.SetNumFaceWeights(0);
│ │ │ │ +
164 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
165
│ │ │ │ +
166 Weight vWeight = 0.75f;
│ │ │ │ +
167 Weight eWeight = 0.125f;
│ │ │ │ +
168
│ │ │ │ +
169 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
170 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
171 mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
172 }
│ │ │ │ +
173 mask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ +
174 mask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ +
175}
│ │ │ │ +
176
│ │ │ │ +
177template <>
│ │ │ │ +
178template <typename VERTEX, typename MASK>
│ │ │ │ +
179inline void
│ │ │ │ +
180Scheme<SCHEME_LOOP>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const
│ │ │ │ +
181{
│ │ │ │ +
182 typedef typename MASK::Weight Weight;
│ │ │ │ +
183
│ │ │ │ +
184 int valence = vertex.GetNumFaces();
│ │ │ │ +
185
│ │ │ │ +
186 mask.SetNumVertexWeights(1);
│ │ │ │ +
187 mask.SetNumEdgeWeights(valence);
│ │ │ │ +
188 mask.SetNumFaceWeights(0);
│ │ │ │ +
189 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
190
│ │ │ │ +
191 // Specialize for the regular case: 1/16 per edge-vert, 5/8 for the vert itself:
│ │ │ │ +
192 Weight eWeight = (Weight) 0.0625f;
│ │ │ │ +
193 Weight vWeight = (Weight) 0.625f;
│ │ │ │ +
194
│ │ │ │ +
195 if (valence != 6) {
│ │ │ │ +
196 // From HbrLoopSubdivision<T>::Subdivide(mesh, vertex):
│ │ │ │ +
197 // - could use some lookup tables here for common irregular valence (5, 7, 8)
│ │ │ │ +
198 // or all of these cosine calls will be adding up...
│ │ │ │ +
199
│ │ │ │ +
200 double dValence = (double) valence;
│ │ │ │ +
201 double invValence = 1.0f / dValence;
│ │ │ │ +
202 double cosTheta = std::cos(M_PI * 2.0f * invValence);
│ │ │ │ +
203
│ │ │ │ +
204 double beta = 0.25f * cosTheta + 0.375f;
│ │ │ │ +
205
│ │ │ │ +
206 eWeight = (Weight) ((0.625f - (beta * beta)) * invValence);
│ │ │ │ +
207 vWeight = (Weight) (1.0f - (eWeight * dValence));
│ │ │ │ +
208 }
│ │ │ │ +
209
│ │ │ │ +
210 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
211 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
212 mask.EdgeWeight(i) = eWeight;
│ │ │ │ +
213 }
│ │ │ │ +
214}
│ │ │ │ +
215
│ │ │ │ +
216
│ │ │ │ +
217//
│ │ │ │ +
218// Limit masks for position:
│ │ │ │ +
219//
│ │ │ │ +
220template <>
│ │ │ │ +
221template <typename VERTEX, typename MASK>
│ │ │ │ +
222inline void
│ │ │ │ +
223Scheme<SCHEME_LOOP>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ +
224
│ │ │ │ +
225 posMask.SetNumVertexWeights(1);
│ │ │ │ +
226 posMask.SetNumEdgeWeights(0);
│ │ │ │ +
227 posMask.SetNumFaceWeights(0);
│ │ │ │ +
228 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
229
│ │ │ │ +
230 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ +
231}
│ │ │ │ +
232
│ │ │ │ +
233template <>
│ │ │ │ +
234template <typename VERTEX, typename MASK>
│ │ │ │ +
235inline void
│ │ │ │ +
236Scheme<SCHEME_LOOP>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ +
237 int const creaseEnds[2]) const {
│ │ │ │ +
238
│ │ │ │ +
239 typedef typename MASK::Weight Weight;
│ │ │ │ +
240
│ │ │ │ +
241 int valence = vertex.GetNumEdges();
│ │ │ │ +
242
│ │ │ │ +
243 posMask.SetNumVertexWeights(1);
│ │ │ │ +
244 posMask.SetNumEdgeWeights(valence);
│ │ │ │ +
245 posMask.SetNumFaceWeights(0);
│ │ │ │ +
246 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
247
│ │ │ │ +
248 //
│ │ │ │ +
249 // The refinement mask for a crease vertex is (1/8, 3/4, 1/8) and for a crease
│ │ │ │ +
250 // edge is (1/2, 1/2) -- producing a uniform B-spline curve along the crease
│ │ │ │ +
251 // (boundary) whether the vertex or its crease is regular or not. The limit
│ │ │ │ +
252 // mask is therefore (1/6, 2/3, 1/6) for ALL cases.
│ │ │ │ +
253 //
│ │ │ │ +
254 // An alternative limit mask (1/5, 3/5, 1/5) is often published for use either
│ │ │ │ +
255 // for irregular crease vertices or for all crease/boundary vertices, but this
│ │ │ │ +
256 // is based on an alternate refinement mask for the edge -- (3/8, 5/8) versus
│ │ │ │ +
257 // the usual (1/2, 1/2) -- and will not produce the B-spline curve desired.
│ │ │ │ +
258 //
│ │ │ │ +
259 Weight vWeight = (Weight) (4.0 / 6.0);
│ │ │ │ +
260 Weight eWeight = (Weight) (1.0 / 6.0);
│ │ │ │ +
261
│ │ │ │ +
262 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
263 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
264 posMask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
265 }
│ │ │ │ +
266 posMask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ +
267 posMask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ +
268}
│ │ │ │ +
269
│ │ │ │ +
270template <>
│ │ │ │ +
271template <typename VERTEX, typename MASK>
│ │ │ │ +
272inline void
│ │ │ │ +
273Scheme<SCHEME_LOOP>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ +
274
│ │ │ │ +
275 typedef typename MASK::Weight Weight;
│ │ │ │ +
276
│ │ │ │ +
277 int valence = vertex.GetNumFaces();
│ │ │ │ +
278
│ │ │ │ +
279 posMask.SetNumVertexWeights(1);
│ │ │ │ +
280 posMask.SetNumEdgeWeights(valence);
│ │ │ │ +
281 posMask.SetNumFaceWeights(0);
│ │ │ │ +
282 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
283
│ │ │ │ +
284 // Specialize for the regular case: 1/12 per edge-vert, 1/2 for the vert itself:
│ │ │ │ +
285 if (valence == 6) {
│ │ │ │ +
286 Weight eWeight = (Weight) (1.0 / 12.0);
│ │ │ │ +
287 Weight vWeight = 0.5f;
│ │ │ │ +
288
│ │ │ │ +
289 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
290
│ │ │ │ +
291 posMask.EdgeWeight(0) = eWeight;
│ │ │ │ +
292 posMask.EdgeWeight(1) = eWeight;
│ │ │ │ +
293 posMask.EdgeWeight(2) = eWeight;
│ │ │ │ +
294 posMask.EdgeWeight(3) = eWeight;
│ │ │ │ +
295 posMask.EdgeWeight(4) = eWeight;
│ │ │ │ +
296 posMask.EdgeWeight(5) = eWeight;
│ │ │ │ +
297
│ │ │ │ +
298 } else {
│ │ │ │ +
299 double dValence = (double) valence;
│ │ │ │ +
300 double invValence = 1.0f / dValence;
│ │ │ │ +
301 double cosTheta = std::cos(M_PI * 2.0f * invValence);
│ │ │ │ +
302
│ │ │ │ +
303 double beta = 0.25f * cosTheta + 0.375f;
│ │ │ │ +
304 double gamma = (0.625f - (beta * beta)) * invValence;
│ │ │ │ +
305
│ │ │ │ +
306 Weight eWeight = (Weight) (1.0f / (dValence + 3.0f / (8.0f * gamma)));
│ │ │ │ +
307 Weight vWeight = (Weight) (1.0f - (eWeight * dValence));
│ │ │ │ +
308
│ │ │ │ +
309 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
310 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
311 posMask.EdgeWeight(i) = eWeight;
│ │ │ │ +
312 }
│ │ │ │ +
313 }
│ │ │ │ +
314}
│ │ │ │ +
315
│ │ │ │ +
316/*
│ │ │ │ +
317// Limit masks for tangents:
│ │ │ │ +
318//
│ │ │ │ +
319// A note on tangent magnitudes:
│ │ │ │ +
320//
│ │ │ │ +
321// Several formulae exist for limit tangents at a vertex to accommodate the
│ │ │ │ +
322// different topological configurations around the vertex. While these produce
│ │ │ │ +
323// the desired direction, there is inconsistency in the resulting magnitudes.
│ │ │ │ +
324// Ideally a regular mesh of uniformly shaped triangles with similar edge lengths
│ │ │ │ +
325// should produce tangents of similar magnitudes throughout -- including corners
│ │ │ │ +
326// and boundaries. So some of the common formulae for these are adjusted with
│ │ │ │ +
327// scale factors.
│ │ │ │ +
328//
│ │ │ │ +
329// For uses where magnitude does not matter, this scaling should be irrelevant.
│ │ │ │ +
330// But just as with patches, where the magnitudes of partial derivatives are
│ │ │ │ +
331// consistent between similar patches, the magnitudes of limit tangents should
│ │ │ │ +
332// also be similar.
│ │ │ │ +
333//
│ │ │ │ +
334// The reference tangents, in terms of magnitudes, are those produced by the
│ │ │ │ +
335// limit tangent mask for smooth interior vertices, for which well established
│ │ │ │ +
336// sin/cos formulae apply -- these remain unscaled. Formulae for the other
│ │ │ │ +
337// crease/boundary, corner tangents and irregular cases are scaled to be more
│ │ │ │ +
338// consistent with these.
│ │ │ │ +
339//
│ │ │ │ +
340// The crease/boundary tangents for the regular case can be viewed as derived
│ │ │ │ +
341// from the smooth interior masks with two "phantom" points extrapolated across
│ │ │ │ +
342// the regular boundary:
│ │ │ │ +
343//
│ │ │ │ +
344// v3 v2
│ │ │ │ +
345// X - - - - - X
│ │ │ │ +
346// / \ / \
│ │ │ │ +
347// / \ / \
│ │ │ │ +
348// v4 X - - - - - X - - - - - X v1
│ │ │ │ +
349// . . 0 . .
│ │ │ │ +
350// . . . .
│ │ │ │ +
351// . . . .
│ │ │ │ +
352// (v5) (v6)
│ │ │ │ +
353//
│ │ │ │ +
354// where v5 = v0 + (v4 - v3) and v6 = v0 + v1 - v2.
│ │ │ │ +
355//
│ │ │ │ +
356// When the standard limit tangent mask is applied, the cosines of increments
│ │ │ │ +
357// of pi/3 give us coefficients that are multiples of 1/2, leading to the first
│ │ │ │ +
358// tangent T1 = 3/2 * (v1 - v4), rather than the widely used T1 = v1 - v4. So
│ │ │ │ +
359// this scale factor of 3/2 is applied to ensure tangents along the boundaries
│ │ │ │ +
360// are of similar magnitude as tangents in the immediate interior (which may be
│ │ │ │ +
361// parallel).
│ │ │ │ +
362//
│ │ │ │ +
363// Tangents at corners are essentially a form of boundary tangent, and so its
│ │ │ │ +
364// simple difference formula is scaled to be consistent with adjoining boundary
│ │ │ │ +
365// tangents -- not just with the 3/2 factor from above, but with an additional
│ │ │ │ +
366// 2.0 to compensate for the fact that the difference of only side of the vertex
│ │ │ │ +
367// is considered here. The resulting scale factor of 3.0 for the regular corner
│ │ │ │ +
368// is what similarly arises by extrapolating an interior region around the
│ │ │ │ +
369// vertex and using the interior mask for the first tangent.
│ │ │ │ +
370//
│ │ │ │ +
371// The cross-tangent formula for the regular crease/boundary is similarly found
│ │ │ │ +
372// from the above construction of the boundary, but the commonly used weights of
│ │ │ │ +
373// +/- 1 and 2 result from omitting the common factor of sqrt(3)/2 (arising from
│ │ │ │ +
374// the sines of increments of pi/3). With that scale factor close to one, it has
│ │ │ │ +
375// less impact than the irregular cases, which are analogous to corner tangents
│ │ │ │ +
376// in that differences on only one side of the vertex are considered. While a
│ │ │ │ +
377// scaling of 3.0 is similarly understandable for the valence 2 and 3 cases, it is
│ │ │ │ +
378// less obvious in the irregular formula for valence > 4, but similarly effective.
│ │ │ │ +
379//
│ │ │ │ +
380// The end result of these adjustments should be a set of limit tangents that are
│ │ │ │ +
381// of similar magnitude over a regular mesh including boundaries and corners.
│ │ │ │ +
382*/
│ │ │ │ +
383template <>
│ │ │ │ +
384template <typename VERTEX, typename MASK>
│ │ │ │ +
385inline void
│ │ │ │ + │ │ │ │ +
387 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
388
│ │ │ │ +
389 int valence = vertex.GetNumEdges();
│ │ │ │ +
390
│ │ │ │ +
391 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
392 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
393 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ +
394 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
395
│ │ │ │ +
396 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
397 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
398 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ +
399 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
400
│ │ │ │ +
401 // See note above regarding scale factor of 3.0:
│ │ │ │ +
402 tan1Mask.VertexWeight(0) = -3.0f;
│ │ │ │ +
403 tan1Mask.EdgeWeight(0) = 3.0f;
│ │ │ │ +
404 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ +
405
│ │ │ │ +
406 tan2Mask.VertexWeight(0) = -3.0f;
│ │ │ │ +
407 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ +
408 tan2Mask.EdgeWeight(1) = 3.0f;
│ │ │ │ +
409
│ │ │ │ +
410 // Should be at least 2 edges -- be sure to clear weights for any more:
│ │ │ │ +
411 for (int i = 2; i < valence; ++i) {
│ │ │ │ +
412 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
413 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
414 }
│ │ │ │ +
415}
│ │ │ │ +
416
│ │ │ │ +
417template <>
│ │ │ │ +
418template <typename VERTEX, typename MASK>
│ │ │ │ +
419inline void
│ │ │ │ + │ │ │ │ +
421 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const {
│ │ │ │ +
422
│ │ │ │ +
423 typedef typename MASK::Weight Weight;
│ │ │ │ +
424
│ │ │ │ +
425 //
│ │ │ │ +
426 // First, the tangent along the crease:
│ │ │ │ +
427 // The first crease edge is considered the "leading" edge of the span
│ │ │ │ +
428 // of surface for which we are evaluating tangents and the second edge the
│ │ │ │ +
429 // "trailing edge". By convention, the tangent along the crease is oriented
│ │ │ │ +
430 // in the direction of the leading edge.
│ │ │ │ +
431 //
│ │ │ │ +
432 int valence = vertex.GetNumEdges();
│ │ │ │ +
433
│ │ │ │ +
434 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
435 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
436 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ +
437 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
438
│ │ │ │ +
439 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
440 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
441 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
442 }
│ │ │ │ +
443
│ │ │ │ +
444 // See the note above regarding scale factor of 1.5:
│ │ │ │ +
445 tan1Mask.EdgeWeight(creaseEnds[0]) = 1.5f;
│ │ │ │ +
446 tan1Mask.EdgeWeight(creaseEnds[1]) = -1.5f;
│ │ │ │ +
447
│ │ │ │ +
448 //
│ │ │ │ +
449 // Second, the tangent across the interior faces:
│ │ │ │ +
450 // Note this is ambiguous for an interior vertex. We currently return
│ │ │ │ +
451 // the tangent for the surface in the counter-clockwise span between the
│ │ │ │ +
452 // leading and trailing edges that form the crease. Given the expected
│ │ │ │ +
453 // computation of a surface normal as Tan1 X Tan2, this tangent should be
│ │ │ │ +
454 // oriented "inward" from the crease/boundary -- across the surface rather
│ │ │ │ +
455 // than outward and away from it.
│ │ │ │ +
456 //
│ │ │ │ +
457 // There is inconsistency in the orientation of this tangent in commonly
│ │ │ │ +
458 // published results: the general formula provided for arbitrary valence
│ │ │ │ +
459 // has the tangent pointing across the crease and "outward" from the surface,
│ │ │ │ +
460 // while the special cases for regular valence and lower have the tangent
│ │ │ │ +
461 // pointing across the surface and "inward" from the crease. So if we are
│ │ │ │ +
462 // to consistently orient the first tangent along the crease, regardless of
│ │ │ │ +
463 // the interior topology, we have to correct this. With the first tangent
│ │ │ │ +
464 // following the direction of the leading crease edge, we want the second
│ │ │ │ +
465 // tangent pointing inward/across the surface -- so we flip the result of
│ │ │ │ +
466 // the general formula.
│ │ │ │ +
467 //
│ │ │ │ +
468 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
469 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
470 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ +
471 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
472
│ │ │ │ +
473 for (int i = 0; i < creaseEnds[0]; ++i) {
│ │ │ │ +
474 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
475 }
│ │ │ │ +
476 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1;
│ │ │ │ +
477 if (interiorEdgeCount == 2) {
│ │ │ │ +
478 // See note above regarding scale factor of (sin(60 degs) == sqrt(3)/2:
│ │ │ │ +
479
│ │ │ │ +
480 static Weight const Root3 = (Weight) 1.73205080756887729352;
│ │ │ │ +
481 static Weight const Root3by2 = (Weight) (Root3 * 0.5);
│ │ │ │ +
482
│ │ │ │ +
483 tan2Mask.VertexWeight(0) = -Root3;
│ │ │ │ +
484
│ │ │ │ +
485 tan2Mask.EdgeWeight(creaseEnds[0]) = -Root3by2;
│ │ │ │ +
486 tan2Mask.EdgeWeight(creaseEnds[1]) = -Root3by2;
│ │ │ │ +
487
│ │ │ │ +
488 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = Root3;
│ │ │ │ +
489 tan2Mask.EdgeWeight(creaseEnds[0] + 2) = Root3;
│ │ │ │ +
490 } else if (interiorEdgeCount > 2) {
│ │ │ │ +
491 // See notes above regarding scale factor of -3.0 (-1 for orientation,
│ │ │ │ +
492 // 2.0 for considering the region as a half-disk, and 1.5 in keeping
│ │ │ │ +
493 // with the crease tangent):
│ │ │ │ +
494
│ │ │ │ +
495 double theta = M_PI / (interiorEdgeCount + 1);
│ │ │ │ +
496
│ │ │ │ +
497 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
498
│ │ │ │ +
499 Weight cWeight = (Weight) (-3.0f * std::sin(theta));
│ │ │ │ +
500 tan2Mask.EdgeWeight(creaseEnds[0]) = cWeight;
│ │ │ │ +
501 tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight;
│ │ │ │ +
502
│ │ │ │ +
503 double eCoeff = -3.0f * 2.0f * (std::cos(theta) - 1.0f);
│ │ │ │ +
504 for (int i = 1; i <= interiorEdgeCount; ++i) {
│ │ │ │ +
505 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) (eCoeff * std::sin(i * theta));
│ │ │ │ +
506 }
│ │ │ │ +
507 } else if (interiorEdgeCount == 1) {
│ │ │ │ +
508 // See notes above regarding scale factor of 3.0:
│ │ │ │ +
509
│ │ │ │ +
510 tan2Mask.VertexWeight(0) = -3.0f;
│ │ │ │ +
511
│ │ │ │ +
512 tan2Mask.EdgeWeight(creaseEnds[0]) = 0.0f;
│ │ │ │ +
513 tan2Mask.EdgeWeight(creaseEnds[1]) = 0.0f;
│ │ │ │ +
514
│ │ │ │ +
515 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = 3.0f;
│ │ │ │ +
516 } else {
│ │ │ │ +
517 // See notes above regarding scale factor of 3.0:
│ │ │ │ +
518
│ │ │ │ +
519 tan2Mask.VertexWeight(0) = -6.0f;
│ │ │ │ +
520
│ │ │ │ +
521 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f;
│ │ │ │ +
522 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f;
│ │ │ │ +
523 }
│ │ │ │ +
524 for (int i = creaseEnds[1] + 1; i < valence; ++i) {
│ │ │ │ +
525 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
526 }
│ │ │ │ +
527}
│ │ │ │ +
528
│ │ │ │ +
529template <>
│ │ │ │ +
530template <typename VERTEX, typename MASK>
│ │ │ │ +
531inline void
│ │ │ │ + │ │ │ │ +
533 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
534
│ │ │ │ +
535 typedef typename MASK::Weight Weight;
│ │ │ │ +
536
│ │ │ │ +
537 int valence = vertex.GetNumFaces();
│ │ │ │ +
538
│ │ │ │ +
539 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
540 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
541 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ +
542 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
543
│ │ │ │ +
544 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
545 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
546 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ +
547 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
548
│ │ │ │ +
549 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
550 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
551
│ │ │ │ +
552 if (valence == 6) {
│ │ │ │ +
553 static Weight const Root3by2 = (Weight)(0.5 * 1.73205080756887729352);
│ │ │ │ +
554
│ │ │ │ +
555 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ +
556 tan1Mask.EdgeWeight(1) = 0.5f;
│ │ │ │ +
557 tan1Mask.EdgeWeight(2) = -0.5f;
│ │ │ │ +
558 tan1Mask.EdgeWeight(3) = -1.0f;
│ │ │ │ +
559 tan1Mask.EdgeWeight(4) = -0.5f;
│ │ │ │ +
560 tan1Mask.EdgeWeight(5) = 0.5f;
│ │ │ │ +
561
│ │ │ │ +
562 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ +
563 tan2Mask.EdgeWeight(1) = Root3by2;
│ │ │ │ +
564 tan2Mask.EdgeWeight(2) = Root3by2;
│ │ │ │ +
565 tan2Mask.EdgeWeight(3) = 0.0f;
│ │ │ │ +
566 tan2Mask.EdgeWeight(4) = -Root3by2;
│ │ │ │ +
567 tan2Mask.EdgeWeight(5) = -Root3by2;
│ │ │ │ +
568 } else {
│ │ │ │ +
569 double alpha = 2.0f * M_PI / valence;
│ │ │ │ +
570 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
571 double alphaI = alpha * i;
│ │ │ │ +
572 tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI);
│ │ │ │ +
573 tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI);
│ │ │ │ +
574 }
│ │ │ │ +
575 }
│ │ │ │ +
576}
│ │ │ │ +
577
│ │ │ │ +
578} // end namespace Sdc
│ │ │ │ +
579} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
580using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
581} // end namespace OpenSubdiv
│ │ │ │ +
582
│ │ │ │ +
583#endif /* OPENSUBDIV3_SDC_LOOP_SCHEME_H */
│ │ │ │ │ │ │ │ -
std::vector< PatchParam > PatchParamVector
Definition: types.h:133
│ │ │ │ -
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ -
Container for arrays of parametric patches.
Definition: patchTable.h:55
│ │ │ │ - │ │ │ │ -
const PatchArray * GetFVarPatchArrayBuffer(int fvarChannel=0) const
│ │ │ │ - │ │ │ │ - │ │ │ │ -
size_t GetFVarPatchParamSize(int fvarChannel=0) const
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
static CpuPatchTable * Create(const Far::PatchTable *patchTable, void *deviceContext=NULL)
Definition: cpuPatchTable.h:61
│ │ │ │ -
std::vector< PatchParamVector > _fvarParamBuffers
│ │ │ │ -
CpuPatchTable(const Far::PatchTable *patchTable)
│ │ │ │ -
std::vector< std::vector< int > > _fvarIndexBuffers
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
size_t GetFVarPatchIndexSize(int fvarChannel=0) const
│ │ │ │ -
const int * GetFVarPatchIndexBuffer(int fvarChannel=0) const
│ │ │ │ -
const PatchParam * GetFVarPatchParamBuffer(int fvarChannel=0) const
│ │ │ │ - │ │ │ │ - │ │ │ │ -
const PatchArray * GetVaryingPatchArrayBuffer() const
Definition: cpuPatchTable.h:90
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
std::vector< PatchArrayVector > _fvarPatchArrays
│ │ │ │ - │ │ │ │ - │ │ │ │ +
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ +
@ SPLIT_TO_TRIS
Used by Loop.
Definition: types.h:49
│ │ │ │ +
void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const
│ │ │ │ + │ │ │ │ +
void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const creaseEnds[2]) const
│ │ │ │ +
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ + │ │ │ │ +
void assignCreaseMaskForEdge(EDGE const &edge, MASK &mask) const
Definition: scheme.h:317
│ │ │ │ +
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ + │ │ │ │ +
void assignCornerMaskForVertex(VERTEX const &edge, MASK &mask) const
Definition: scheme.h:331
│ │ │ │ +
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ +
void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const
│ │ │ │ + │ │ │ │ +
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ +
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cpuPatchTable.h │ │ │ │ │ +loopScheme.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,216 +29,677 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include "../far/patchDescriptor.h" │ │ │ │ │ - 32#include "../osd/nonCopyable.h" │ │ │ │ │ - 33#include "../osd/types.h" │ │ │ │ │ - 34 │ │ │ │ │ - 35#include │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace OpenSubdiv { │ │ │ │ │ - 38namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 39 │ │ │ │ │ - 40namespace Far{ │ │ │ │ │ - 41 class PatchTable; │ │ │ │ │ - 42}; │ │ │ │ │ + 24#ifndef OPENSUBDIV3_SDC_LOOP_SCHEME_H │ │ │ │ │ + 25#define OPENSUBDIV3_SDC_LOOP_SCHEME_H │ │ │ │ │ + 26 │ │ │ │ │ + 27#include "../version.h" │ │ │ │ │ + 28 │ │ │ │ │ + 29#include "../sdc/scheme.h" │ │ │ │ │ + 30 │ │ │ │ │ + 31#include │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ + 36namespace Sdc { │ │ │ │ │ + 37 │ │ │ │ │ + 38 │ │ │ │ │ + 39// │ │ │ │ │ + 40// Specializations for Sdc::Scheme: │ │ │ │ │ + 41// │ │ │ │ │ + 42// │ │ │ │ │ 43 │ │ │ │ │ - 44namespace Osd { │ │ │ │ │ - 45 │ │ │ │ │ -59class CpuPatchTable { │ │ │ │ │ - 60public: │ │ │ │ │ -61 static CpuPatchTable *Create(const Far::PatchTable *patchTable, │ │ │ │ │ - 62 void *deviceContext = NULL) { │ │ │ │ │ - 63 (void)deviceContext; // unused │ │ │ │ │ - 64 return new CpuPatchTable(patchTable); │ │ │ │ │ - 65 } │ │ │ │ │ - 66 │ │ │ │ │ -67 explicit CpuPatchTable(const Far::PatchTable *patchTable); │ │ │ │ │ -68 ~CpuPatchTable() {} │ │ │ │ │ - 69 │ │ │ │ │ -70 const PatchArray *GetPatchArrayBuffer() const { │ │ │ │ │ - 71 return &_patchArrays[0]; │ │ │ │ │ - 72 } │ │ │ │ │ -73 const int *GetPatchIndexBuffer() const { │ │ │ │ │ - 74 return &_indexBuffer[0]; │ │ │ │ │ - 75 } │ │ │ │ │ -76 const PatchParam *GetPatchParamBuffer() const { │ │ │ │ │ - 77 return &_patchParamBuffer[0]; │ │ │ │ │ - 78 } │ │ │ │ │ - 79 │ │ │ │ │ -80 size_t GetNumPatchArrays() const { │ │ │ │ │ - 81 return _patchArrays.size(); │ │ │ │ │ - 82 } │ │ │ │ │ -83 size_t GetPatchIndexSize() const { │ │ │ │ │ - 84 return _indexBuffer.size(); │ │ │ │ │ - 85 } │ │ │ │ │ -86 size_t GetPatchParamSize() const { │ │ │ │ │ - 87 return _patchParamBuffer.size(); │ │ │ │ │ - 88 } │ │ │ │ │ - 89 │ │ │ │ │ -90 const PatchArray *GetVaryingPatchArrayBuffer() const { │ │ │ │ │ - 91 if (_varyingPatchArrays.empty()) { │ │ │ │ │ - 92 return NULL; │ │ │ │ │ - 93 } │ │ │ │ │ - 94 return &_varyingPatchArrays[0]; │ │ │ │ │ - 95 } │ │ │ │ │ -96 const int *GetVaryingPatchIndexBuffer() const { │ │ │ │ │ - 97 if (_varyingIndexBuffer.empty()) { │ │ │ │ │ - 98 return NULL; │ │ │ │ │ - 99 } │ │ │ │ │ - 100 return &_varyingIndexBuffer[0]; │ │ │ │ │ - 101 } │ │ │ │ │ -102 size_t GetVaryingPatchIndexSize() const { │ │ │ │ │ - 103 return _varyingIndexBuffer.size(); │ │ │ │ │ - 104 } │ │ │ │ │ - 105 │ │ │ │ │ -106 int GetNumFVarChannels() const { │ │ │ │ │ - 107 return (int)_fvarPatchArrays.size(); │ │ │ │ │ - 108 } │ │ │ │ │ -109 const PatchArray *GetFVarPatchArrayBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 110 return &_fvarPatchArrays[fvarChannel][0]; │ │ │ │ │ - 111 } │ │ │ │ │ -112 const int *GetFVarPatchIndexBuffer(int fvarChannel = 0) const { │ │ │ │ │ - 113 return &_fvarIndexBuffers[fvarChannel][0]; │ │ │ │ │ - 114 } │ │ │ │ │ -115 size_t GetFVarPatchIndexSize(int fvarChannel = 0) const { │ │ │ │ │ - 116 return _fvarIndexBuffers[fvarChannel].size(); │ │ │ │ │ - 117 } │ │ │ │ │ -118 const PatchParam *GetFVarPatchParamBuffer(int fvarChannel= 0) const { │ │ │ │ │ - 119 return &_fvarParamBuffers[fvarChannel][0]; │ │ │ │ │ - 120 } │ │ │ │ │ -121 size_t GetFVarPatchParamSize(int fvarChannel = 0) const { │ │ │ │ │ - 122 return _fvarParamBuffers[fvarChannel].size(); │ │ │ │ │ - 123 } │ │ │ │ │ - 124 │ │ │ │ │ - 125protected: │ │ │ │ │ -126 PatchArrayVector _patchArrays; │ │ │ │ │ -127 std::vector _indexBuffer; │ │ │ │ │ -128 PatchParamVector _patchParamBuffer; │ │ │ │ │ - 129 │ │ │ │ │ -130 PatchArrayVector _varyingPatchArrays; │ │ │ │ │ -131 std::vector _varyingIndexBuffer; │ │ │ │ │ - 132 │ │ │ │ │ -133 std::vector< PatchArrayVector > _fvarPatchArrays; │ │ │ │ │ -134 std::vector< std::vector > _fvarIndexBuffers; │ │ │ │ │ -135 std::vector< PatchParamVector > _fvarParamBuffers; │ │ │ │ │ - 136}; │ │ │ │ │ - 137 │ │ │ │ │ - 138} // end namespace Osd │ │ │ │ │ - 139 │ │ │ │ │ - 140} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 141using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 142 │ │ │ │ │ - 143} // end namespace OpenSubdiv │ │ │ │ │ - 144 │ │ │ │ │ - 145#endif // OPENSUBDIV3_OSD_CPU_PATCH_TABLE_H │ │ │ │ │ + 44// │ │ │ │ │ + 45// Loop traits: │ │ │ │ │ + 46// │ │ │ │ │ + 47template <> │ │ │ │ │ +48inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ +SPLIT_TO_TRIS; } │ │ │ │ │ + 49 │ │ │ │ │ + 50template <> │ │ │ │ │ +51inline int Scheme::GetRegularFaceSize() { return 3; } │ │ │ │ │ + 52 │ │ │ │ │ + 53template <> │ │ │ │ │ +54inline int Scheme::GetRegularVertexValence() { return 6; } │ │ │ │ │ + 55 │ │ │ │ │ + 56template <> │ │ │ │ │ +57inline int Scheme::GetLocalNeighborhoodSize() { return 1; } │ │ │ │ │ + 58 │ │ │ │ │ + 59 │ │ │ │ │ + 60// │ │ │ │ │ + 61// Protected methods to assign the two types of masks for an edge-vertex -- │ │ │ │ │ + 62// Crease and Smooth. │ │ │ │ │ + 63// │ │ │ │ │ + 64// The Crease case does not really need to be specialized, though it may be │ │ │ │ │ + 65// preferable to define all explicitly here. │ │ │ │ │ + 66// │ │ │ │ │ + 67template <> │ │ │ │ │ + 68template │ │ │ │ │ + 69inline void │ │ │ │ │ +70Scheme::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const │ │ │ │ │ + 71{ │ │ │ │ │ + 72 mask.SetNumVertexWeights(2); │ │ │ │ │ + 73 mask.SetNumEdgeWeights(0); │ │ │ │ │ + 74 mask.SetNumFaceWeights(0); │ │ │ │ │ + 75 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 76 │ │ │ │ │ + 77 mask.VertexWeight(0) = 0.5f; │ │ │ │ │ + 78 mask.VertexWeight(1) = 0.5f; │ │ │ │ │ + 79} │ │ │ │ │ + 80 │ │ │ │ │ + 81template <> │ │ │ │ │ + 82template │ │ │ │ │ + 83inline void │ │ │ │ │ +84Scheme::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) │ │ │ │ │ +const │ │ │ │ │ + 85{ │ │ │ │ │ + 86 int faceCount = edge.GetNumFaces(); │ │ │ │ │ + 87 │ │ │ │ │ + 88 mask.SetNumVertexWeights(2); │ │ │ │ │ + 89 mask.SetNumEdgeWeights(0); │ │ │ │ │ + 90 mask.SetNumFaceWeights(faceCount); │ │ │ │ │ + 91 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 92 │ │ │ │ │ + 93 // │ │ │ │ │ + 94 // This is where we run into the issue of "face weights" -- we want to │ │ │ │ │ +weight the │ │ │ │ │ + 95 // face-centers for Catmark, but face-centers are not generated for Loop. │ │ │ │ │ +So do │ │ │ │ │ + 96 // we make assumptions on how the mask is used, assign some property to the │ │ │ │ │ +mask │ │ │ │ │ + 97 // to indicate how they were assigned, or take input from the mask itself? │ │ │ │ │ + 98 // │ │ │ │ │ + 99 // Regardless, we have two choices: │ │ │ │ │ + 100 // - face-weights are for the vertices opposite the edge (as in Hbr): │ │ │ │ │ + 101 // vertex weights = 0.375f; │ │ │ │ │ + 102 // face weights = 0.125f; │ │ │ │ │ + 103 // │ │ │ │ │ + 104 // - face-weights are for the face centers: │ │ │ │ │ + 105 // vertex weights = 0.125f; │ │ │ │ │ + 106 // face weights = 0.375f; │ │ │ │ │ + 107 // │ │ │ │ │ + 108 // Coincidentally the coefficients are the same but reversed. │ │ │ │ │ + 109 // │ │ │ │ │ + 110 typedef typename MASK::Weight Weight; │ │ │ │ │ + 111 │ │ │ │ │ + 112 Weight vWeight = mask.AreFaceWeightsForFaceCenters() ? 0.125f : 0.375f; │ │ │ │ │ + 113 Weight fWeight = mask.AreFaceWeightsForFaceCenters() ? 0.375f : 0.125f; │ │ │ │ │ + 114 │ │ │ │ │ + 115 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 116 mask.VertexWeight(1) = vWeight; │ │ │ │ │ + 117 │ │ │ │ │ + 118 if (faceCount == 2) { │ │ │ │ │ + 119 mask.FaceWeight(0) = fWeight; │ │ │ │ │ + 120 mask.FaceWeight(1) = fWeight; │ │ │ │ │ + 121 } else { │ │ │ │ │ + 122 // The non-manifold case is not clearly defined -- we adjust the above │ │ │ │ │ + 123 // face-weight to preserve the ratio of edge-center and face-centers: │ │ │ │ │ + 124 fWeight *= 2.0f / (Weight) faceCount; │ │ │ │ │ + 125 for (int i = 0; i < faceCount; ++i) { │ │ │ │ │ + 126 mask.FaceWeight(i) = fWeight; │ │ │ │ │ + 127 } │ │ │ │ │ + 128 } │ │ │ │ │ + 129} │ │ │ │ │ + 130 │ │ │ │ │ + 131 │ │ │ │ │ + 132// │ │ │ │ │ + 133// Protected methods to assign the three types of masks for a vertex-vertex │ │ │ │ │ +-- │ │ │ │ │ + 134// Corner, Crease and Smooth (Dart is the same as Smooth). │ │ │ │ │ + 135// │ │ │ │ │ + 136// Corner and Crease do not really need to be specialized, though it may be │ │ │ │ │ + 137// preferable to define all explicitly here. │ │ │ │ │ + 138// │ │ │ │ │ + 139template <> │ │ │ │ │ + 140template │ │ │ │ │ + 141inline void │ │ │ │ │ +142Scheme::assignCornerMaskForVertex(VERTEX const&, MASK& mask) │ │ │ │ │ +const │ │ │ │ │ + 143{ │ │ │ │ │ + 144 mask.SetNumVertexWeights(1); │ │ │ │ │ + 145 mask.SetNumEdgeWeights(0); │ │ │ │ │ + 146 mask.SetNumFaceWeights(0); │ │ │ │ │ + 147 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 148 │ │ │ │ │ + 149 mask.VertexWeight(0) = 1.0f; │ │ │ │ │ + 150} │ │ │ │ │ + 151 │ │ │ │ │ + 152template <> │ │ │ │ │ + 153template │ │ │ │ │ + 154inline void │ │ │ │ │ +155Scheme::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& │ │ │ │ │ +mask, │ │ │ │ │ + 156 int const creaseEnds[2]) const { │ │ │ │ │ + 157 typedef typename MASK::Weight Weight; │ │ │ │ │ + 158 │ │ │ │ │ + 159 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 160 │ │ │ │ │ + 161 mask.SetNumVertexWeights(1); │ │ │ │ │ + 162 mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 163 mask.SetNumFaceWeights(0); │ │ │ │ │ + 164 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 165 │ │ │ │ │ + 166 Weight vWeight = 0.75f; │ │ │ │ │ + 167 Weight eWeight = 0.125f; │ │ │ │ │ + 168 │ │ │ │ │ + 169 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 170 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 171 mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 172 } │ │ │ │ │ + 173 mask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ + 174 mask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ + 175} │ │ │ │ │ + 176 │ │ │ │ │ + 177template <> │ │ │ │ │ + 178template │ │ │ │ │ + 179inline void │ │ │ │ │ +180Scheme::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& │ │ │ │ │ +mask) const │ │ │ │ │ + 181{ │ │ │ │ │ + 182 typedef typename MASK::Weight Weight; │ │ │ │ │ + 183 │ │ │ │ │ + 184 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 185 │ │ │ │ │ + 186 mask.SetNumVertexWeights(1); │ │ │ │ │ + 187 mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 188 mask.SetNumFaceWeights(0); │ │ │ │ │ + 189 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 190 │ │ │ │ │ + 191 // Specialize for the regular case: 1/16 per edge-vert, 5/8 for the vert │ │ │ │ │ +itself: │ │ │ │ │ + 192 Weight eWeight = (Weight) 0.0625f; │ │ │ │ │ + 193 Weight vWeight = (Weight) 0.625f; │ │ │ │ │ + 194 │ │ │ │ │ + 195 if (valence != 6) { │ │ │ │ │ + 196 // From HbrLoopSubdivision::Subdivide(mesh, vertex): │ │ │ │ │ + 197 // - could use some lookup tables here for common irregular valence (5, 7, │ │ │ │ │ +8) │ │ │ │ │ + 198 // or all of these cosine calls will be adding up... │ │ │ │ │ + 199 │ │ │ │ │ + 200 double dValence = (double) valence; │ │ │ │ │ + 201 double invValence = 1.0f / dValence; │ │ │ │ │ + 202 double cosTheta = std::cos(M_PI * 2.0f * invValence); │ │ │ │ │ + 203 │ │ │ │ │ + 204 double beta = 0.25f * cosTheta + 0.375f; │ │ │ │ │ + 205 │ │ │ │ │ + 206 eWeight = (Weight) ((0.625f - (beta * beta)) * invValence); │ │ │ │ │ + 207 vWeight = (Weight) (1.0f - (eWeight * dValence)); │ │ │ │ │ + 208 } │ │ │ │ │ + 209 │ │ │ │ │ + 210 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 211 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 212 mask.EdgeWeight(i) = eWeight; │ │ │ │ │ + 213 } │ │ │ │ │ + 214} │ │ │ │ │ + 215 │ │ │ │ │ + 216 │ │ │ │ │ + 217// │ │ │ │ │ + 218// Limit masks for position: │ │ │ │ │ + 219// │ │ │ │ │ + 220template <> │ │ │ │ │ + 221template │ │ │ │ │ + 222inline void │ │ │ │ │ +223Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& │ │ │ │ │ +posMask) const { │ │ │ │ │ + 224 │ │ │ │ │ + 225 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 226 posMask.SetNumEdgeWeights(0); │ │ │ │ │ + 227 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 228 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 229 │ │ │ │ │ + 230 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ + 231} │ │ │ │ │ + 232 │ │ │ │ │ + 233template <> │ │ │ │ │ + 234template │ │ │ │ │ + 235inline void │ │ │ │ │ +236Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask, │ │ │ │ │ + 237 int const creaseEnds[2]) const { │ │ │ │ │ + 238 │ │ │ │ │ + 239 typedef typename MASK::Weight Weight; │ │ │ │ │ + 240 │ │ │ │ │ + 241 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 242 │ │ │ │ │ + 243 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 244 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ + 245 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 246 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 247 │ │ │ │ │ + 248 // │ │ │ │ │ + 249 // The refinement mask for a crease vertex is (1/8, 3/4, 1/8) and for a │ │ │ │ │ +crease │ │ │ │ │ + 250 // edge is (1/2, 1/2) -- producing a uniform B-spline curve along the │ │ │ │ │ +crease │ │ │ │ │ + 251 // (boundary) whether the vertex or its crease is regular or not. The │ │ │ │ │ +limit │ │ │ │ │ + 252 // mask is therefore (1/6, 2/3, 1/6) for ALL cases. │ │ │ │ │ + 253 // │ │ │ │ │ + 254 // An alternative limit mask (1/5, 3/5, 1/5) is often published for use │ │ │ │ │ +either │ │ │ │ │ + 255 // for irregular crease vertices or for all crease/boundary vertices, but │ │ │ │ │ +this │ │ │ │ │ + 256 // is based on an alternate refinement mask for the edge -- (3/8, 5/8) │ │ │ │ │ +versus │ │ │ │ │ + 257 // the usual (1/2, 1/2) -- and will not produce the B-spline curve │ │ │ │ │ +desired. │ │ │ │ │ + 258 // │ │ │ │ │ + 259 Weight vWeight = (Weight) (4.0 / 6.0); │ │ │ │ │ + 260 Weight eWeight = (Weight) (1.0 / 6.0); │ │ │ │ │ + 261 │ │ │ │ │ + 262 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 263 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 264 posMask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 265 } │ │ │ │ │ + 266 posMask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ + 267 posMask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ + 268} │ │ │ │ │ + 269 │ │ │ │ │ + 270template <> │ │ │ │ │ + 271template │ │ │ │ │ + 272inline void │ │ │ │ │ +273Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask) const { │ │ │ │ │ + 274 │ │ │ │ │ + 275 typedef typename MASK::Weight Weight; │ │ │ │ │ + 276 │ │ │ │ │ + 277 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 278 │ │ │ │ │ + 279 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 280 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ + 281 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 282 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 283 │ │ │ │ │ + 284 // Specialize for the regular case: 1/12 per edge-vert, 1/2 for the vert │ │ │ │ │ +itself: │ │ │ │ │ + 285 if (valence == 6) { │ │ │ │ │ + 286 Weight eWeight = (Weight) (1.0 / 12.0); │ │ │ │ │ + 287 Weight vWeight = 0.5f; │ │ │ │ │ + 288 │ │ │ │ │ + 289 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 290 │ │ │ │ │ + 291 posMask.EdgeWeight(0) = eWeight; │ │ │ │ │ + 292 posMask.EdgeWeight(1) = eWeight; │ │ │ │ │ + 293 posMask.EdgeWeight(2) = eWeight; │ │ │ │ │ + 294 posMask.EdgeWeight(3) = eWeight; │ │ │ │ │ + 295 posMask.EdgeWeight(4) = eWeight; │ │ │ │ │ + 296 posMask.EdgeWeight(5) = eWeight; │ │ │ │ │ + 297 │ │ │ │ │ + 298 } else { │ │ │ │ │ + 299 double dValence = (double) valence; │ │ │ │ │ + 300 double invValence = 1.0f / dValence; │ │ │ │ │ + 301 double cosTheta = std::cos(M_PI * 2.0f * invValence); │ │ │ │ │ + 302 │ │ │ │ │ + 303 double beta = 0.25f * cosTheta + 0.375f; │ │ │ │ │ + 304 double gamma = (0.625f - (beta * beta)) * invValence; │ │ │ │ │ + 305 │ │ │ │ │ + 306 Weight eWeight = (Weight) (1.0f / (dValence + 3.0f / (8.0f * gamma))); │ │ │ │ │ + 307 Weight vWeight = (Weight) (1.0f - (eWeight * dValence)); │ │ │ │ │ + 308 │ │ │ │ │ + 309 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 310 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 311 posMask.EdgeWeight(i) = eWeight; │ │ │ │ │ + 312 } │ │ │ │ │ + 313 } │ │ │ │ │ + 314} │ │ │ │ │ + 315 │ │ │ │ │ + 316/* │ │ │ │ │ + 317// Limit masks for tangents: │ │ │ │ │ + 318// │ │ │ │ │ + 319// A note on tangent magnitudes: │ │ │ │ │ + 320// │ │ │ │ │ + 321// Several formulae exist for limit tangents at a vertex to accommodate the │ │ │ │ │ + 322// different topological configurations around the vertex. While these │ │ │ │ │ +produce │ │ │ │ │ + 323// the desired direction, there is inconsistency in the resulting │ │ │ │ │ +magnitudes. │ │ │ │ │ + 324// Ideally a regular mesh of uniformly shaped triangles with similar edge │ │ │ │ │ +lengths │ │ │ │ │ + 325// should produce tangents of similar magnitudes throughout -- including │ │ │ │ │ +corners │ │ │ │ │ + 326// and boundaries. So some of the common formulae for these are adjusted │ │ │ │ │ +with │ │ │ │ │ + 327// scale factors. │ │ │ │ │ + 328// │ │ │ │ │ + 329// For uses where magnitude does not matter, this scaling should be │ │ │ │ │ +irrelevant. │ │ │ │ │ + 330// But just as with patches, where the magnitudes of partial derivatives │ │ │ │ │ +are │ │ │ │ │ + 331// consistent between similar patches, the magnitudes of limit tangents │ │ │ │ │ +should │ │ │ │ │ + 332// also be similar. │ │ │ │ │ + 333// │ │ │ │ │ + 334// The reference tangents, in terms of magnitudes, are those produced by │ │ │ │ │ +the │ │ │ │ │ + 335// limit tangent mask for smooth interior vertices, for which well │ │ │ │ │ +established │ │ │ │ │ + 336// sin/cos formulae apply -- these remain unscaled. Formulae for the other │ │ │ │ │ + 337// crease/boundary, corner tangents and irregular cases are scaled to be │ │ │ │ │ +more │ │ │ │ │ + 338// consistent with these. │ │ │ │ │ + 339// │ │ │ │ │ + 340// The crease/boundary tangents for the regular case can be viewed as │ │ │ │ │ +derived │ │ │ │ │ + 341// from the smooth interior masks with two "phantom" points extrapolated │ │ │ │ │ +across │ │ │ │ │ + 342// the regular boundary: │ │ │ │ │ + 343// │ │ │ │ │ + 344// v3 v2 │ │ │ │ │ + 345// X - - - - - X │ │ │ │ │ + 346// / \ / \ │ │ │ │ │ + 347// / \ / \ │ │ │ │ │ + 348// v4 X - - - - - X - - - - - X v1 │ │ │ │ │ + 349// . . 0 . . │ │ │ │ │ + 350// . . . . │ │ │ │ │ + 351// . . . . │ │ │ │ │ + 352// (v5) (v6) │ │ │ │ │ + 353// │ │ │ │ │ + 354// where v5 = v0 + (v4 - v3) and v6 = v0 + v1 - v2. │ │ │ │ │ + 355// │ │ │ │ │ + 356// When the standard limit tangent mask is applied, the cosines of │ │ │ │ │ +increments │ │ │ │ │ + 357// of pi/3 give us coefficients that are multiples of 1/2, leading to the │ │ │ │ │ +first │ │ │ │ │ + 358// tangent T1 = 3/2 * (v1 - v4), rather than the widely used T1 = v1 - v4. │ │ │ │ │ +So │ │ │ │ │ + 359// this scale factor of 3/2 is applied to ensure tangents along the │ │ │ │ │ +boundaries │ │ │ │ │ + 360// are of similar magnitude as tangents in the immediate interior (which │ │ │ │ │ +may be │ │ │ │ │ + 361// parallel). │ │ │ │ │ + 362// │ │ │ │ │ + 363// Tangents at corners are essentially a form of boundary tangent, and so │ │ │ │ │ +its │ │ │ │ │ + 364// simple difference formula is scaled to be consistent with adjoining │ │ │ │ │ +boundary │ │ │ │ │ + 365// tangents -- not just with the 3/2 factor from above, but with an │ │ │ │ │ +additional │ │ │ │ │ + 366// 2.0 to compensate for the fact that the difference of only side of the │ │ │ │ │ +vertex │ │ │ │ │ + 367// is considered here. The resulting scale factor of 3.0 for the regular │ │ │ │ │ +corner │ │ │ │ │ + 368// is what similarly arises by extrapolating an interior region around the │ │ │ │ │ + 369// vertex and using the interior mask for the first tangent. │ │ │ │ │ + 370// │ │ │ │ │ + 371// The cross-tangent formula for the regular crease/boundary is similarly │ │ │ │ │ +found │ │ │ │ │ + 372// from the above construction of the boundary, but the commonly used │ │ │ │ │ +weights of │ │ │ │ │ + 373// +/- 1 and 2 result from omitting the common factor of sqrt(3)/2 (arising │ │ │ │ │ +from │ │ │ │ │ + 374// the sines of increments of pi/3). With that scale factor close to one, │ │ │ │ │ +it has │ │ │ │ │ + 375// less impact than the irregular cases, which are analogous to corner │ │ │ │ │ +tangents │ │ │ │ │ + 376// in that differences on only one side of the vertex are considered. While │ │ │ │ │ +a │ │ │ │ │ + 377// scaling of 3.0 is similarly understandable for the valence 2 and 3 │ │ │ │ │ +cases, it is │ │ │ │ │ + 378// less obvious in the irregular formula for valence > 4, but similarly │ │ │ │ │ +effective. │ │ │ │ │ + 379// │ │ │ │ │ + 380// The end result of these adjustments should be a set of limit tangents │ │ │ │ │ +that are │ │ │ │ │ + 381// of similar magnitude over a regular mesh including boundaries and │ │ │ │ │ +corners. │ │ │ │ │ + 382*/ │ │ │ │ │ + 383template <> │ │ │ │ │ + 384template │ │ │ │ │ + 385inline void │ │ │ │ │ +386Scheme::assignCornerLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 387 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 388 │ │ │ │ │ + 389 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 390 │ │ │ │ │ + 391 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 392 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 393 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ + 394 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 395 │ │ │ │ │ + 396 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 397 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 398 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ + 399 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 400 │ │ │ │ │ + 401 // See note above regarding scale factor of 3.0: │ │ │ │ │ + 402 tan1Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ + 403 tan1Mask.EdgeWeight(0) = 3.0f; │ │ │ │ │ + 404 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ + 405 │ │ │ │ │ + 406 tan2Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ + 407 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ + 408 tan2Mask.EdgeWeight(1) = 3.0f; │ │ │ │ │ + 409 │ │ │ │ │ + 410 // Should be at least 2 edges -- be sure to clear weights for any more: │ │ │ │ │ + 411 for (int i = 2; i < valence; ++i) { │ │ │ │ │ + 412 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 413 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 414 } │ │ │ │ │ + 415} │ │ │ │ │ + 416 │ │ │ │ │ + 417template <> │ │ │ │ │ + 418template │ │ │ │ │ + 419inline void │ │ │ │ │ +420Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 421 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const { │ │ │ │ │ + 422 │ │ │ │ │ + 423 typedef typename MASK::Weight Weight; │ │ │ │ │ + 424 │ │ │ │ │ + 425 // │ │ │ │ │ + 426 // First, the tangent along the crease: │ │ │ │ │ + 427 // The first crease edge is considered the "leading" edge of the span │ │ │ │ │ + 428 // of surface for which we are evaluating tangents and the second edge the │ │ │ │ │ + 429 // "trailing edge". By convention, the tangent along the crease is │ │ │ │ │ +oriented │ │ │ │ │ + 430 // in the direction of the leading edge. │ │ │ │ │ + 431 // │ │ │ │ │ + 432 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 433 │ │ │ │ │ + 434 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 435 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 436 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ + 437 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 438 │ │ │ │ │ + 439 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 440 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 441 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 442 } │ │ │ │ │ + 443 │ │ │ │ │ + 444 // See the note above regarding scale factor of 1.5: │ │ │ │ │ + 445 tan1Mask.EdgeWeight(creaseEnds[0]) = 1.5f; │ │ │ │ │ + 446 tan1Mask.EdgeWeight(creaseEnds[1]) = -1.5f; │ │ │ │ │ + 447 │ │ │ │ │ + 448 // │ │ │ │ │ + 449 // Second, the tangent across the interior faces: │ │ │ │ │ + 450 // Note this is ambiguous for an interior vertex. We currently return │ │ │ │ │ + 451 // the tangent for the surface in the counter-clockwise span between the │ │ │ │ │ + 452 // leading and trailing edges that form the crease. Given the expected │ │ │ │ │ + 453 // computation of a surface normal as Tan1 X Tan2, this tangent should be │ │ │ │ │ + 454 // oriented "inward" from the crease/boundary -- across the surface rather │ │ │ │ │ + 455 // than outward and away from it. │ │ │ │ │ + 456 // │ │ │ │ │ + 457 // There is inconsistency in the orientation of this tangent in commonly │ │ │ │ │ + 458 // published results: the general formula provided for arbitrary valence │ │ │ │ │ + 459 // has the tangent pointing across the crease and "outward" from the │ │ │ │ │ +surface, │ │ │ │ │ + 460 // while the special cases for regular valence and lower have the tangent │ │ │ │ │ + 461 // pointing across the surface and "inward" from the crease. So if we are │ │ │ │ │ + 462 // to consistently orient the first tangent along the crease, regardless │ │ │ │ │ +of │ │ │ │ │ + 463 // the interior topology, we have to correct this. With the first tangent │ │ │ │ │ + 464 // following the direction of the leading crease edge, we want the second │ │ │ │ │ + 465 // tangent pointing inward/across the surface -- so we flip the result of │ │ │ │ │ + 466 // the general formula. │ │ │ │ │ + 467 // │ │ │ │ │ + 468 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 469 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 470 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ + 471 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 472 │ │ │ │ │ + 473 for (int i = 0; i < creaseEnds[0]; ++i) { │ │ │ │ │ + 474 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 475 } │ │ │ │ │ + 476 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1; │ │ │ │ │ + 477 if (interiorEdgeCount == 2) { │ │ │ │ │ + 478 // See note above regarding scale factor of (sin(60 degs) == sqrt(3)/2: │ │ │ │ │ + 479 │ │ │ │ │ + 480 static Weight const Root3 = (Weight) 1.73205080756887729352; │ │ │ │ │ + 481 static Weight const Root3by2 = (Weight) (Root3 * 0.5); │ │ │ │ │ + 482 │ │ │ │ │ + 483 tan2Mask.VertexWeight(0) = -Root3; │ │ │ │ │ + 484 │ │ │ │ │ + 485 tan2Mask.EdgeWeight(creaseEnds[0]) = -Root3by2; │ │ │ │ │ + 486 tan2Mask.EdgeWeight(creaseEnds[1]) = -Root3by2; │ │ │ │ │ + 487 │ │ │ │ │ + 488 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = Root3; │ │ │ │ │ + 489 tan2Mask.EdgeWeight(creaseEnds[0] + 2) = Root3; │ │ │ │ │ + 490 } else if (interiorEdgeCount > 2) { │ │ │ │ │ + 491 // See notes above regarding scale factor of -3.0 (-1 for orientation, │ │ │ │ │ + 492 // 2.0 for considering the region as a half-disk, and 1.5 in keeping │ │ │ │ │ + 493 // with the crease tangent): │ │ │ │ │ + 494 │ │ │ │ │ + 495 double theta = M_PI / (interiorEdgeCount + 1); │ │ │ │ │ + 496 │ │ │ │ │ + 497 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 498 │ │ │ │ │ + 499 Weight cWeight = (Weight) (-3.0f * std::sin(theta)); │ │ │ │ │ + 500 tan2Mask.EdgeWeight(creaseEnds[0]) = cWeight; │ │ │ │ │ + 501 tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight; │ │ │ │ │ + 502 │ │ │ │ │ + 503 double eCoeff = -3.0f * 2.0f * (std::cos(theta) - 1.0f); │ │ │ │ │ + 504 for (int i = 1; i <= interiorEdgeCount; ++i) { │ │ │ │ │ + 505 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) (eCoeff * std::sin(i * │ │ │ │ │ +theta)); │ │ │ │ │ + 506 } │ │ │ │ │ + 507 } else if (interiorEdgeCount == 1) { │ │ │ │ │ + 508 // See notes above regarding scale factor of 3.0: │ │ │ │ │ + 509 │ │ │ │ │ + 510 tan2Mask.VertexWeight(0) = -3.0f; │ │ │ │ │ + 511 │ │ │ │ │ + 512 tan2Mask.EdgeWeight(creaseEnds[0]) = 0.0f; │ │ │ │ │ + 513 tan2Mask.EdgeWeight(creaseEnds[1]) = 0.0f; │ │ │ │ │ + 514 │ │ │ │ │ + 515 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = 3.0f; │ │ │ │ │ + 516 } else { │ │ │ │ │ + 517 // See notes above regarding scale factor of 3.0: │ │ │ │ │ + 518 │ │ │ │ │ + 519 tan2Mask.VertexWeight(0) = -6.0f; │ │ │ │ │ + 520 │ │ │ │ │ + 521 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f; │ │ │ │ │ + 522 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f; │ │ │ │ │ + 523 } │ │ │ │ │ + 524 for (int i = creaseEnds[1] + 1; i < valence; ++i) { │ │ │ │ │ + 525 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 526 } │ │ │ │ │ + 527} │ │ │ │ │ + 528 │ │ │ │ │ + 529template <> │ │ │ │ │ + 530template │ │ │ │ │ + 531inline void │ │ │ │ │ +532Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 533 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 534 │ │ │ │ │ + 535 typedef typename MASK::Weight Weight; │ │ │ │ │ + 536 │ │ │ │ │ + 537 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 538 │ │ │ │ │ + 539 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 540 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 541 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ + 542 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 543 │ │ │ │ │ + 544 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 545 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 546 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ + 547 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 548 │ │ │ │ │ + 549 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 550 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 551 │ │ │ │ │ + 552 if (valence == 6) { │ │ │ │ │ + 553 static Weight const Root3by2 = (Weight)(0.5 * 1.73205080756887729352); │ │ │ │ │ + 554 │ │ │ │ │ + 555 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ + 556 tan1Mask.EdgeWeight(1) = 0.5f; │ │ │ │ │ + 557 tan1Mask.EdgeWeight(2) = -0.5f; │ │ │ │ │ + 558 tan1Mask.EdgeWeight(3) = -1.0f; │ │ │ │ │ + 559 tan1Mask.EdgeWeight(4) = -0.5f; │ │ │ │ │ + 560 tan1Mask.EdgeWeight(5) = 0.5f; │ │ │ │ │ + 561 │ │ │ │ │ + 562 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ + 563 tan2Mask.EdgeWeight(1) = Root3by2; │ │ │ │ │ + 564 tan2Mask.EdgeWeight(2) = Root3by2; │ │ │ │ │ + 565 tan2Mask.EdgeWeight(3) = 0.0f; │ │ │ │ │ + 566 tan2Mask.EdgeWeight(4) = -Root3by2; │ │ │ │ │ + 567 tan2Mask.EdgeWeight(5) = -Root3by2; │ │ │ │ │ + 568 } else { │ │ │ │ │ + 569 double alpha = 2.0f * M_PI / valence; │ │ │ │ │ + 570 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 571 double alphaI = alpha * i; │ │ │ │ │ + 572 tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI); │ │ │ │ │ + 573 tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI); │ │ │ │ │ + 574 } │ │ │ │ │ + 575 } │ │ │ │ │ + 576} │ │ │ │ │ + 577 │ │ │ │ │ + 578} // end namespace Sdc │ │ │ │ │ + 579} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 580using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 581} // end namespace OpenSubdiv │ │ │ │ │ + 582 │ │ │ │ │ + 583#endif /* OPENSUBDIV3_SDC_LOOP_SCHEME_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParamVector │ │ │ │ │ -std::vector< PatchParam > PatchParamVector │ │ │ │ │ -Definition: types.h:133 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector │ │ │ │ │ -std::vector< PatchArray > PatchArrayVector │ │ │ │ │ -Definition: types.h:132 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable │ │ │ │ │ -Container for arrays of parametric patches. │ │ │ │ │ -Definition: patchTable.h:55 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable │ │ │ │ │ -Cpu patch table. │ │ │ │ │ -Definition: cpuPatchTable.h:59 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchArrayBuffer │ │ │ │ │ -const PatchArray * GetFVarPatchArrayBuffer(int fvarChannel=0) const │ │ │ │ │ -Definition: cpuPatchTable.h:109 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchIndexBuffer │ │ │ │ │ -const int * GetVaryingPatchIndexBuffer() const │ │ │ │ │ -Definition: cpuPatchTable.h:96 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_varyingIndexBuffer │ │ │ │ │ -std::vector< int > _varyingIndexBuffer │ │ │ │ │ -Definition: cpuPatchTable.h:131 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchParamSize │ │ │ │ │ -size_t GetFVarPatchParamSize(int fvarChannel=0) const │ │ │ │ │ -Definition: cpuPatchTable.h:121 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::~CpuPatchTable │ │ │ │ │ -~CpuPatchTable() │ │ │ │ │ -Definition: cpuPatchTable.h:68 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_patchParamBuffer │ │ │ │ │ -PatchParamVector _patchParamBuffer │ │ │ │ │ -Definition: cpuPatchTable.h:128 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchIndexBuffer │ │ │ │ │ -const int * GetPatchIndexBuffer() const │ │ │ │ │ -Definition: cpuPatchTable.h:73 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::Create │ │ │ │ │ -static CpuPatchTable * Create(const Far::PatchTable *patchTable, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Definition: cpuPatchTable.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarParamBuffers │ │ │ │ │ -std::vector< PatchParamVector > _fvarParamBuffers │ │ │ │ │ -Definition: cpuPatchTable.h:135 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::CpuPatchTable │ │ │ │ │ -CpuPatchTable(const Far::PatchTable *patchTable) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarIndexBuffers │ │ │ │ │ -std::vector< std::vector< int > > _fvarIndexBuffers │ │ │ │ │ -Definition: cpuPatchTable.h:134 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchIndexSize │ │ │ │ │ -size_t GetPatchIndexSize() const │ │ │ │ │ -Definition: cpuPatchTable.h:83 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_patchArrays │ │ │ │ │ -PatchArrayVector _patchArrays │ │ │ │ │ -Definition: cpuPatchTable.h:126 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchParamBuffer │ │ │ │ │ -const PatchParam * GetPatchParamBuffer() const │ │ │ │ │ -Definition: cpuPatchTable.h:76 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_indexBuffer │ │ │ │ │ -std::vector< int > _indexBuffer │ │ │ │ │ -Definition: cpuPatchTable.h:127 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchIndexSize │ │ │ │ │ -size_t GetFVarPatchIndexSize(int fvarChannel=0) const │ │ │ │ │ -Definition: cpuPatchTable.h:115 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchIndexBuffer │ │ │ │ │ -const int * GetFVarPatchIndexBuffer(int fvarChannel=0) const │ │ │ │ │ -Definition: cpuPatchTable.h:112 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetFVarPatchParamBuffer │ │ │ │ │ -const PatchParam * GetFVarPatchParamBuffer(int fvarChannel=0) const │ │ │ │ │ -Definition: cpuPatchTable.h:118 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchParamSize │ │ │ │ │ -size_t GetPatchParamSize() const │ │ │ │ │ -Definition: cpuPatchTable.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchIndexSize │ │ │ │ │ -size_t GetVaryingPatchIndexSize() const │ │ │ │ │ -Definition: cpuPatchTable.h:102 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetVaryingPatchArrayBuffer │ │ │ │ │ -const PatchArray * GetVaryingPatchArrayBuffer() const │ │ │ │ │ -Definition: cpuPatchTable.h:90 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetNumFVarChannels │ │ │ │ │ -int GetNumFVarChannels() const │ │ │ │ │ -Definition: cpuPatchTable.h:106 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetNumPatchArrays │ │ │ │ │ -size_t GetNumPatchArrays() const │ │ │ │ │ -Definition: cpuPatchTable.h:80 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::GetPatchArrayBuffer │ │ │ │ │ -const PatchArray * GetPatchArrayBuffer() const │ │ │ │ │ -Definition: cpuPatchTable.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_varyingPatchArrays │ │ │ │ │ -PatchArrayVector _varyingPatchArrays │ │ │ │ │ -Definition: cpuPatchTable.h:130 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuPatchTable::_fvarPatchArrays │ │ │ │ │ -std::vector< PatchArrayVector > _fvarPatchArrays │ │ │ │ │ -Definition: cpuPatchTable.h:133 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ -Definition: types.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ -Definition: types.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ +Split │ │ │ │ │ +Enumerated type for all face splitting schemes. │ │ │ │ │ +Definition: types.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_TRIS │ │ │ │ │ +@ SPLIT_TO_TRIS │ │ │ │ │ +Used by Loop. │ │ │ │ │ +Definition: types.h:49 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForEdge │ │ │ │ │ +void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ +static Split GetTopologicalSplitType() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForVertex │ │ │ │ │ +void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const │ │ │ │ │ +creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ +void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2, int const creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ +static int GetRegularFaceSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForEdge │ │ │ │ │ +void assignCreaseMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ +Definition: scheme.h:317 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ +void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ +static int GetLocalNeighborhoodSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerMaskForVertex │ │ │ │ │ +void assignCornerMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ +Definition: scheme.h:331 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ +void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ +creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForVertex │ │ │ │ │ +void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ +static int GetRegularVertexValence() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ +void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ +void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ +void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuPatchTable.h │ │ │ │ │ + * sdc │ │ │ │ │ + * loopScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00896.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuEvaluator.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/sdc/crease.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -83,42 +83,41 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
cpuEvaluator.h File Reference
│ │ │ │ +
crease.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../osd/bufferDescriptor.h"
│ │ │ │ -#include "../osd/types.h"
│ │ │ │ -#include <cstddef>
│ │ │ │ +#include "../sdc/options.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  CpuEvaluator
class  Crease
 Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,27 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -cpuEvaluator.h File Reference │ │ │ │ │ +crease.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include "../osd/bufferDescriptor.h" │ │ │ │ │ -#include "../osd/types.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../sdc/options.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  CpuEvaluator │ │ │ │ │ +class  Crease │ │ │ │ │ +  Types, constants and utilities related to semi-sharp creasing – whose │ │ │ │ │ + implementation is independent of the subdivision scheme. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuEvaluator.h │ │ │ │ │ + * sdc │ │ │ │ │ + * crease.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00896.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ │ var a00896 = [ │ │ │ │ │ - ["CpuEvaluator", "a01157.html", null] │ │ │ │ │ + ["Crease", "a01325.html", "a01325"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00896_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cpuEvaluator.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/sdc/crease.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cpuEvaluator.h
│ │ │ │ +
crease.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,502 +106,205 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │ -
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29#include "../osd/bufferDescriptor.h"
│ │ │ │ -
30#include "../osd/types.h"
│ │ │ │ -
31
│ │ │ │ -
32#include <cstddef>
│ │ │ │ +
24#ifndef OPENSUBDIV3_SDC_CREASE_H
│ │ │ │ +
25#define OPENSUBDIV3_SDC_CREASE_H
│ │ │ │ +
26
│ │ │ │ +
27#include "../version.h"
│ │ │ │ +
28
│ │ │ │ +
29#include "../sdc/options.h"
│ │ │ │ +
30
│ │ │ │ +
31namespace OpenSubdiv {
│ │ │ │ +
32namespace OPENSUBDIV_VERSION {
│ │ │ │
33
│ │ │ │ -
34namespace OpenSubdiv {
│ │ │ │ -
35namespace OPENSUBDIV_VERSION {
│ │ │ │ -
36
│ │ │ │ -
37namespace Osd {
│ │ │ │ -
38
│ │ │ │ - │ │ │ │ -
40public:
│ │ │ │ -
46
│ │ │ │ -
71 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
72 static bool EvalStencils(
│ │ │ │ -
73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
75 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
76 const CpuEvaluator *instance = NULL,
│ │ │ │ -
77 void * deviceContext = NULL) {
│ │ │ │ -
78
│ │ │ │ -
79 (void)instance; // unused
│ │ │ │ -
80 (void)deviceContext; // unused
│ │ │ │ -
81
│ │ │ │ -
82 if (stencilTable->GetNumStencils() == 0)
│ │ │ │ -
83 return false;
│ │ │ │ -
84
│ │ │ │ -
85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
86 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
87 &stencilTable->GetSizes()[0],
│ │ │ │ -
88 &stencilTable->GetOffsets()[0],
│ │ │ │ -
89 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
90 &stencilTable->GetWeights()[0],
│ │ │ │ -
91 /*start = */ 0,
│ │ │ │ -
92 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
93 }
│ │ │ │ +
34namespace Sdc {
│ │ │ │ +
35
│ │ │ │ +
61
│ │ │ │ +
62class Crease {
│ │ │ │ +
63public:
│ │ │ │ +
65
│ │ │ │ +
67 static float const SHARPNESS_SMOOTH; // = 0.0f, do we really need this?
│ │ │ │ +
68 static float const SHARPNESS_INFINITE; // = 10.0f;
│ │ │ │ +
69
│ │ │ │ +
70 static bool IsSmooth(float sharpness) { return sharpness <= SHARPNESS_SMOOTH; }
│ │ │ │ +
71 static bool IsSharp(float sharpness) { return sharpness > SHARPNESS_SMOOTH; }
│ │ │ │ +
72 static bool IsInfinite(float sharpness) { return sharpness >= SHARPNESS_INFINITE; }
│ │ │ │ +
73 static bool IsSemiSharp(float sharpness) { return (SHARPNESS_SMOOTH < sharpness) && (sharpness < SHARPNESS_INFINITE); }
│ │ │ │ +
75
│ │ │ │ +
82 enum Rule {
│ │ │ │ + │ │ │ │ +
84 RULE_SMOOTH = (1 << 0),
│ │ │ │ +
85 RULE_DART = (1 << 1),
│ │ │ │ +
86 RULE_CREASE = (1 << 2),
│ │ │ │ +
87 RULE_CORNER = (1 << 3)
│ │ │ │ +
88 };
│ │ │ │ +
89
│ │ │ │ +
90public:
│ │ │ │ +
91 Crease() : _options() { }
│ │ │ │ +
92 Crease(Options const& options) : _options(options) { }
│ │ │ │ +
93 ~Crease() { }
│ │ │ │
94
│ │ │ │ -
121 static bool EvalStencils(
│ │ │ │ -
122 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
123 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
124 const int * sizes,
│ │ │ │ -
125 const int * offsets,
│ │ │ │ -
126 const int * indices,
│ │ │ │ -
127 const float * weights,
│ │ │ │ -
128 int start, int end);
│ │ │ │ -
129
│ │ │ │ -
167 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
168 static bool EvalStencils(
│ │ │ │ -
169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
173 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
174 const CpuEvaluator *instance = NULL,
│ │ │ │ -
175 void * deviceContext = NULL) {
│ │ │ │ +
95 bool IsUniform() const { return _options.GetCreasingMethod() == Options::CREASE_UNIFORM; }
│ │ │ │ +
96
│ │ │ │ +
98
│ │ │ │ +
104 float SharpenBoundaryEdge(float edgeSharpness) const;
│ │ │ │ +
105 float SharpenBoundaryVertex(float edgeSharpness) const;
│ │ │ │ +
106
│ │ │ │ +
107 // For future consideration
│ │ │ │ +
108 //float SharpenNonManifoldEdge(float edgeSharpness) const;
│ │ │ │ +
109 //float SharpenNonManifoldVertex(float edgeSharpness) const;
│ │ │ │ +
111
│ │ │ │ +
113
│ │ │ │ +
124 float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const;
│ │ │ │ +
125
│ │ │ │ +
126 float SubdivideVertexSharpness(float vertexSharpness) const;
│ │ │ │ +
127
│ │ │ │ +
128 float SubdivideEdgeSharpnessAtVertex(float edgeSharpness,
│ │ │ │ +
129 int incidentEdgeCountAtEndVertex,
│ │ │ │ +
130 float const* edgeSharpnessAroundEndVertex) const;
│ │ │ │ +
131
│ │ │ │ +
132 void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex,
│ │ │ │ +
133 float const* incidentEdgeSharpnessAroundVertex,
│ │ │ │ +
134 float* childEdgesSharpnessAroundVertex) const;
│ │ │ │ +
136
│ │ │ │ +
138
│ │ │ │ +
144 Rule DetermineVertexVertexRule(float vertexSharpness,
│ │ │ │ +
145 int incidentEdgeCount,
│ │ │ │ +
146 float const* incidentEdgeSharpness) const;
│ │ │ │ +
147 Rule DetermineVertexVertexRule(float vertexSharpness,
│ │ │ │ +
148 int sharpEdgeCount) const;
│ │ │ │ +
150
│ │ │ │ +
162 float ComputeFractionalWeightAtVertex(float vertexSharpness,
│ │ │ │ +
163 float childVertexSharpness,
│ │ │ │ +
164 int incidentEdgeCount,
│ │ │ │ +
165 float const* incidentEdgeSharpness,
│ │ │ │ +
166 float const* childEdgesSharpness) const;
│ │ │ │ +
167
│ │ │ │ +
168 void GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness,
│ │ │ │ +
169 int incidentEdgeCount,
│ │ │ │ +
170 int sharpEdgePair[2]) const;
│ │ │ │ +
171
│ │ │ │ +
172 // Would these really help? Maybe only need Rules for the vertex-vertex case...
│ │ │ │ +
173 //
│ │ │ │ +
174 // Rule DetermineEdgeVertexRule(float parentEdgeSharpness) const;
│ │ │ │ +
175 // Rule DetermineEdgeVertexRule(float childEdge1Sharpness, float childEdge2Sharpness) const;
│ │ │ │
176
│ │ │ │ -
177 (void)instance; // unused
│ │ │ │ -
178 (void)deviceContext; // unused
│ │ │ │ +
177protected:
│ │ │ │ +
178 float decrementSharpness(float sharpness) const;
│ │ │ │
179
│ │ │ │ -
180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
181 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
182 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
183 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
184 &stencilTable->GetSizes()[0],
│ │ │ │ -
185 &stencilTable->GetOffsets()[0],
│ │ │ │ -
186 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
187 &stencilTable->GetWeights()[0],
│ │ │ │ -
188 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
189 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
190 /*start = */ 0,
│ │ │ │ -
191 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
192 }
│ │ │ │ -
193
│ │ │ │ -
234 static bool EvalStencils(
│ │ │ │ -
235 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
236 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
237 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
238 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
239 const int * sizes,
│ │ │ │ -
240 const int * offsets,
│ │ │ │ -
241 const int * indices,
│ │ │ │ -
242 const float * weights,
│ │ │ │ -
243 const float * duWeights,
│ │ │ │ -
244 const float * dvWeights,
│ │ │ │ -
245 int start, int end);
│ │ │ │ +
180private:
│ │ │ │ +
181 Options _options;
│ │ │ │ +
182};
│ │ │ │ +
183
│ │ │ │ +
184
│ │ │ │ +
185//
│ │ │ │ +
186// Inline declarations:
│ │ │ │ +
187//
│ │ │ │ +
188inline float
│ │ │ │ +
189Crease::SharpenBoundaryEdge(float /* edgeSharpness */) const {
│ │ │ │ +
190
│ │ │ │ +
191 //
│ │ │ │ +
192 // Despite the presence of the BOUNDARY_NONE option, boundary edges are always sharpened.
│ │ │ │ +
193 // Much of the code relies on sharpness to indicate boundaries to avoid the more complex
│ │ │ │ +
194 // topological inspection
│ │ │ │ +
195 //
│ │ │ │ +
196 return SHARPNESS_INFINITE;
│ │ │ │ +
197}
│ │ │ │ +
198
│ │ │ │ +
199inline float
│ │ │ │ +
200Crease::SharpenBoundaryVertex(float vertexSharpness) const {
│ │ │ │ +
201
│ │ │ │ + │ │ │ │ +
203 SHARPNESS_INFINITE : vertexSharpness;
│ │ │ │ +
204}
│ │ │ │ +
205
│ │ │ │ +
206inline float
│ │ │ │ +
207Crease::decrementSharpness(float sharpness) const {
│ │ │ │ +
208
│ │ │ │ +
209 if (IsSmooth(sharpness)) return Crease::SHARPNESS_SMOOTH; // redundant but most common
│ │ │ │ +
210 if (IsInfinite(sharpness)) return Crease::SHARPNESS_INFINITE;
│ │ │ │ +
211 if (sharpness > 1.0f) return (sharpness - 1.0f);
│ │ │ │ + │ │ │ │ +
213}
│ │ │ │ +
214
│ │ │ │ +
215inline float
│ │ │ │ +
216Crease::SubdivideUniformSharpness(float vertexOrEdgeSharpness) const {
│ │ │ │ +
217
│ │ │ │ +
218 return decrementSharpness(vertexOrEdgeSharpness);
│ │ │ │ +
219}
│ │ │ │ +
220
│ │ │ │ +
221inline float
│ │ │ │ +
222Crease::SubdivideVertexSharpness(float vertexSharpness) const {
│ │ │ │ +
223
│ │ │ │ +
224 return decrementSharpness(vertexSharpness);
│ │ │ │ +
225}
│ │ │ │ +
226
│ │ │ │ +
227inline void
│ │ │ │ +
228Crease::GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, int incidentEdgeCount,
│ │ │ │ +
229 int sharpEdgePair[2]) const {
│ │ │ │ +
230
│ │ │ │ +
231 // Only to be called when a crease is present at a vertex -- exactly two sharp
│ │ │ │ +
232 // edges are expected here:
│ │ │ │ +
233 //
│ │ │ │ +
234 sharpEdgePair[0] = 0;
│ │ │ │ +
235 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[0]])) ++ sharpEdgePair[0];
│ │ │ │ +
236
│ │ │ │ +
237 sharpEdgePair[1] = incidentEdgeCount - 1;
│ │ │ │ +
238 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[1]])) -- sharpEdgePair[1];
│ │ │ │ +
239}
│ │ │ │ +
240
│ │ │ │ +
241} // end namespace sdc
│ │ │ │ +
242
│ │ │ │ +
243} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
244using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
245} // end namespace OpenSubdiv
│ │ │ │
246
│ │ │ │ -
302 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
│ │ │ │ -
303 static bool EvalStencils(
│ │ │ │ -
304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
311 STENCIL_TABLE const *stencilTable,
│ │ │ │ -
312 const CpuEvaluator *instance = NULL,
│ │ │ │ -
313 void * deviceContext = NULL) {
│ │ │ │ -
314
│ │ │ │ -
315 (void)instance; // unused
│ │ │ │ -
316 (void)deviceContext; // unused
│ │ │ │ -
317
│ │ │ │ -
318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
319 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
320 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
321 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
322 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
323 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
324 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
325 &stencilTable->GetSizes()[0],
│ │ │ │ -
326 &stencilTable->GetOffsets()[0],
│ │ │ │ -
327 &stencilTable->GetControlIndices()[0],
│ │ │ │ -
328 &stencilTable->GetWeights()[0],
│ │ │ │ -
329 &stencilTable->GetDuWeights()[0],
│ │ │ │ -
330 &stencilTable->GetDvWeights()[0],
│ │ │ │ -
331 &stencilTable->GetDuuWeights()[0],
│ │ │ │ -
332 &stencilTable->GetDuvWeights()[0],
│ │ │ │ -
333 &stencilTable->GetDvvWeights()[0],
│ │ │ │ -
334 /*start = */ 0,
│ │ │ │ -
335 /*end = */ stencilTable->GetNumStencils());
│ │ │ │ -
336 }
│ │ │ │ -
337
│ │ │ │ -
399 static bool EvalStencils(
│ │ │ │ -
400 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
401 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
402 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
403 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
404 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
405 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
406 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
407 const int * sizes,
│ │ │ │ -
408 const int * offsets,
│ │ │ │ -
409 const int * indices,
│ │ │ │ -
410 const float * weights,
│ │ │ │ -
411 const float * duWeights,
│ │ │ │ -
412 const float * dvWeights,
│ │ │ │ -
413 const float * duuWeights,
│ │ │ │ -
414 const float * duvWeights,
│ │ │ │ -
415 const float * dvvWeights,
│ │ │ │ -
416 int start, int end);
│ │ │ │ -
417
│ │ │ │ -
423
│ │ │ │ -
452 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
453 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
454 static bool EvalPatches(
│ │ │ │ -
455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
457 int numPatchCoords,
│ │ │ │ -
458 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
459 PATCH_TABLE *patchTable,
│ │ │ │ -
460 CpuEvaluator const *instance = NULL,
│ │ │ │ -
461 void * deviceContext = NULL) {
│ │ │ │ -
462
│ │ │ │ -
463 (void)instance; // unused
│ │ │ │ -
464 (void)deviceContext; // unused
│ │ │ │ -
465
│ │ │ │ -
466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
467 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
468 numPatchCoords,
│ │ │ │ -
469 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
470 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
471 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
472 patchTable->GetPatchParamBuffer());
│ │ │ │ -
473 }
│ │ │ │ -
474
│ │ │ │ -
515 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
516 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
517 static bool EvalPatches(
│ │ │ │ -
518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
522 int numPatchCoords,
│ │ │ │ -
523 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
524 PATCH_TABLE *patchTable,
│ │ │ │ -
525 CpuEvaluator const *instance = NULL,
│ │ │ │ -
526 void * deviceContext = NULL) {
│ │ │ │ -
527
│ │ │ │ -
528 (void)instance; // unused
│ │ │ │ -
529 (void)deviceContext; // unused
│ │ │ │ -
530
│ │ │ │ -
531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
532 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
533 // so that downcast isn't needed there.
│ │ │ │ -
534 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
535 //
│ │ │ │ -
536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
537 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
538 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
539 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
540 numPatchCoords,
│ │ │ │ -
541 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
542 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
543 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
544 patchTable->GetPatchParamBuffer());
│ │ │ │ -
545 }
│ │ │ │ -
546
│ │ │ │ -
605 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
606 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ -
607 static bool EvalPatches(
│ │ │ │ -
608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
615 int numPatchCoords,
│ │ │ │ -
616 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
617 PATCH_TABLE *patchTable,
│ │ │ │ -
618 CpuEvaluator const *instance = NULL,
│ │ │ │ -
619 void * deviceContext = NULL) {
│ │ │ │ -
620
│ │ │ │ -
621 (void)instance; // unused
│ │ │ │ -
622 (void)deviceContext; // unused
│ │ │ │ -
623
│ │ │ │ -
624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop.
│ │ │ │ -
625 // ideally all buffer classes should have templated by datatype
│ │ │ │ -
626 // so that downcast isn't needed there.
│ │ │ │ -
627 // (e.g. Osd::CpuBuffer<PatchCoord> )
│ │ │ │ -
628 //
│ │ │ │ -
629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
630 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
631 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
632 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
633 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
634 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
635 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
636 numPatchCoords,
│ │ │ │ -
637 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
638 patchTable->GetPatchArrayBuffer(),
│ │ │ │ -
639 patchTable->GetPatchIndexBuffer(),
│ │ │ │ -
640 patchTable->GetPatchParamBuffer());
│ │ │ │ -
641 }
│ │ │ │ -
642
│ │ │ │ -
670 static bool EvalPatches(
│ │ │ │ -
671 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
672 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
673 int numPatchCoords,
│ │ │ │ -
674 const PatchCoord *patchCoords,
│ │ │ │ -
675 const PatchArray *patchArrays,
│ │ │ │ -
676 const int *patchIndexBuffer,
│ │ │ │ -
677 const PatchParam *patchParamBuffer);
│ │ │ │ -
678
│ │ │ │ -
716 static bool EvalPatches(
│ │ │ │ -
717 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
718 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
719 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
720 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
721 int numPatchCoords,
│ │ │ │ -
722 PatchCoord const *patchCoords,
│ │ │ │ -
723 PatchArray const *patchArrays,
│ │ │ │ -
724 const int *patchIndexBuffer,
│ │ │ │ -
725 PatchParam const *patchParamBuffer);
│ │ │ │ -
726
│ │ │ │ -
779 static bool EvalPatches(
│ │ │ │ -
780 const float *src, BufferDescriptor const &srcDesc,
│ │ │ │ -
781 float *dst, BufferDescriptor const &dstDesc,
│ │ │ │ -
782 float *du, BufferDescriptor const &duDesc,
│ │ │ │ -
783 float *dv, BufferDescriptor const &dvDesc,
│ │ │ │ -
784 float *duu, BufferDescriptor const &duuDesc,
│ │ │ │ -
785 float *duv, BufferDescriptor const &duvDesc,
│ │ │ │ -
786 float *dvv, BufferDescriptor const &dvvDesc,
│ │ │ │ -
787 int numPatchCoords,
│ │ │ │ -
788 PatchCoord const *patchCoords,
│ │ │ │ -
789 PatchArray const *patchArrays,
│ │ │ │ -
790 const int *patchIndexBuffer,
│ │ │ │ -
791 PatchParam const *patchParamBuffer);
│ │ │ │ -
792
│ │ │ │ -
821 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
822 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
826 int numPatchCoords,
│ │ │ │ -
827 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
828 PATCH_TABLE *patchTable,
│ │ │ │ -
829 CpuEvaluator const *instance = NULL,
│ │ │ │ -
830 void * deviceContext = NULL) {
│ │ │ │ -
831
│ │ │ │ -
832 (void)instance; // unused
│ │ │ │ -
833 (void)deviceContext; // unused
│ │ │ │ -
834
│ │ │ │ -
835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
836 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
837 numPatchCoords,
│ │ │ │ -
838 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
839 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
840 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
841 patchTable->GetPatchParamBuffer());
│ │ │ │ -
842 }
│ │ │ │ -
843
│ │ │ │ -
884 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
885 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
891 int numPatchCoords,
│ │ │ │ -
892 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
893 PATCH_TABLE *patchTable,
│ │ │ │ -
894 CpuEvaluator const *instance = NULL,
│ │ │ │ -
895 void * deviceContext = NULL) {
│ │ │ │ -
896
│ │ │ │ -
897 (void)instance; // unused
│ │ │ │ -
898 (void)deviceContext; // unused
│ │ │ │ -
899
│ │ │ │ -
900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
901 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
902 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
903 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
904 numPatchCoords,
│ │ │ │ -
905 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
906 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
907 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
908 patchTable->GetPatchParamBuffer());
│ │ │ │ -
909 }
│ │ │ │ -
910
│ │ │ │ -
969 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
970 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
979 int numPatchCoords,
│ │ │ │ -
980 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
981 PATCH_TABLE *patchTable,
│ │ │ │ -
982 CpuEvaluator const *instance = NULL,
│ │ │ │ -
983 void * deviceContext = NULL) {
│ │ │ │ -
984
│ │ │ │ -
985 (void)instance; // unused
│ │ │ │ -
986 (void)deviceContext; // unused
│ │ │ │ -
987
│ │ │ │ -
988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
989 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
990 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
991 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
992 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
993 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
994 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
995 numPatchCoords,
│ │ │ │ -
996 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
997 patchTable->GetVaryingPatchArrayBuffer(),
│ │ │ │ -
998 patchTable->GetVaryingPatchIndexBuffer(),
│ │ │ │ -
999 patchTable->GetPatchParamBuffer());
│ │ │ │ -
1000 }
│ │ │ │ -
1001
│ │ │ │ -
1032 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1033 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1037 int numPatchCoords,
│ │ │ │ -
1038 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1039 PATCH_TABLE *patchTable,
│ │ │ │ -
1040 int fvarChannel,
│ │ │ │ -
1041 CpuEvaluator const *instance = NULL,
│ │ │ │ -
1042 void * deviceContext = NULL) {
│ │ │ │ -
1043
│ │ │ │ -
1044 (void)instance; // unused
│ │ │ │ -
1045 (void)deviceContext; // unused
│ │ │ │ -
1046
│ │ │ │ -
1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1048 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1049 numPatchCoords,
│ │ │ │ -
1050 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1053 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1054 }
│ │ │ │ -
1055
│ │ │ │ -
1098 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1099 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1105 int numPatchCoords,
│ │ │ │ -
1106 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1107 PATCH_TABLE *patchTable,
│ │ │ │ -
1108 int fvarChannel,
│ │ │ │ -
1109 CpuEvaluator const *instance = NULL,
│ │ │ │ -
1110 void * deviceContext = NULL) {
│ │ │ │ -
1111
│ │ │ │ -
1112 (void)instance; // unused
│ │ │ │ -
1113 (void)deviceContext; // unused
│ │ │ │ -
1114
│ │ │ │ -
1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1116 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1117 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1118 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1119 numPatchCoords,
│ │ │ │ -
1120 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1123 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1124 }
│ │ │ │ -
1125
│ │ │ │ -
1186 template <typename SRC_BUFFER, typename DST_BUFFER,
│ │ │ │ -
1187 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
│ │ │ │ - │ │ │ │ -
1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
│ │ │ │ -
1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
│ │ │ │ -
1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
│ │ │ │ -
1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
│ │ │ │ -
1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
│ │ │ │ -
1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
│ │ │ │ -
1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
│ │ │ │ -
1196 int numPatchCoords,
│ │ │ │ -
1197 PATCHCOORD_BUFFER *patchCoords,
│ │ │ │ -
1198 PATCH_TABLE *patchTable,
│ │ │ │ -
1199 int fvarChannel,
│ │ │ │ -
1200 CpuEvaluator const *instance = NULL,
│ │ │ │ -
1201 void * deviceContext = NULL) {
│ │ │ │ -
1202
│ │ │ │ -
1203 (void)instance; // unused
│ │ │ │ -
1204 (void)deviceContext; // unused
│ │ │ │ -
1205
│ │ │ │ -
1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
│ │ │ │ -
1207 dstBuffer->BindCpuBuffer(), dstDesc,
│ │ │ │ -
1208 duBuffer->BindCpuBuffer(), duDesc,
│ │ │ │ -
1209 dvBuffer->BindCpuBuffer(), dvDesc,
│ │ │ │ -
1210 duuBuffer->BindCpuBuffer(), duuDesc,
│ │ │ │ -
1211 duvBuffer->BindCpuBuffer(), duvDesc,
│ │ │ │ -
1212 dvvBuffer->BindCpuBuffer(), dvvDesc,
│ │ │ │ -
1213 numPatchCoords,
│ │ │ │ -
1214 (const PatchCoord*)patchCoords->BindCpuBuffer(),
│ │ │ │ -
1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
│ │ │ │ -
1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
│ │ │ │ -
1217 patchTable->GetFVarPatchParamBuffer(fvarChannel));
│ │ │ │ -
1218 }
│ │ │ │ -
1219
│ │ │ │ -
1225
│ │ │ │ -
1227 static void Synchronize(void * /*deviceContext = NULL*/) {
│ │ │ │ -
1228 // nothing.
│ │ │ │ -
1229 }
│ │ │ │ -
1230};
│ │ │ │ -
1231
│ │ │ │ -
1232
│ │ │ │ -
1233} // end namespace Osd
│ │ │ │ -
1234
│ │ │ │ -
1235} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
1236using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
1237
│ │ │ │ -
1238} // end namespace OpenSubdiv
│ │ │ │ -
1239
│ │ │ │ -
1240
│ │ │ │ -
1241#endif // OPENSUBDIV3_OSD_CPU_EVALUATOR_H
│ │ │ │ +
247#endif /* OPENSUBDIV3_SDC_CREASE_H */
│ │ │ │ │ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
Static eval stencils function which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:971
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, const float *duuWeights, const float *duvWeights, const float *dvvWeights, int start, int end)
Static eval stencils function with derivatives, which takes raw CPU pointers for input and output.
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:454
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: cpuEvaluator.h:517
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, PatchCoord const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, PatchParam const *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: cpuEvaluator.h:303
│ │ │ │ -
static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndexBuffer, const PatchParam *patchParamBuffer)
Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchT...
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:886
│ │ │ │ -
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: cpuEvaluator.h:823
│ │ │ │ -
static void Synchronize(void *)
synchronize all asynchronous computation invoked on this device.
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
Definition: cpuEvaluator.h:72
│ │ │ │ -
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: cpuEvaluator.h:607
│ │ │ │ -
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Definition: cpuEvaluator.h:168
│ │ │ │ -
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │ - │ │ │ │ - │ │ │ │ +
Types, constants and utilities related to semi-sharp creasing – whose implementation is independent o...
Definition: crease.h:62
│ │ │ │ +
float SubdivideVertexSharpness(float vertexSharpness) const
Definition: crease.h:222
│ │ │ │ +
static bool IsInfinite(float sharpness)
Definition: crease.h:72
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
float SharpenBoundaryVertex(float edgeSharpness) const
Definition: crease.h:200
│ │ │ │ + │ │ │ │ +
void GetSharpEdgePairOfCrease(float const *incidentEdgeSharpness, int incidentEdgeCount, int sharpEdgePair[2]) const
Definition: crease.h:228
│ │ │ │ + │ │ │ │ +
Rule DetermineVertexVertexRule(float vertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness) const
│ │ │ │ +
float decrementSharpness(float sharpness) const
Definition: crease.h:207
│ │ │ │ +
static bool IsSmooth(float sharpness)
Definition: crease.h:70
│ │ │ │ +
Rule DetermineVertexVertexRule(float vertexSharpness, int sharpEdgeCount) const
│ │ │ │ + │ │ │ │ +
static bool IsSemiSharp(float sharpness)
Definition: crease.h:73
│ │ │ │ +
Crease(Options const &options)
Definition: crease.h:92
│ │ │ │ +
void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, float const *incidentEdgeSharpnessAroundVertex, float *childEdgesSharpnessAroundVertex) const
│ │ │ │ +
float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const
Definition: crease.h:216
│ │ │ │ + │ │ │ │ +
float SharpenBoundaryEdge(float edgeSharpness) const
Definition: crease.h:189
│ │ │ │ +
float ComputeFractionalWeightAtVertex(float vertexSharpness, float childVertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness, float const *childEdgesSharpness) const
Transitional weighting: When the rules applicable to a parent vertex and its child differ,...
│ │ │ │ +
float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, int incidentEdgeCountAtEndVertex, float const *edgeSharpnessAroundEndVertex) const
│ │ │ │ +
static bool IsSharp(float sharpness)
Definition: crease.h:71
│ │ │ │ + │ │ │ │ +
All supported options applying to subdivision scheme.
Definition: options.h:51
│ │ │ │ + │ │ │ │ +
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:101
│ │ │ │ +
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:89
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── encoding │ │ │ │ │ @@ -1 +1 @@ │ │ │ │ │ -us-ascii │ │ │ │ │ +utf-8 │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cpuEvaluator.h │ │ │ │ │ +crease.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,658 +29,289 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29#include "../osd/bufferDescriptor.h" │ │ │ │ │ - 30#include "../osd/types.h" │ │ │ │ │ - 31 │ │ │ │ │ - 32#include │ │ │ │ │ + 24#ifndef OPENSUBDIV3_SDC_CREASE_H │ │ │ │ │ + 25#define OPENSUBDIV3_SDC_CREASE_H │ │ │ │ │ + 26 │ │ │ │ │ + 27#include "../version.h" │ │ │ │ │ + 28 │ │ │ │ │ + 29#include "../sdc/options.h" │ │ │ │ │ + 30 │ │ │ │ │ + 31namespace OpenSubdiv { │ │ │ │ │ + 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ 33 │ │ │ │ │ - 34namespace OpenSubdiv { │ │ │ │ │ - 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 36 │ │ │ │ │ - 37namespace Osd { │ │ │ │ │ - 38 │ │ │ │ │ -39class CpuEvaluator { │ │ │ │ │ - 40public: │ │ │ │ │ - 46 │ │ │ │ │ - 71 template │ │ │ │ │ -72 static bool EvalStencils( │ │ │ │ │ - 73 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 74 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 75 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 76 const CpuEvaluator *instance = NULL, │ │ │ │ │ - 77 void * deviceContext = NULL) { │ │ │ │ │ - 78 │ │ │ │ │ - 79 (void)instance; // unused │ │ │ │ │ - 80 (void)deviceContext; // unused │ │ │ │ │ - 81 │ │ │ │ │ - 82 if (stencilTable->GetNumStencils() == 0) │ │ │ │ │ - 83 return false; │ │ │ │ │ - 84 │ │ │ │ │ - 85 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 86 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 87 &stencilTable->GetSizes()[0], │ │ │ │ │ - 88 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 89 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 90 &stencilTable->GetWeights()[0], │ │ │ │ │ - 91 /*start = */ 0, │ │ │ │ │ - 92 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 93 } │ │ │ │ │ + 34namespace Sdc { │ │ │ │ │ + 35 │ │ │ │ │ + 61 │ │ │ │ │ +62class Crease { │ │ │ │ │ + 63public: │ │ │ │ │ + 65 │ │ │ │ │ +67 static float const SHARPNESS_SMOOTH; // = 0.0f, do we really need this? │ │ │ │ │ +68 static float const SHARPNESS_INFINITE; // = 10.0f; │ │ │ │ │ + 69 │ │ │ │ │ +70 static bool IsSmooth(float sharpness) { return sharpness <= │ │ │ │ │ +SHARPNESS_SMOOTH; } │ │ │ │ │ +71 static bool IsSharp(float sharpness) { return sharpness > SHARPNESS_SMOOTH; │ │ │ │ │ +} │ │ │ │ │ +72 static bool IsInfinite(float sharpness) { return sharpness >= │ │ │ │ │ +SHARPNESS_INFINITE; } │ │ │ │ │ +73 static bool IsSemiSharp(float sharpness) { return (SHARPNESS_SMOOTH < │ │ │ │ │ +sharpness) && (sharpness < SHARPNESS_INFINITE); } │ │ │ │ │ + 75 │ │ │ │ │ +82 enum Rule { │ │ │ │ │ +83 RULE_UNKNOWN = 0, │ │ │ │ │ +84 RULE_SMOOTH = (1 << 0), │ │ │ │ │ +85 RULE_DART = (1 << 1), │ │ │ │ │ +86 RULE_CREASE = (1 << 2), │ │ │ │ │ + 87 RULE_CORNER = (1 << 3) │ │ │ │ │ +88 }; │ │ │ │ │ + 89 │ │ │ │ │ + 90public: │ │ │ │ │ +91 Crease() : _options() { } │ │ │ │ │ +92 Crease(Options const& options) : _options(options) { } │ │ │ │ │ +93 ~Crease() { } │ │ │ │ │ 94 │ │ │ │ │ -121 static bool EvalStencils( │ │ │ │ │ - 122 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 123 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 124 const int * sizes, │ │ │ │ │ - 125 const int * offsets, │ │ │ │ │ - 126 const int * indices, │ │ │ │ │ - 127 const float * weights, │ │ │ │ │ - 128 int start, int end); │ │ │ │ │ - 129 │ │ │ │ │ - 167 template │ │ │ │ │ -168 static bool EvalStencils( │ │ │ │ │ - 169 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 170 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 171 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 172 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 173 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 174 const CpuEvaluator *instance = NULL, │ │ │ │ │ - 175 void * deviceContext = NULL) { │ │ │ │ │ +95 bool IsUniform() const { return _options.GetCreasingMethod() == Options:: │ │ │ │ │ +CREASE_UNIFORM; } │ │ │ │ │ + 96 │ │ │ │ │ + 98 │ │ │ │ │ + 104 float SharpenBoundaryEdge(float edgeSharpness) const; │ │ │ │ │ + 105 float SharpenBoundaryVertex(float edgeSharpness) const; │ │ │ │ │ + 106 │ │ │ │ │ + 107 // For future consideration │ │ │ │ │ + 108 //float SharpenNonManifoldEdge(float edgeSharpness) const; │ │ │ │ │ + 109 //float SharpenNonManifoldVertex(float edgeSharpness) const; │ │ │ │ │ + 111 │ │ │ │ │ + 113 │ │ │ │ │ + 124 float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const; │ │ │ │ │ + 125 │ │ │ │ │ + 126 float SubdivideVertexSharpness(float vertexSharpness) const; │ │ │ │ │ + 127 │ │ │ │ │ +128 float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, │ │ │ │ │ + 129 int incidentEdgeCountAtEndVertex, │ │ │ │ │ + 130 float const* edgeSharpnessAroundEndVertex) const; │ │ │ │ │ + 131 │ │ │ │ │ +132 void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, │ │ │ │ │ + 133 float const* incidentEdgeSharpnessAroundVertex, │ │ │ │ │ + 134 float* childEdgesSharpnessAroundVertex) const; │ │ │ │ │ + 136 │ │ │ │ │ + 138 │ │ │ │ │ +144 Rule DetermineVertexVertexRule(float vertexSharpness, │ │ │ │ │ + 145 int incidentEdgeCount, │ │ │ │ │ + 146 float const* incidentEdgeSharpness) const; │ │ │ │ │ +147 Rule DetermineVertexVertexRule(float vertexSharpness, │ │ │ │ │ + 148 int sharpEdgeCount) const; │ │ │ │ │ + 150 │ │ │ │ │ +162 float ComputeFractionalWeightAtVertex(float vertexSharpness, │ │ │ │ │ + 163 float childVertexSharpness, │ │ │ │ │ + 164 int incidentEdgeCount, │ │ │ │ │ + 165 float const* incidentEdgeSharpness, │ │ │ │ │ + 166 float const* childEdgesSharpness) const; │ │ │ │ │ + 167 │ │ │ │ │ + 168 void GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, │ │ │ │ │ + 169 int incidentEdgeCount, │ │ │ │ │ + 170 int sharpEdgePair[2]) const; │ │ │ │ │ + 171 │ │ │ │ │ + 172 // Would these really help? Maybe only need Rules for the vertex-vertex │ │ │ │ │ +case... │ │ │ │ │ + 173 // │ │ │ │ │ + 174 // Rule DetermineEdgeVertexRule(float parentEdgeSharpness) const; │ │ │ │ │ + 175 // Rule DetermineEdgeVertexRule(float childEdge1Sharpness, float │ │ │ │ │ +childEdge2Sharpness) const; │ │ │ │ │ 176 │ │ │ │ │ - 177 (void)instance; // unused │ │ │ │ │ - 178 (void)deviceContext; // unused │ │ │ │ │ + 177protected: │ │ │ │ │ + 178 float decrementSharpness(float sharpness) const; │ │ │ │ │ 179 │ │ │ │ │ - 180 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 181 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 182 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 183 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 184 &stencilTable->GetSizes()[0], │ │ │ │ │ - 185 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 186 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 187 &stencilTable->GetWeights()[0], │ │ │ │ │ - 188 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 189 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 190 /*start = */ 0, │ │ │ │ │ - 191 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 │ │ │ │ │ -234 static bool EvalStencils( │ │ │ │ │ - 235 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 236 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 237 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 238 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 239 const int * sizes, │ │ │ │ │ - 240 const int * offsets, │ │ │ │ │ - 241 const int * indices, │ │ │ │ │ - 242 const float * weights, │ │ │ │ │ - 243 const float * duWeights, │ │ │ │ │ - 244 const float * dvWeights, │ │ │ │ │ - 245 int start, int end); │ │ │ │ │ + 180private: │ │ │ │ │ + 181 Options _options; │ │ │ │ │ + 182}; │ │ │ │ │ + 183 │ │ │ │ │ + 184 │ │ │ │ │ + 185// │ │ │ │ │ + 186// Inline declarations: │ │ │ │ │ + 187// │ │ │ │ │ + 188inline float │ │ │ │ │ +189Crease::SharpenBoundaryEdge(float /* edgeSharpness */) const { │ │ │ │ │ + 190 │ │ │ │ │ + 191 // │ │ │ │ │ + 192 // Despite the presence of the BOUNDARY_NONE option, boundary edges are │ │ │ │ │ +always sharpened. │ │ │ │ │ + 193 // Much of the code relies on sharpness to indicate boundaries to avoid │ │ │ │ │ +the more complex │ │ │ │ │ + 194 // topological inspection │ │ │ │ │ + 195 // │ │ │ │ │ + 196 return SHARPNESS_INFINITE; │ │ │ │ │ + 197} │ │ │ │ │ + 198 │ │ │ │ │ + 199inline float │ │ │ │ │ +200Crease::SharpenBoundaryVertex(float vertexSharpness) const { │ │ │ │ │ + 201 │ │ │ │ │ + 202 return (_options.GetVtxBoundaryInterpolation() == Options:: │ │ │ │ │ +VTX_BOUNDARY_EDGE_AND_CORNER) ? │ │ │ │ │ + 203 SHARPNESS_INFINITE : vertexSharpness; │ │ │ │ │ + 204} │ │ │ │ │ + 205 │ │ │ │ │ + 206inline float │ │ │ │ │ +207Crease::decrementSharpness(float sharpness) const { │ │ │ │ │ + 208 │ │ │ │ │ + 209 if (IsSmooth(sharpness)) return Crease::SHARPNESS_SMOOTH; // redundant but │ │ │ │ │ +most common │ │ │ │ │ + 210 if (IsInfinite(sharpness)) return Crease::SHARPNESS_INFINITE; │ │ │ │ │ + 211 if (sharpness > 1.0f) return (sharpness - 1.0f); │ │ │ │ │ + 212 return Crease::SHARPNESS_SMOOTH; │ │ │ │ │ + 213} │ │ │ │ │ + 214 │ │ │ │ │ + 215inline float │ │ │ │ │ +216Crease::SubdivideUniformSharpness(float vertexOrEdgeSharpness) const { │ │ │ │ │ + 217 │ │ │ │ │ + 218 return decrementSharpness(vertexOrEdgeSharpness); │ │ │ │ │ + 219} │ │ │ │ │ + 220 │ │ │ │ │ + 221inline float │ │ │ │ │ +222Crease::SubdivideVertexSharpness(float vertexSharpness) const { │ │ │ │ │ + 223 │ │ │ │ │ + 224 return decrementSharpness(vertexSharpness); │ │ │ │ │ + 225} │ │ │ │ │ + 226 │ │ │ │ │ + 227inline void │ │ │ │ │ +228Crease::GetSharpEdgePairOfCrease(float const * incidentEdgeSharpness, int │ │ │ │ │ +incidentEdgeCount, │ │ │ │ │ + 229 int sharpEdgePair[2]) const { │ │ │ │ │ + 230 │ │ │ │ │ + 231 // Only to be called when a crease is present at a vertex -- exactly two │ │ │ │ │ +sharp │ │ │ │ │ + 232 // edges are expected here: │ │ │ │ │ + 233 // │ │ │ │ │ + 234 sharpEdgePair[0] = 0; │ │ │ │ │ + 235 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[0]])) ++ sharpEdgePair │ │ │ │ │ +[0]; │ │ │ │ │ + 236 │ │ │ │ │ + 237 sharpEdgePair[1] = incidentEdgeCount - 1; │ │ │ │ │ + 238 while (IsSmooth(incidentEdgeSharpness[sharpEdgePair[1]])) -- sharpEdgePair │ │ │ │ │ +[1]; │ │ │ │ │ + 239} │ │ │ │ │ + 240 │ │ │ │ │ + 241} // end namespace sdc │ │ │ │ │ + 242 │ │ │ │ │ + 243} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 244using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 245} // end namespace OpenSubdiv │ │ │ │ │ 246 │ │ │ │ │ - 302 template │ │ │ │ │ -303 static bool EvalStencils( │ │ │ │ │ - 304 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 305 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 306 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 307 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 308 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 309 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 310 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 311 STENCIL_TABLE const *stencilTable, │ │ │ │ │ - 312 const CpuEvaluator *instance = NULL, │ │ │ │ │ - 313 void * deviceContext = NULL) { │ │ │ │ │ - 314 │ │ │ │ │ - 315 (void)instance; // unused │ │ │ │ │ - 316 (void)deviceContext; // unused │ │ │ │ │ - 317 │ │ │ │ │ - 318 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 319 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 320 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 321 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 322 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 323 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 324 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 325 &stencilTable->GetSizes()[0], │ │ │ │ │ - 326 &stencilTable->GetOffsets()[0], │ │ │ │ │ - 327 &stencilTable->GetControlIndices()[0], │ │ │ │ │ - 328 &stencilTable->GetWeights()[0], │ │ │ │ │ - 329 &stencilTable->GetDuWeights()[0], │ │ │ │ │ - 330 &stencilTable->GetDvWeights()[0], │ │ │ │ │ - 331 &stencilTable->GetDuuWeights()[0], │ │ │ │ │ - 332 &stencilTable->GetDuvWeights()[0], │ │ │ │ │ - 333 &stencilTable->GetDvvWeights()[0], │ │ │ │ │ - 334 /*start = */ 0, │ │ │ │ │ - 335 /*end = */ stencilTable->GetNumStencils()); │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ -399 static bool EvalStencils( │ │ │ │ │ - 400 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 401 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 402 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 403 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 404 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 405 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 406 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 407 const int * sizes, │ │ │ │ │ - 408 const int * offsets, │ │ │ │ │ - 409 const int * indices, │ │ │ │ │ - 410 const float * weights, │ │ │ │ │ - 411 const float * duWeights, │ │ │ │ │ - 412 const float * dvWeights, │ │ │ │ │ - 413 const float * duuWeights, │ │ │ │ │ - 414 const float * duvWeights, │ │ │ │ │ - 415 const float * dvvWeights, │ │ │ │ │ - 416 int start, int end); │ │ │ │ │ - 417 │ │ │ │ │ - 423 │ │ │ │ │ - 452 template │ │ │ │ │ -454 static bool EvalPatches( │ │ │ │ │ - 455 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 456 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 457 int numPatchCoords, │ │ │ │ │ - 458 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 459 PATCH_TABLE *patchTable, │ │ │ │ │ - 460 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 461 void * deviceContext = NULL) { │ │ │ │ │ - 462 │ │ │ │ │ - 463 (void)instance; // unused │ │ │ │ │ - 464 (void)deviceContext; // unused │ │ │ │ │ - 465 │ │ │ │ │ - 466 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 467 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 468 numPatchCoords, │ │ │ │ │ - 469 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 470 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 471 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 472 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 473 } │ │ │ │ │ - 474 │ │ │ │ │ - 515 template │ │ │ │ │ -517 static bool EvalPatches( │ │ │ │ │ - 518 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 519 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 520 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 521 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 522 int numPatchCoords, │ │ │ │ │ - 523 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 524 PATCH_TABLE *patchTable, │ │ │ │ │ - 525 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 526 void * deviceContext = NULL) { │ │ │ │ │ - 527 │ │ │ │ │ - 528 (void)instance; // unused │ │ │ │ │ - 529 (void)deviceContext; // unused │ │ │ │ │ - 530 │ │ │ │ │ - 531 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 532 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 533 // so that downcast isn't needed there. │ │ │ │ │ - 534 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 535 // │ │ │ │ │ - 536 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 537 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 538 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 539 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 540 numPatchCoords, │ │ │ │ │ - 541 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 542 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 543 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 544 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 545 } │ │ │ │ │ - 546 │ │ │ │ │ - 605 template │ │ │ │ │ -607 static bool EvalPatches( │ │ │ │ │ - 608 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 609 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 610 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 611 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 612 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 613 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 614 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 615 int numPatchCoords, │ │ │ │ │ - 616 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 617 PATCH_TABLE *patchTable, │ │ │ │ │ - 618 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 619 void * deviceContext = NULL) { │ │ │ │ │ - 620 │ │ │ │ │ - 621 (void)instance; // unused │ │ │ │ │ - 622 (void)deviceContext; // unused │ │ │ │ │ - 623 │ │ │ │ │ - 624 // XXX: PatchCoords is somewhat abusing vertex primvar buffer interop. │ │ │ │ │ - 625 // ideally all buffer classes should have templated by datatype │ │ │ │ │ - 626 // so that downcast isn't needed there. │ │ │ │ │ - 627 // (e.g. Osd::CpuBuffer ) │ │ │ │ │ - 628 // │ │ │ │ │ - 629 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 630 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 631 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 632 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 633 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 634 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 635 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 636 numPatchCoords, │ │ │ │ │ - 637 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 638 patchTable->GetPatchArrayBuffer(), │ │ │ │ │ - 639 patchTable->GetPatchIndexBuffer(), │ │ │ │ │ - 640 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 641 } │ │ │ │ │ - 642 │ │ │ │ │ -670 static bool EvalPatches( │ │ │ │ │ - 671 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 672 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 673 int numPatchCoords, │ │ │ │ │ - 674 const PatchCoord *patchCoords, │ │ │ │ │ - 675 const PatchArray *patchArrays, │ │ │ │ │ - 676 const int *patchIndexBuffer, │ │ │ │ │ - 677 const PatchParam *patchParamBuffer); │ │ │ │ │ - 678 │ │ │ │ │ -716 static bool EvalPatches( │ │ │ │ │ - 717 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 718 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 719 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 720 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 721 int numPatchCoords, │ │ │ │ │ - 722 PatchCoord const *patchCoords, │ │ │ │ │ - 723 PatchArray const *patchArrays, │ │ │ │ │ - 724 const int *patchIndexBuffer, │ │ │ │ │ - 725 PatchParam const *patchParamBuffer); │ │ │ │ │ - 726 │ │ │ │ │ -779 static bool EvalPatches( │ │ │ │ │ - 780 const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ - 781 float *dst, BufferDescriptor const &dstDesc, │ │ │ │ │ - 782 float *du, BufferDescriptor const &duDesc, │ │ │ │ │ - 783 float *dv, BufferDescriptor const &dvDesc, │ │ │ │ │ - 784 float *duu, BufferDescriptor const &duuDesc, │ │ │ │ │ - 785 float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ - 786 float *dvv, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 787 int numPatchCoords, │ │ │ │ │ - 788 PatchCoord const *patchCoords, │ │ │ │ │ - 789 PatchArray const *patchArrays, │ │ │ │ │ - 790 const int *patchIndexBuffer, │ │ │ │ │ - 791 PatchParam const *patchParamBuffer); │ │ │ │ │ - 792 │ │ │ │ │ - 821 template │ │ │ │ │ -823 static bool EvalPatchesVarying( │ │ │ │ │ - 824 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 825 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 826 int numPatchCoords, │ │ │ │ │ - 827 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 828 PATCH_TABLE *patchTable, │ │ │ │ │ - 829 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 830 void * deviceContext = NULL) { │ │ │ │ │ - 831 │ │ │ │ │ - 832 (void)instance; // unused │ │ │ │ │ - 833 (void)deviceContext; // unused │ │ │ │ │ - 834 │ │ │ │ │ - 835 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 836 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 837 numPatchCoords, │ │ │ │ │ - 838 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 839 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 840 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 841 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 842 } │ │ │ │ │ - 843 │ │ │ │ │ - 884 template │ │ │ │ │ -886 static bool EvalPatchesVarying( │ │ │ │ │ - 887 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 888 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 889 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 890 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 891 int numPatchCoords, │ │ │ │ │ - 892 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 893 PATCH_TABLE *patchTable, │ │ │ │ │ - 894 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 895 void * deviceContext = NULL) { │ │ │ │ │ - 896 │ │ │ │ │ - 897 (void)instance; // unused │ │ │ │ │ - 898 (void)deviceContext; // unused │ │ │ │ │ - 899 │ │ │ │ │ - 900 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 901 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 902 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 903 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 904 numPatchCoords, │ │ │ │ │ - 905 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 906 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 907 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 908 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 909 } │ │ │ │ │ - 910 │ │ │ │ │ - 969 template │ │ │ │ │ -971 static bool EvalPatchesVarying( │ │ │ │ │ - 972 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 973 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 974 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 975 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 976 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 977 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 978 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 979 int numPatchCoords, │ │ │ │ │ - 980 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 981 PATCH_TABLE *patchTable, │ │ │ │ │ - 982 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 983 void * deviceContext = NULL) { │ │ │ │ │ - 984 │ │ │ │ │ - 985 (void)instance; // unused │ │ │ │ │ - 986 (void)deviceContext; // unused │ │ │ │ │ - 987 │ │ │ │ │ - 988 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 989 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 990 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 991 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 992 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 993 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 994 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 995 numPatchCoords, │ │ │ │ │ - 996 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 997 patchTable->GetVaryingPatchArrayBuffer(), │ │ │ │ │ - 998 patchTable->GetVaryingPatchIndexBuffer(), │ │ │ │ │ - 999 patchTable->GetPatchParamBuffer()); │ │ │ │ │ - 1000 } │ │ │ │ │ - 1001 │ │ │ │ │ - 1032 template │ │ │ │ │ -1034 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1035 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1036 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1037 int numPatchCoords, │ │ │ │ │ - 1038 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1039 PATCH_TABLE *patchTable, │ │ │ │ │ - 1040 int fvarChannel, │ │ │ │ │ - 1041 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 1042 void * deviceContext = NULL) { │ │ │ │ │ - 1043 │ │ │ │ │ - 1044 (void)instance; // unused │ │ │ │ │ - 1045 (void)deviceContext; // unused │ │ │ │ │ - 1046 │ │ │ │ │ - 1047 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1048 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1049 numPatchCoords, │ │ │ │ │ - 1050 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1051 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1052 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1053 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1054 } │ │ │ │ │ - 1055 │ │ │ │ │ - 1098 template │ │ │ │ │ -1100 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1101 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1102 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1103 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1104 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1105 int numPatchCoords, │ │ │ │ │ - 1106 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1107 PATCH_TABLE *patchTable, │ │ │ │ │ - 1108 int fvarChannel, │ │ │ │ │ - 1109 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 1110 void * deviceContext = NULL) { │ │ │ │ │ - 1111 │ │ │ │ │ - 1112 (void)instance; // unused │ │ │ │ │ - 1113 (void)deviceContext; // unused │ │ │ │ │ - 1114 │ │ │ │ │ - 1115 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1116 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1117 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1118 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1119 numPatchCoords, │ │ │ │ │ - 1120 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1121 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1122 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1123 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1124 } │ │ │ │ │ - 1125 │ │ │ │ │ - 1186 template │ │ │ │ │ -1188 static bool EvalPatchesFaceVarying( │ │ │ │ │ - 1189 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ - 1190 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ - 1191 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, │ │ │ │ │ - 1192 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, │ │ │ │ │ - 1193 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, │ │ │ │ │ - 1194 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, │ │ │ │ │ - 1195 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, │ │ │ │ │ - 1196 int numPatchCoords, │ │ │ │ │ - 1197 PATCHCOORD_BUFFER *patchCoords, │ │ │ │ │ - 1198 PATCH_TABLE *patchTable, │ │ │ │ │ - 1199 int fvarChannel, │ │ │ │ │ - 1200 CpuEvaluator const *instance = NULL, │ │ │ │ │ - 1201 void * deviceContext = NULL) { │ │ │ │ │ - 1202 │ │ │ │ │ - 1203 (void)instance; // unused │ │ │ │ │ - 1204 (void)deviceContext; // unused │ │ │ │ │ - 1205 │ │ │ │ │ - 1206 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc, │ │ │ │ │ - 1207 dstBuffer->BindCpuBuffer(), dstDesc, │ │ │ │ │ - 1208 duBuffer->BindCpuBuffer(), duDesc, │ │ │ │ │ - 1209 dvBuffer->BindCpuBuffer(), dvDesc, │ │ │ │ │ - 1210 duuBuffer->BindCpuBuffer(), duuDesc, │ │ │ │ │ - 1211 duvBuffer->BindCpuBuffer(), duvDesc, │ │ │ │ │ - 1212 dvvBuffer->BindCpuBuffer(), dvvDesc, │ │ │ │ │ - 1213 numPatchCoords, │ │ │ │ │ - 1214 (const PatchCoord*)patchCoords->BindCpuBuffer(), │ │ │ │ │ - 1215 patchTable->GetFVarPatchArrayBuffer(fvarChannel), │ │ │ │ │ - 1216 patchTable->GetFVarPatchIndexBuffer(fvarChannel), │ │ │ │ │ - 1217 patchTable->GetFVarPatchParamBuffer(fvarChannel)); │ │ │ │ │ - 1218 } │ │ │ │ │ - 1219 │ │ │ │ │ - 1225 │ │ │ │ │ -1227 static void Synchronize(void * /*deviceContext = NULL*/) { │ │ │ │ │ - 1228 // nothing. │ │ │ │ │ - 1229 } │ │ │ │ │ - 1230}; │ │ │ │ │ - 1231 │ │ │ │ │ - 1232 │ │ │ │ │ - 1233} // end namespace Osd │ │ │ │ │ - 1234 │ │ │ │ │ - 1235} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 1236using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 1237 │ │ │ │ │ - 1238} // end namespace OpenSubdiv │ │ │ │ │ - 1239 │ │ │ │ │ - 1240 │ │ │ │ │ - 1241#endif // OPENSUBDIV3_OSD_CPU_EVALUATOR_H │ │ │ │ │ + 247#endif /* OPENSUBDIV3_SDC_CREASE_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator │ │ │ │ │ -Definition: cpuEvaluator.h:39 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int │ │ │ │ │ -fvarChannel, CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:1034 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CpuEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:1100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, int start, int end) │ │ │ │ │ -Static eval stencils function which takes raw CPU pointers for input and │ │ │ │ │ -output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesFaceVarying │ │ │ │ │ -static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor │ │ │ │ │ -const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, │ │ │ │ │ -DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, │ │ │ │ │ -CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:1188 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:971 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, const int *sizes, const int │ │ │ │ │ -*offsets, const int *indices, const float *weights, const float *duWeights, │ │ │ │ │ -const float *dvWeights, const float *duuWeights, const float *duvWeights, const │ │ │ │ │ -float *dvvWeights, int start, int end) │ │ │ │ │ -Static eval stencils function with derivatives, which takes raw CPU pointers │ │ │ │ │ -for input and output. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, float *duu, │ │ │ │ │ -BufferDescriptor const &duuDesc, float *duv, BufferDescriptor const &duvDesc, │ │ │ │ │ -float *dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, PatchCoord │ │ │ │ │ -const *patchCoords, PatchArray const *patchArrays, const int *patchIndexBuffer, │ │ │ │ │ -PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, │ │ │ │ │ -PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const │ │ │ │ │ -*instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:454 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE │ │ │ │ │ -*patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: cpuEvaluator.h:517 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const │ │ │ │ │ -&duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, │ │ │ │ │ -PatchCoord const *patchCoords, PatchArray const *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, PatchParam const *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const │ │ │ │ │ -&duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER │ │ │ │ │ -*dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, │ │ │ │ │ -const CpuEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: cpuEvaluator.h:303 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(const float *src, BufferDescriptor const &srcDesc, │ │ │ │ │ -float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const │ │ │ │ │ -PatchCoord *patchCoords, const PatchArray *patchArrays, const int │ │ │ │ │ -*patchIndexBuffer, const PatchParam *patchParamBuffer) │ │ │ │ │ -Static limit eval function. It takes an array of PatchCoord and evaluate limit │ │ │ │ │ -values on given PatchT... │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:886 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatchesVarying │ │ │ │ │ -static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int │ │ │ │ │ -numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, │ │ │ │ │ -CpuEvaluator const *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic limit eval function. This function has a same signature as other device │ │ │ │ │ -kernels have so that ... │ │ │ │ │ -Definition: cpuEvaluator.h:823 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::Synchronize │ │ │ │ │ -static void Synchronize(void *) │ │ │ │ │ -synchronize all asynchronous computation invoked on this device. │ │ │ │ │ -Definition: cpuEvaluator.h:1227 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE │ │ │ │ │ -const *stencilTable, const CpuEvaluator *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function. This function has a same signature as │ │ │ │ │ -other device kernels hav... │ │ │ │ │ -Definition: cpuEvaluator.h:72 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalPatches │ │ │ │ │ -static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, │ │ │ │ │ -DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, │ │ │ │ │ -BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const │ │ │ │ │ -&dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER │ │ │ │ │ -*duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, │ │ │ │ │ -BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER │ │ │ │ │ -*patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Generic limit eval function with derivatives. This function has a same │ │ │ │ │ -signature as other device kern... │ │ │ │ │ -Definition: cpuEvaluator.h:607 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CpuEvaluator::EvalStencils │ │ │ │ │ -static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const │ │ │ │ │ -&srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER │ │ │ │ │ -*duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, │ │ │ │ │ -BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, const │ │ │ │ │ -CpuEvaluator *instance=NULL, void *deviceContext=NULL) │ │ │ │ │ -Generic static eval stencils function with derivatives. This function has a │ │ │ │ │ -same signature as other d... │ │ │ │ │ -Definition: cpuEvaluator.h:168 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchCoord │ │ │ │ │ -Coordinates set on a patch table. │ │ │ │ │ -Definition: types.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArray │ │ │ │ │ -Definition: types.h:66 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchParam │ │ │ │ │ -Definition: types.h:127 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease │ │ │ │ │ +Types, constants and utilities related to semi-sharp creasing – whose │ │ │ │ │ +implementation is independent o... │ │ │ │ │ +Definition: crease.h:62 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideVertexSharpness │ │ │ │ │ +float SubdivideVertexSharpness(float vertexSharpness) const │ │ │ │ │ +Definition: crease.h:222 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsInfinite │ │ │ │ │ +static bool IsInfinite(float sharpness) │ │ │ │ │ +Definition: crease.h:72 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule │ │ │ │ │ +Rule │ │ │ │ │ +Definition: crease.h:82 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_CORNER │ │ │ │ │ +@ RULE_CORNER │ │ │ │ │ +Definition: crease.h:87 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_DART │ │ │ │ │ +@ RULE_DART │ │ │ │ │ +Definition: crease.h:85 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_SMOOTH │ │ │ │ │ +@ RULE_SMOOTH │ │ │ │ │ +Definition: crease.h:84 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_CREASE │ │ │ │ │ +@ RULE_CREASE │ │ │ │ │ +Definition: crease.h:86 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::RULE_UNKNOWN │ │ │ │ │ +@ RULE_UNKNOWN │ │ │ │ │ +Definition: crease.h:83 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SharpenBoundaryVertex │ │ │ │ │ +float SharpenBoundaryVertex(float edgeSharpness) const │ │ │ │ │ +Definition: crease.h:200 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SHARPNESS_SMOOTH │ │ │ │ │ +static float const SHARPNESS_SMOOTH │ │ │ │ │ +Definition: crease.h:67 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::GetSharpEdgePairOfCrease │ │ │ │ │ +void GetSharpEdgePairOfCrease(float const *incidentEdgeSharpness, int │ │ │ │ │ +incidentEdgeCount, int sharpEdgePair[2]) const │ │ │ │ │ +Definition: crease.h:228 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SHARPNESS_INFINITE │ │ │ │ │ +static float const SHARPNESS_INFINITE │ │ │ │ │ +Definition: crease.h:68 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::DetermineVertexVertexRule │ │ │ │ │ +Rule DetermineVertexVertexRule(float vertexSharpness, int incidentEdgeCount, │ │ │ │ │ +float const *incidentEdgeSharpness) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::decrementSharpness │ │ │ │ │ +float decrementSharpness(float sharpness) const │ │ │ │ │ +Definition: crease.h:207 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSmooth │ │ │ │ │ +static bool IsSmooth(float sharpness) │ │ │ │ │ +Definition: crease.h:70 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::DetermineVertexVertexRule │ │ │ │ │ +Rule DetermineVertexVertexRule(float vertexSharpness, int sharpEdgeCount) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsUniform │ │ │ │ │ +bool IsUniform() const │ │ │ │ │ +Definition: crease.h:95 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSemiSharp │ │ │ │ │ +static bool IsSemiSharp(float sharpness) │ │ │ │ │ +Definition: crease.h:73 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Crease │ │ │ │ │ +Crease(Options const &options) │ │ │ │ │ +Definition: crease.h:92 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease:: │ │ │ │ │ +SubdivideEdgeSharpnessesAroundVertex │ │ │ │ │ +void SubdivideEdgeSharpnessesAroundVertex(int incidentEdgeCountAtVertex, float │ │ │ │ │ +const *incidentEdgeSharpnessAroundVertex, float │ │ │ │ │ +*childEdgesSharpnessAroundVertex) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideUniformSharpness │ │ │ │ │ +float SubdivideUniformSharpness(float vertexOrEdgeSharpness) const │ │ │ │ │ +Definition: crease.h:216 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Crease │ │ │ │ │ +Crease() │ │ │ │ │ +Definition: crease.h:91 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SharpenBoundaryEdge │ │ │ │ │ +float SharpenBoundaryEdge(float edgeSharpness) const │ │ │ │ │ +Definition: crease.h:189 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::ComputeFractionalWeightAtVertex │ │ │ │ │ +float ComputeFractionalWeightAtVertex(float vertexSharpness, float │ │ │ │ │ +childVertexSharpness, int incidentEdgeCount, float const │ │ │ │ │ +*incidentEdgeSharpness, float const *childEdgesSharpness) const │ │ │ │ │ +Transitional weighting: When the rules applicable to a parent vertex and its │ │ │ │ │ +child differ,... │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::SubdivideEdgeSharpnessAtVertex │ │ │ │ │ +float SubdivideEdgeSharpnessAtVertex(float edgeSharpness, int │ │ │ │ │ +incidentEdgeCountAtEndVertex, float const *edgeSharpnessAroundEndVertex) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::IsSharp │ │ │ │ │ +static bool IsSharp(float sharpness) │ │ │ │ │ +Definition: crease.h:71 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::~Crease │ │ │ │ │ +~Crease() │ │ │ │ │ +Definition: crease.h:93 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options │ │ │ │ │ +All supported options applying to subdivision scheme. │ │ │ │ │ +Definition: options.h:51 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM │ │ │ │ │ +@ CREASE_UNIFORM │ │ │ │ │ +Catmark rule. │ │ │ │ │ +Definition: options.h:69 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod │ │ │ │ │ +CreasingMethod GetCreasingMethod() const │ │ │ │ │ +Get edge crease rule. │ │ │ │ │ +Definition: options.h:101 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation │ │ │ │ │ +VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const │ │ │ │ │ +Get vertex boundary interpolation rule. │ │ │ │ │ +Definition: options.h:89 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ +@ VTX_BOUNDARY_EDGE_AND_CORNER │ │ │ │ │ +Definition: options.h:57 │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cpuEvaluator.h │ │ │ │ │ + * sdc │ │ │ │ │ + * crease.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00899.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/bufferDescriptor.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/sdc/bilinearScheme.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces
│ │ │ │ -
bufferDescriptor.h File Reference
│ │ │ │ +
bilinearScheme.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <string.h>
│ │ │ │ +#include "../sdc/scheme.h"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

struct  BufferDescriptor
 BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,29 +4,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -bufferDescriptor.h File Reference │ │ │ │ │ +Namespaces │ │ │ │ │ +bilinearScheme.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../sdc/scheme.h" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -struct  BufferDescriptor │ │ │ │ │ - BufferDescriptor is a struct which describes buffer elements in │ │ │ │ │ -  interleaved data buffers. Almost all Osd Evaluator APIs take │ │ │ │ │ - BufferDescriptors along with device-specific buffer objects. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * bufferDescriptor.h │ │ │ │ │ + * sdc │ │ │ │ │ + * bilinearScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00899_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/bufferDescriptor.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/sdc/bilinearScheme.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
bufferDescriptor.h
│ │ │ │ +
bilinearScheme.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2015 Pixar
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,99 +106,175 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │ -
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29#include <string.h>
│ │ │ │ +
24#ifndef OPENSUBDIV3_SDC_BILINEAR_SCHEME_H
│ │ │ │ +
25#define OPENSUBDIV3_SDC_BILINEAR_SCHEME_H
│ │ │ │ +
26
│ │ │ │ +
27#include "../version.h"
│ │ │ │ +
28
│ │ │ │ +
29#include "../sdc/scheme.h"
│ │ │ │
30
│ │ │ │
31namespace OpenSubdiv {
│ │ │ │
32namespace OPENSUBDIV_VERSION {
│ │ │ │
33
│ │ │ │ -
34namespace Osd {
│ │ │ │ +
34namespace Sdc {
│ │ │ │
35
│ │ │ │ -
46
│ │ │ │ -
47// example:
│ │ │ │ -
48// n
│ │ │ │ -
49// -----+----------------------------------------+-------------------------
│ │ │ │ -
50// | vertex 0 |
│ │ │ │ -
51// -----+----------------------------------------+-------------------------
│ │ │ │ -
52// | X Y Z R G B A Xu Yu Zu Xv Yv Zv |
│ │ │ │ -
53// -----+----------------------------------------+-------------------------
│ │ │ │ -
54// <------------- stride = 13 -------------->
│ │ │ │ -
55//
│ │ │ │ -
56// - XYZ (offset = n+0, length = 3, stride = 13)
│ │ │ │ -
57// - RGBA (offset = n+3, length = 4, stride = 13)
│ │ │ │ -
58// - uTangent (offset = n+7, length = 3, stride = 13)
│ │ │ │ -
59// - vTangent (offset = n+10, length = 3, stride = 13)
│ │ │ │ -
60//
│ │ │ │ - │ │ │ │ -
62
│ │ │ │ - │ │ │ │ -
65
│ │ │ │ -
67 BufferDescriptor(int o, int l, int s) : offset(o), length(l), stride(s) { }
│ │ │ │ -
68
│ │ │ │ -
70 int GetLocalOffset() const {
│ │ │ │ -
71 return stride > 0 ? offset % stride : 0;
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ -
75 bool IsValid() const {
│ │ │ │ -
76 return ((length > 0) &&
│ │ │ │ - │ │ │ │ -
78 }
│ │ │ │ -
79
│ │ │ │ -
81 void Reset() {
│ │ │ │ -
82 offset = length = stride = 0;
│ │ │ │ -
83 }
│ │ │ │ -
84
│ │ │ │ -
86 bool operator == (BufferDescriptor const &other) const {
│ │ │ │ -
87 return (offset == other.offset &&
│ │ │ │ -
88 length == other.length &&
│ │ │ │ -
89 stride == other.stride);
│ │ │ │ -
90 }
│ │ │ │ -
91
│ │ │ │ -
93 bool operator != (BufferDescriptor const &other) const {
│ │ │ │ -
94 return !(this->operator==(other));
│ │ │ │ -
95 }
│ │ │ │ -
96
│ │ │ │ -
98 int offset;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
103};
│ │ │ │ -
104
│ │ │ │ -
105} // end namespace Osd
│ │ │ │ -
106
│ │ │ │ -
107} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
108using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
109
│ │ │ │ -
110} // end namespace OpenSubdiv
│ │ │ │ -
111
│ │ │ │ -
112#endif // OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H
│ │ │ │ +
36//
│ │ │ │ +
37// Specializations for Scheme<SCHEME_BILINEAR>:
│ │ │ │ +
38//
│ │ │ │ +
39
│ │ │ │ +
40//
│ │ │ │ +
41// Bilinear traits:
│ │ │ │ +
42//
│ │ │ │ +
43template <>
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ +
46template <>
│ │ │ │ + │ │ │ │ +
48
│ │ │ │ +
49template <>
│ │ │ │ + │ │ │ │ +
51
│ │ │ │ +
52template <>
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
55
│ │ │ │ +
56//
│ │ │ │ +
57// Refinement masks:
│ │ │ │ +
58//
│ │ │ │ +
59template <>
│ │ │ │ +
60template <typename EDGE, typename MASK>
│ │ │ │ +
61void
│ │ │ │ + │ │ │ │ + │ │ │ │ +
64 // This should be inline, otherwise trivially replicate it:
│ │ │ │ +
65 assignCreaseMaskForEdge(edge, mask);
│ │ │ │ +
66}
│ │ │ │ +
67
│ │ │ │ +
68template <>
│ │ │ │ +
69template <typename VERTEX, typename MASK>
│ │ │ │ +
70void
│ │ │ │ +
71Scheme<SCHEME_BILINEAR>::ComputeVertexVertexMask(VERTEX const& vertex, MASK& mask,
│ │ │ │ + │ │ │ │ +
73 // This should be inline, otherwise trivially replicate it:
│ │ │ │ +
74 assignCornerMaskForVertex(vertex, mask);
│ │ │ │ +
75}
│ │ │ │ +
76
│ │ │ │ +
77
│ │ │ │ +
78//
│ │ │ │ +
79// Limit masks for position -- the limit position of all vertices is the refined vertex.
│ │ │ │ +
80//
│ │ │ │ +
81template <>
│ │ │ │ +
82template <typename VERTEX, typename MASK>
│ │ │ │ +
83inline void
│ │ │ │ +
84Scheme<SCHEME_BILINEAR>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ +
85
│ │ │ │ +
86 posMask.SetNumVertexWeights(1);
│ │ │ │ +
87 posMask.SetNumEdgeWeights(0);
│ │ │ │ +
88 posMask.SetNumFaceWeights(0);
│ │ │ │ +
89 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
90
│ │ │ │ +
91 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ +
92}
│ │ │ │ +
93
│ │ │ │ +
94template <>
│ │ │ │ +
95template <typename VERTEX, typename MASK>
│ │ │ │ +
96inline void
│ │ │ │ +
97Scheme<SCHEME_BILINEAR>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ +
98 int const /* creaseEnds */[2]) const {
│ │ │ │ +
99
│ │ │ │ +
100 assignCornerLimitMask(vertex, posMask);
│ │ │ │ +
101}
│ │ │ │ +
102
│ │ │ │ +
103template <>
│ │ │ │ +
104template <typename VERTEX, typename MASK>
│ │ │ │ +
105inline void
│ │ │ │ +
106Scheme<SCHEME_BILINEAR>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ +
107
│ │ │ │ +
108 assignCornerLimitMask(vertex, posMask);
│ │ │ │ +
109}
│ │ │ │ +
110
│ │ │ │ +
111//
│ │ │ │ +
112// Limit masks for tangents -- these are ambiguous around all vertices. Provide
│ │ │ │ +
113// the tangents based on the incident edges of the first face.
│ │ │ │ +
114//
│ │ │ │ +
115template <>
│ │ │ │ +
116template <typename VERTEX, typename MASK>
│ │ │ │ +
117inline void
│ │ │ │ + │ │ │ │ +
119 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
120
│ │ │ │ +
121 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
122 tan1Mask.SetNumEdgeWeights(2);
│ │ │ │ +
123 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ +
124 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
125
│ │ │ │ +
126 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
127 tan2Mask.SetNumEdgeWeights(2);
│ │ │ │ +
128 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ +
129 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
130
│ │ │ │ +
131 tan1Mask.VertexWeight(0) = -1.0f;
│ │ │ │ +
132 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ +
133 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ +
134
│ │ │ │ +
135 tan2Mask.VertexWeight(0) = -1.0f;
│ │ │ │ +
136 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ +
137 tan2Mask.EdgeWeight(1) = 1.0f;
│ │ │ │ +
138}
│ │ │ │ +
139
│ │ │ │ +
140template <>
│ │ │ │ +
141template <typename VERTEX, typename MASK>
│ │ │ │ +
142inline void
│ │ │ │ + │ │ │ │ +
144 MASK& tan1Mask, MASK& tan2Mask, int const /* creaseEnds */[2]) const {
│ │ │ │ +
145
│ │ │ │ +
146 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ +
147}
│ │ │ │ +
148
│ │ │ │ +
149template <>
│ │ │ │ +
150template <typename VERTEX, typename MASK>
│ │ │ │ +
151inline void
│ │ │ │ + │ │ │ │ +
153 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
154
│ │ │ │ +
155 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ +
156}
│ │ │ │ +
157
│ │ │ │ +
158} // end namespace sdc
│ │ │ │ +
159
│ │ │ │ +
160} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
161using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
162} // end namespace OpenSubdiv
│ │ │ │ +
163
│ │ │ │ +
164#endif /* OPENSUBDIV3_SDC_BILINEAR_SCHEME_H */
│ │ │ │ │ │ │ │ -
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
│ │ │ │ - │ │ │ │ -
void Reset()
Resets the descriptor to default.
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
bool operator!=(BufferDescriptor const &other) const
True if the descriptors are not identical.
│ │ │ │ -
bool operator==(BufferDescriptor const &other) const
True if the descriptors are identical.
│ │ │ │ -
bool IsValid() const
True if the descriptor values are internally consistent.
│ │ │ │ -
int GetLocalOffset() const
Returns the relative offset within a stride.
│ │ │ │ - │ │ │ │ +
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ +
@ SPLIT_TO_QUADS
Used by Catmark and Bilinear.
Definition: types.h:48
│ │ │ │ + │ │ │ │ + │ │ │ │ +
void ComputeVertexVertexMask(VERTEX const &vertexNeighborhood, MASK &vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease tr...
Definition: scheme.h:512
│ │ │ │ +
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ + │ │ │ │ +
void ComputeEdgeVertexMask(EDGE const &edgeNeighborhood, MASK &edgeVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accel...
Definition: scheme.h:392
│ │ │ │ +
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ + │ │ │ │ +
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ + │ │ │ │ +
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ +
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -bufferDescriptor.h │ │ │ │ │ +bilinearScheme.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2015 Pixar │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,126 +29,211 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29#include │ │ │ │ │ + 24#ifndef OPENSUBDIV3_SDC_BILINEAR_SCHEME_H │ │ │ │ │ + 25#define OPENSUBDIV3_SDC_BILINEAR_SCHEME_H │ │ │ │ │ + 26 │ │ │ │ │ + 27#include "../version.h" │ │ │ │ │ + 28 │ │ │ │ │ + 29#include "../sdc/scheme.h" │ │ │ │ │ 30 │ │ │ │ │ 31namespace OpenSubdiv { │ │ │ │ │ 32namespace OPENSUBDIV_VERSION { │ │ │ │ │ 33 │ │ │ │ │ -34namespace Osd { │ │ │ │ │ +34namespace Sdc { │ │ │ │ │ 35 │ │ │ │ │ - 46 │ │ │ │ │ - 47// example: │ │ │ │ │ - 48// n │ │ │ │ │ - 49// -----+----------------------------------------+------------------------- │ │ │ │ │ - 50// | vertex 0 | │ │ │ │ │ - 51// -----+----------------------------------------+------------------------- │ │ │ │ │ - 52// | X Y Z R G B A Xu Yu Zu Xv Yv Zv | │ │ │ │ │ - 53// -----+----------------------------------------+------------------------- │ │ │ │ │ - 54// <------------- stride = 13 --------------> │ │ │ │ │ - 55// │ │ │ │ │ - 56// - XYZ (offset = n+0, length = 3, stride = 13) │ │ │ │ │ - 57// - RGBA (offset = n+3, length = 4, stride = 13) │ │ │ │ │ - 58// - uTangent (offset = n+7, length = 3, stride = 13) │ │ │ │ │ - 59// - vTangent (offset = n+10, length = 3, stride = 13) │ │ │ │ │ - 60// │ │ │ │ │ -61struct BufferDescriptor { │ │ │ │ │ - 62 │ │ │ │ │ -64 BufferDescriptor() : offset(0), length(0), stride(0) { } │ │ │ │ │ - 65 │ │ │ │ │ -67 BufferDescriptor(int o, int l, int s) : offset(o), length(l), stride(s) { } │ │ │ │ │ - 68 │ │ │ │ │ -70 int GetLocalOffset() const { │ │ │ │ │ - 71 return stride > 0 ? offset % stride : 0; │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ -75 bool IsValid() const { │ │ │ │ │ - 76 return ((length > 0) && │ │ │ │ │ - 77 (length <= stride - GetLocalOffset())); │ │ │ │ │ - 78 } │ │ │ │ │ - 79 │ │ │ │ │ -81 void Reset() { │ │ │ │ │ - 82 offset = length = stride = 0; │ │ │ │ │ - 83 } │ │ │ │ │ - 84 │ │ │ │ │ -86 bool operator_==(BufferDescriptor const &other) const { │ │ │ │ │ - 87 return (offset == other.offset && │ │ │ │ │ - 88 length == other.length && │ │ │ │ │ - 89 stride == other.stride); │ │ │ │ │ - 90 } │ │ │ │ │ - 91 │ │ │ │ │ -93 bool operator_!=(BufferDescriptor const &other) const { │ │ │ │ │ - 94 return !(this->operator==(other)); │ │ │ │ │ - 95 } │ │ │ │ │ - 96 │ │ │ │ │ -98 int offset; │ │ │ │ │ -100 int length; │ │ │ │ │ -102 int stride; │ │ │ │ │ - 103}; │ │ │ │ │ - 104 │ │ │ │ │ - 105} // end namespace Osd │ │ │ │ │ - 106 │ │ │ │ │ - 107} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 108using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 109 │ │ │ │ │ - 110} // end namespace OpenSubdiv │ │ │ │ │ - 111 │ │ │ │ │ - 112#endif // OPENSUBDIV3_OSD_BUFFER_DESCRIPTOR_H │ │ │ │ │ + 36// │ │ │ │ │ + 37// Specializations for Scheme: │ │ │ │ │ + 38// │ │ │ │ │ + 39 │ │ │ │ │ + 40// │ │ │ │ │ + 41// Bilinear traits: │ │ │ │ │ + 42// │ │ │ │ │ + 43template <> │ │ │ │ │ +44inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ +SPLIT_TO_QUADS; } │ │ │ │ │ + 45 │ │ │ │ │ + 46template <> │ │ │ │ │ +47inline int Scheme::GetRegularFaceSize() { return 4; } │ │ │ │ │ + 48 │ │ │ │ │ + 49template <> │ │ │ │ │ +50inline int Scheme::GetRegularVertexValence() { return 4; } │ │ │ │ │ + 51 │ │ │ │ │ + 52template <> │ │ │ │ │ +53inline int Scheme::GetLocalNeighborhoodSize() { return 0; } │ │ │ │ │ + 54 │ │ │ │ │ + 55 │ │ │ │ │ + 56// │ │ │ │ │ + 57// Refinement masks: │ │ │ │ │ + 58// │ │ │ │ │ + 59template <> │ │ │ │ │ + 60template │ │ │ │ │ + 61void │ │ │ │ │ +62Scheme::ComputeEdgeVertexMask(EDGE const& edge, MASK& mask, │ │ │ │ │ + 63 Crease::Rule, Crease::Rule) const { │ │ │ │ │ + 64 // This should be inline, otherwise trivially replicate it: │ │ │ │ │ + 65 assignCreaseMaskForEdge(edge, mask); │ │ │ │ │ + 66} │ │ │ │ │ + 67 │ │ │ │ │ + 68template <> │ │ │ │ │ + 69template │ │ │ │ │ + 70void │ │ │ │ │ +71Scheme::ComputeVertexVertexMask(VERTEX const& vertex, MASK& │ │ │ │ │ +mask, │ │ │ │ │ + 72 Crease::Rule, Crease::Rule) const { │ │ │ │ │ + 73 // This should be inline, otherwise trivially replicate it: │ │ │ │ │ + 74 assignCornerMaskForVertex(vertex, mask); │ │ │ │ │ + 75} │ │ │ │ │ + 76 │ │ │ │ │ + 77 │ │ │ │ │ + 78// │ │ │ │ │ + 79// Limit masks for position -- the limit position of all vertices is the │ │ │ │ │ +refined vertex. │ │ │ │ │ + 80// │ │ │ │ │ + 81template <> │ │ │ │ │ + 82template │ │ │ │ │ + 83inline void │ │ │ │ │ +84Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, │ │ │ │ │ +MASK& posMask) const { │ │ │ │ │ + 85 │ │ │ │ │ + 86 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 87 posMask.SetNumEdgeWeights(0); │ │ │ │ │ + 88 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 89 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 90 │ │ │ │ │ + 91 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ + 92} │ │ │ │ │ + 93 │ │ │ │ │ + 94template <> │ │ │ │ │ + 95template │ │ │ │ │ + 96inline void │ │ │ │ │ +97Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask, │ │ │ │ │ + 98 int const /* creaseEnds */[2]) const { │ │ │ │ │ + 99 │ │ │ │ │ + 100 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ + 101} │ │ │ │ │ + 102 │ │ │ │ │ + 103template <> │ │ │ │ │ + 104template │ │ │ │ │ + 105inline void │ │ │ │ │ +106Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask) const { │ │ │ │ │ + 107 │ │ │ │ │ + 108 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ + 109} │ │ │ │ │ + 110 │ │ │ │ │ + 111// │ │ │ │ │ + 112// Limit masks for tangents -- these are ambiguous around all vertices. │ │ │ │ │ +Provide │ │ │ │ │ + 113// the tangents based on the incident edges of the first face. │ │ │ │ │ + 114// │ │ │ │ │ + 115template <> │ │ │ │ │ + 116template │ │ │ │ │ + 117inline void │ │ │ │ │ +118Scheme::assignCornerLimitTangentMasks(VERTEX const& / │ │ │ │ │ +* vertex */, │ │ │ │ │ + 119 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 120 │ │ │ │ │ + 121 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 122 tan1Mask.SetNumEdgeWeights(2); │ │ │ │ │ + 123 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ + 124 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 125 │ │ │ │ │ + 126 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 127 tan2Mask.SetNumEdgeWeights(2); │ │ │ │ │ + 128 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ + 129 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 130 │ │ │ │ │ + 131 tan1Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ + 132 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ + 133 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ + 134 │ │ │ │ │ + 135 tan2Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ + 136 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ + 137 tan2Mask.EdgeWeight(1) = 1.0f; │ │ │ │ │ + 138} │ │ │ │ │ + 139 │ │ │ │ │ + 140template <> │ │ │ │ │ + 141template │ │ │ │ │ + 142inline void │ │ │ │ │ +143Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 144 MASK& tan1Mask, MASK& tan2Mask, int const /* creaseEnds */[2]) const { │ │ │ │ │ + 145 │ │ │ │ │ + 146 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ + 147} │ │ │ │ │ + 148 │ │ │ │ │ + 149template <> │ │ │ │ │ + 150template │ │ │ │ │ + 151inline void │ │ │ │ │ +152Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 153 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 154 │ │ │ │ │ + 155 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ + 156} │ │ │ │ │ + 157 │ │ │ │ │ + 158} // end namespace sdc │ │ │ │ │ + 159 │ │ │ │ │ + 160} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 161using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 162} // end namespace OpenSubdiv │ │ │ │ │ + 163 │ │ │ │ │ + 164#endif /* OPENSUBDIV3_SDC_BILINEAR_SCHEME_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor │ │ │ │ │ -BufferDescriptor is a struct which describes buffer elements in interleaved │ │ │ │ │ -data buffers.... │ │ │ │ │ -Definition: bufferDescriptor.h:61 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::stride │ │ │ │ │ -int stride │ │ │ │ │ -stride to the next element │ │ │ │ │ -Definition: bufferDescriptor.h:102 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::Reset │ │ │ │ │ -void Reset() │ │ │ │ │ -Resets the descriptor to default. │ │ │ │ │ -Definition: bufferDescriptor.h:81 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::BufferDescriptor │ │ │ │ │ -BufferDescriptor() │ │ │ │ │ -Default Constructor. │ │ │ │ │ -Definition: bufferDescriptor.h:64 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::BufferDescriptor │ │ │ │ │ -BufferDescriptor(int o, int l, int s) │ │ │ │ │ -Constructor. │ │ │ │ │ -Definition: bufferDescriptor.h:67 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::length │ │ │ │ │ -int length │ │ │ │ │ -number or length of the data │ │ │ │ │ -Definition: bufferDescriptor.h:100 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::operator!= │ │ │ │ │ -bool operator!=(BufferDescriptor const &other) const │ │ │ │ │ -True if the descriptors are not identical. │ │ │ │ │ -Definition: bufferDescriptor.h:93 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::operator== │ │ │ │ │ -bool operator==(BufferDescriptor const &other) const │ │ │ │ │ -True if the descriptors are identical. │ │ │ │ │ -Definition: bufferDescriptor.h:86 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::IsValid │ │ │ │ │ -bool IsValid() const │ │ │ │ │ -True if the descriptor values are internally consistent. │ │ │ │ │ -Definition: bufferDescriptor.h:75 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::GetLocalOffset │ │ │ │ │ -int GetLocalOffset() const │ │ │ │ │ -Returns the relative offset within a stride. │ │ │ │ │ -Definition: bufferDescriptor.h:70 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor::offset │ │ │ │ │ -int offset │ │ │ │ │ -offset to desired element data │ │ │ │ │ -Definition: bufferDescriptor.h:98 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ +Split │ │ │ │ │ +Enumerated type for all face splitting schemes. │ │ │ │ │ +Definition: types.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_QUADS │ │ │ │ │ +@ SPLIT_TO_QUADS │ │ │ │ │ +Used by Catmark and Bilinear. │ │ │ │ │ +Definition: types.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Crease::Rule │ │ │ │ │ +Rule │ │ │ │ │ +Definition: crease.h:82 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ +static Split GetTopologicalSplitType() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeVertexVertexMask │ │ │ │ │ +void ComputeVertexVertexMask(VERTEX const &vertexNeighborhood, MASK │ │ │ │ │ +&vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule │ │ │ │ │ +childRule=Crease::RULE_UNKNOWN) const │ │ │ │ │ +Vertex-vertex masks If known, a single Rule or pair of Rules can be specified │ │ │ │ │ +(indicating a crease tr... │ │ │ │ │ +Definition: scheme.h:512 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ +void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2, int const creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ +static int GetRegularFaceSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::ComputeEdgeVertexMask │ │ │ │ │ +void ComputeEdgeVertexMask(EDGE const &edgeNeighborhood, MASK &edgeVertexMask, │ │ │ │ │ +Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease:: │ │ │ │ │ +RULE_UNKNOWN) const │ │ │ │ │ +Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can │ │ │ │ │ +be specified to accel... │ │ │ │ │ +Definition: scheme.h:392 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ +void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ +static int GetLocalNeighborhoodSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ +void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ +creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ +static int GetRegularVertexValence() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ +void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ +void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ +void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * bufferDescriptor.h │ │ │ │ │ + * sdc │ │ │ │ │ + * bilinearScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00902.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaVertexBuffer.h File Reference │ │ │ │ +OpenSubdiv: opensubdiv/sdc/catmarkScheme.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -81,43 +81,38 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces
│ │ │ │ -
cudaVertexBuffer.h File Reference
│ │ │ │ +
catmarkScheme.h File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include <cstddef>
│ │ │ │ +#include "../sdc/scheme.h"
│ │ │ │ +#include <cassert>
│ │ │ │ +#include <cmath>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  CudaVertexBuffer
 Concrete vertex buffer class for Cuda subdivision. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  OpenSubdiv
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION
 
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd
namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,27 +4,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -cudaVertexBuffer.h File Reference │ │ │ │ │ +Namespaces │ │ │ │ │ +catmarkScheme.h File Reference │ │ │ │ │ #include "../version.h" │ │ │ │ │ -#include │ │ │ │ │ +#include "../sdc/scheme.h" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  CudaVertexBuffer │ │ │ │ │ -  Concrete vertex buffer class for Cuda subdivision. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  OpenSubdiv │ │ │ │ │   │ │ │ │ │ namespace  OpenSubdiv::OPENSUBDIV_VERSION │ │ │ │ │   │ │ │ │ │ -namespace  OpenSubdiv::OPENSUBDIV_VERSION::Osd │ │ │ │ │ +namespace  OpenSubdiv::OPENSUBDIV_VERSION::Sdc │ │ │ │ │   │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cudaVertexBuffer.h │ │ │ │ │ + * sdc │ │ │ │ │ + * catmarkScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00902_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -OpenSubdiv: opensubdiv/osd/cudaVertexBuffer.h Source File │ │ │ │ +OpenSubdiv: opensubdiv/sdc/catmarkScheme.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -80,19 +80,19 @@ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -
cudaVertexBuffer.h
│ │ │ │ +
catmarkScheme.h
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1//
│ │ │ │ -
2// Copyright 2013 Pixar
│ │ │ │ +
2// Copyright 2014 DreamWorks Animation LLC.
│ │ │ │
3//
│ │ │ │
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
│ │ │ │
5// with the following modification; you may not use this file except in
│ │ │ │
6// compliance with the Apache License and the following modification to it:
│ │ │ │
7// Section 6. Trademarks. is deleted and replaced with:
│ │ │ │
8//
│ │ │ │
9// 6. Trademarks. This License does not grant permission to use the trade
│ │ │ │ @@ -106,78 +106,548 @@ │ │ │ │
17//
│ │ │ │
18// Unless required by applicable law or agreed to in writing, software
│ │ │ │
19// distributed under the Apache License with the above modification is
│ │ │ │
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
│ │ │ │
21// KIND, either express or implied. See the Apache License for the specific
│ │ │ │
22// language governing permissions and limitations under the Apache License.
│ │ │ │
23//
│ │ │ │ -
24
│ │ │ │ -
25#ifndef OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │ -
26#define OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │ -
27
│ │ │ │ -
28#include "../version.h"
│ │ │ │ -
29
│ │ │ │ -
30#include <cstddef>
│ │ │ │ -
31
│ │ │ │ -
32namespace OpenSubdiv {
│ │ │ │ -
33namespace OPENSUBDIV_VERSION {
│ │ │ │ -
34
│ │ │ │ -
35namespace Osd {
│ │ │ │ +
24#ifndef OPENSUBDIV3_SDC_CATMARK_SCHEME_H
│ │ │ │ +
25#define OPENSUBDIV3_SDC_CATMARK_SCHEME_H
│ │ │ │ +
26
│ │ │ │ +
27#include "../version.h"
│ │ │ │ +
28
│ │ │ │ +
29#include "../sdc/scheme.h"
│ │ │ │ +
30
│ │ │ │ +
31#include <cassert>
│ │ │ │ +
32#include <cmath>
│ │ │ │ +
33
│ │ │ │ +
34namespace OpenSubdiv {
│ │ │ │ +
35namespace OPENSUBDIV_VERSION {
│ │ │ │
36
│ │ │ │ - │ │ │ │ -
43
│ │ │ │ -
44public:
│ │ │ │ -
46 static CudaVertexBuffer * Create(int numElements, int numVertices,
│ │ │ │ -
47 void *deviceContext = NULL);
│ │ │ │ +
37namespace Sdc {
│ │ │ │ +
38
│ │ │ │ +
39//
│ │ │ │ +
40// Specializations for Scheme<SCHEME_CATMARK>:
│ │ │ │ +
41//
│ │ │ │ +
42
│ │ │ │ +
43//
│ │ │ │ +
44// Catmark traits:
│ │ │ │ +
45//
│ │ │ │ +
46template <>
│ │ │ │ + │ │ │ │
48
│ │ │ │ - │ │ │ │ +
49template <>
│ │ │ │ + │ │ │ │
51
│ │ │ │ -
54 void UpdateData(const float *src, int startVertex, int numVertices,
│ │ │ │ -
55 void *deviceContext=NULL);
│ │ │ │ -
56
│ │ │ │ -
58 int GetNumElements() const;
│ │ │ │ -
59
│ │ │ │ -
61 int GetNumVertices() const;
│ │ │ │ -
62
│ │ │ │ -
64 float * BindCudaBuffer();
│ │ │ │ -
65
│ │ │ │ -
66protected:
│ │ │ │ -
68 CudaVertexBuffer(int numElements, int numVertices);
│ │ │ │ -
69
│ │ │ │ -
72 bool allocate();
│ │ │ │ -
73
│ │ │ │ -
74private:
│ │ │ │ -
75 int _numElements;
│ │ │ │ -
76 int _numVertices;
│ │ │ │ -
77 void *_cudaMem;
│ │ │ │ -
78
│ │ │ │ -
79};
│ │ │ │ -
80
│ │ │ │ -
81} // end namespace Osd
│ │ │ │ -
82
│ │ │ │ -
83} // end namespace OPENSUBDIV_VERSION
│ │ │ │ -
84using namespace OPENSUBDIV_VERSION;
│ │ │ │ -
85
│ │ │ │ -
86} // end namespace OpenSubdiv
│ │ │ │ -
87
│ │ │ │ -
88#endif // OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H
│ │ │ │ +
52template <>
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
55template <>
│ │ │ │ + │ │ │ │ +
57
│ │ │ │ +
58
│ │ │ │ +
59//
│ │ │ │ +
60// Masks for edge-vertices: the hard Crease mask does not need to be specialized
│ │ │ │ +
61// (simply the midpoint), so all that is left is the Smooth case:
│ │ │ │ +
62//
│ │ │ │ +
63// The Smooth mask is complicated by the need to support the "triangle subdivision"
│ │ │ │ +
64// option, which applies different weighting in the presence of triangles. It is
│ │ │ │ +
65// up for debate as to whether this is useful or not -- we may be able to deprecate
│ │ │ │ +
66// this option.
│ │ │ │ +
67//
│ │ │ │ +
68template <>
│ │ │ │ +
69template <typename EDGE, typename MASK>
│ │ │ │ +
70inline void
│ │ │ │ +
71Scheme<SCHEME_CATMARK>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const {
│ │ │ │ +
72
│ │ │ │ +
73 typedef typename MASK::Weight Weight;
│ │ │ │ +
74
│ │ │ │ +
75 int faceCount = edge.GetNumFaces();
│ │ │ │ +
76
│ │ │ │ +
77 mask.SetNumVertexWeights(2);
│ │ │ │ +
78 mask.SetNumEdgeWeights(0);
│ │ │ │ +
79 mask.SetNumFaceWeights(faceCount);
│ │ │ │ +
80 mask.SetFaceWeightsForFaceCenters(true);
│ │ │ │ +
81
│ │ │ │ +
82 //
│ │ │ │ +
83 // Determine if we need to inspect incident faces and apply alternate weighting for
│ │ │ │ +
84 // triangles -- and if so, determine which of the two are triangles.
│ │ │ │ +
85 //
│ │ │ │ +
86 bool face0IsTri = false;
│ │ │ │ +
87 bool face1IsTri = false;
│ │ │ │ +
88 bool useTriangleOption = (_options.GetTriangleSubdivision() == Options::TRI_SUB_SMOOTH);
│ │ │ │ +
89 if (useTriangleOption) {
│ │ │ │ +
90 if (faceCount == 2) {
│ │ │ │ +
91 //
│ │ │ │ +
92 // Ideally we want to avoid this inspection when we have already subdivided at
│ │ │ │ +
93 // least once -- need something in the Edge interface to help avoid this, e.g.
│ │ │ │ +
94 // an IsRegular() query, the subdivision level...
│ │ │ │ +
95 //
│ │ │ │ +
96 int vertsPerFace[2];
│ │ │ │ +
97 edge.GetNumVerticesPerFace(vertsPerFace);
│ │ │ │ +
98
│ │ │ │ +
99 face0IsTri = (vertsPerFace[0] == 3);
│ │ │ │ +
100 face1IsTri = (vertsPerFace[1] == 3);
│ │ │ │ +
101 useTriangleOption = face0IsTri || face1IsTri;
│ │ │ │ +
102 } else {
│ │ │ │ +
103 useTriangleOption = false;
│ │ │ │ +
104 }
│ │ │ │ +
105 }
│ │ │ │ +
106
│ │ │ │ +
107 if (! useTriangleOption) {
│ │ │ │ +
108 mask.VertexWeight(0) = 0.25f;
│ │ │ │ +
109 mask.VertexWeight(1) = 0.25f;
│ │ │ │ +
110
│ │ │ │ +
111 if (faceCount == 2) {
│ │ │ │ +
112 mask.FaceWeight(0) = 0.25f;
│ │ │ │ +
113 mask.FaceWeight(1) = 0.25f;
│ │ │ │ +
114 } else {
│ │ │ │ +
115 Weight fWeight = 0.5f / (Weight)faceCount;
│ │ │ │ +
116 for (int i = 0; i < faceCount; ++i) {
│ │ │ │ +
117 mask.FaceWeight(i) = fWeight;
│ │ │ │ +
118 }
│ │ │ │ +
119 }
│ │ │ │ +
120 } else {
│ │ │ │ +
121 //
│ │ │ │ +
122 // This mimics the implementation in Hbr in terms of order of operations.
│ │ │ │ +
123 //
│ │ │ │ +
124 const Weight CATMARK_SMOOTH_TRI_EDGE_WEIGHT = (Weight) 0.470;
│ │ │ │ +
125
│ │ │ │ +
126 Weight f0Weight = face0IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f;
│ │ │ │ +
127 Weight f1Weight = face1IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f;
│ │ │ │ +
128
│ │ │ │ +
129 Weight fWeight = 0.5f * (f0Weight + f1Weight);
│ │ │ │ +
130 Weight vWeight = 0.5f * (1.0f - 2.0f * fWeight);
│ │ │ │ +
131
│ │ │ │ +
132 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
133 mask.VertexWeight(1) = vWeight;
│ │ │ │ +
134
│ │ │ │ +
135 mask.FaceWeight(0) = fWeight;
│ │ │ │ +
136 mask.FaceWeight(1) = fWeight;
│ │ │ │ +
137 }
│ │ │ │ +
138}
│ │ │ │ +
139
│ │ │ │ +
140
│ │ │ │ +
141//
│ │ │ │ +
142// Masks for vertex-vertices: the hard Corner mask does not need to be specialized
│ │ │ │ +
143// (simply the vertex itself), leaving the Crease and Smooth cases (Dart is smooth):
│ │ │ │ +
144//
│ │ │ │ +
145template <>
│ │ │ │ +
146template <typename VERTEX, typename MASK>
│ │ │ │ +
147inline void
│ │ │ │ + │ │ │ │ +
149 int const creaseEnds[2]) const {
│ │ │ │ +
150 typedef typename MASK::Weight Weight;
│ │ │ │ +
151
│ │ │ │ +
152 int valence = vertex.GetNumEdges();
│ │ │ │ +
153
│ │ │ │ +
154 mask.SetNumVertexWeights(1);
│ │ │ │ +
155 mask.SetNumEdgeWeights(valence);
│ │ │ │ +
156 mask.SetNumFaceWeights(0);
│ │ │ │ +
157 mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
158
│ │ │ │ +
159 Weight vWeight = 0.75f;
│ │ │ │ +
160 Weight eWeight = 0.125f;
│ │ │ │ +
161
│ │ │ │ +
162 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
163 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
164 mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
165 }
│ │ │ │ +
166 mask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ +
167 mask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ +
168}
│ │ │ │ +
169
│ │ │ │ +
170template <>
│ │ │ │ +
171template <typename VERTEX, typename MASK>
│ │ │ │ +
172inline void
│ │ │ │ +
173Scheme<SCHEME_CATMARK>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const {
│ │ │ │ +
174
│ │ │ │ +
175 typedef typename MASK::Weight Weight;
│ │ │ │ +
176
│ │ │ │ +
177 //
│ │ │ │ +
178 // A Smooth vertex must be manifold and interior -- manifold boundary vertices will be
│ │ │ │ +
179 // Creases and non-manifold vertices of any kind will be Corners or Creases. If smooth
│ │ │ │ +
180 // rules for non-manifold vertices are ever defined, this will need adjusting:
│ │ │ │ +
181 //
│ │ │ │ +
182 assert(vertex.GetNumFaces() == vertex.GetNumEdges());
│ │ │ │ +
183
│ │ │ │ +
184 int valence = vertex.GetNumFaces();
│ │ │ │ +
185
│ │ │ │ +
186 mask.SetNumVertexWeights(1);
│ │ │ │ +
187 mask.SetNumEdgeWeights(valence);
│ │ │ │ +
188 mask.SetNumFaceWeights(valence);
│ │ │ │ +
189 mask.SetFaceWeightsForFaceCenters(true);
│ │ │ │ +
190
│ │ │ │ +
191 Weight vWeight = (Weight)(valence - 2) / (Weight)valence;
│ │ │ │ +
192 Weight fWeight = 1.0f / (Weight)(valence * valence);
│ │ │ │ +
193 Weight eWeight = fWeight;
│ │ │ │ +
194
│ │ │ │ +
195 mask.VertexWeight(0) = vWeight;
│ │ │ │ +
196 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
197 mask.EdgeWeight(i) = eWeight;
│ │ │ │ +
198 mask.FaceWeight(i) = fWeight;
│ │ │ │ +
199 }
│ │ │ │ +
200}
│ │ │ │ +
201
│ │ │ │ +
202//
│ │ │ │ +
203// Limit masks for position:
│ │ │ │ +
204//
│ │ │ │ +
205template <>
│ │ │ │ +
206template <typename VERTEX, typename MASK>
│ │ │ │ +
207inline void
│ │ │ │ +
208Scheme<SCHEME_CATMARK>::assignCornerLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
│ │ │ │ +
209
│ │ │ │ +
210 posMask.SetNumVertexWeights(1);
│ │ │ │ +
211 posMask.SetNumEdgeWeights(0);
│ │ │ │ +
212 posMask.SetNumFaceWeights(0);
│ │ │ │ +
213 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
214
│ │ │ │ +
215 posMask.VertexWeight(0) = 1.0f;
│ │ │ │ +
216}
│ │ │ │ +
217
│ │ │ │ +
218template <>
│ │ │ │ +
219template <typename VERTEX, typename MASK>
│ │ │ │ +
220inline void
│ │ │ │ +
221Scheme<SCHEME_CATMARK>::assignCreaseLimitMask(VERTEX const& vertex, MASK& posMask,
│ │ │ │ +
222 int const creaseEnds[2]) const {
│ │ │ │ +
223
│ │ │ │ +
224 typedef typename MASK::Weight Weight;
│ │ │ │ +
225
│ │ │ │ +
226 int valence = vertex.GetNumEdges();
│ │ │ │ +
227
│ │ │ │ +
228 posMask.SetNumVertexWeights(1);
│ │ │ │ +
229 posMask.SetNumEdgeWeights(valence);
│ │ │ │ +
230 posMask.SetNumFaceWeights(0);
│ │ │ │ +
231 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
232
│ │ │ │ +
233 Weight vWeight = (Weight)(2.0 / 3.0);
│ │ │ │ +
234 Weight eWeight = (Weight)(1.0 / 6.0);
│ │ │ │ +
235
│ │ │ │ +
236 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
237 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
238 posMask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
239 }
│ │ │ │ +
240 posMask.EdgeWeight(creaseEnds[0]) = eWeight;
│ │ │ │ +
241 posMask.EdgeWeight(creaseEnds[1]) = eWeight;
│ │ │ │ +
242}
│ │ │ │ +
243
│ │ │ │ +
244template <>
│ │ │ │ +
245template <typename VERTEX, typename MASK>
│ │ │ │ +
246inline void
│ │ │ │ +
247Scheme<SCHEME_CATMARK>::assignSmoothLimitMask(VERTEX const& vertex, MASK& posMask) const {
│ │ │ │ +
248
│ │ │ │ +
249 typedef typename MASK::Weight Weight;
│ │ │ │ +
250
│ │ │ │ +
251 int valence = vertex.GetNumFaces();
│ │ │ │ +
252 if (valence == 2) {
│ │ │ │ +
253 assignCornerLimitMask(vertex, posMask);
│ │ │ │ +
254 return;
│ │ │ │ +
255 }
│ │ │ │ +
256
│ │ │ │ +
257 posMask.SetNumVertexWeights(1);
│ │ │ │ +
258 posMask.SetNumEdgeWeights(valence);
│ │ │ │ +
259 posMask.SetNumFaceWeights(valence);
│ │ │ │ +
260 posMask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
261
│ │ │ │ +
262 // Specialize for the regular case:
│ │ │ │ +
263 if (valence == 4) {
│ │ │ │ +
264 Weight fWeight = (Weight)(1.0 / 36.0);
│ │ │ │ +
265 Weight eWeight = (Weight)(1.0 / 9.0);
│ │ │ │ +
266 Weight vWeight = (Weight)(4.0 / 9.0);
│ │ │ │ +
267
│ │ │ │ +
268 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
269
│ │ │ │ +
270 posMask.EdgeWeight(0) = eWeight;
│ │ │ │ +
271 posMask.EdgeWeight(1) = eWeight;
│ │ │ │ +
272 posMask.EdgeWeight(2) = eWeight;
│ │ │ │ +
273 posMask.EdgeWeight(3) = eWeight;
│ │ │ │ +
274
│ │ │ │ +
275 posMask.FaceWeight(0) = fWeight;
│ │ │ │ +
276 posMask.FaceWeight(1) = fWeight;
│ │ │ │ +
277 posMask.FaceWeight(2) = fWeight;
│ │ │ │ +
278 posMask.FaceWeight(3) = fWeight;
│ │ │ │ +
279 } else {
│ │ │ │ +
280 Weight Valence = (Weight) valence;
│ │ │ │ +
281
│ │ │ │ +
282 Weight fWeight = 1.0f / (Valence * (Valence + 5.0f));
│ │ │ │ +
283 Weight eWeight = 4.0f * fWeight;
│ │ │ │ +
284 Weight vWeight = 1.0f - Valence * (eWeight + fWeight);
│ │ │ │ +
285
│ │ │ │ +
286 posMask.VertexWeight(0) = vWeight;
│ │ │ │ +
287 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
288 posMask.EdgeWeight(i) = eWeight;
│ │ │ │ +
289 posMask.FaceWeight(i) = fWeight;
│ │ │ │ +
290 }
│ │ │ │ +
291 }
│ │ │ │ +
292}
│ │ │ │ +
293
│ │ │ │ +
294//
│ │ │ │ +
295// Limit masks for tangents -- these are stubs for now, or have a temporary
│ │ │ │ +
296// implementation
│ │ │ │ +
297//
│ │ │ │ +
298template <>
│ │ │ │ +
299template <typename VERTEX, typename MASK>
│ │ │ │ +
300inline void
│ │ │ │ + │ │ │ │ +
302 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
303
│ │ │ │ +
304 int valence = vertex.GetNumEdges();
│ │ │ │ +
305
│ │ │ │ +
306 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
307 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
308 tan1Mask.SetNumFaceWeights(0);
│ │ │ │ +
309 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
310
│ │ │ │ +
311 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
312 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
313 tan2Mask.SetNumFaceWeights(0);
│ │ │ │ +
314 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
315
│ │ │ │ +
316 // Should be at least 2 edges -- be sure to clear weights for any more:
│ │ │ │ +
317 tan1Mask.VertexWeight(0) = -1.0f;
│ │ │ │ +
318 tan1Mask.EdgeWeight(0) = 1.0f;
│ │ │ │ +
319 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ +
320
│ │ │ │ +
321 tan2Mask.VertexWeight(0) = -1.0f;
│ │ │ │ +
322 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ +
323 tan2Mask.EdgeWeight(1) = 1.0f;
│ │ │ │ +
324
│ │ │ │ +
325 for (int i = 2; i < valence; ++i) {
│ │ │ │ +
326 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
327 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
328 }
│ │ │ │ +
329}
│ │ │ │ +
330
│ │ │ │ +
331template <>
│ │ │ │ +
332template <typename VERTEX, typename MASK>
│ │ │ │ +
333inline void
│ │ │ │ + │ │ │ │ +
335 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const {
│ │ │ │ +
336
│ │ │ │ +
337 typedef typename MASK::Weight Weight;
│ │ │ │ +
338
│ │ │ │ +
339 //
│ │ │ │ +
340 // First, the tangent along the crease:
│ │ │ │ +
341 // The first crease edge is considered the "leading" edge of the span
│ │ │ │ +
342 // of surface for which we are evaluating tangents and the second edge the
│ │ │ │ +
343 // "trailing edge". By convention, the tangent along the crease is oriented
│ │ │ │ +
344 // in the direction of the leading edge.
│ │ │ │ +
345 //
│ │ │ │ +
346 int numEdges = vertex.GetNumEdges();
│ │ │ │ +
347 int numFaces = vertex.GetNumFaces();
│ │ │ │ +
348
│ │ │ │ +
349 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
350 tan1Mask.SetNumEdgeWeights(numEdges);
│ │ │ │ +
351 tan1Mask.SetNumFaceWeights(numFaces);
│ │ │ │ +
352 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
353
│ │ │ │ +
354 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
355 for (int i = 0; i < numEdges; ++i) {
│ │ │ │ +
356 tan1Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
357 }
│ │ │ │ +
358 for (int i = 0; i < numFaces; ++i) {
│ │ │ │ +
359 tan1Mask.FaceWeight(i) = 0.0f;
│ │ │ │ +
360 }
│ │ │ │ +
361
│ │ │ │ +
362 tan1Mask.EdgeWeight(creaseEnds[0]) = 0.5f;
│ │ │ │ +
363 tan1Mask.EdgeWeight(creaseEnds[1]) = -0.5f;
│ │ │ │ +
364
│ │ │ │ +
365 //
│ │ │ │ +
366 // Second, the tangent across the interior faces:
│ │ │ │ +
367 // Note this is ambiguous for an interior vertex. We currently return
│ │ │ │ +
368 // the tangent for the surface in the counter-clockwise span between the
│ │ │ │ +
369 // leading and trailing edges that form the crease. Given the expected
│ │ │ │ +
370 // computation of a surface normal as Tan1 X Tan2, this tangent should be
│ │ │ │ +
371 // oriented "inward" from the crease/boundary -- across the surface rather
│ │ │ │ +
372 // than outward and away from it.
│ │ │ │ +
373 //
│ │ │ │ +
374 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
375 tan2Mask.SetNumEdgeWeights(numEdges);
│ │ │ │ +
376 tan2Mask.SetNumFaceWeights(numFaces);
│ │ │ │ +
377 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
378
│ │ │ │ +
379 // Prepend weights of 0 preceding the crease:
│ │ │ │ +
380 for (int i = 0; i < creaseEnds[0]; ++i) {
│ │ │ │ +
381 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
382 tan2Mask.FaceWeight(i) = 0.0f;
│ │ │ │ +
383 }
│ │ │ │ +
384
│ │ │ │ +
385 // Assign weights to crease edge and interior points:
│ │ │ │ +
386 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1;
│ │ │ │ +
387 if (interiorEdgeCount == 1) {
│ │ │ │ +
388 // The regular case -- uniform B-spline cross-tangent:
│ │ │ │ +
389
│ │ │ │ +
390 tan2Mask.VertexWeight(0) = (Weight)(-4.0 / 6.0);
│ │ │ │ +
391
│ │ │ │ +
392 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight)(-1.0 / 6.0);
│ │ │ │ +
393 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = (Weight)( 4.0 / 6.0);
│ │ │ │ +
394 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight)(-1.0 / 6.0);
│ │ │ │ +
395
│ │ │ │ +
396 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight)(1.0 / 6.0);
│ │ │ │ +
397 tan2Mask.FaceWeight(creaseEnds[0] + 1) = (Weight)(1.0 / 6.0);
│ │ │ │ +
398 } else if (interiorEdgeCount > 1) {
│ │ │ │ +
399 // The irregular case -- formulae from Biermann et al:
│ │ │ │ +
400
│ │ │ │ +
401 double k = (double) (interiorEdgeCount + 1);
│ │ │ │ +
402 double theta = M_PI / k;
│ │ │ │ +
403
│ │ │ │ +
404 double cosTheta = std::cos(theta);
│ │ │ │ +
405 double sinTheta = std::sin(theta);
│ │ │ │ +
406
│ │ │ │ +
407 // Loop/Schaefer use a different divisor here (3*k + cos(theta)):
│ │ │ │ +
408 double commonDenom = 1.0f / (k * (3.0f + cosTheta));
│ │ │ │ +
409 double R = (cosTheta + 1.0f) / sinTheta;
│ │ │ │ +
410
│ │ │ │ +
411 double vertexWeight = 4.0f * R * (cosTheta - 1.0f);
│ │ │ │ +
412 double creaseWeight = -R * (1.0f + 2.0f * cosTheta);
│ │ │ │ +
413
│ │ │ │ +
414 tan2Mask.VertexWeight(0) = (Weight) (vertexWeight * commonDenom);
│ │ │ │ +
415
│ │ │ │ +
416 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight) (creaseWeight * commonDenom);
│ │ │ │ +
417 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight) (creaseWeight * commonDenom);
│ │ │ │ +
418
│ │ │ │ +
419 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight) (sinTheta * commonDenom);
│ │ │ │ +
420
│ │ │ │ +
421 double sinThetaI = 0.0f;
│ │ │ │ +
422 double sinThetaIplus1 = sinTheta;
│ │ │ │ +
423 for (int i = 1; i < k; ++i) {
│ │ │ │ +
424 sinThetaI = sinThetaIplus1;
│ │ │ │ +
425 sinThetaIplus1 = std::sin((i+1)*theta);
│ │ │ │ +
426
│ │ │ │ +
427 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) ((4.0f * sinThetaI) * commonDenom);
│ │ │ │ +
428 tan2Mask.FaceWeight(creaseEnds[0] + i) = (Weight) ((sinThetaI + sinThetaIplus1) * commonDenom);
│ │ │ │ +
429 }
│ │ │ │ +
430 } else {
│ │ │ │ +
431 // Special case for a single face -- simple average of boundary edges:
│ │ │ │ +
432
│ │ │ │ +
433 tan2Mask.VertexWeight(0) = -6.0f;
│ │ │ │ +
434
│ │ │ │ +
435 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f;
│ │ │ │ +
436 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f;
│ │ │ │ +
437
│ │ │ │ +
438 tan2Mask.FaceWeight(creaseEnds[0]) = 0.0f;
│ │ │ │ +
439 }
│ │ │ │ +
440
│ │ │ │ +
441 // Append weights of 0 following the crease:
│ │ │ │ +
442 for (int i = creaseEnds[1]; i < numFaces; ++i) {
│ │ │ │ +
443 tan2Mask.FaceWeight(i) = 0.0f;
│ │ │ │ +
444 }
│ │ │ │ +
445 for (int i = creaseEnds[1] + 1; i < numEdges; ++i) {
│ │ │ │ +
446 tan2Mask.EdgeWeight(i) = 0.0f;
│ │ │ │ +
447 }
│ │ │ │ +
448}
│ │ │ │ +
449
│ │ │ │ +
450template <>
│ │ │ │ +
451template <typename VERTEX, typename MASK>
│ │ │ │ +
452inline void
│ │ │ │ + │ │ │ │ +
454 MASK& tan1Mask, MASK& tan2Mask) const {
│ │ │ │ +
455
│ │ │ │ +
456 typedef typename MASK::Weight Weight;
│ │ │ │ +
457
│ │ │ │ +
458 int valence = vertex.GetNumFaces();
│ │ │ │ +
459 if (valence == 2) {
│ │ │ │ +
460 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask);
│ │ │ │ +
461 return;
│ │ │ │ +
462 }
│ │ │ │ +
463
│ │ │ │ +
464 // Compute tan1 initially -- tan2 is simply a rotation:
│ │ │ │ +
465 tan1Mask.SetNumVertexWeights(1);
│ │ │ │ +
466 tan1Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
467 tan1Mask.SetNumFaceWeights(valence);
│ │ │ │ +
468 tan1Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
469
│ │ │ │ +
470 tan1Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
471
│ │ │ │ +
472 if (valence == 4) {
│ │ │ │ +
473 tan1Mask.EdgeWeight(0) = 4.0f;
│ │ │ │ +
474 tan1Mask.EdgeWeight(1) = 0.0f;
│ │ │ │ +
475 tan1Mask.EdgeWeight(2) = -4.0f;
│ │ │ │ +
476 tan1Mask.EdgeWeight(3) = 0.0f;
│ │ │ │ +
477
│ │ │ │ +
478 tan1Mask.FaceWeight(0) = 1.0f;
│ │ │ │ +
479 tan1Mask.FaceWeight(1) = -1.0f;
│ │ │ │ +
480 tan1Mask.FaceWeight(2) = -1.0f;
│ │ │ │ +
481 tan1Mask.FaceWeight(3) = 1.0f;
│ │ │ │ +
482 } else {
│ │ │ │ +
483 double theta = 2.0f * M_PI / (double)valence;
│ │ │ │ +
484
│ │ │ │ +
485 double cosTheta = std::cos(theta);
│ │ │ │ +
486 double cosHalfTheta = std::cos(theta * 0.5f);
│ │ │ │ +
487
│ │ │ │ +
488 double lambda = (5.0 / 16.0) + (1.0 / 16.0) *
│ │ │ │ +
489 (cosTheta + cosHalfTheta * std::sqrt(2.0f * (9.0f + cosTheta)));
│ │ │ │ +
490
│ │ │ │ +
491 double edgeWeightScale = 4.0f;
│ │ │ │ +
492 double faceWeightScale = 1.0f / (4.0f * lambda - 1.0f);
│ │ │ │ +
493
│ │ │ │ +
494 for (int i = 0; i < valence; ++i) {
│ │ │ │ +
495 double cosThetaI = std::cos( i * theta);
│ │ │ │ +
496 double cosThetaIplus1 = std::cos((i+1)* theta);
│ │ │ │ +
497
│ │ │ │ +
498 tan1Mask.EdgeWeight(i) = (Weight) (edgeWeightScale * cosThetaI);
│ │ │ │ +
499 tan1Mask.FaceWeight(i) = (Weight) (faceWeightScale * (cosThetaI + cosThetaIplus1));
│ │ │ │ +
500 }
│ │ │ │ +
501 }
│ │ │ │ +
502
│ │ │ │ +
503 // Now rotate/copy tan1 weights to tan2:
│ │ │ │ +
504 tan2Mask.SetNumVertexWeights(1);
│ │ │ │ +
505 tan2Mask.SetNumEdgeWeights(valence);
│ │ │ │ +
506 tan2Mask.SetNumFaceWeights(valence);
│ │ │ │ +
507 tan2Mask.SetFaceWeightsForFaceCenters(false);
│ │ │ │ +
508
│ │ │ │ +
509 tan2Mask.VertexWeight(0) = 0.0f;
│ │ │ │ +
510 if (valence == 4) {
│ │ │ │ +
511 tan2Mask.EdgeWeight(0) = 0.0f;
│ │ │ │ +
512 tan2Mask.EdgeWeight(1) = 4.0f;
│ │ │ │ +
513 tan2Mask.EdgeWeight(2) = 0.0f;
│ │ │ │ +
514 tan2Mask.EdgeWeight(3) = -4.0f;
│ │ │ │ +
515
│ │ │ │ +
516 tan2Mask.FaceWeight(0) = 1.0f;
│ │ │ │ +
517 tan2Mask.FaceWeight(1) = 1.0f;
│ │ │ │ +
518 tan2Mask.FaceWeight(2) = -1.0f;
│ │ │ │ +
519 tan2Mask.FaceWeight(3) = -1.0f;
│ │ │ │ +
520 } else {
│ │ │ │ +
521 tan2Mask.EdgeWeight(0) = tan1Mask.EdgeWeight(valence-1);
│ │ │ │ +
522 tan2Mask.FaceWeight(0) = tan1Mask.FaceWeight(valence-1);
│ │ │ │ +
523 for (int i = 1; i < valence; ++i) {
│ │ │ │ +
524 tan2Mask.EdgeWeight(i) = tan1Mask.EdgeWeight(i-1);
│ │ │ │ +
525 tan2Mask.FaceWeight(i) = tan1Mask.FaceWeight(i-1);
│ │ │ │ +
526 }
│ │ │ │ +
527 }
│ │ │ │ +
528}
│ │ │ │ +
529
│ │ │ │ +
530} // end namespace sdc
│ │ │ │ +
531
│ │ │ │ +
532} // end namespace OPENSUBDIV_VERSION
│ │ │ │ +
533using namespace OPENSUBDIV_VERSION;
│ │ │ │ +
534} // end namespace OpenSubdiv
│ │ │ │ +
535
│ │ │ │ +
536#endif /* OPENSUBDIV3_SDC_CATMARK_SCHEME_H */
│ │ │ │ │ │ │ │ -
Concrete vertex buffer class for Cuda subdivision.
│ │ │ │ - │ │ │ │ - │ │ │ │ -
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
│ │ │ │ -
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
│ │ │ │ -
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
│ │ │ │ -
static CudaVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
│ │ │ │ - │ │ │ │ -
CudaVertexBuffer(int numElements, int numVertices)
Constructor.
│ │ │ │ +
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
│ │ │ │ +
@ SPLIT_TO_QUADS
Used by Catmark and Bilinear.
Definition: types.h:48
│ │ │ │ +
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:74
│ │ │ │ +
void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const
│ │ │ │ + │ │ │ │ +
void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const creaseEnds[2]) const
│ │ │ │ +
void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
│ │ │ │ + │ │ │ │ +
void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ + │ │ │ │ +
void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
│ │ │ │ +
void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const
│ │ │ │ + │ │ │ │ +
void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │ +
void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const
│ │ │ │ +
void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK &tan2) const
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,18 +4,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ [Logo] OpenSubdiv │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -cudaVertexBuffer.h │ │ │ │ │ +catmarkScheme.h │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// │ │ │ │ │ - 2// Copyright 2013 Pixar │ │ │ │ │ + 2// Copyright 2014 DreamWorks Animation LLC. │ │ │ │ │ 3// │ │ │ │ │ 4// Licensed under the Apache License, Version 2.0 (the "Apache License") │ │ │ │ │ 5// with the following modification; you may not use this file except in │ │ │ │ │ 6// compliance with the Apache License and the following modification to it: │ │ │ │ │ 7// Section 6. Trademarks. is deleted and replaced with: │ │ │ │ │ 8// │ │ │ │ │ 9// 6. Trademarks. This License does not grant permission to use the trade │ │ │ │ │ @@ -29,90 +29,595 @@ │ │ │ │ │ 17// │ │ │ │ │ 18// Unless required by applicable law or agreed to in writing, software │ │ │ │ │ 19// distributed under the Apache License with the above modification is │ │ │ │ │ 20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ 21// KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ 22// language governing permissions and limitations under the Apache License. │ │ │ │ │ 23// │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifndef OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ - 26#define OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../version.h" │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31 │ │ │ │ │ - 32namespace OpenSubdiv { │ │ │ │ │ - 33namespace OPENSUBDIV_VERSION { │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace Osd { │ │ │ │ │ + 24#ifndef OPENSUBDIV3_SDC_CATMARK_SCHEME_H │ │ │ │ │ + 25#define OPENSUBDIV3_SDC_CATMARK_SCHEME_H │ │ │ │ │ + 26 │ │ │ │ │ + 27#include "../version.h" │ │ │ │ │ + 28 │ │ │ │ │ + 29#include "../sdc/scheme.h" │ │ │ │ │ + 30 │ │ │ │ │ + 31#include │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34namespace OpenSubdiv { │ │ │ │ │ + 35namespace OPENSUBDIV_VERSION { │ │ │ │ │ 36 │ │ │ │ │ -42class CudaVertexBuffer { │ │ │ │ │ - 43 │ │ │ │ │ - 44public: │ │ │ │ │ -46 static CudaVertexBuffer * Create(int numElements, int numVertices, │ │ │ │ │ - 47 void *deviceContext = NULL); │ │ │ │ │ + 37namespace Sdc { │ │ │ │ │ + 38 │ │ │ │ │ + 39// │ │ │ │ │ + 40// Specializations for Scheme: │ │ │ │ │ + 41// │ │ │ │ │ + 42 │ │ │ │ │ + 43// │ │ │ │ │ + 44// Catmark traits: │ │ │ │ │ + 45// │ │ │ │ │ + 46template <> │ │ │ │ │ +47inline Split Scheme::GetTopologicalSplitType() { return │ │ │ │ │ +SPLIT_TO_QUADS; } │ │ │ │ │ 48 │ │ │ │ │ -50 ~CudaVertexBuffer(); │ │ │ │ │ + 49template <> │ │ │ │ │ +50inline int Scheme::GetRegularFaceSize() { return 4; } │ │ │ │ │ 51 │ │ │ │ │ -54 void UpdateData(const float *src, int startVertex, int numVertices, │ │ │ │ │ - 55 void *deviceContext=NULL); │ │ │ │ │ - 56 │ │ │ │ │ -58 int GetNumElements() const; │ │ │ │ │ - 59 │ │ │ │ │ -61 int GetNumVertices() const; │ │ │ │ │ - 62 │ │ │ │ │ -64 float * BindCudaBuffer(); │ │ │ │ │ - 65 │ │ │ │ │ - 66protected: │ │ │ │ │ -68 CudaVertexBuffer(int numElements, int numVertices); │ │ │ │ │ - 69 │ │ │ │ │ -72 bool allocate(); │ │ │ │ │ - 73 │ │ │ │ │ - 74private: │ │ │ │ │ - 75 int _numElements; │ │ │ │ │ - 76 int _numVertices; │ │ │ │ │ - 77 void *_cudaMem; │ │ │ │ │ - 78 │ │ │ │ │ - 79}; │ │ │ │ │ - 80 │ │ │ │ │ - 81} // end namespace Osd │ │ │ │ │ - 82 │ │ │ │ │ - 83} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ - 84using namespace OPENSUBDIV_VERSION; │ │ │ │ │ - 85 │ │ │ │ │ - 86} // end namespace OpenSubdiv │ │ │ │ │ - 87 │ │ │ │ │ - 88#endif // OPENSUBDIV3_OSD_CUDA_VERTEX_BUFFER_H │ │ │ │ │ + 52template <> │ │ │ │ │ +53inline int Scheme::GetRegularVertexValence() { return 4; } │ │ │ │ │ + 54 │ │ │ │ │ + 55template <> │ │ │ │ │ +56inline int Scheme::GetLocalNeighborhoodSize() { return 1; } │ │ │ │ │ + 57 │ │ │ │ │ + 58 │ │ │ │ │ + 59// │ │ │ │ │ + 60// Masks for edge-vertices: the hard Crease mask does not need to be │ │ │ │ │ +specialized │ │ │ │ │ + 61// (simply the midpoint), so all that is left is the Smooth case: │ │ │ │ │ + 62// │ │ │ │ │ + 63// The Smooth mask is complicated by the need to support the "triangle │ │ │ │ │ +subdivision" │ │ │ │ │ + 64// option, which applies different weighting in the presence of triangles. │ │ │ │ │ +It is │ │ │ │ │ + 65// up for debate as to whether this is useful or not -- we may be able to │ │ │ │ │ +deprecate │ │ │ │ │ + 66// this option. │ │ │ │ │ + 67// │ │ │ │ │ + 68template <> │ │ │ │ │ + 69template │ │ │ │ │ + 70inline void │ │ │ │ │ +71Scheme::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) │ │ │ │ │ +const { │ │ │ │ │ + 72 │ │ │ │ │ + 73 typedef typename MASK::Weight Weight; │ │ │ │ │ + 74 │ │ │ │ │ + 75 int faceCount = edge.GetNumFaces(); │ │ │ │ │ + 76 │ │ │ │ │ + 77 mask.SetNumVertexWeights(2); │ │ │ │ │ + 78 mask.SetNumEdgeWeights(0); │ │ │ │ │ + 79 mask.SetNumFaceWeights(faceCount); │ │ │ │ │ + 80 mask.SetFaceWeightsForFaceCenters(true); │ │ │ │ │ + 81 │ │ │ │ │ + 82 // │ │ │ │ │ + 83 // Determine if we need to inspect incident faces and apply alternate │ │ │ │ │ +weighting for │ │ │ │ │ + 84 // triangles -- and if so, determine which of the two are triangles. │ │ │ │ │ + 85 // │ │ │ │ │ + 86 bool face0IsTri = false; │ │ │ │ │ + 87 bool face1IsTri = false; │ │ │ │ │ + 88 bool useTriangleOption = (_options.GetTriangleSubdivision() == Options:: │ │ │ │ │ +TRI_SUB_SMOOTH); │ │ │ │ │ + 89 if (useTriangleOption) { │ │ │ │ │ + 90 if (faceCount == 2) { │ │ │ │ │ + 91 // │ │ │ │ │ + 92 // Ideally we want to avoid this inspection when we have already subdivided │ │ │ │ │ +at │ │ │ │ │ + 93 // least once -- need something in the Edge interface to help avoid this, │ │ │ │ │ +e.g. │ │ │ │ │ + 94 // an IsRegular() query, the subdivision level... │ │ │ │ │ + 95 // │ │ │ │ │ + 96 int vertsPerFace[2]; │ │ │ │ │ + 97 edge.GetNumVerticesPerFace(vertsPerFace); │ │ │ │ │ + 98 │ │ │ │ │ + 99 face0IsTri = (vertsPerFace[0] == 3); │ │ │ │ │ + 100 face1IsTri = (vertsPerFace[1] == 3); │ │ │ │ │ + 101 useTriangleOption = face0IsTri || face1IsTri; │ │ │ │ │ + 102 } else { │ │ │ │ │ + 103 useTriangleOption = false; │ │ │ │ │ + 104 } │ │ │ │ │ + 105 } │ │ │ │ │ + 106 │ │ │ │ │ + 107 if (! useTriangleOption) { │ │ │ │ │ + 108 mask.VertexWeight(0) = 0.25f; │ │ │ │ │ + 109 mask.VertexWeight(1) = 0.25f; │ │ │ │ │ + 110 │ │ │ │ │ + 111 if (faceCount == 2) { │ │ │ │ │ + 112 mask.FaceWeight(0) = 0.25f; │ │ │ │ │ + 113 mask.FaceWeight(1) = 0.25f; │ │ │ │ │ + 114 } else { │ │ │ │ │ + 115 Weight fWeight = 0.5f / (Weight)faceCount; │ │ │ │ │ + 116 for (int i = 0; i < faceCount; ++i) { │ │ │ │ │ + 117 mask.FaceWeight(i) = fWeight; │ │ │ │ │ + 118 } │ │ │ │ │ + 119 } │ │ │ │ │ + 120 } else { │ │ │ │ │ + 121 // │ │ │ │ │ + 122 // This mimics the implementation in Hbr in terms of order of operations. │ │ │ │ │ + 123 // │ │ │ │ │ + 124 const Weight CATMARK_SMOOTH_TRI_EDGE_WEIGHT = (Weight) 0.470; │ │ │ │ │ + 125 │ │ │ │ │ + 126 Weight f0Weight = face0IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f; │ │ │ │ │ + 127 Weight f1Weight = face1IsTri ? CATMARK_SMOOTH_TRI_EDGE_WEIGHT : 0.25f; │ │ │ │ │ + 128 │ │ │ │ │ + 129 Weight fWeight = 0.5f * (f0Weight + f1Weight); │ │ │ │ │ + 130 Weight vWeight = 0.5f * (1.0f - 2.0f * fWeight); │ │ │ │ │ + 131 │ │ │ │ │ + 132 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 133 mask.VertexWeight(1) = vWeight; │ │ │ │ │ + 134 │ │ │ │ │ + 135 mask.FaceWeight(0) = fWeight; │ │ │ │ │ + 136 mask.FaceWeight(1) = fWeight; │ │ │ │ │ + 137 } │ │ │ │ │ + 138} │ │ │ │ │ + 139 │ │ │ │ │ + 140 │ │ │ │ │ + 141// │ │ │ │ │ + 142// Masks for vertex-vertices: the hard Corner mask does not need to be │ │ │ │ │ +specialized │ │ │ │ │ + 143// (simply the vertex itself), leaving the Crease and Smooth cases (Dart is │ │ │ │ │ +smooth): │ │ │ │ │ + 144// │ │ │ │ │ + 145template <> │ │ │ │ │ + 146template │ │ │ │ │ + 147inline void │ │ │ │ │ +148Scheme::assignCreaseMaskForVertex(VERTEX const& vertex, │ │ │ │ │ +MASK& mask, │ │ │ │ │ + 149 int const creaseEnds[2]) const { │ │ │ │ │ + 150 typedef typename MASK::Weight Weight; │ │ │ │ │ + 151 │ │ │ │ │ + 152 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 153 │ │ │ │ │ + 154 mask.SetNumVertexWeights(1); │ │ │ │ │ + 155 mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 156 mask.SetNumFaceWeights(0); │ │ │ │ │ + 157 mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 158 │ │ │ │ │ + 159 Weight vWeight = 0.75f; │ │ │ │ │ + 160 Weight eWeight = 0.125f; │ │ │ │ │ + 161 │ │ │ │ │ + 162 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 163 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 164 mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 165 } │ │ │ │ │ + 166 mask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ + 167 mask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ + 168} │ │ │ │ │ + 169 │ │ │ │ │ + 170template <> │ │ │ │ │ + 171template │ │ │ │ │ + 172inline void │ │ │ │ │ +173Scheme::assignSmoothMaskForVertex(VERTEX const& vertex, │ │ │ │ │ +MASK& mask) const { │ │ │ │ │ + 174 │ │ │ │ │ + 175 typedef typename MASK::Weight Weight; │ │ │ │ │ + 176 │ │ │ │ │ + 177 // │ │ │ │ │ + 178 // A Smooth vertex must be manifold and interior -- manifold boundary │ │ │ │ │ +vertices will be │ │ │ │ │ + 179 // Creases and non-manifold vertices of any kind will be Corners or │ │ │ │ │ +Creases. If smooth │ │ │ │ │ + 180 // rules for non-manifold vertices are ever defined, this will need │ │ │ │ │ +adjusting: │ │ │ │ │ + 181 // │ │ │ │ │ + 182 assert(vertex.GetNumFaces() == vertex.GetNumEdges()); │ │ │ │ │ + 183 │ │ │ │ │ + 184 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 185 │ │ │ │ │ + 186 mask.SetNumVertexWeights(1); │ │ │ │ │ + 187 mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 188 mask.SetNumFaceWeights(valence); │ │ │ │ │ + 189 mask.SetFaceWeightsForFaceCenters(true); │ │ │ │ │ + 190 │ │ │ │ │ + 191 Weight vWeight = (Weight)(valence - 2) / (Weight)valence; │ │ │ │ │ + 192 Weight fWeight = 1.0f / (Weight)(valence * valence); │ │ │ │ │ + 193 Weight eWeight = fWeight; │ │ │ │ │ + 194 │ │ │ │ │ + 195 mask.VertexWeight(0) = vWeight; │ │ │ │ │ + 196 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 197 mask.EdgeWeight(i) = eWeight; │ │ │ │ │ + 198 mask.FaceWeight(i) = fWeight; │ │ │ │ │ + 199 } │ │ │ │ │ + 200} │ │ │ │ │ + 201 │ │ │ │ │ + 202// │ │ │ │ │ + 203// Limit masks for position: │ │ │ │ │ + 204// │ │ │ │ │ + 205template <> │ │ │ │ │ + 206template │ │ │ │ │ + 207inline void │ │ │ │ │ +208Scheme::assignCornerLimitMask(VERTEX const& /* vertex */, │ │ │ │ │ +MASK& posMask) const { │ │ │ │ │ + 209 │ │ │ │ │ + 210 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 211 posMask.SetNumEdgeWeights(0); │ │ │ │ │ + 212 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 213 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 214 │ │ │ │ │ + 215 posMask.VertexWeight(0) = 1.0f; │ │ │ │ │ + 216} │ │ │ │ │ + 217 │ │ │ │ │ + 218template <> │ │ │ │ │ + 219template │ │ │ │ │ + 220inline void │ │ │ │ │ +221Scheme::assignCreaseLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask, │ │ │ │ │ + 222 int const creaseEnds[2]) const { │ │ │ │ │ + 223 │ │ │ │ │ + 224 typedef typename MASK::Weight Weight; │ │ │ │ │ + 225 │ │ │ │ │ + 226 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 227 │ │ │ │ │ + 228 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 229 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ + 230 posMask.SetNumFaceWeights(0); │ │ │ │ │ + 231 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 232 │ │ │ │ │ + 233 Weight vWeight = (Weight)(2.0 / 3.0); │ │ │ │ │ + 234 Weight eWeight = (Weight)(1.0 / 6.0); │ │ │ │ │ + 235 │ │ │ │ │ + 236 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 237 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 238 posMask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 239 } │ │ │ │ │ + 240 posMask.EdgeWeight(creaseEnds[0]) = eWeight; │ │ │ │ │ + 241 posMask.EdgeWeight(creaseEnds[1]) = eWeight; │ │ │ │ │ + 242} │ │ │ │ │ + 243 │ │ │ │ │ + 244template <> │ │ │ │ │ + 245template │ │ │ │ │ + 246inline void │ │ │ │ │ +247Scheme::assignSmoothLimitMask(VERTEX const& vertex, MASK& │ │ │ │ │ +posMask) const { │ │ │ │ │ + 248 │ │ │ │ │ + 249 typedef typename MASK::Weight Weight; │ │ │ │ │ + 250 │ │ │ │ │ + 251 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 252 if (valence == 2) { │ │ │ │ │ + 253 assignCornerLimitMask(vertex, posMask); │ │ │ │ │ + 254 return; │ │ │ │ │ + 255 } │ │ │ │ │ + 256 │ │ │ │ │ + 257 posMask.SetNumVertexWeights(1); │ │ │ │ │ + 258 posMask.SetNumEdgeWeights(valence); │ │ │ │ │ + 259 posMask.SetNumFaceWeights(valence); │ │ │ │ │ + 260 posMask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 261 │ │ │ │ │ + 262 // Specialize for the regular case: │ │ │ │ │ + 263 if (valence == 4) { │ │ │ │ │ + 264 Weight fWeight = (Weight)(1.0 / 36.0); │ │ │ │ │ + 265 Weight eWeight = (Weight)(1.0 / 9.0); │ │ │ │ │ + 266 Weight vWeight = (Weight)(4.0 / 9.0); │ │ │ │ │ + 267 │ │ │ │ │ + 268 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 269 │ │ │ │ │ + 270 posMask.EdgeWeight(0) = eWeight; │ │ │ │ │ + 271 posMask.EdgeWeight(1) = eWeight; │ │ │ │ │ + 272 posMask.EdgeWeight(2) = eWeight; │ │ │ │ │ + 273 posMask.EdgeWeight(3) = eWeight; │ │ │ │ │ + 274 │ │ │ │ │ + 275 posMask.FaceWeight(0) = fWeight; │ │ │ │ │ + 276 posMask.FaceWeight(1) = fWeight; │ │ │ │ │ + 277 posMask.FaceWeight(2) = fWeight; │ │ │ │ │ + 278 posMask.FaceWeight(3) = fWeight; │ │ │ │ │ + 279 } else { │ │ │ │ │ + 280 Weight Valence = (Weight) valence; │ │ │ │ │ + 281 │ │ │ │ │ + 282 Weight fWeight = 1.0f / (Valence * (Valence + 5.0f)); │ │ │ │ │ + 283 Weight eWeight = 4.0f * fWeight; │ │ │ │ │ + 284 Weight vWeight = 1.0f - Valence * (eWeight + fWeight); │ │ │ │ │ + 285 │ │ │ │ │ + 286 posMask.VertexWeight(0) = vWeight; │ │ │ │ │ + 287 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 288 posMask.EdgeWeight(i) = eWeight; │ │ │ │ │ + 289 posMask.FaceWeight(i) = fWeight; │ │ │ │ │ + 290 } │ │ │ │ │ + 291 } │ │ │ │ │ + 292} │ │ │ │ │ + 293 │ │ │ │ │ + 294// │ │ │ │ │ + 295// Limit masks for tangents -- these are stubs for now, or have a temporary │ │ │ │ │ + 296// implementation │ │ │ │ │ + 297// │ │ │ │ │ + 298template <> │ │ │ │ │ + 299template │ │ │ │ │ + 300inline void │ │ │ │ │ +301Scheme::assignCornerLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 302 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 303 │ │ │ │ │ + 304 int valence = vertex.GetNumEdges(); │ │ │ │ │ + 305 │ │ │ │ │ + 306 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 307 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 308 tan1Mask.SetNumFaceWeights(0); │ │ │ │ │ + 309 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 310 │ │ │ │ │ + 311 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 312 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 313 tan2Mask.SetNumFaceWeights(0); │ │ │ │ │ + 314 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 315 │ │ │ │ │ + 316 // Should be at least 2 edges -- be sure to clear weights for any more: │ │ │ │ │ + 317 tan1Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ + 318 tan1Mask.EdgeWeight(0) = 1.0f; │ │ │ │ │ + 319 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ + 320 │ │ │ │ │ + 321 tan2Mask.VertexWeight(0) = -1.0f; │ │ │ │ │ + 322 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ + 323 tan2Mask.EdgeWeight(1) = 1.0f; │ │ │ │ │ + 324 │ │ │ │ │ + 325 for (int i = 2; i < valence; ++i) { │ │ │ │ │ + 326 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 327 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 328 } │ │ │ │ │ + 329} │ │ │ │ │ + 330 │ │ │ │ │ + 331template <> │ │ │ │ │ + 332template │ │ │ │ │ + 333inline void │ │ │ │ │ +334Scheme::assignCreaseLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 335 MASK& tan1Mask, MASK& tan2Mask, int const creaseEnds[2]) const { │ │ │ │ │ + 336 │ │ │ │ │ + 337 typedef typename MASK::Weight Weight; │ │ │ │ │ + 338 │ │ │ │ │ + 339 // │ │ │ │ │ + 340 // First, the tangent along the crease: │ │ │ │ │ + 341 // The first crease edge is considered the "leading" edge of the span │ │ │ │ │ + 342 // of surface for which we are evaluating tangents and the second edge the │ │ │ │ │ + 343 // "trailing edge". By convention, the tangent along the crease is │ │ │ │ │ +oriented │ │ │ │ │ + 344 // in the direction of the leading edge. │ │ │ │ │ + 345 // │ │ │ │ │ + 346 int numEdges = vertex.GetNumEdges(); │ │ │ │ │ + 347 int numFaces = vertex.GetNumFaces(); │ │ │ │ │ + 348 │ │ │ │ │ + 349 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 350 tan1Mask.SetNumEdgeWeights(numEdges); │ │ │ │ │ + 351 tan1Mask.SetNumFaceWeights(numFaces); │ │ │ │ │ + 352 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 353 │ │ │ │ │ + 354 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 355 for (int i = 0; i < numEdges; ++i) { │ │ │ │ │ + 356 tan1Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 357 } │ │ │ │ │ + 358 for (int i = 0; i < numFaces; ++i) { │ │ │ │ │ + 359 tan1Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ + 360 } │ │ │ │ │ + 361 │ │ │ │ │ + 362 tan1Mask.EdgeWeight(creaseEnds[0]) = 0.5f; │ │ │ │ │ + 363 tan1Mask.EdgeWeight(creaseEnds[1]) = -0.5f; │ │ │ │ │ + 364 │ │ │ │ │ + 365 // │ │ │ │ │ + 366 // Second, the tangent across the interior faces: │ │ │ │ │ + 367 // Note this is ambiguous for an interior vertex. We currently return │ │ │ │ │ + 368 // the tangent for the surface in the counter-clockwise span between the │ │ │ │ │ + 369 // leading and trailing edges that form the crease. Given the expected │ │ │ │ │ + 370 // computation of a surface normal as Tan1 X Tan2, this tangent should be │ │ │ │ │ + 371 // oriented "inward" from the crease/boundary -- across the surface rather │ │ │ │ │ + 372 // than outward and away from it. │ │ │ │ │ + 373 // │ │ │ │ │ + 374 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 375 tan2Mask.SetNumEdgeWeights(numEdges); │ │ │ │ │ + 376 tan2Mask.SetNumFaceWeights(numFaces); │ │ │ │ │ + 377 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 378 │ │ │ │ │ + 379 // Prepend weights of 0 preceding the crease: │ │ │ │ │ + 380 for (int i = 0; i < creaseEnds[0]; ++i) { │ │ │ │ │ + 381 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 382 tan2Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ + 383 } │ │ │ │ │ + 384 │ │ │ │ │ + 385 // Assign weights to crease edge and interior points: │ │ │ │ │ + 386 int interiorEdgeCount = creaseEnds[1] - creaseEnds[0] - 1; │ │ │ │ │ + 387 if (interiorEdgeCount == 1) { │ │ │ │ │ + 388 // The regular case -- uniform B-spline cross-tangent: │ │ │ │ │ + 389 │ │ │ │ │ + 390 tan2Mask.VertexWeight(0) = (Weight)(-4.0 / 6.0); │ │ │ │ │ + 391 │ │ │ │ │ + 392 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight)(-1.0 / 6.0); │ │ │ │ │ + 393 tan2Mask.EdgeWeight(creaseEnds[0] + 1) = (Weight)( 4.0 / 6.0); │ │ │ │ │ + 394 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight)(-1.0 / 6.0); │ │ │ │ │ + 395 │ │ │ │ │ + 396 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight)(1.0 / 6.0); │ │ │ │ │ + 397 tan2Mask.FaceWeight(creaseEnds[0] + 1) = (Weight)(1.0 / 6.0); │ │ │ │ │ + 398 } else if (interiorEdgeCount > 1) { │ │ │ │ │ + 399 // The irregular case -- formulae from Biermann et al: │ │ │ │ │ + 400 │ │ │ │ │ + 401 double k = (double) (interiorEdgeCount + 1); │ │ │ │ │ + 402 double theta = M_PI / k; │ │ │ │ │ + 403 │ │ │ │ │ + 404 double cosTheta = std::cos(theta); │ │ │ │ │ + 405 double sinTheta = std::sin(theta); │ │ │ │ │ + 406 │ │ │ │ │ + 407 // Loop/Schaefer use a different divisor here (3*k + cos(theta)): │ │ │ │ │ + 408 double commonDenom = 1.0f / (k * (3.0f + cosTheta)); │ │ │ │ │ + 409 double R = (cosTheta + 1.0f) / sinTheta; │ │ │ │ │ + 410 │ │ │ │ │ + 411 double vertexWeight = 4.0f * R * (cosTheta - 1.0f); │ │ │ │ │ + 412 double creaseWeight = -R * (1.0f + 2.0f * cosTheta); │ │ │ │ │ + 413 │ │ │ │ │ + 414 tan2Mask.VertexWeight(0) = (Weight) (vertexWeight * commonDenom); │ │ │ │ │ + 415 │ │ │ │ │ + 416 tan2Mask.EdgeWeight(creaseEnds[0]) = (Weight) (creaseWeight * │ │ │ │ │ +commonDenom); │ │ │ │ │ + 417 tan2Mask.EdgeWeight(creaseEnds[1]) = (Weight) (creaseWeight * │ │ │ │ │ +commonDenom); │ │ │ │ │ + 418 │ │ │ │ │ + 419 tan2Mask.FaceWeight(creaseEnds[0]) = (Weight) (sinTheta * commonDenom); │ │ │ │ │ + 420 │ │ │ │ │ + 421 double sinThetaI = 0.0f; │ │ │ │ │ + 422 double sinThetaIplus1 = sinTheta; │ │ │ │ │ + 423 for (int i = 1; i < k; ++i) { │ │ │ │ │ + 424 sinThetaI = sinThetaIplus1; │ │ │ │ │ + 425 sinThetaIplus1 = std::sin((i+1)*theta); │ │ │ │ │ + 426 │ │ │ │ │ + 427 tan2Mask.EdgeWeight(creaseEnds[0] + i) = (Weight) ((4.0f * sinThetaI) * │ │ │ │ │ +commonDenom); │ │ │ │ │ + 428 tan2Mask.FaceWeight(creaseEnds[0] + i) = (Weight) ((sinThetaI + │ │ │ │ │ +sinThetaIplus1) * commonDenom); │ │ │ │ │ + 429 } │ │ │ │ │ + 430 } else { │ │ │ │ │ + 431 // Special case for a single face -- simple average of boundary edges: │ │ │ │ │ + 432 │ │ │ │ │ + 433 tan2Mask.VertexWeight(0) = -6.0f; │ │ │ │ │ + 434 │ │ │ │ │ + 435 tan2Mask.EdgeWeight(creaseEnds[0]) = 3.0f; │ │ │ │ │ + 436 tan2Mask.EdgeWeight(creaseEnds[1]) = 3.0f; │ │ │ │ │ + 437 │ │ │ │ │ + 438 tan2Mask.FaceWeight(creaseEnds[0]) = 0.0f; │ │ │ │ │ + 439 } │ │ │ │ │ + 440 │ │ │ │ │ + 441 // Append weights of 0 following the crease: │ │ │ │ │ + 442 for (int i = creaseEnds[1]; i < numFaces; ++i) { │ │ │ │ │ + 443 tan2Mask.FaceWeight(i) = 0.0f; │ │ │ │ │ + 444 } │ │ │ │ │ + 445 for (int i = creaseEnds[1] + 1; i < numEdges; ++i) { │ │ │ │ │ + 446 tan2Mask.EdgeWeight(i) = 0.0f; │ │ │ │ │ + 447 } │ │ │ │ │ + 448} │ │ │ │ │ + 449 │ │ │ │ │ + 450template <> │ │ │ │ │ + 451template │ │ │ │ │ + 452inline void │ │ │ │ │ +453Scheme::assignSmoothLimitTangentMasks(VERTEX const& vertex, │ │ │ │ │ + 454 MASK& tan1Mask, MASK& tan2Mask) const { │ │ │ │ │ + 455 │ │ │ │ │ + 456 typedef typename MASK::Weight Weight; │ │ │ │ │ + 457 │ │ │ │ │ + 458 int valence = vertex.GetNumFaces(); │ │ │ │ │ + 459 if (valence == 2) { │ │ │ │ │ + 460 assignCornerLimitTangentMasks(vertex, tan1Mask, tan2Mask); │ │ │ │ │ + 461 return; │ │ │ │ │ + 462 } │ │ │ │ │ + 463 │ │ │ │ │ + 464 // Compute tan1 initially -- tan2 is simply a rotation: │ │ │ │ │ + 465 tan1Mask.SetNumVertexWeights(1); │ │ │ │ │ + 466 tan1Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 467 tan1Mask.SetNumFaceWeights(valence); │ │ │ │ │ + 468 tan1Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 469 │ │ │ │ │ + 470 tan1Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 471 │ │ │ │ │ + 472 if (valence == 4) { │ │ │ │ │ + 473 tan1Mask.EdgeWeight(0) = 4.0f; │ │ │ │ │ + 474 tan1Mask.EdgeWeight(1) = 0.0f; │ │ │ │ │ + 475 tan1Mask.EdgeWeight(2) = -4.0f; │ │ │ │ │ + 476 tan1Mask.EdgeWeight(3) = 0.0f; │ │ │ │ │ + 477 │ │ │ │ │ + 478 tan1Mask.FaceWeight(0) = 1.0f; │ │ │ │ │ + 479 tan1Mask.FaceWeight(1) = -1.0f; │ │ │ │ │ + 480 tan1Mask.FaceWeight(2) = -1.0f; │ │ │ │ │ + 481 tan1Mask.FaceWeight(3) = 1.0f; │ │ │ │ │ + 482 } else { │ │ │ │ │ + 483 double theta = 2.0f * M_PI / (double)valence; │ │ │ │ │ + 484 │ │ │ │ │ + 485 double cosTheta = std::cos(theta); │ │ │ │ │ + 486 double cosHalfTheta = std::cos(theta * 0.5f); │ │ │ │ │ + 487 │ │ │ │ │ + 488 double lambda = (5.0 / 16.0) + (1.0 / 16.0) * │ │ │ │ │ + 489 (cosTheta + cosHalfTheta * std::sqrt(2.0f * (9.0f + cosTheta))); │ │ │ │ │ + 490 │ │ │ │ │ + 491 double edgeWeightScale = 4.0f; │ │ │ │ │ + 492 double faceWeightScale = 1.0f / (4.0f * lambda - 1.0f); │ │ │ │ │ + 493 │ │ │ │ │ + 494 for (int i = 0; i < valence; ++i) { │ │ │ │ │ + 495 double cosThetaI = std::cos( i * theta); │ │ │ │ │ + 496 double cosThetaIplus1 = std::cos((i+1)* theta); │ │ │ │ │ + 497 │ │ │ │ │ + 498 tan1Mask.EdgeWeight(i) = (Weight) (edgeWeightScale * cosThetaI); │ │ │ │ │ + 499 tan1Mask.FaceWeight(i) = (Weight) (faceWeightScale * (cosThetaI + │ │ │ │ │ +cosThetaIplus1)); │ │ │ │ │ + 500 } │ │ │ │ │ + 501 } │ │ │ │ │ + 502 │ │ │ │ │ + 503 // Now rotate/copy tan1 weights to tan2: │ │ │ │ │ + 504 tan2Mask.SetNumVertexWeights(1); │ │ │ │ │ + 505 tan2Mask.SetNumEdgeWeights(valence); │ │ │ │ │ + 506 tan2Mask.SetNumFaceWeights(valence); │ │ │ │ │ + 507 tan2Mask.SetFaceWeightsForFaceCenters(false); │ │ │ │ │ + 508 │ │ │ │ │ + 509 tan2Mask.VertexWeight(0) = 0.0f; │ │ │ │ │ + 510 if (valence == 4) { │ │ │ │ │ + 511 tan2Mask.EdgeWeight(0) = 0.0f; │ │ │ │ │ + 512 tan2Mask.EdgeWeight(1) = 4.0f; │ │ │ │ │ + 513 tan2Mask.EdgeWeight(2) = 0.0f; │ │ │ │ │ + 514 tan2Mask.EdgeWeight(3) = -4.0f; │ │ │ │ │ + 515 │ │ │ │ │ + 516 tan2Mask.FaceWeight(0) = 1.0f; │ │ │ │ │ + 517 tan2Mask.FaceWeight(1) = 1.0f; │ │ │ │ │ + 518 tan2Mask.FaceWeight(2) = -1.0f; │ │ │ │ │ + 519 tan2Mask.FaceWeight(3) = -1.0f; │ │ │ │ │ + 520 } else { │ │ │ │ │ + 521 tan2Mask.EdgeWeight(0) = tan1Mask.EdgeWeight(valence-1); │ │ │ │ │ + 522 tan2Mask.FaceWeight(0) = tan1Mask.FaceWeight(valence-1); │ │ │ │ │ + 523 for (int i = 1; i < valence; ++i) { │ │ │ │ │ + 524 tan2Mask.EdgeWeight(i) = tan1Mask.EdgeWeight(i-1); │ │ │ │ │ + 525 tan2Mask.FaceWeight(i) = tan1Mask.FaceWeight(i-1); │ │ │ │ │ + 526 } │ │ │ │ │ + 527 } │ │ │ │ │ + 528} │ │ │ │ │ + 529 │ │ │ │ │ + 530} // end namespace sdc │ │ │ │ │ + 531 │ │ │ │ │ + 532} // end namespace OPENSUBDIV_VERSION │ │ │ │ │ + 533using namespace OPENSUBDIV_VERSION; │ │ │ │ │ + 534} // end namespace OpenSubdiv │ │ │ │ │ + 535 │ │ │ │ │ + 536#endif /* OPENSUBDIV3_SDC_CATMARK_SCHEME_H */ │ │ │ │ │ OpenSubdiv │ │ │ │ │ Definition: limits.h:32 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer │ │ │ │ │ -Concrete vertex buffer class for Cuda subdivision. │ │ │ │ │ -Definition: cudaVertexBuffer.h:42 │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::BindCudaBuffer │ │ │ │ │ -float * BindCudaBuffer() │ │ │ │ │ -Returns cuda memory. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::~CudaVertexBuffer │ │ │ │ │ -~CudaVertexBuffer() │ │ │ │ │ -Destructor. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::GetNumElements │ │ │ │ │ -int GetNumElements() const │ │ │ │ │ -Returns how many elements defined in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::UpdateData │ │ │ │ │ -void UpdateData(const float *src, int startVertex, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::GetNumVertices │ │ │ │ │ -int GetNumVertices() const │ │ │ │ │ -Returns how many vertices allocated in this vertex buffer. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::Create │ │ │ │ │ -static CudaVertexBuffer * Create(int numElements, int numVertices, void │ │ │ │ │ -*deviceContext=NULL) │ │ │ │ │ -Creator. Returns NULL if error. │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::allocate │ │ │ │ │ -bool allocate() │ │ │ │ │ -OpenSubdiv::OPENSUBDIV_VERSION::Osd::CudaVertexBuffer::CudaVertexBuffer │ │ │ │ │ -CudaVertexBuffer(int numElements, int numVertices) │ │ │ │ │ -Constructor. │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split │ │ │ │ │ +Split │ │ │ │ │ +Enumerated type for all face splitting schemes. │ │ │ │ │ +Definition: types.h:47 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SPLIT_TO_QUADS │ │ │ │ │ +@ SPLIT_TO_QUADS │ │ │ │ │ +Used by Catmark and Bilinear. │ │ │ │ │ +Definition: types.h:48 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH │ │ │ │ │ +@ TRI_SUB_SMOOTH │ │ │ │ │ +"smooth triangle" weights (Catmark scheme only) │ │ │ │ │ +Definition: options.h:74 │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForEdge │ │ │ │ │ +void assignSmoothMaskForEdge(EDGE const &edge, MASK &mask) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetTopologicalSplitType │ │ │ │ │ +static Split GetTopologicalSplitType() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseMaskForVertex │ │ │ │ │ +void assignCreaseMaskForVertex(VERTEX const &edge, MASK &mask, int const │ │ │ │ │ +creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitTangentMasks │ │ │ │ │ +void assignCreaseLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2, int const creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularFaceSize │ │ │ │ │ +static int GetRegularFaceSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitMask │ │ │ │ │ +void assignSmoothLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetLocalNeighborhoodSize │ │ │ │ │ +static int GetLocalNeighborhoodSize() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCreaseLimitMask │ │ │ │ │ +void assignCreaseLimitMask(VERTEX const &vertex, MASK &pos, int const │ │ │ │ │ +creaseEnds[2]) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothMaskForVertex │ │ │ │ │ +void assignSmoothMaskForVertex(VERTEX const &edge, MASK &mask) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::GetRegularVertexValence │ │ │ │ │ +static int GetRegularVertexValence() │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignSmoothLimitTangentMasks │ │ │ │ │ +void assignSmoothLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitMask │ │ │ │ │ +void assignCornerLimitMask(VERTEX const &vertex, MASK &pos) const │ │ │ │ │ +OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme::assignCornerLimitTangentMasks │ │ │ │ │ +void assignCornerLimitTangentMasks(VERTEX const &vertex, MASK &tan1, MASK │ │ │ │ │ +&tan2) const │ │ │ │ │ * opensubdiv │ │ │ │ │ - * osd │ │ │ │ │ - * cudaVertexBuffer.h │ │ │ │ │ + * sdc │ │ │ │ │ + * catmarkScheme.h │ │ │ │ │ * Generated on Sun Dec 11 2022 09:52:28 for OpenSubdiv by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00912.html │ │ │ │ @@ -284,15 +284,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef MeshInterface<D3D11PatchTable> D3D11MeshInterface
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 38 of file d3d11Mesh.h.

│ │ │ │ +

Definition at line 38 of file d3d11Mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GLMeshInterface

│ │ │ │ │ │ │ │
│ │ │ │ @@ -300,15 +300,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef MeshInterface<GLPatchTable> GLMeshInterface
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 38 of file glMesh.h.

│ │ │ │ +

Definition at line 38 of file glMesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ MeshBitset

│ │ │ │ │ │ │ │
│ │ │ │ @@ -316,15 +316,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef std::bitset<NUM_MESH_BITS> MeshBitset
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 63 of file mesh.h.

│ │ │ │ +

Definition at line 63 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ MTLMeshInterface

│ │ │ │ │ │ │ │
│ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef MeshInterface<MTLPatchTable> MTLMeshInterface
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 38 of file mtlMesh.h.

│ │ │ │ +

Definition at line 38 of file mtlMesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PatchArrayVector

│ │ │ │ │ │ │ │
│ │ │ │ @@ -395,15 +395,15 @@ │ │ │ │

MeshEndCapBilinearBasis 
MeshEndCapBSplineBasis 
MeshEndCapGregoryBasis 
MeshEndCapLegacyGregory 
NUM_MESH_BITS 
│ │ │ │ │ │ │ │ -

Definition at line 49 of file mesh.h.

│ │ │ │ +

Definition at line 49 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Function Documentation

│ │ │ │ │ │ │ │

◆ convertToCompatibleStencilTable()

│ │ │ │ │ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 141 of file mesh.h.

│ │ │ │ +

Definition at line 141 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ convertToCompatibleStencilTable< Far::LimitStencilTable, Far::LimitStencilTable, void >()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -464,15 +464,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 158 of file mesh.h.

│ │ │ │ +

Definition at line 158 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, ID3D11DeviceContext >()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -502,15 +502,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 168 of file mesh.h.

│ │ │ │ +

Definition at line 168 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ convertToCompatibleStencilTable< Far::StencilTable, Far::StencilTable, void >()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -540,15 +540,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 148 of file mesh.h.

│ │ │ │ +

Definition at line 148 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ OmpEvalStencils() [1/3]

│ │ │ │ │ │ │ │
│ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a00949.html │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
SurfaceFactoryCache Class Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Container used internally by SurfaceFactory to store reusable information. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <surfaceFactoryCache.h>

│ │ │ │ +

#include <surfaceFactoryCache.h>

│ │ │ │
│ │ │ │ Inheritance diagram for SurfaceFactoryCache:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE > │ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Container used internally by SurfaceFactory to store reusable information.

│ │ │ │

SurfaceFactoryCache is a container for storing/caching instances of the internal representation of complex patches used by SurfaceFactory so that they can be quickly identified and retrieved for reuse.

│ │ │ │

It is intended for internal use by SurfaceFactory. Public access is available but limited to construction only – allowing an instance to be reused by assigning it to more than one SurfaceFactory.

│ │ │ │ │ │ │ │ -

Definition at line 59 of file surfaceFactoryCache.h.

│ │ │ │ +

Definition at line 59 of file surfaceFactoryCache.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ SurfaceFactoryCache() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -215,15 +215,15 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Template for declaring thread-safe subclasses of SurfaceFactoryCache. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <surfaceFactoryCache.h>

│ │ │ │ +

#include <surfaceFactoryCache.h>

│ │ │ │
│ │ │ │ Inheritance diagram for SurfaceFactoryCacheThreaded< MUTEX_TYPE, READ_LOCK_GUARD_TYPE, WRITE_LOCK_GUARD_TYPE >:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ SurfaceFactoryCache │ │ │ │ @@ -130,15 +130,15 @@ │ │ │ │ MUTEX_TYPEA mutex type with supported lock guards │ │ │ │ READ_LOCK_GUARD_TYPEA scoped lock guard allowing potentially shared access for read operations. │ │ │ │ WRITE_LOCK_GUARD_TYPEA scoped lock guard allowing exclusive access for write operations. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 118 of file surfaceFactoryCache.h.

│ │ │ │ +

Definition at line 118 of file surfaceFactoryCache.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ SurfaceFactoryCacheThreaded()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -155,15 +155,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 120 of file surfaceFactoryCache.h.

│ │ │ │ +

Definition at line 120 of file surfaceFactoryCache.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ ~SurfaceFactoryCacheThreaded()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -185,15 +185,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Encapsulates a specific tessellation pattern of a Parameterization. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <tessellation.h>

│ │ │ │ +

#include <tessellation.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Options
 Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate. More...
 
│ │ │ │ @@ -212,15 +212,15 @@ │ │ │ │ │ │ │ │
 
│ │ │ │

Detailed Description

│ │ │ │

Encapsulates a specific tessellation pattern of a Parameterization.

│ │ │ │

Tessellation is a simple class that encapsulates a specified tessellation pattern for a given Parameterization. Tessellation parameters are given on construction and are fixed for its lifetime.

│ │ │ │

Methods allow inspection of the pattern in terms of the 2D coordinates of the points comprising the pattern and the faces that connect them. The 2D coordinates are referred to both in the documentation and the interface as "coords" while the faces connecting them are referred to as "facets" (to distinguish from the faces of the mesh, to which a Tessellation is applied).

│ │ │ │ │ │ │ │ -

Definition at line 51 of file tessellation.h.

│ │ │ │ +

Definition at line 51 of file tessellation.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Tessellation() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -434,15 +434,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Retrieve the coordinates for the entire pattern.

│ │ │ │ │ │ │ │ -

Definition at line 372 of file tessellation.h.

│ │ │ │ +

Definition at line 372 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetCoordStride()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -463,15 +463,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of elements between each coordinate.

│ │ │ │ │ │ │ │ -

Definition at line 208 of file tessellation.h.

│ │ │ │ +

Definition at line 208 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetEdgeCoords()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -522,15 +522,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the size of the face.

│ │ │ │ │ │ │ │ -

Definition at line 182 of file tessellation.h.

│ │ │ │ +

Definition at line 182 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFacets()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -571,15 +571,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of indices assigned to each facet.

│ │ │ │ │ │ │ │ -

Definition at line 258 of file tessellation.h.

│ │ │ │ +

Definition at line 258 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFacetStride()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -600,15 +600,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of elements between each facet.

│ │ │ │ │ │ │ │ -

Definition at line 261 of file tessellation.h.

│ │ │ │ +

Definition at line 261 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetInteriorCoords()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -649,15 +649,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of boundary coordinates.

│ │ │ │ │ │ │ │ -

Definition at line 211 of file tessellation.h.

│ │ │ │ +

Definition at line 211 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumCoords()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -678,15 +678,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of coordinates in the entire pattern.

│ │ │ │ │ │ │ │ -

Definition at line 205 of file tessellation.h.

│ │ │ │ +

Definition at line 205 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumEdgeCoords()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -708,15 +708,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of coordinates within a given edge (excluding those at its end vertices)

│ │ │ │ │ │ │ │ -

Definition at line 218 of file tessellation.h.

│ │ │ │ +

Definition at line 218 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFacets()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -737,15 +737,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of facets in the entire pattern.

│ │ │ │ │ │ │ │ -

Definition at line 255 of file tessellation.h.

│ │ │ │ +

Definition at line 255 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumInteriorCoords()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -766,15 +766,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the number of interior coordinates.

│ │ │ │ │ │ │ │ -

Definition at line 214 of file tessellation.h.

│ │ │ │ +

Definition at line 214 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetParameterization()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -795,15 +795,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the Parameterization.

│ │ │ │ │ │ │ │ -

Definition at line 179 of file tessellation.h.

│ │ │ │ +

Definition at line 179 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRates()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -855,15 +855,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Retrieve the coordinate for a given vertex of the face.

│ │ │ │ │ │ │ │ -

Definition at line 365 of file tessellation.h.

│ │ │ │ +

Definition at line 365 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsUniform()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -884,15 +884,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if the pattern is uniform.

│ │ │ │ │ │ │ │ -

Definition at line 188 of file tessellation.h.

│ │ │ │ +

Definition at line 188 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsValid()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -913,15 +913,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return true if correctly initialized.

│ │ │ │ │ │ │ │ -

Definition at line 162 of file tessellation.h.

│ │ │ │ +

Definition at line 162 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ operator=()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1046,15 +1046,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Reassign indices of boundary coordinates while offseting those of interior coordinates.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <tessellation.h>

│ │ │ │ +

#include <tessellation.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -125,15 +125,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 Options ()
 
OptionsPreserveQuads (bool on)
 Select preservation of quads for quad-based subdivision (requires 4-sided facets, default is off) More...
 
│ │ │ │

Detailed Description

│ │ │ │

Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate.

│ │ │ │

The sizes and strides of the target arrays should be specified explicitly as they are not inferred by the presence of other options.

│ │ │ │

Modifiers of Options return a reference to itself to facilitate inline usage.

│ │ │ │ │ │ │ │ -

Definition at line 65 of file tessellation.h.

│ │ │ │ +

Definition at line 65 of file tessellation.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Options()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -150,15 +150,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 67 of file tessellation.h.

│ │ │ │ +

Definition at line 67 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetCoordStride()

│ │ │ │ │ │ │ │ @@ -180,15 +180,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the stride between (u,v) pairs.

│ │ │ │ │ │ │ │ -

Definition at line 90 of file tessellation.h.

│ │ │ │ +

Definition at line 90 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFacetSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -207,15 +207,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 80 of file tessellation.h.

│ │ │ │ +

Definition at line 80 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFacetStride()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -236,15 +236,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the stride between facets.

│ │ │ │ │ │ │ │ -

Definition at line 85 of file tessellation.h.

│ │ │ │ +

Definition at line 85 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PreserveQuads() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -265,15 +265,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if preservation of quads is set.

│ │ │ │ │ │ │ │ -

Definition at line 74 of file tessellation.h.

│ │ │ │ +

Definition at line 74 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PreserveQuads() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -295,15 +295,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Select preservation of quads for quad-based subdivision (requires 4-sided facets, default is off)

│ │ │ │ │ │ │ │ -

Definition at line 343 of file tessellation.h.

│ │ │ │ +

Definition at line 343 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetCoordStride()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -325,15 +325,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the stride between (u,v) pairs (default is 2)

│ │ │ │ │ │ │ │ -

Definition at line 358 of file tessellation.h.

│ │ │ │ +

Definition at line 358 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetFacetSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -355,15 +355,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the number of indices per facet (must be 3 or 4, default is 3)

│ │ │ │ │ │ │ │ -

Definition at line 348 of file tessellation.h.

│ │ │ │ +

Definition at line 348 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetFacetStride()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -385,20 +385,20 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the stride between facets (default is facet size)

│ │ │ │ │ │ │ │ -

Definition at line 353 of file tessellation.h.

│ │ │ │ +

Definition at line 353 of file tessellation.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Simple class used by subclasses of SurfaceFactory to describe a vertex. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <vertexDescriptor.h>

│ │ │ │ +

#include <vertexDescriptor.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -171,15 +171,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

Methods to begin and end specification

Partially constructed instances are populated using a set of methods between calls to Initialize() and Finalize(). Both return false to indicate failure due to invalid input, or the instance can be inspected after each to determine if valid.

│ │ │ │
bool Initialize (int numIncidentFaces)
 
│ │ │ │

Detailed Description

│ │ │ │

Simple class used by subclasses of SurfaceFactory to describe a vertex.

│ │ │ │

VertexDescriptor is a simple class used by SurfaceFactory and its subclasses to provide a complete topological description around the vertex of a face, i.e. its valence, the sizes of its incident faces, sharpness values, etc.

│ │ │ │

Instances are created and partially initialized by SurfaceFactory before being passed to its subclasses to be fully populated. So public construction is not available (or useful).

│ │ │ │ │ │ │ │ -

Definition at line 131 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 131 of file vertexDescriptor.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ ClearEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -198,15 +198,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Remove any sharpness assigned to the incident edges.

│ │ │ │ │ │ │ │ -

Definition at line 398 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 398 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ ClearIncidentFaceSizes()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -227,15 +227,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Remove any assigned sizes of incident faces.

│ │ │ │ │ │ │ │ -

Definition at line 350 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 350 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ ClearVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -256,15 +256,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Remove any sharpness assigned to the vertex.

│ │ │ │ │ │ │ │ -

Definition at line 377 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 377 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Finalize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -321,15 +321,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the sharpness assigned to edges of an incident face.

│ │ │ │ │ │ │ │ -

Definition at line 436 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 436 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIncidentFaceSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the size of an incident face.

│ │ │ │ │ │ │ │ -

Definition at line 362 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 362 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetManifoldEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -381,15 +381,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the sharpness assigned to a manifold edge.

│ │ │ │ │ │ │ │ -

Definition at line 420 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 420 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -410,15 +410,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return the sharpness of the vertex.

│ │ │ │ │ │ │ │ -

Definition at line 386 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 386 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ HasEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -439,15 +439,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if sharpness was assigned to the incident edges.

│ │ │ │ │ │ │ │ -

Definition at line 394 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 394 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ HasIncidentFaceSizes()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -468,15 +468,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if the sizes of incident faces are assigned.

│ │ │ │ │ │ │ │ -

Definition at line 346 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 346 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ HasVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -497,15 +497,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if sharpness was assigned to the vertex.

│ │ │ │ │ │ │ │ -

Definition at line 373 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 373 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Initialize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -546,15 +546,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if vertex neighborhood is on a boundary.

│ │ │ │ │ │ │ │ -

Definition at line 338 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 338 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsManifold()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -575,15 +575,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if vertex neighborhood is manifold.

│ │ │ │ │ │ │ │ -

Definition at line 329 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 329 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsValid()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -604,15 +604,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Return if instance is valid.

│ │ │ │ │ │ │ │ -

Definition at line 320 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 320 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetBoundary()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -634,15 +634,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Declare the vertex neighborhood as being on a boundary.

│ │ │ │ │ │ │ │ -

Definition at line 334 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 334 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetIncidentFaceEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -689,15 +689,15 @@ │ │ │ │ faceIndexIndex of the incident face │ │ │ │ leadingEdgeSharpSharpness to assign to the leading edge of the incident face, i.e. the edge of the face following the vertex. │ │ │ │ trailingEdgeSharpSharpness to assign to the trailing edge of the incident face, i.e. the edge of the face preceding the vertex. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 427 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 427 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetIncidentFaceSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -729,15 +729,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the size of an incident face.

│ │ │ │ │ │ │ │ -

Definition at line 355 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 355 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetManifold()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -759,15 +759,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Declare the vertex neighborhood as manifold (ordered)

│ │ │ │ │ │ │ │ -

Definition at line 325 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 325 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetManifoldEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -807,15 +807,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
edgeIndexIndex of the edge in the ordered sequence
edgeSharpnessSharpness to be assigned to the edge
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 403 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 403 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -837,20 +837,20 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign sharpness to the vertex.

│ │ │ │ │ │ │ │ -

Definition at line 382 of file vertexDescriptor.h.

│ │ │ │ +

Definition at line 382 of file vertexDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An quadtree-based map connecting coarse faces to their sub-patches. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <patchMap.h>

│ │ │ │ +

#include <patchMap.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef PatchTable::PatchHandle Handle
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -113,29 +113,29 @@ │ │ │ │

 
│ │ │ │

Detailed Description

│ │ │ │

An quadtree-based map connecting coarse faces to their sub-patches.

│ │ │ │

PatchTable::PatchArrays contain lists of patches that represent the limit surface of a mesh, sorted by their topological type. These arrays break the connection between coarse faces and their sub-patches.

│ │ │ │

The PatchMap provides a quad-tree based lookup structure that, given a singular parametric location, can efficiently return a handle to the sub-patch that contains this location.

│ │ │ │ │ │ │ │ -

Definition at line 49 of file patchMap.h.

│ │ │ │ +

Definition at line 49 of file patchMap.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Handle

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef PatchTable::PatchHandle Handle
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 52 of file patchMap.h.

│ │ │ │ +

Definition at line 52 of file patchMap.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ PatchMap()

│ │ │ │ │ │ │ │ @@ -211,20 +211,20 @@ │ │ │ │ uLocal u parameter │ │ │ │ vLocal v parameter │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
A patch handle or 0 if the face is not supported (index out of bounds) or is tagged as a hole
│ │ │ │ │ │ │ │ -

Definition at line 193 of file patchMap.h.

│ │ │ │ +

Definition at line 193 of file patchMap.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/far/patchMap.h
  • │ │ │ │ +
  • opensubdiv/far/patchMap.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <patchMap.h>

│ │ │ │ +

#include <patchMap.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

unsigned int isSet: 1
 
unsigned int isLeaf: 1
 
unsigned int index: 30
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 85 of file patchMap.h.

│ │ │ │ +

Definition at line 85 of file patchMap.h.

│ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ index

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
unsigned int index
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 88 of file patchMap.h.

│ │ │ │ +

Definition at line 88 of file patchMap.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ isLeaf

│ │ │ │ │ │ │ │
│ │ │ │ @@ -130,15 +130,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
unsigned int isLeaf
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 87 of file patchMap.h.

│ │ │ │ +

Definition at line 87 of file patchMap.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ isSet

│ │ │ │ │ │ │ │
│ │ │ │ @@ -146,20 +146,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
unsigned int isSet
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 86 of file patchMap.h.

│ │ │ │ +

Definition at line 86 of file patchMap.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file:
    │ │ │ │ -
  • opensubdiv/far/patchMap.h
  • │ │ │ │ +
  • opensubdiv/far/patchMap.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Container for arrays of parametric patches. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <patchTable.h>

│ │ │ │ +

#include <patchTable.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  PatchHandle
 Handle that can be used as unique patch identifier within PatchTable. More...
 
│ │ │ │ @@ -413,15 +413,15 @@ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │

Container for arrays of parametric patches.

│ │ │ │

PatchTable contains topology and parametric information about the patches generated by the Refinement process. Patches in the table are sorted into arrays based on their PatchDescriptor Type.

│ │ │ │

Note : PatchTable can be accessed either using a PatchHandle or a combination of array and patch indices.

│ │ │ │

XXXX manuelk we should add a PatchIterator that can dereference into a PatchHandle for fast linear traversal of the table

│ │ │ │ │ │ │ │ -

Definition at line 55 of file patchTable.h.

│ │ │ │ +

Definition at line 55 of file patchTable.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ ConstQuadOffsetsArray

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -429,15 +429,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
typedef Vtr::ConstArray<unsigned int> ConstQuadOffsetsArray
│ │ │ │
│ │ │ │ │ │ │ │

Accessors for the gregory patch evaluation buffers. These methods will be deprecated.

│ │ │ │ │ │ │ │ -

Definition at line 259 of file patchTable.h.

│ │ │ │ +

Definition at line 259 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PatchVertsTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -445,15 +445,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef std::vector<Index> PatchVertsTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 375 of file patchTable.h.

│ │ │ │ +

Definition at line 375 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ QuadOffsetsTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef std::vector<unsigned int> QuadOffsetsTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 389 of file patchTable.h.

│ │ │ │ +

Definition at line 389 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VertexValenceTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -477,15 +477,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef std::vector<Index> VertexValenceTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 264 of file patchTable.h.

│ │ │ │ +

Definition at line 264 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ PatchTable() [1/2]

│ │ │ │ │ │ │ │ @@ -592,15 +592,15 @@ │ │ │ │ srcBuffer with primvar data for the base and refined vertex values │ │ │ │ dstDestination buffer for the computed local point vertex values │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

For more flexibility computing local vertex points, retrieval of the local point stencil table and use of its public methods is recommended or often required.

│ │ │ │ │ │ │ │ -

Definition at line 778 of file patchTable.h.

│ │ │ │ +

Definition at line 778 of file patchTable.h.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeLocalPointValuesFaceVarying()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -647,15 +647,15 @@ │ │ │ │ dstDestination buffer for the computed local point face-varying values │ │ │ │ channelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

For more flexibility computing local face-varying points, retrieval of the local point face-varying stencil table and use of its public methods is recommended or often required.

│ │ │ │ │ │ │ │ -

Definition at line 796 of file patchTable.h.

│ │ │ │ +

Definition at line 796 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeLocalPointValuesVarying()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -695,15 +695,15 @@ │ │ │ │ srcBuffer with primvar data for the base and refined varying values │ │ │ │ dstDestination buffer for the computed local point varying values │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

For more flexibility computing local varying points, retrieval of the local point varying stencil table and use of its public methods is recommended or often required.

│ │ │ │ │ │ │ │ -

Definition at line 787 of file patchTable.h.

│ │ │ │ +

Definition at line 787 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasis() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -777,15 +777,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 817 of file patchTable.h.

│ │ │ │ +

Definition at line 817 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasis() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -859,15 +859,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 810 of file patchTable.h.

│ │ │ │ +

Definition at line 810 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasis() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1033,15 +1033,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 847 of file patchTable.h.

│ │ │ │ +

Definition at line 847 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasisFaceVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1121,15 +1121,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 840 of file patchTable.h.

│ │ │ │ +

Definition at line 840 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasisFaceVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1296,15 +1296,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 832 of file patchTable.h.

│ │ │ │ +

Definition at line 832 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasisVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1378,15 +1378,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

An overloaded version to assist template parameter resolution when explicitly declaring unused array arguments as 0.

│ │ │ │ │ │ │ │ -

Definition at line 825 of file patchTable.h.

│ │ │ │ +

Definition at line 825 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvaluateBasisVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1633,15 +1633,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 764 of file patchTable.h.

│ │ │ │ +

Definition at line 764 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalPointFaceVaryingStencilTable() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1663,15 +1663,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the stencil table to compute local point face-varying values.

│ │ │ │ │ │ │ │ -

Definition at line 741 of file patchTable.h.

│ │ │ │ +

Definition at line 741 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalPointFaceVaryingStencilTable() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1712,15 +1712,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the stencil table to compute local point vertex values.

│ │ │ │ │ │ │ │ -

Definition at line 730 of file patchTable.h.

│ │ │ │ +

Definition at line 730 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalPointStencilTable() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1758,15 +1758,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 752 of file patchTable.h.

│ │ │ │ +

Definition at line 752 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalPointVaryingStencilTable() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1787,15 +1787,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the stencil table to compute local point varying values.

│ │ │ │ │ │ │ │ -

Definition at line 735 of file patchTable.h.

│ │ │ │ +

Definition at line 735 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalPointVaryingStencilTable() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1833,15 +1833,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 758 of file patchTable.h.

│ │ │ │ +

Definition at line 758 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetMaxValence()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1862,15 +1862,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns max vertex valence.

│ │ │ │ │ │ │ │ -

Definition at line 92 of file patchTable.h.

│ │ │ │ +

Definition at line 92 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumControlVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1911,15 +1911,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of control vertex indices in the table.

│ │ │ │ │ │ │ │ -

Definition at line 84 of file patchTable.h.

│ │ │ │ +

Definition at line 84 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2075,15 +2075,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of ptex faces in the mesh.

│ │ │ │ │ │ │ │ -

Definition at line 95 of file patchTable.h.

│ │ │ │ +

Definition at line 95 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrayDescriptor()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2224,15 +2224,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get the table of patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 378 of file patchTable.h.

│ │ │ │ +

Definition at line 378 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchDescriptor()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2537,15 +2537,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the PatchParamTable (PatchParams order matches patch array sorting)

│ │ │ │ │ │ │ │ -

Definition at line 381 of file patchTable.h.

│ │ │ │ +

Definition at line 381 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchQuadOffsets()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2686,15 +2686,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the quad-offsets table.

│ │ │ │ │ │ │ │ -

Definition at line 392 of file patchTable.h.

│ │ │ │ +

Definition at line 392 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSharpnessIndexTable()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2715,15 +2715,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns a sharpness index table for each patch (if exists)

│ │ │ │ │ │ │ │ -

Definition at line 384 of file patchTable.h.

│ │ │ │ +

Definition at line 384 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getSharpnessIndices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2770,15 +2770,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns sharpness values table.

│ │ │ │ │ │ │ │ -

Definition at line 387 of file patchTable.h.

│ │ │ │ +

Definition at line 387 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getSharpnessValues()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2913,15 +2913,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the 'VertexValences' table (vertex neighborhoods table)

│ │ │ │ │ │ │ │ -

Definition at line 267 of file patchTable.h.

│ │ │ │ +

Definition at line 267 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsFeatureAdaptive()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2978,15 +2978,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 708 of file patchTable.h.

│ │ │ │ +

Definition at line 708 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ LocalPointFaceVaryingStencilPrecisionMatchesType() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3005,15 +3005,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 721 of file patchTable.h.

│ │ │ │ +

Definition at line 721 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ LocalPointStencilPrecisionMatchesType() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3051,15 +3051,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 700 of file patchTable.h.

│ │ │ │ +

Definition at line 700 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ LocalPointStencilPrecisionMatchesType() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3078,15 +3078,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 713 of file patchTable.h.

│ │ │ │ +

Definition at line 713 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ LocalPointVaryingStencilPrecisionMatchesType() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3124,15 +3124,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 704 of file patchTable.h.

│ │ │ │ +

Definition at line 704 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ LocalPointVaryingStencilPrecisionMatchesType() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3151,15 +3151,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 717 of file patchTable.h.

│ │ │ │ +

Definition at line 717 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ print()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3195,20 +3195,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 531 of file patchTable.h.

│ │ │ │ +

Definition at line 531 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Handle that can be used as unique patch identifier within PatchTable. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <patchTable.h>

│ │ │ │ +

#include <patchTable.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -112,15 +112,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

Index arrayIndex
 
Index patchIndex
 
 
class PatchMap
 
│ │ │ │

Detailed Description

│ │ │ │

Handle that can be used as unique patch identifier within PatchTable.

│ │ │ │ │ │ │ │ -

Definition at line 60 of file patchTable.h.

│ │ │ │ +

Definition at line 60 of file patchTable.h.

│ │ │ │

Friends And Related Function Documentation

│ │ │ │ │ │ │ │

◆ PatchMap

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ friend
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file patchTable.h.

│ │ │ │ +

Definition at line 65 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PatchTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -158,15 +158,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 64 of file patchTable.h.

│ │ │ │ +

Definition at line 64 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ arrayIndex

│ │ │ │ │ │ │ │ @@ -175,15 +175,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Index arrayIndex
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 67 of file patchTable.h.

│ │ │ │ +

Definition at line 67 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ patchIndex

│ │ │ │ │ │ │ │
│ │ │ │ @@ -191,15 +191,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Index patchIndex
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file patchTable.h.

│ │ │ │ +

Definition at line 68 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ vertIndex

│ │ │ │ │ │ │ │
│ │ │ │ @@ -207,20 +207,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Index vertIndex
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 69 of file patchTable.h.

│ │ │ │ +

Definition at line 69 of file patchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Factory for constructing TopologyRefiners from specific mesh classes. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefinerFactory.h>

│ │ │ │ +

#include <topologyRefinerFactory.h>

│ │ │ │
│ │ │ │ Inheritance diagram for TopologyRefinerFactory< MESH >:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ TopologyRefinerFactoryBase │ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │
template<class MESH>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory< MESH >

Factory for constructing TopologyRefiners from specific mesh classes.

│ │ │ │

TopologyRefinerFactory<MESH> is the factory class template to convert an instance of TopologyRefiner from an arbitrary mesh class. While a class template, the implementation is not (cannot) be complete, so specialization of a few methods is required (it is a stateless factory, so no instance and only static methods).

│ │ │ │

This template provides both the interface and high level assembly for the construction of the TopologyRefiner instance. The high level construction executes a specific set of operations to convert the client's MESH into TopologyRefiner. This set of operations combines methods independent of MESH from the base class with those specialized here for class MESH.

│ │ │ │ │ │ │ │ -

Definition at line 78 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 78 of file topologyRefinerFactory.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ TopologyError

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -292,15 +292,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ protected
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 131 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 131 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ assignComponentTags()

│ │ │ │ │ │ │ │ @@ -333,15 +333,15 @@ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

(Optional) Specify edge or vertex sharpness or face holes

│ │ │ │ │ │ │ │ -

Definition at line 690 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 690 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ assignComponentTopology()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -373,15 +373,15 @@ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces, edge-vertices, etc.

│ │ │ │ │ │ │ │ -

Definition at line 621 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 621 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ assignFaceVaryingTopology()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -413,15 +413,15 @@ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

(Optional) Specify face-varying data per face

│ │ │ │ │ │ │ │ -

Definition at line 674 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 674 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -462,15 +462,15 @@ │ │ │ │ meshClient's topological representation (or a converter) │ │ │ │ optionsOptions controlling the creation of the TopologyRefiner │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
A new instance of TopologyRefiner or 0 for failure
│ │ │ │ │ │ │ │ -

Definition at line 346 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 346 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -500,15 +500,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
baseLevelAn existing TopologyRefiner to share base level.
│ │ │ │ │ │ │ │ │ │ │ │
Returns
A new instance of TopologyRefiner or 0 for failure
│ │ │ │ │ │ │ │ -

Definition at line 364 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 364 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ createBaseFVarChannel() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -540,15 +540,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Create a new face-varying channel with the given number of values.

│ │ │ │ │ │ │ │ -

Definition at line 561 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 561 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ createBaseFVarChannel() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -586,15 +586,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Create a new face-varying channel with the given number of values and independent interpolation options.

│ │ │ │ │ │ │ │ -

Definition at line 566 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 566 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ findBaseEdge()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -632,15 +632,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Identify an edge to be assigned a sharpness value given a vertex pair.

│ │ │ │ │ │ │ │ -

Definition at line 521 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 521 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseEdgeFaceLocalIndices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -672,15 +672,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the local indices of an edge within each of its incident faces.

│ │ │ │ │ │ │ │ -

Definition at line 505 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 505 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseEdgeFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -712,15 +712,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the faces incident each edge.

│ │ │ │ │ │ │ │ -

Definition at line 489 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 489 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseEdgeVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -752,15 +752,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the vertices incident each edge.

│ │ │ │ │ │ │ │ -

Definition at line 484 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 484 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseFaceEdges()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -792,15 +792,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the edges incident each face.

│ │ │ │ │ │ │ │ -

Definition at line 479 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 479 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseFaceFVarValues()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -838,15 +838,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the face-varying values for the corners of each face.

│ │ │ │ │ │ │ │ -

Definition at line 573 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 573 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseFaceVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -878,15 +878,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the vertices incident each face.

│ │ │ │ │ │ │ │ -

Definition at line 474 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 474 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseVertexEdgeLocalIndices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -918,15 +918,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the local indices of a vertex within each of its incident edges.

│ │ │ │ │ │ │ │ -

Definition at line 515 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 515 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseVertexEdges()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -958,15 +958,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the edges incident each vertex.

│ │ │ │ │ │ │ │ -

Definition at line 499 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 499 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseVertexFaceLocalIndices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -998,15 +998,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the local indices of a vertex within each of its incident faces.

│ │ │ │ │ │ │ │ -

Definition at line 510 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 510 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getBaseVertexFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1038,15 +1038,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign the faces incident each vertex.

│ │ │ │ │ │ │ │ -

Definition at line 494 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 494 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getNumBaseEdges()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1066,15 +1066,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 441 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 441 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getNumBaseFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1094,15 +1094,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 436 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 436 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getNumBaseVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1122,15 +1122,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 446 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 446 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ populateBaseLevel()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1166,15 +1166,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 371 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 371 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ populateBaseLocalIndices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1196,15 +1196,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Determine all local indices by inspection (only for pure manifold meshes)

│ │ │ │ │ │ │ │ -

Definition at line 527 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 527 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ reportInvalidTopology()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1242,15 +1242,15 @@ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

(Optional) Control run-time topology validation and error reporting

│ │ │ │ │ │ │ │ -

Definition at line 707 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 707 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ resizeComponentTopology()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1282,15 +1282,15 @@ │ │ │ │ staticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of vertices, faces, face-vertices, etc.

│ │ │ │ │ │ │ │ -

Definition at line 580 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 580 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setBaseEdgeNonManifold()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1328,15 +1328,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag an edge as non-manifold.

│ │ │ │ │ │ │ │ -

Definition at line 533 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 533 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setBaseEdgeSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1374,15 +1374,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign a sharpness value to a given edge.

│ │ │ │ │ │ │ │ -

Definition at line 544 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 544 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setBaseFaceHole()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1420,15 +1420,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag a face as a hole.

│ │ │ │ │ │ │ │ -

Definition at line 554 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 554 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setBaseVertexNonManifold()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1466,15 +1466,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag a vertex as non-manifold.

│ │ │ │ │ │ │ │ -

Definition at line 538 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 538 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setBaseVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1512,15 +1512,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Assign a sharpness value to a given vertex.

│ │ │ │ │ │ │ │ -

Definition at line 549 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 549 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseEdgeFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1558,15 +1558,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of faces incident each edge.

│ │ │ │ │ │ │ │ -

Definition at line 458 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 458 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseEdges()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1598,15 +1598,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of edges to be accommodated.

│ │ │ │ │ │ │ │ -

Definition at line 425 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 425 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1638,15 +1638,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of faces to be accommodated.

│ │ │ │ │ │ │ │ -

Definition at line 420 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 420 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseFaceVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1684,15 +1684,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of vertices incident each face.

│ │ │ │ │ │ │ │ -

Definition at line 452 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 452 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseVertexEdges()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1730,15 +1730,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of edges incident each vertex.

│ │ │ │ │ │ │ │ -

Definition at line 468 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 468 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseVertexFaces()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1776,15 +1776,15 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of faces incident each vertex.

│ │ │ │ │ │ │ │ -

Definition at line 463 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 463 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ setNumBaseVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1816,21 +1816,21 @@ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specify the number of vertices to be accommodated.

│ │ │ │ │ │ │ │ -

Definition at line 430 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 430 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Stores topology data for a specified set of refinement options. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefiner.h>

│ │ │ │ +

#include <topologyRefiner.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -201,15 +201,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  AdaptiveOptions
 Adaptive refinement options. More...
 
struct  UniformOptions
 
 TopologyRefiner (TopologyRefiner const &source)
 
│ │ │ │

Detailed Description

│ │ │ │

Stores topology data for a specified set of refinement options.

│ │ │ │ │ │ │ │ -

Definition at line 51 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 51 of file topologyRefiner.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ TopologyRefiner() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -304,15 +304,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Returns the options specified on refinement.

│ │ │ │ │ │ │ │ -

Definition at line 196 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 196 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarLinearInterpolation()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -334,15 +334,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the face-varying interpolation rule set for a given channel.

│ │ │ │ │ │ │ │ -

Definition at line 298 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 298 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ getLevel() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -362,15 +362,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 236 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 236 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getLevel() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -390,15 +390,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 237 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 237 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLevel()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -420,15 +420,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns a handle to access data specific to a particular level.

│ │ │ │ │ │ │ │ -

Definition at line 95 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 95 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetMaxLevel()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -449,15 +449,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the highest level of refinement.

│ │ │ │ │ │ │ │ -

Definition at line 74 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 74 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetMaxValence()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -478,15 +478,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the maximum vertex valence in all levels.

│ │ │ │ │ │ │ │ -

Definition at line 77 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 77 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumEdgesTotal()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -507,15 +507,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of edges in all levels.

│ │ │ │ │ │ │ │ -

Definition at line 86 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 86 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFacesTotal()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -536,15 +536,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of edges in all levels.

│ │ │ │ │ │ │ │ -

Definition at line 89 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 89 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFaceVerticesTotal()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -565,15 +565,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of face vertices in all levels.

│ │ │ │ │ │ │ │ -

Definition at line 92 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 92 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -594,15 +594,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the number of face-varying channels in the tables.

│ │ │ │ │ │ │ │ -

Definition at line 293 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 293 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarValuesTotal()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -643,15 +643,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the number of refinement levels.

│ │ │ │ │ │ │ │ -

Definition at line 71 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 71 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumVerticesTotal()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -672,15 +672,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the total number of vertices in all levels.

│ │ │ │ │ │ │ │ -

Definition at line 83 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 83 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getRefinement() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -700,15 +700,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 239 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 239 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ getRefinement() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -728,15 +728,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 240 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 240 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSchemeOptions()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -757,15 +757,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the subdivision options.

│ │ │ │ │ │ │ │ -

Definition at line 65 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 65 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSchemeType()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -786,15 +786,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the subdivision scheme.

│ │ │ │ │ │ │ │ -

Definition at line 62 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 62 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetUniformOptions()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -815,15 +815,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the options specified on refinement.

│ │ │ │ │ │ │ │ -

Definition at line 149 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 149 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ HasHoles()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -844,15 +844,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns true if faces have been tagged as holes.

│ │ │ │ │ │ │ │ -

Definition at line 80 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 80 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsUniform()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -873,15 +873,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns true if uniform refinement has been applied.

│ │ │ │ │ │ │ │ -

Definition at line 68 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 68 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ RefineAdaptive()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -982,15 +982,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 226 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 226 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PatchTableBuilder

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1006,15 +1006,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 225 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 225 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PrimvarRefinerReal

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1030,15 +1030,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 229 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 229 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ PtexIndices

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1054,15 +1054,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 227 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 227 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ TopologyRefinerFactory

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1078,15 +1078,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 223 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 223 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ TopologyRefinerFactoryBase

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1102,20 +1102,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 224 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 224 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Uniform refinement options. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefiner.h>

│ │ │ │ +

#include <topologyRefiner.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 UniformOptions (int level)
 
void SetRefinementLevel (int level)
 Set uniform refinement level. More...
 
│ │ │ │

Detailed Description

│ │ │ │

Uniform refinement options.

│ │ │ │

Options for uniform refinement, including the number of levels, vertex ordering and generation of topology information.

│ │ │ │

Note the impact of the option to generate fullTopologyInLastLevel. Given subsequent levels of uniform refinement typically reguire 4x the data of the previous level, only the minimum amount of data is generated in the last level by default, i.e. a vertex and face-vertex list. If requiring topology traversal of the last level, e.g. inspecting edges or incident faces of vertices, the option to generate full topology in the last level should be enabled.

│ │ │ │ │ │ │ │ -

Definition at line 118 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 118 of file topologyRefiner.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ UniformOptions()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -142,15 +142,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 120 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 120 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ SetRefinementLevel()

│ │ │ │ │ │ │ │ @@ -173,15 +173,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set uniform refinement level.

│ │ │ │ │ │ │ │ -

Definition at line 126 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 126 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ fullTopologyInLastLevel

│ │ │ │ │ │ │ │ @@ -191,15 +191,15 @@ │ │ │ │ │ │ │ │ unsigned int fullTopologyInLastLevel │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Skip topological relationships in the last level of refinement that are not needed for interpolation (keep false if using limit).

│ │ │ │ │ │ │ │ -

Definition at line 131 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 131 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ orderVerticesFromFacesFirst

│ │ │ │ │ │ │ │
│ │ │ │ @@ -208,15 +208,15 @@ │ │ │ │ │ │ │ │ unsigned int orderVerticesFromFacesFirst │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Order child vertices from faces first instead of child vertices of vertices

│ │ │ │ │ │ │ │ -

Definition at line 129 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 129 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ refinementLevel

│ │ │ │ │ │ │ │
│ │ │ │ @@ -226,20 +226,20 @@ │ │ │ │ unsigned int refinementLevel │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Number of refinement iterations.

│ │ │ │ │ │ │ │ -

Definition at line 128 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 128 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Adaptive refinement options. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefiner.h>

│ │ │ │ +

#include <topologyRefiner.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -122,15 +122,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 AdaptiveOptions (int level)
 
void SetIsolationLevel (int level)
 Set isolation level. More...
 
unsigned int orderVerticesFromFacesFirst:1
 
│ │ │ │

Detailed Description

│ │ │ │

Adaptive refinement options.

│ │ │ │ │ │ │ │ -

Definition at line 156 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 156 of file topologyRefiner.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ AdaptiveOptions()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -148,15 +148,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 158 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 158 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ SetIsolationLevel()

│ │ │ │ │ │ │ │ @@ -179,15 +179,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set isolation level.

│ │ │ │ │ │ │ │ -

Definition at line 167 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 167 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetSecondaryLevel()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -209,15 +209,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set secondary isolation level.

│ │ │ │ │ │ │ │ -

Definition at line 170 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 170 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ considerFVarChannels

│ │ │ │ │ │ │ │ @@ -227,15 +227,15 @@ │ │ │ │ │ │ │ │ unsigned int considerFVarChannels │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Inspect face-varying channels and isolate when irregular features present

│ │ │ │ │ │ │ │ -

Definition at line 180 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 180 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ isolationLevel

│ │ │ │ │ │ │ │
│ │ │ │ @@ -244,15 +244,15 @@ │ │ │ │ │ │ │ │ unsigned int isolationLevel │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Number of iterations applied to isolate extraordinary vertices and creases

│ │ │ │ │ │ │ │ -

Definition at line 172 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 172 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ orderVerticesFromFacesFirst

│ │ │ │ │ │ │ │
│ │ │ │ @@ -261,15 +261,15 @@ │ │ │ │ │ │ │ │ unsigned int orderVerticesFromFacesFirst │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Order child vertices from faces first instead of child vertices of vertices

│ │ │ │ │ │ │ │ -

Definition at line 182 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 182 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ secondaryLevel

│ │ │ │ │ │ │ │
│ │ │ │ @@ -278,15 +278,15 @@ │ │ │ │ │ │ │ │ unsigned int secondaryLevel │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Shallower level to stop isolation of smooth irregular features

│ │ │ │ │ │ │ │ -

Definition at line 174 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 174 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ useInfSharpPatch

│ │ │ │ │ │ │ │
│ │ │ │ @@ -295,15 +295,15 @@ │ │ │ │ │ │ │ │ unsigned int useInfSharpPatch │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Use infinitely sharp patches and stop isolation where applicable

│ │ │ │ │ │ │ │ -

Definition at line 178 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 178 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ useSingleCreasePatch

│ │ │ │ │ │ │ │
│ │ │ │ @@ -312,20 +312,20 @@ │ │ │ │ │ │ │ │ unsigned int useSingleCreasePatch │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Use 'single-crease' patch and stop isolation where applicable

│ │ │ │ │ │ │ │ -

Definition at line 176 of file topologyRefiner.h.

│ │ │ │ +

Definition at line 176 of file topologyRefiner.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Private base class of Factories for constructing TopologyRefiners. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefinerFactory.h>

│ │ │ │ +

#include <topologyRefinerFactory.h>

│ │ │ │
│ │ │ │ Inheritance diagram for TopologyRefinerFactoryBase:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ TopologyRefinerFactory< MESH > │ │ │ │ @@ -122,15 +122,15 @@ │ │ │ │ static bool prepareFaceVaryingChannels (TopologyRefiner &refiner) │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Private base class of Factories for constructing TopologyRefiners.

│ │ │ │

TopologyRefinerFactoryBase is the base class for subclasses that are intended to construct TopologyRefiners directly from meshes in their native representations. The subclasses are parameterized by the mesh type <class MESH> and are expected to inherit the details related to assembly and validation provided here that are independent of the subclass' mesh type.

│ │ │ │ │ │ │ │ -

Definition at line 47 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 47 of file topologyRefinerFactory.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ TopologyCallback

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -144,15 +144,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ protected
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 54 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ prepareComponentTagsAndSharpness()

│ │ │ │ │ │ │ │ @@ -276,15 +276,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Options related to the construction of each TopologyRefiner. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <topologyRefinerFactory.h>

│ │ │ │ +

#include <topologyRefinerFactory.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 Options (Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions=Sdc::Options())
 
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -112,15 +112,15 @@ │ │ │ │

unsigned int validateFullTopology: 1
 
│ │ │ │

Detailed Description

│ │ │ │
template<class MESH>
│ │ │ │ struct OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory< MESH >::Options

Options related to the construction of each TopologyRefiner.

│ │ │ │ │ │ │ │ -

Definition at line 84 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 84 of file topologyRefinerFactory.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Options()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -148,15 +148,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 86 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 86 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ schemeOptions

│ │ │ │ │ │ │ │ @@ -166,15 +166,15 @@ │ │ │ │ │ │ │ │ Sdc::Options schemeOptions │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

The full set of options for the scheme, e.g. boundary interpolation rules...

│ │ │ │ │ │ │ │ -

Definition at line 92 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 92 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ schemeType

│ │ │ │ │ │ │ │
│ │ │ │ @@ -184,15 +184,15 @@ │ │ │ │ Sdc::SchemeType schemeType │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The subdivision scheme type identifier.

│ │ │ │ │ │ │ │ -

Definition at line 91 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 91 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ validateFullTopology

│ │ │ │ │ │ │ │
│ │ │ │ @@ -201,20 +201,20 @@ │ │ │ │ │ │ │ │ unsigned int validateFullTopology │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Apply more extensive validation of the constructed topology – intended for debugging.

│ │ │ │ │ │ │ │ -

Definition at line 94 of file topologyRefinerFactory.h.

│ │ │ │ +

Definition at line 94 of file topologyRefinerFactory.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <bufferDescriptor.h>

│ │ │ │ +

#include <bufferDescriptor.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │

Detailed Description

│ │ │ │

BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects.

│ │ │ │

The offset of BufferDescriptor can also be used to express a batching offset if the data buffer is combined across multiple objects together.

│ │ │ │
    │ │ │ │
  • Note that each element has the same data type (float)
  • │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 61 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 61 of file bufferDescriptor.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ BufferDescriptor() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

│ │ │ │ Public Member Functions

 BufferDescriptor ()
 Default Constructor. More...
 
 BufferDescriptor (int o, int l, int s)
│ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Default Constructor.

│ │ │ │ │ │ │ │ -

Definition at line 64 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 64 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ BufferDescriptor() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -209,15 +209,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Constructor.

│ │ │ │ │ │ │ │ -

Definition at line 67 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 67 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetLocalOffset()

│ │ │ │ │ │ │ │ @@ -239,15 +239,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the relative offset within a stride.

│ │ │ │ │ │ │ │ -

Definition at line 70 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 70 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsValid()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -268,15 +268,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

True if the descriptor values are internally consistent.

│ │ │ │ │ │ │ │ -

Definition at line 75 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 75 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ operator!=()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -298,15 +298,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

True if the descriptors are not identical.

│ │ │ │ │ │ │ │ -

Definition at line 93 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 93 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ operator==()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -328,15 +328,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

True if the descriptors are identical.

│ │ │ │ │ │ │ │ -

Definition at line 86 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 86 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Reset()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -357,15 +357,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Resets the descriptor to default.

│ │ │ │ │ │ │ │ -

Definition at line 81 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 81 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ length

│ │ │ │ │ │ │ │ @@ -376,15 +376,15 @@ │ │ │ │ int length │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

number or length of the data

│ │ │ │ │ │ │ │ -

Definition at line 100 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 100 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ offset

│ │ │ │ │ │ │ │
│ │ │ │ @@ -394,15 +394,15 @@ │ │ │ │ int offset │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

offset to desired element data

│ │ │ │ │ │ │ │ -

Definition at line 98 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 98 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ stride

│ │ │ │ │ │ │ │
│ │ │ │ @@ -412,20 +412,20 @@ │ │ │ │ int stride │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

stride to the next element

│ │ │ │ │ │ │ │ -

Definition at line 102 of file bufferDescriptor.h.

│ │ │ │ +

Definition at line 102 of file bufferDescriptor.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

OpenCL stencil table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <clEvaluator.h>

│ │ │ │ +

#include <clEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 CLStencilTable (Far::StencilTable const *stencilTable, cl_context clContext)
 
 CLStencilTable (Far::LimitStencilTable const *limitStencilTable, cl_context clContext)
 
 
│ │ │ │

Detailed Description

│ │ │ │

OpenCL stencil table.

│ │ │ │

This class is an OpenCL buffer representation of Far::StencilTable.

│ │ │ │

CLCompute consumes this table to apply stencils

│ │ │ │ │ │ │ │ -

Definition at line 52 of file clEvaluator.h.

│ │ │ │ +

Definition at line 52 of file clEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ CLStencilTable() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -246,15 +246,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 61 of file clEvaluator.h.

│ │ │ │ +

Definition at line 61 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -284,15 +284,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 55 of file clEvaluator.h.

│ │ │ │ +

Definition at line 55 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -311,15 +311,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 80 of file clEvaluator.h.

│ │ │ │ +

Definition at line 80 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -338,15 +338,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 81 of file clEvaluator.h.

│ │ │ │ +

Definition at line 81 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -365,15 +365,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file clEvaluator.h.

│ │ │ │ +

Definition at line 78 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -392,15 +392,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 82 of file clEvaluator.h.

│ │ │ │ +

Definition at line 82 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -419,15 +419,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file clEvaluator.h.

│ │ │ │ +

Definition at line 79 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIndicesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -446,15 +446,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file clEvaluator.h.

│ │ │ │ +

Definition at line 76 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -473,15 +473,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 83 of file clEvaluator.h.

│ │ │ │ +

Definition at line 83 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -500,15 +500,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file clEvaluator.h.

│ │ │ │ +

Definition at line 75 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -527,15 +527,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file clEvaluator.h.

│ │ │ │ +

Definition at line 74 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -554,20 +554,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 77 of file clEvaluator.h.

│ │ │ │ +

Definition at line 77 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
CLEvaluator Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <clEvaluator.h>

│ │ │ │ +

#include <clEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef bool Instantiatable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -238,29 +238,29 @@ │ │ │ │

 Wait the OpenCL kernels finish. More...
 
static void Synchronize (cl_command_queue queue)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 100 of file clEvaluator.h.

│ │ │ │ +

Definition at line 100 of file clEvaluator.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Instantiatable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef bool Instantiatable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 102 of file clEvaluator.h.

│ │ │ │ +

Definition at line 102 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ CLEvaluator()

│ │ │ │ │ │ │ │ @@ -445,15 +445,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 145 of file clEvaluator.h.

│ │ │ │ +

Definition at line 145 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -521,15 +521,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Generic creator template.

│ │ │ │ │ │ │ │ -

Definition at line 131 of file clEvaluator.h.

│ │ │ │ +

Definition at line 131 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -583,15 +583,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 116 of file clEvaluator.h.

│ │ │ │ +

Definition at line 116 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -641,15 +641,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Generic creator template.

│ │ │ │ │ │ │ │ -

Definition at line 106 of file clEvaluator.h.

│ │ │ │ +

Definition at line 106 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1088,15 +1088,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1125 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1125 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1261,15 +1261,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1379 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1379 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1406,15 +1406,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1003 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1003 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1537,15 +1537,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1288 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1288 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1657,15 +1657,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 902 of file clEvaluator.h.

│ │ │ │ +

Definition at line 902 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1760,15 +1760,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1217 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1217 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1954,15 +1954,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2437 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2437 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2134,15 +2134,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2564 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2564 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2286,15 +2286,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2231 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2231 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2424,15 +2424,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2329 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2329 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2548,15 +2548,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2061 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2061 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2658,15 +2658,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2143 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2143 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2845,15 +2845,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1854 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1854 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3018,15 +3018,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1978 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1978 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3163,15 +3163,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1653 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1653 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3294,15 +3294,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1749 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1749 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3411,15 +3411,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1489 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1489 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3514,15 +3514,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1568 of file clEvaluator.h.

│ │ │ │ +

Definition at line 1568 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4157,15 +4157,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 421 of file clEvaluator.h.

│ │ │ │ +

Definition at line 421 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4316,15 +4316,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 646 of file clEvaluator.h.

│ │ │ │ +

Definition at line 646 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4447,15 +4447,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 309 of file clEvaluator.h.

│ │ │ │ +

Definition at line 309 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [7/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4564,15 +4564,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 561 of file clEvaluator.h.

│ │ │ │ +

Definition at line 561 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [8/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4670,15 +4670,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 219 of file clEvaluator.h.

│ │ │ │ +

Definition at line 219 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [9/9]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4759,15 +4759,15 @@ │ │ │ │ numStartEventsthe number of events in the array pointed to by startEvents. │ │ │ │ startEventspoints to an array of cl_event which will determine when it is safe for the OpenCL device to begin work or NULL if it can begin immediately. │ │ │ │ endEventpointer to a cl_event which will receive a copy of the cl_event which indicates when all work for this call has completed. This cl_event has an incremented reference count and should be released via clReleaseEvent(). NULL if not required. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 500 of file clEvaluator.h.

│ │ │ │ +

Definition at line 500 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4815,20 +4815,20 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Wait the OpenCL kernels finish.

│ │ │ │ │ │ │ │ -

Definition at line 2613 of file clEvaluator.h.

│ │ │ │ +

Definition at line 2613 of file clEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

CL patch table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <clPatchTable.h>

│ │ │ │ +

#include <clPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for CLPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -174,15 +174,15 @@ │ │ │ │ │ │ │ │
 
│ │ │ │

Detailed Description

│ │ │ │

CL patch table.

│ │ │ │

This class is a CL buffer representation of Far::PatchTable.

│ │ │ │

CLEvaluator consumes this table to evaluate on the patches.

│ │ │ │ │ │ │ │ -

Definition at line 52 of file clPatchTable.h.

│ │ │ │ +

Definition at line 52 of file clPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CLPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -329,15 +329,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 59 of file clPatchTable.h.

│ │ │ │ +

Definition at line 59 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -359,15 +359,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 86 of file clPatchTable.h.

│ │ │ │ +

Definition at line 86 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -389,15 +389,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the face-varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 89 of file clPatchTable.h.

│ │ │ │ +

Definition at line 89 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -419,15 +419,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the array of Osd::PatchParam buffer.

│ │ │ │ │ │ │ │ -

Definition at line 92 of file clPatchTable.h.

│ │ │ │ +

Definition at line 92 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -448,15 +448,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the number of face-varying channel buffers.

│ │ │ │ │ │ │ │ -

Definition at line 83 of file clPatchTable.h.

│ │ │ │ +

Definition at line 83 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -477,15 +477,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 68 of file clPatchTable.h.

│ │ │ │ +

Definition at line 68 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -506,15 +506,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 71 of file clPatchTable.h.

│ │ │ │ +

Definition at line 71 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -535,15 +535,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the array of Osd::PatchParam buffer.

│ │ │ │ │ │ │ │ -

Definition at line 74 of file clPatchTable.h.

│ │ │ │ +

Definition at line 74 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -564,15 +564,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 77 of file clPatchTable.h.

│ │ │ │ +

Definition at line 77 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -593,15 +593,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the CL memory of the varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 80 of file clPatchTable.h.

│ │ │ │ +

Definition at line 80 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _fvarIndexBuffers

│ │ │ │ │ │ │ │ @@ -618,15 +618,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 107 of file clPatchTable.h.

│ │ │ │ +

Definition at line 107 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamBuffers

│ │ │ │ │ │ │ │
│ │ │ │ @@ -642,15 +642,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 108 of file clPatchTable.h.

│ │ │ │ +

Definition at line 108 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -666,15 +666,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 106 of file clPatchTable.h.

│ │ │ │ +

Definition at line 106 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _indexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -690,15 +690,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 100 of file clPatchTable.h.

│ │ │ │ +

Definition at line 100 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -714,15 +714,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 99 of file clPatchTable.h.

│ │ │ │ +

Definition at line 99 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -738,15 +738,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 101 of file clPatchTable.h.

│ │ │ │ +

Definition at line 101 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -762,15 +762,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 104 of file clPatchTable.h.

│ │ │ │ +

Definition at line 104 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -786,20 +786,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 103 of file clPatchTable.h.

│ │ │ │ +

Definition at line 103 of file clPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for OpenCL subdivision. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <clVertexBuffer.h>

│ │ │ │ +

#include <clVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -135,15 +135,15 @@ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ~CLVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
bool allocate (cl_context clContext)
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for OpenCL subdivision.

│ │ │ │

CLVertexBuffer implements CLVertexBufferInterface. An instance of this buffer class can be passed to CLEvaluator

│ │ │ │ │ │ │ │ -

Definition at line 42 of file clVertexBuffer.h.

│ │ │ │ +

Definition at line 42 of file clVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CLVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 49 of file clVertexBuffer.h.

│ │ │ │ +

Definition at line 49 of file clVertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetNumElements()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -497,20 +497,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 63 of file clVertexBuffer.h.

│ │ │ │ +

Definition at line 63 of file clVertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for Cpu subdivision and DirectX drawing. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cpuD3D11VertexBuffer.h>

│ │ │ │ +

#include <cpuD3D11VertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

virtual ~CpuD3D11VertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for Cpu subdivision and DirectX drawing.

│ │ │ │

CpuD3D11VertexBuffer implements CpuVertexBufferInterface and D3D11VertexBufferInterface.

│ │ │ │

An instance of this buffer class can be passed to CpuEvaluator.

│ │ │ │ │ │ │ │ -

Definition at line 48 of file cpuD3D11VertexBuffer.h.

│ │ │ │ +

Definition at line 48 of file cpuD3D11VertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CpuD3D11VertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -295,15 +295,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Returns the D3D11 buffer object (for Osd::Mesh interface)

│ │ │ │ │ │ │ │ -

Definition at line 75 of file cpuD3D11VertexBuffer.h.

│ │ │ │ +

Definition at line 75 of file cpuD3D11VertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -423,15 +423,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <cpuEvaluator.h>

│ │ │ │ +

#include <cpuEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const CpuEvaluator *instance=NULL, void *deviceContext=NULL)
 Generic static eval stencils function. This function has a same signature as other device kernels have so that it can be called in the same way from OsdMesh template interface. More...
 
 
static void Synchronize (void *)
 synchronize all asynchronous computation invoked on this device. More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 39 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 39 of file cpuEvaluator.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ EvalPatches() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -707,15 +707,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch
instancenot used in the cpu evaluator
deviceContextnot used in the cpu evaluator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 607 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 607 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -831,15 +831,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 517 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 517 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -930,15 +930,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 454 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 454 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1103,15 +1103,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1188 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 1188 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1234,15 +1234,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1100 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 1100 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1337,15 +1337,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1034 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 1034 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1503,15 +1503,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 971 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 971 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1627,15 +1627,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 886 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 886 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1723,15 +1723,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 823 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 823 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2325,15 +2325,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the cpu kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the cpu kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 303 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 303 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2435,15 +2435,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the cpu kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the cpu kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 168 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 168 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2520,15 +2520,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the cpu kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the cpu kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 72 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 72 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2553,20 +2553,20 @@ │ │ │ │
│ │ │ │ │ │ │ │

synchronize all asynchronous computation invoked on this device.

│ │ │ │
│ │ │ │

Other methods

│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 1227 of file cpuEvaluator.h.

│ │ │ │ +

Definition at line 1227 of file cpuEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for cpu subdivision and OpenGL drawing. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cpuGLVertexBuffer.h>

│ │ │ │ +

#include <cpuGLVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -132,15 +132,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ~CpuGLVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for cpu subdivision and OpenGL drawing.

│ │ │ │

CpuGLVertexBuffer implements CpuVertexBufferInterface and GLVertexBufferInterface.

│ │ │ │

The buffer interop between Cpu and GL is handled automatically when a client calls BindCpuBuffer and BindVBO methods.

│ │ │ │ │ │ │ │ -

Definition at line 47 of file cpuGLVertexBuffer.h.

│ │ │ │ +

Definition at line 47 of file cpuGLVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CpuGLVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -380,15 +380,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Cpu patch table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cpuPatchTable.h>

│ │ │ │ +

#include <cpuPatchTable.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -161,15 +161,15 @@ │ │ │ │

│ │ │ │ Public Member Functions

 CpuPatchTable (const Far::PatchTable *patchTable)
 
 ~CpuPatchTable ()
 
│ │ │ │

Detailed Description

│ │ │ │

Cpu patch table.

│ │ │ │

XXX: We can use just Far::PatchTable for typical CpuEval use cases.

│ │ │ │

Currently this class exists because of the template resolution for the CpuEvaluator's generic interface functions (glEvalLimit example uses), and device-specific patch tables such as GLPatchTables internally use as a staging buffer to splice patcharray and interleave sharpnesses.

│ │ │ │

Ideally Far::PatchTables should have the same data representation and accessors so that we don't have to copy data unnecessarily.

│ │ │ │ │ │ │ │ -

Definition at line 59 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 59 of file cpuPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ CpuPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -212,15 +212,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 68 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ Create()

│ │ │ │ │ │ │ │ @@ -251,15 +251,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 61 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 61 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -279,15 +279,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 109 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 109 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -307,15 +307,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 112 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 112 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchIndexSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -335,15 +335,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 115 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 115 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -363,15 +363,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 118 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 118 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -391,15 +391,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 121 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 121 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -418,15 +418,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 106 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 106 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumPatchArrays()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -445,15 +445,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 80 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 80 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -472,15 +472,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 70 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -499,15 +499,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 73 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -526,15 +526,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 83 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 83 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -553,15 +553,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 76 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -580,15 +580,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 86 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 86 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -607,15 +607,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 90 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 90 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -634,15 +634,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 96 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 96 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexSize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -661,15 +661,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 102 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 102 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _fvarIndexBuffers

│ │ │ │ │ │ │ │ @@ -686,15 +686,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 134 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 134 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamBuffers

│ │ │ │ │ │ │ │
│ │ │ │ @@ -710,15 +710,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 135 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 135 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -734,15 +734,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 133 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 133 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _indexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -758,15 +758,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 127 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 127 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -782,15 +782,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 126 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 126 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -806,15 +806,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 128 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 128 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -830,15 +830,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 131 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 131 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -854,20 +854,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 130 of file cpuPatchTable.h.

│ │ │ │ +

Definition at line 130 of file cpuPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for CPU subdivision. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cpuVertexBuffer.h>

│ │ │ │ +

#include <cpuVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -127,15 +127,15 @@ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ~CpuVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
 Constructor. More...
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for CPU subdivision.

│ │ │ │

CpuVertexBuffer implements the VertexBufferInterface. An instance of this buffer class can be passed to CpuEvaluator

│ │ │ │ │ │ │ │ -

Definition at line 42 of file cpuVertexBuffer.h.

│ │ │ │ +

Definition at line 42 of file cpuVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CpuVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -330,15 +330,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

CUDA stencil table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cudaEvaluator.h>

│ │ │ │ +

#include <cudaEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 CudaStencilTable (Far::StencilTable const *stencilTable)
 
 CudaStencilTable (Far::LimitStencilTable const *limitStencilTable)
 
 
│ │ │ │

Detailed Description

│ │ │ │

CUDA stencil table.

│ │ │ │

This class is a cuda buffer representation of Far::StencilTable.

│ │ │ │

CudaEvaluator consumes this table to apply stencils

│ │ │ │ │ │ │ │ -

Definition at line 52 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 52 of file cudaEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ CudaStencilTable() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -240,15 +240,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 59 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 59 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -278,15 +278,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 54 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -305,15 +305,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 76 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 77 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 77 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -359,15 +359,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 74 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -386,15 +386,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 78 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -413,15 +413,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 75 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIndicesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -440,15 +440,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 72 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -467,15 +467,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 79 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -494,15 +494,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 71 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -521,15 +521,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 70 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -548,20 +548,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 73 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <cudaEvaluator.h>

│ │ │ │ +

#include <cudaEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -162,15 +162,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const void *instance=NULL, void *deviceContext=NULL)
 Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface. More...
 
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way. More...
 
static void Synchronize (void *deviceContext=NULL)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 94 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 94 of file cudaEvaluator.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ EvalPatches() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -706,15 +706,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
patchTableCudaPatchTable or equivalent
instancenot used in the cuda evaluator
deviceContextnot used in the cuda evaluator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 648 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 648 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -830,15 +830,15 @@ │ │ │ │ patchTableCudaPatchTable or equivalent │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 565 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 565 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -929,15 +929,15 @@ │ │ │ │ patchTableCudaPatchTable or equivalent │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 504 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 504 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1102,15 +1102,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1224 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 1224 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1233,15 +1233,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1136 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 1136 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1336,15 +1336,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1070 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 1070 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1502,15 +1502,15 @@ │ │ │ │ patchTableCudaPatchTable or equivalent │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1007 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 1007 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1626,15 +1626,15 @@ │ │ │ │ patchTableCudaPatchTable or equivalent │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 922 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 922 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1722,15 +1722,15 @@ │ │ │ │ patchTableCudaPatchTable or equivalent │ │ │ │ instancenot used in the cuda evaluator │ │ │ │ deviceContextnot used in the cuda evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 859 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 859 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2324,15 +2324,15 @@ │ │ │ │ stencilTablestencil table to be applied. │ │ │ │ instancenot used in the cuda kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the cuda kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 353 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 353 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2434,15 +2434,15 @@ │ │ │ │ stencilTablestencil table to be applied. │ │ │ │ instancenot used in the cuda kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the cuda kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 218 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 218 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2519,15 +2519,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have Cuda memory interfaces. │ │ │ │ instancenot used in the CudaEvaluator │ │ │ │ deviceContextnot used in the CudaEvaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 126 of file cudaEvaluator.h.

│ │ │ │ +

Definition at line 126 of file cudaEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2553,15 +2553,15 @@ │ │ │ │
│ │ │ │

Other methods

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

CUDA patch table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cudaPatchTable.h>

│ │ │ │ +

#include <cudaPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for CudaPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -171,15 +171,15 @@ │ │ │ │ │ │ │ │
 
│ │ │ │

Detailed Description

│ │ │ │

CUDA patch table.

│ │ │ │

This class is a cuda buffer representation of Far::PatchTable.

│ │ │ │

CudaEvaluator consumes this table to evaluate on the patches.

│ │ │ │ │ │ │ │ -

Definition at line 51 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 51 of file cudaPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CudaPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -308,15 +308,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 81 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 81 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -338,15 +338,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of face-varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 86 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 86 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -368,15 +368,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of face-varying param.

│ │ │ │ │ │ │ │ -

Definition at line 91 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 91 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -397,15 +397,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the number of face-varying channels buffers.

│ │ │ │ │ │ │ │ -

Definition at line 78 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 78 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 60 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 60 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -455,15 +455,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 63 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 63 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of Osd::PatchParam buffer.

│ │ │ │ │ │ │ │ -

Definition at line 66 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 66 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchArrayBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -513,15 +513,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of Osd::PatchArray buffer.

│ │ │ │ │ │ │ │ -

Definition at line 69 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 69 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -542,15 +542,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the cuda memory of the array of varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 73 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 73 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _fvarIndexBuffers

│ │ │ │ │ │ │ │ @@ -567,15 +567,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 108 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 108 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamBuffers

│ │ │ │ │ │ │ │
│ │ │ │ @@ -591,15 +591,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 109 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 109 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -615,15 +615,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 107 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 107 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _indexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -639,15 +639,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 101 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 101 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -663,15 +663,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 100 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 100 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -687,15 +687,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 102 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 102 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -711,15 +711,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 105 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 105 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -735,20 +735,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 104 of file cudaPatchTable.h.

│ │ │ │ +

Definition at line 104 of file cudaPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for Cuda subdivision. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <cudaVertexBuffer.h>

│ │ │ │ +

#include <cudaVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ~CudaVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
bool allocate ()
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for Cuda subdivision.

│ │ │ │

CudaVertexBuffer implements CudaVertexBufferInterface. An instance of this buffer class can be passed to CudaEvaluator

│ │ │ │ │ │ │ │ -

Definition at line 42 of file cudaVertexBuffer.h.

│ │ │ │ +

Definition at line 42 of file cudaVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~CudaVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -358,15 +358,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

D3D11 stencil table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <d3d11ComputeEvaluator.h>

│ │ │ │ +

#include <d3d11ComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 D3D11StencilTable (Far::StencilTable const *stencilTable, ID3D11DeviceContext *deviceContext)
 
 ~D3D11StencilTable ()
 
 
│ │ │ │

Detailed Description

│ │ │ │

D3D11 stencil table.

│ │ │ │

This class is a D3D11 Shader Resource View representation of Far::StencilTable.

│ │ │ │

D3D11ComputeEvaluator consumes this table to apply stencils

│ │ │ │ │ │ │ │ -

Definition at line 56 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 56 of file d3d11ComputeEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ D3D11StencilTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -205,15 +205,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 59 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 59 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -243,15 +243,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 64 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 64 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetIndicesSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 77 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 77 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -297,15 +297,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 79 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -324,15 +324,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 76 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 75 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -378,20 +378,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 78 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
D3D11ComputeEvaluator Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <d3d11ComputeEvaluator.h>

│ │ │ │ +

#include <d3d11ComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef bool Instantiatable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -129,29 +129,29 @@ │ │ │ │

 
static void Synchronize (ID3D11DeviceContext *deviceContext)
 Wait the dispatched kernel finishes. More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 96 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 96 of file d3d11ComputeEvaluator.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Instantiatable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef bool Instantiatable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 98 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 98 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ D3D11ComputeEvaluator()

│ │ │ │ │ │ │ │ @@ -510,15 +510,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextID3D11DeviceContext. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 148 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 148 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -573,15 +573,15 @@ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Dispatch the DX compute kernel on GPU asynchronously. returns false if the kernel hasn't been compiled yet.

│ │ │ │ │ │ │ │ -

Definition at line 181 of file d3d11ComputeEvaluator.h.

│ │ │ │ +

Definition at line 181 of file d3d11ComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -606,15 +606,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Wait the dispatched kernel finishes.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
D3D11LegacyGregoryPatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <d3d11LegacyGregoryPatchTable.h>

│ │ │ │ +

#include <d3d11LegacyGregoryPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for D3D11LegacyGregoryPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -127,15 +127,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Protected Member Functions

 D3D11LegacyGregoryPatchTable ()
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 43 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 43 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~D3D11LegacyGregoryPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -206,15 +206,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 49 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 49 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 74 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetQuadOffsetsSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -297,15 +297,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 70 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -324,15 +324,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 62 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 62 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexValenceSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 66 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 66 of file d3d11LegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -396,15 +396,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
D3D11PatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <d3d11PatchTable.h>

│ │ │ │ +

#include <d3d11PatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for D3D11PatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -145,29 +145,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
ID3D11Buffer * _patchParamBuffer
 
ID3D11ShaderResourceView * _patchParamBufferSRV
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 49 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 49 of file d3d11PatchTable.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ VertexBufferBinding

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef ID3D11Buffer* VertexBufferBinding
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 51 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 51 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ D3D11PatchTable()

│ │ │ │ │ │ │ │ @@ -269,15 +269,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 57 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 57 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 65 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -361,15 +361,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the index buffer containing the patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 70 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 70 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamSRV()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -390,15 +390,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the SRV containing the patch parameter.

│ │ │ │ │ │ │ │ -

Definition at line 75 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 75 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _indexBuffer

│ │ │ │ │ │ │ │ @@ -415,15 +415,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 86 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 86 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -439,15 +439,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 84 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 84 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -463,15 +463,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 87 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 87 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBufferSRV

│ │ │ │ │ │ │ │
│ │ │ │ @@ -487,20 +487,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 88 of file d3d11PatchTable.h.

│ │ │ │ +

Definition at line 88 of file d3d11PatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for DirectX subdivision and DirectX drawing. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <d3d11VertexBuffer.h>

│ │ │ │ +

#include <d3d11VertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -135,15 +135,15 @@ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

virtual ~D3D11VertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, ID3D11DeviceContext *deviceContext)
bool allocate (ID3D11Device *device)
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for DirectX subdivision and DirectX drawing.

│ │ │ │

D3D11VertexBuffer implements D3D11VertexBufferInterface. An instance of this buffer class can be passed to D3D11ComputeEvaluator.

│ │ │ │ │ │ │ │ -

Definition at line 46 of file d3d11VertexBuffer.h.

│ │ │ │ +

Definition at line 46 of file d3d11VertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~D3D11VertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -295,15 +295,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Returns the D3D11 buffer object (for Osd::Mesh interface)

│ │ │ │ │ │ │ │ -

Definition at line 70 of file d3d11VertexBuffer.h.

│ │ │ │ +

Definition at line 70 of file d3d11VertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -423,15 +423,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

GL stencil table (Shader Storage buffer) │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <glComputeEvaluator.h>

│ │ │ │ +

#include <glComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 GLStencilTableSSBO (Far::StencilTable const *stencilTable)
 
 GLStencilTableSSBO (Far::LimitStencilTable const *limitStencilTable)
 
 
│ │ │ │

Detailed Description

│ │ │ │

GL stencil table (Shader Storage buffer)

│ │ │ │

This class is a GLSL SSBO representation of Far::StencilTable.

│ │ │ │

GLSLComputeKernel consumes this table to apply stencils

│ │ │ │ │ │ │ │ -

Definition at line 51 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 51 of file glComputeEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ GLStencilTableSSBO() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -240,15 +240,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 58 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 58 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -278,15 +278,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 53 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 53 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -305,15 +305,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 76 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 77 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 77 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -359,15 +359,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 74 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -386,15 +386,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 78 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -413,15 +413,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 75 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIndicesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -440,15 +440,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 72 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -467,15 +467,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 79 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -494,15 +494,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 71 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -521,15 +521,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 70 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -548,20 +548,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 73 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
GLComputeEvaluator Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <glComputeEvaluator.h>

│ │ │ │ +

#include <glComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef bool Instantiatable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -226,29 +226,29 @@ │ │ │ │

 
static void Synchronize (void *deviceContext)
 Wait the dispatched kernel finishes. More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 96 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 96 of file glComputeEvaluator.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Instantiatable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef bool Instantiatable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 98 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 98 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ GLComputeEvaluator()

│ │ │ │ │ │ │ │ @@ -416,15 +416,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 111 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 111 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -472,15 +472,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 99 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 99 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -848,15 +848,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1071 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1071 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1014,15 +1014,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 870 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 870 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1124,15 +1124,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 997 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 997 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1248,15 +1248,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 769 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 769 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1330,15 +1330,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 943 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 943 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1429,15 +1429,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 691 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 691 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1602,15 +1602,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1903 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1903 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1761,15 +1761,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2011 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 2011 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1892,15 +1892,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1736 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1736 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2009,15 +2009,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1816 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1816 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2112,15 +2112,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1606 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1606 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2201,15 +2201,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1669 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1669 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2353,15 +2353,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1544 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1544 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2519,15 +2519,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1439 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1439 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2629,15 +2629,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1355 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1355 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2753,15 +2753,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1278 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1278 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2835,15 +2835,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1214 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1214 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2931,15 +2931,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1154 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 1154 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3402,15 +3402,15 @@ │ │ │ │ dvvBufferOutput buffer 2nd derivative wrt v must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dvvDescvertex buffer descriptor for the dvvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 502 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 502 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3554,15 +3554,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSL kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 326 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 326 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3650,15 +3650,15 @@ │ │ │ │ dvBufferOutput buffer derivative wrt v must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dvDescvertex buffer descriptor for the dvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 434 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 434 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3760,15 +3760,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSL kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 236 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 236 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3828,15 +3828,15 @@ │ │ │ │ dstBufferOutput primvar buffer must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dstDescvertex buffer descriptor for the output buffer │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 386 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 386 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3913,15 +3913,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have SSBO interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSL kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 168 of file glComputeEvaluator.h.

│ │ │ │ +

Definition at line 168 of file glComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3946,15 +3946,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Wait the dispatched kernel finishes.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
GLLegacyGregoryPatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <glLegacyGregoryPatchTable.h>

│ │ │ │ +

#include <glLegacyGregoryPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for GLLegacyGregoryPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -124,15 +124,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Protected Member Functions

 GLLegacyGregoryPatchTable ()
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 39 of file glLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 39 of file glLegacyGregoryPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~GLLegacyGregoryPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -219,15 +219,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 60 of file glLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 60 of file glLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetQuadOffsetsTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -246,15 +246,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 56 of file glLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 56 of file glLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetVertexTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -273,15 +273,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 48 of file glLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 48 of file glLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexValenceTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -300,15 +300,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 52 of file glLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 52 of file glLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -323,15 +323,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
GLPatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <glPatchTable.h>

│ │ │ │ +

#include <glPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for GLPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -194,29 +194,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
std::vector< GLuint > _fvarParamBuffers
 
std::vector< GLuint > _fvarParamTextures
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 45 of file glPatchTable.h.

│ │ │ │ +

Definition at line 45 of file glPatchTable.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ VertexBufferBinding

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef GLuint VertexBufferBinding
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file glPatchTable.h.

│ │ │ │ +

Definition at line 47 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~GLPatchTable()

│ │ │ │ │ │ │ │ @@ -344,15 +344,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the patch arrays for face-varying index buffer data.

│ │ │ │ │ │ │ │ -

Definition at line 98 of file glPatchTable.h.

│ │ │ │ +

Definition at line 98 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -374,15 +374,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL index buffer containing face-varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 103 of file glPatchTable.h.

│ │ │ │ +

Definition at line 103 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchIndexTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -404,15 +404,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL texture buffer containing face-varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 108 of file glPatchTable.h.

│ │ │ │ +

Definition at line 108 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -434,15 +434,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL index buffer containing face-varying patch params.

│ │ │ │ │ │ │ │ -

Definition at line 113 of file glPatchTable.h.

│ │ │ │ +

Definition at line 113 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -464,15 +464,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL texture buffer containing face-varying patch params.

│ │ │ │ │ │ │ │ -

Definition at line 118 of file glPatchTable.h.

│ │ │ │ +

Definition at line 118 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -493,15 +493,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the number of face-varying channel buffers.

│ │ │ │ │ │ │ │ -

Definition at line 95 of file glPatchTable.h.

│ │ │ │ +

Definition at line 95 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrays()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -522,15 +522,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the patch arrays for vertex index buffer data.

│ │ │ │ │ │ │ │ -

Definition at line 55 of file glPatchTable.h.

│ │ │ │ +

Definition at line 55 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -551,15 +551,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL index buffer containing the patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 60 of file glPatchTable.h.

│ │ │ │ +

Definition at line 60 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -580,15 +580,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL texture buffer containing the patch control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 70 of file glPatchTable.h.

│ │ │ │ +

Definition at line 70 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -609,15 +609,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL index buffer containing the patch parameter.

│ │ │ │ │ │ │ │ -

Definition at line 65 of file glPatchTable.h.

│ │ │ │ +

Definition at line 65 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -638,15 +638,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL texture buffer containing the patch parameter.

│ │ │ │ │ │ │ │ -

Definition at line 75 of file glPatchTable.h.

│ │ │ │ +

Definition at line 75 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchArrays()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -667,15 +667,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the patch arrays for varying index buffer data.

│ │ │ │ │ │ │ │ -

Definition at line 80 of file glPatchTable.h.

│ │ │ │ +

Definition at line 80 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -696,15 +696,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL index buffer containing the varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 85 of file glPatchTable.h.

│ │ │ │ +

Definition at line 85 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexTextureBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -725,15 +725,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Returns the GL texture buffer containing the varying control vertices.

│ │ │ │ │ │ │ │ -

Definition at line 90 of file glPatchTable.h.

│ │ │ │ +

Definition at line 90 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _fvarIndexBuffers

│ │ │ │ │ │ │ │ @@ -750,15 +750,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 141 of file glPatchTable.h.

│ │ │ │ +

Definition at line 141 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarIndexTextures

│ │ │ │ │ │ │ │
│ │ │ │ @@ -774,15 +774,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 142 of file glPatchTable.h.

│ │ │ │ +

Definition at line 142 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamBuffers

│ │ │ │ │ │ │ │
│ │ │ │ @@ -798,15 +798,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 144 of file glPatchTable.h.

│ │ │ │ +

Definition at line 144 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamTextures

│ │ │ │ │ │ │ │
│ │ │ │ @@ -822,15 +822,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 145 of file glPatchTable.h.

│ │ │ │ +

Definition at line 145 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -846,15 +846,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 140 of file glPatchTable.h.

│ │ │ │ +

Definition at line 140 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -870,15 +870,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 128 of file glPatchTable.h.

│ │ │ │ +

Definition at line 128 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -894,15 +894,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 130 of file glPatchTable.h.

│ │ │ │ +

Definition at line 130 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchIndexTexture

│ │ │ │ │ │ │ │
│ │ │ │ @@ -918,15 +918,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 133 of file glPatchTable.h.

│ │ │ │ +

Definition at line 133 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -942,15 +942,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 131 of file glPatchTable.h.

│ │ │ │ +

Definition at line 131 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamTexture

│ │ │ │ │ │ │ │
│ │ │ │ @@ -966,15 +966,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 134 of file glPatchTable.h.

│ │ │ │ +

Definition at line 134 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -990,15 +990,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 137 of file glPatchTable.h.

│ │ │ │ +

Definition at line 137 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingIndexTexture

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1014,15 +1014,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 138 of file glPatchTable.h.

│ │ │ │ +

Definition at line 138 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1038,20 +1038,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 136 of file glPatchTable.h.

│ │ │ │ +

Definition at line 136 of file glPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <glslPatchShaderSource.h>

│ │ │ │ +

#include <glslPatchShaderSource.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

static std::string GetCommonShaderSource ()
 
static std::string GetPatchBasisShaderSource ()
 
static std::string GetTessControlShaderSource (Far::PatchDescriptor::Type type)
 
static std::string GetTessEvalShaderSource (Far::PatchDescriptor::Type type)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 37 of file glslPatchShaderSource.h.

│ │ │ │ +

Definition at line 37 of file glslPatchShaderSource.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetCommonShaderSource()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -235,15 +235,15 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Concrete vertex buffer class for GLSL subdivision and OpenGL drawing. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <glVertexBuffer.h>

│ │ │ │ +

#include <glVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ~GLVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
bool allocate ()
 
│ │ │ │

Detailed Description

│ │ │ │

Concrete vertex buffer class for GLSL subdivision and OpenGL drawing.

│ │ │ │

GLVertexBuffer implements GLVertexBufferInterface. An instance of this buffer class can be passed to OsdGLComputeEvaluator.

│ │ │ │ │ │ │ │ -

Definition at line 44 of file glVertexBuffer.h.

│ │ │ │ +

Definition at line 44 of file glVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~GLVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -359,15 +359,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

GL TextureBuffer stencil table. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <glXFBEvaluator.h>

│ │ │ │ +

#include <glXFBEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 GLStencilTableTBO (Far::StencilTable const *stencilTable)
 
 GLStencilTableTBO (Far::LimitStencilTable const *limitStencilTable)
 
 
│ │ │ │

Detailed Description

│ │ │ │

GL TextureBuffer stencil table.

│ │ │ │

This class is a GL Texture Buffer representation of Far::StencilTable.

│ │ │ │

GLSLTransformFeedback consumes this table to apply stencils

│ │ │ │ │ │ │ │ -

Definition at line 52 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 52 of file glXFBEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ GLStencilTableTBO() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -240,15 +240,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 60 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 60 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -278,15 +278,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 54 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuuWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -305,15 +305,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 78 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuvWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -332,15 +332,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 79 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -359,15 +359,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 76 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvvWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -386,15 +386,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 80 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 80 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -413,15 +413,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 77 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 77 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIndicesTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -440,15 +440,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 74 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -467,15 +467,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 81 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 81 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -494,15 +494,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 73 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -521,15 +521,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 72 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsTexture()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -548,20 +548,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 75 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
GLXFBEvaluator Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <glXFBEvaluator.h>

│ │ │ │ +

#include <glXFBEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef bool Instantiatable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -240,29 +240,29 @@ │ │ │ │

 
static void Synchronize (void *kernel)
 Wait the dispatched kernel finishes. More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 98 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 98 of file glXFBEvaluator.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Instantiatable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef bool Instantiatable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 100 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 100 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ GLXFBEvaluator()

│ │ │ │ │ │ │ │ @@ -414,15 +414,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 126 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 126 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -488,15 +488,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 170 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 170 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -564,15 +564,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Generic creator template.

│ │ │ │ │ │ │ │ -

Definition at line 140 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 140 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -640,15 +640,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specialization to allow creation without a device context.

│ │ │ │ │ │ │ │ -

Definition at line 157 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 157 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -698,15 +698,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Generic creator template.

│ │ │ │ │ │ │ │ -

Definition at line 104 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 104 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Create() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -756,15 +756,15 @@ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Specialization to allow creation without a device context.

│ │ │ │ │ │ │ │ -

Definition at line 117 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 117 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1132,15 +1132,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1144 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1144 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1298,15 +1298,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 943 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 943 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1408,15 +1408,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1070 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1070 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1532,15 +1532,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 843 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 843 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1614,15 +1614,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1016 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1016 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1713,15 +1713,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 765 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 765 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1886,15 +1886,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1976 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1976 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2045,15 +2045,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2084 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 2084 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2176,15 +2176,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1809 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1809 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2293,15 +2293,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1889 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1889 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2396,15 +2396,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1679 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1679 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2485,15 +2485,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1742 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1742 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2637,15 +2637,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1617 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1617 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2803,15 +2803,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1512 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1512 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2913,15 +2913,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1428 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1428 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3037,15 +3037,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1351 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1351 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3119,15 +3119,15 @@ │ │ │ │ numPatchCoordsnumber of patchCoords. │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1287 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1287 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3215,15 +3215,15 @@ │ │ │ │ patchTableGLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLXFB evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1227 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 1227 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3686,15 +3686,15 @@ │ │ │ │ dvvBufferOutput buffer 2nd derivative wrt v must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dvvDescvertex buffer descriptor for the dvvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 575 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 575 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3838,15 +3838,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSLTransformFeedback kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 396 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 396 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3934,15 +3934,15 @@ │ │ │ │ dvBufferOutput buffer derivative wrt v must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dvDescvertex buffer descriptor for the dvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 506 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 506 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4044,15 +4044,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSLTransformFeedback kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 306 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 306 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4112,15 +4112,15 @@ │ │ │ │ dstBufferOutput primvar buffer must have BindVBO() method returning a GL buffer object of destination data │ │ │ │ dstDescvertex buffer descriptor for the output buffer │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 457 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 457 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4197,15 +4197,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have Texture Buffer Object interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextnot used in the GLSLTransformFeedback kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 238 of file glXFBEvaluator.h.

│ │ │ │ +

Definition at line 238 of file glXFBEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4230,15 +4230,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Wait the dispatched kernel finishes.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <hlslPatchShaderSource.h>

│ │ │ │ +

#include <hlslPatchShaderSource.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

static std::string GetCommonShaderSource ()
 
static std::string GetPatchBasisShaderSource ()
 
static std::string GetHullShaderSource (Far::PatchDescriptor::Type type)
 
static std::string GetDomainShaderSource (Far::PatchDescriptor::Type type)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 37 of file hlslPatchShaderSource.h.

│ │ │ │ +

Definition at line 37 of file hlslPatchShaderSource.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetCommonShaderSource()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -235,15 +235,15 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
MeshInterface< PATCH_TABLE > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mesh.h>

│ │ │ │ +

#include <mesh.h>

│ │ │ │
│ │ │ │ Inheritance diagram for MeshInterface< PATCH_TABLE >:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT > │ │ │ │ @@ -144,29 +144,29 @@ │ │ │ │   │ │ │ │ static void refineMesh (Far::TopologyRefiner &refiner, int level, MeshBitset bits) │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │
template<class PATCH_TABLE>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Osd::MeshInterface< PATCH_TABLE >
│ │ │ │ -

Definition at line 68 of file mesh.h.

│ │ │ │ +

Definition at line 68 of file mesh.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ PatchTable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef PATCH_TABLE PatchTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file mesh.h.

│ │ │ │ +

Definition at line 70 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ VertexBufferBinding

│ │ │ │ │ │ │ │
│ │ │ │ @@ -174,15 +174,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef PatchTable::VertexBufferBinding VertexBufferBinding
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file mesh.h.

│ │ │ │ +

Definition at line 71 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ MeshInterface()

│ │ │ │ │ │ │ │ @@ -202,15 +202,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file mesh.h.

│ │ │ │ +

Definition at line 74 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ ~MeshInterface()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -229,15 +229,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file mesh.h.

│ │ │ │ +

Definition at line 76 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ BindVaryingBuffer()

│ │ │ │ │ │ │ │ @@ -469,15 +469,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 101 of file mesh.h.

│ │ │ │ +

Definition at line 101 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ refineMesh() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -513,15 +513,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestaticprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 117 of file mesh.h.

│ │ │ │ +

Definition at line 117 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -633,15 +633,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Implemented in Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/osd/mesh.h
  • │ │ │ │ +
  • opensubdiv/osd/mesh.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
EvaluatorCacheT< EVALUATOR > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mesh.h>

│ │ │ │ +

#include <mesh.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Entry
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -118,29 +118,29 @@ │ │ │ │

template<typename DEVICE_CONTEXT >
EVALUATOR * GetEvaluator (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT *deviceContext)
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename EVALUATOR>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT< EVALUATOR >
│ │ │ │ -

Definition at line 186 of file mesh.h.

│ │ │ │ +

Definition at line 186 of file mesh.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Evaluators

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef std::vector<Entry> Evaluators
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 225 of file mesh.h.

│ │ │ │ +

Definition at line 225 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~EvaluatorCacheT()

│ │ │ │ │ │ │ │ @@ -160,15 +160,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 188 of file mesh.h.

│ │ │ │ +

Definition at line 188 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetEvaluator() [1/3]

│ │ │ │ │ │ │ │ @@ -235,15 +235,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 255 of file mesh.h.

│ │ │ │ +

Definition at line 255 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetEvaluator() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -291,15 +291,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 241 of file mesh.h.

│ │ │ │ +

Definition at line 241 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetEvaluator() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -335,20 +335,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 228 of file mesh.h.

│ │ │ │ +

Definition at line 228 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/osd/mesh.h
  • │ │ │ │ +
  • opensubdiv/osd/mesh.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
EvaluatorCacheT< EVALUATOR >::Entry Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mesh.h>

│ │ │ │ +

#include <mesh.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -119,15 +119,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 Entry (BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, EVALUATOR *evalArg)
 
 Entry (BufferDescriptor const &srcDescArg, BufferDescriptor const &dstDescArg, BufferDescriptor const &duDescArg, BufferDescriptor const &dvDescArg, BufferDescriptor const &duuDescArg, BufferDescriptor const &duvDescArg, BufferDescriptor const &dvvDescArg, EVALUATOR *evalArg)
 
 
EVALUATOR * evaluator
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename EVALUATOR>
│ │ │ │ struct OpenSubdiv::OPENSUBDIV_VERSION::Osd::EvaluatorCacheT< EVALUATOR >::Entry
│ │ │ │ -

Definition at line 196 of file mesh.h.

│ │ │ │ +

Definition at line 196 of file mesh.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Entry() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -173,15 +173,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 197 of file mesh.h.

│ │ │ │ +

Definition at line 197 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Entry() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -247,15 +247,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 207 of file mesh.h.

│ │ │ │ +

Definition at line 207 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ dstDesc

│ │ │ │ │ │ │ │ @@ -264,15 +264,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor dstDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 220 of file mesh.h.

│ │ │ │ +

Definition at line 220 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ duDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -280,15 +280,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor duDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 221 of file mesh.h.

│ │ │ │ +

Definition at line 221 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ duuDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -296,15 +296,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor duuDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 222 of file mesh.h.

│ │ │ │ +

Definition at line 222 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ duvDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -312,15 +312,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor duvDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 222 of file mesh.h.

│ │ │ │ +

Definition at line 222 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ dvDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -328,15 +328,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor dvDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 221 of file mesh.h.

│ │ │ │ +

Definition at line 221 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ dvvDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -344,15 +344,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor dvvDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 222 of file mesh.h.

│ │ │ │ +

Definition at line 222 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ evaluator

│ │ │ │ │ │ │ │
│ │ │ │ @@ -360,15 +360,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
EVALUATOR* evaluator
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 223 of file mesh.h.

│ │ │ │ +

Definition at line 223 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ srcDesc

│ │ │ │ │ │ │ │
│ │ │ │ @@ -376,20 +376,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
BufferDescriptor srcDesc
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 220 of file mesh.h.

│ │ │ │ +

Definition at line 220 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file:
    │ │ │ │ -
  • opensubdiv/osd/mesh.h
  • │ │ │ │ +
  • opensubdiv/osd/mesh.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mesh.h>

│ │ │ │ +

#include <mesh.h>

│ │ │ │
│ │ │ │ Inheritance diagram for Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ MeshInterface< PATCH_TABLE > │ │ │ │ @@ -190,29 +190,29 @@ │ │ │ │   │ │ │ │ static void refineMesh (Far::TopologyRefiner &refiner, int level, MeshBitset bits) │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │
template<typename VERTEX_BUFFER, typename STENCIL_TABLE, typename EVALUATOR, typename PATCH_TABLE, typename DEVICE_CONTEXT = void>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Osd::Mesh< VERTEX_BUFFER, STENCIL_TABLE, EVALUATOR, PATCH_TABLE, DEVICE_CONTEXT >
│ │ │ │ -

Definition at line 418 of file mesh.h.

│ │ │ │ +

Definition at line 418 of file mesh.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ DeviceContext

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef DEVICE_CONTEXT DeviceContext
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 424 of file mesh.h.

│ │ │ │ +

Definition at line 424 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Evaluator

│ │ │ │ │ │ │ │
│ │ │ │ @@ -220,15 +220,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef EVALUATOR Evaluator
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 421 of file mesh.h.

│ │ │ │ +

Definition at line 421 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvaluatorCache

│ │ │ │ │ │ │ │
│ │ │ │ @@ -236,15 +236,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef EvaluatorCacheT<Evaluator> EvaluatorCache
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 425 of file mesh.h.

│ │ │ │ +

Definition at line 425 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PatchTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -252,15 +252,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef PATCH_TABLE PatchTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 423 of file mesh.h.

│ │ │ │ +

Definition at line 423 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ StencilTable

│ │ │ │ │ │ │ │
│ │ │ │ @@ -268,15 +268,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef STENCIL_TABLE StencilTable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 422 of file mesh.h.

│ │ │ │ +

Definition at line 422 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VertexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -284,15 +284,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef VERTEX_BUFFER VertexBuffer
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 420 of file mesh.h.

│ │ │ │ +

Definition at line 420 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VertexBufferBinding

│ │ │ │ │ │ │ │
│ │ │ │ @@ -300,15 +300,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef PatchTable::VertexBufferBinding VertexBufferBinding
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 426 of file mesh.h.

│ │ │ │ +

Definition at line 426 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Mesh()

│ │ │ │ │ │ │ │ @@ -369,15 +369,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 428 of file mesh.h.

│ │ │ │ +

Definition at line 428 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ~Mesh()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -396,15 +396,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 478 of file mesh.h.

│ │ │ │ +

Definition at line 478 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ BindVaryingBuffer()

│ │ │ │ │ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 566 of file mesh.h.

│ │ │ │ +

Definition at line 566 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ BindVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -455,15 +455,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 562 of file mesh.h.

│ │ │ │ +

Definition at line 562 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFarPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 554 of file mesh.h.

│ │ │ │ +

Definition at line 554 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetMaxValence()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -513,15 +513,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 560 of file mesh.h.

│ │ │ │ +

Definition at line 560 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -542,15 +542,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 558 of file mesh.h.

│ │ │ │ +

Definition at line 558 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -571,15 +571,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 550 of file mesh.h.

│ │ │ │ +

Definition at line 550 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetTopologyRefiner()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -598,15 +598,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 578 of file mesh.h.

│ │ │ │ +

Definition at line 578 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -625,15 +625,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 574 of file mesh.h.

│ │ │ │ +

Definition at line 574 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -652,15 +652,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 570 of file mesh.h.

│ │ │ │ +

Definition at line 570 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Refine()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -681,15 +681,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 501 of file mesh.h.

│ │ │ │ +

Definition at line 501 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -710,15 +710,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 546 of file mesh.h.

│ │ │ │ +

Definition at line 546 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateVaryingBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -756,15 +756,15 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 495 of file mesh.h.

│ │ │ │ +

Definition at line 495 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -802,20 +802,20 @@ │ │ │ │ inlinevirtual │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implements MeshInterface< PATCH_TABLE >.

│ │ │ │ │ │ │ │ -

Definition at line 489 of file mesh.h.

│ │ │ │ +

Definition at line 489 of file mesh.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/osd/mesh.h
  • │ │ │ │ +
  • opensubdiv/osd/mesh.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlCommon.h>

│ │ │ │ +

#include <mtlCommon.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

id< MTLDevice > device = nullptr
 
id< MTLCommandQueue > commandQueue = nullptr
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 40 of file mtlCommon.h.

│ │ │ │ +

Definition at line 40 of file mtlCommon.h.

│ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ commandQueue

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
id<MTLCommandQueue> commandQueue = nullptr
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 43 of file mtlCommon.h.

│ │ │ │ +

Definition at line 43 of file mtlCommon.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ device

│ │ │ │ │ │ │ │
│ │ │ │ @@ -128,20 +128,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
id<MTLDevice> device = nullptr
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 42 of file mtlCommon.h.

│ │ │ │ +

Definition at line 42 of file mtlCommon.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
MTLStencilTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlComputeEvaluator.h>

│ │ │ │ +

#include <mtlComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -127,15 +127,15 @@ │ │ │ │ Static Public Member Functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 MTLStencilTable (Far::StencilTable const *stencilTable, MTLContext *context)
 
 MTLStencilTable (Far::LimitStencilTable const *stencilTable, MTLContext *context)
 
template<typename STENCIL_TABLE , typename DEVICE_CONTEXT >
static MTLStencilTableCreate (STENCIL_TABLE *stencilTable, DEVICE_CONTEXT context)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 50 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 50 of file mtlComputeEvaluator.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ MTLStencilTable() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -237,15 +237,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 54 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -264,15 +264,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 71 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetDuvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -291,15 +291,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 72 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDuWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -318,15 +318,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 69 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 69 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -345,15 +345,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 73 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetDvWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -372,15 +372,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 70 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetIndicesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -399,15 +399,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 67 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 67 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumStencils()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 75 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetOffsetsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -453,15 +453,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 66 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 66 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetSizesBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -480,15 +480,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 65 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetWeightsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -507,20 +507,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 68 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
MTLComputeEvaluator Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlComputeEvaluator.h>

│ │ │ │ +

#include <mtlComputeEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef bool Instantiatable
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -224,29 +224,29 @@ │ │ │ │

 
static void Synchronize (MTLContext *context)
 Wait for the dispatched kernel to finish. More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 91 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 91 of file mtlComputeEvaluator.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Instantiatable

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef bool Instantiatable
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 94 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 94 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ MTLComputeEvaluator()

│ │ │ │ │ │ │ │ @@ -868,15 +868,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 889 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 889 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1027,15 +1027,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1104 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1104 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1151,15 +1151,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 786 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 786 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1268,15 +1268,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1025 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1025 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1367,15 +1367,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 705 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 705 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatches() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1456,15 +1456,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 966 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 966 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1629,15 +1629,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1991 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1991 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1795,15 +1795,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 2106 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 2106 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1926,15 +1926,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1813 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1813 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2050,15 +2050,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1900 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1900 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2153,15 +2153,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1672 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1672 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2249,15 +2249,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ fvarChannelface-varying channel │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1742 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1742 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2415,15 +2415,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1496 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1496 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2574,15 +2574,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1606 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1606 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2698,15 +2698,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1325 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1325 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [4/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2815,15 +2815,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1407 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1407 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2911,15 +2911,15 @@ │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1192 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1192 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3000,15 +3000,15 @@ │ │ │ │ patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO. │ │ │ │ patchTableMTLPatchTable or equivalent │ │ │ │ deviceContextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1257 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 1257 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3499,15 +3499,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 312 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 312 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [4/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3644,15 +3644,15 @@ │ │ │ │ dvvDescvertex buffer descriptor for the dvvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 504 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 504 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3754,15 +3754,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 220 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 220 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3857,15 +3857,15 @@ │ │ │ │ dvDescvertex buffer descriptor for the dvBuffer │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 430 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 430 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [7/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -3942,15 +3942,15 @@ │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 149 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 149 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [8/8]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4017,15 +4017,15 @@ │ │ │ │ dstDescvertex buffer descriptor for the output buffer │ │ │ │ stencilTablestencil table to be applied. The table must have MTLBuffer interfaces. │ │ │ │ contextused to obtain the MTLDevice object and command queue to obtain command buffers from. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 376 of file mtlComputeEvaluator.h.

│ │ │ │ +

Definition at line 376 of file mtlComputeEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Synchronize()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -4050,15 +4050,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Wait for the dispatched kernel to finish.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
MTLLegacyGregoryPatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlLegacyGregoryPatchTable.h>

│ │ │ │ +

#include <mtlLegacyGregoryPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for MTLLegacyGregoryPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
static MTLLegacyGregoryPatchTableCreate (Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)
 
static MTLLegacyGregoryPatchTableCreate (Far::PatchTable const *farPatchTable, MTLContext *context)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 41 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 41 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ~MTLLegacyGregoryPatchTable()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -175,15 +175,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inlinestatic
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 48 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 48 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -239,15 +239,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 71 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetQuadOffsetsBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -266,15 +266,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 66 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 66 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -293,15 +293,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 56 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 56 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVertexValenceBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -320,15 +320,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 61 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ +

Definition at line 61 of file mtlLegacyGregoryPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -365,15 +365,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlPatchShaderSource.h>

│ │ │ │ +

#include <mtlPatchShaderSource.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

static std::string GetCommonShaderSource ()
 
static std::string GetPatchBasisShaderSource ()
 
static std::string GetHullShaderSource (Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
 
static std::string GetDomainShaderSource (Far::PatchDescriptor::Type type, Far::PatchDescriptor::Type fvarType)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 37 of file mtlPatchShaderSource.h.

│ │ │ │ +

Definition at line 37 of file mtlPatchShaderSource.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetCommonShaderSource()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -353,15 +353,15 @@ │ │ │ │ │ │ │ │

Deprecated.

│ │ │ │

These methods are deprecated. Clients should determine the patch type of a face-varying patch by inspecting the face-varying patch array descriptors.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
MTLPatchTable Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlPatchTable.h>

│ │ │ │ +

#include <mtlPatchTable.h>

│ │ │ │
│ │ │ │ Inheritance diagram for MTLPatchTable:
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -163,29 +163,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
std::vector< id< MTLBuffer > > _fvarIndexBuffers
 
std::vector< id< MTLBuffer > > _fvarParamBuffers
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 46 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 46 of file mtlPatchTable.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ VertexBufferBinding

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef id<MTLBuffer> VertexBufferBinding
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 48 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 48 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ MTLPatchTable()

│ │ │ │ │ │ │ │ @@ -287,15 +287,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 54 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 69 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 69 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetFVarPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -379,15 +379,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 70 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -407,15 +407,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 71 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFVarChannels()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -434,15 +434,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 68 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchArrays()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 61 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 61 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -488,15 +488,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 62 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 62 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetPatchParamBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -515,15 +515,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 63 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 63 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchArrays()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -542,15 +542,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 65 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVaryingPatchIndexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -569,15 +569,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 66 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 66 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ _fvarIndexBuffers

│ │ │ │ │ │ │ │ @@ -594,15 +594,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 86 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 86 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarParamBuffers

│ │ │ │ │ │ │ │
│ │ │ │ @@ -618,15 +618,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 87 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 87 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _fvarPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -642,15 +642,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 85 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 85 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _indexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -666,15 +666,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 78 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 78 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -690,15 +690,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 76 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _patchParamBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -714,15 +714,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 79 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchArrays

│ │ │ │ │ │ │ │
│ │ │ │ @@ -738,15 +738,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 81 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 81 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ _varyingPatchIndexBuffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -762,20 +762,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ protected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 83 of file mtlPatchTable.h.

│ │ │ │ +

Definition at line 83 of file mtlPatchTable.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
CPUMTLVertexBuffer Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <mtlVertexBuffer.h>

│ │ │ │ +

#include <mtlVertexBuffer.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -120,15 +120,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

void UpdateData (const float *src, int startVertex, int numVertices, MTLContext *context)
 
int GetNumElements () const
 
 CPUMTLVertexBuffer (int numElements, int numVertices)
 
bool allocate (MTLContext *context)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 39 of file mtlVertexBuffer.h.

│ │ │ │ +

Definition at line 39 of file mtlVertexBuffer.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ CPUMTLVertexBuffer()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -244,15 +244,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 58 of file mtlVertexBuffer.h.

│ │ │ │ +

Definition at line 58 of file mtlVertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Create()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -313,15 +313,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 45 of file mtlVertexBuffer.h.

│ │ │ │ +

Definition at line 45 of file mtlVertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ GetNumVertices()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -340,15 +340,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 50 of file mtlVertexBuffer.h.

│ │ │ │ +

Definition at line 50 of file mtlVertexBuffer.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ UpdateData()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -385,15 +385,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <ompEvaluator.h>

│ │ │ │ +

#include <ompEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -164,15 +164,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
 Generic static eval stencils function. This function has a same signature as other device kernels have so that it can be called in the same way from OsdMesh template interface. More...
 
static void Synchronize (void *deviceContext=NULL)
 
static void SetNumThreads (int numThreads)
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 39 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 39 of file ompEvaluator.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ EvalPatches() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -708,15 +708,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch
instancenot used in the omp evaluator
deviceContextnot used in the omp evaluator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 607 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 607 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -832,15 +832,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 517 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 517 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -931,15 +931,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 454 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 454 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1104,15 +1104,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1188 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 1188 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1235,15 +1235,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1100 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 1100 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1338,15 +1338,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1034 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 1034 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1504,15 +1504,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 971 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 971 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1628,15 +1628,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 886 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 886 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1724,15 +1724,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the omp evaluator │ │ │ │ deviceContextnot used in the omp evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 823 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 823 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2326,15 +2326,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the omp kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the omp kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 303 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 303 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2436,15 +2436,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the omp kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the omp kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 168 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 168 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2521,15 +2521,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the omp kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the omp kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 72 of file ompEvaluator.h.

│ │ │ │ +

Definition at line 72 of file ompEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetNumThreads()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2581,15 +2581,15 @@ │ │ │ │
│ │ │ │

Other methods

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <tbbEvaluator.h>

│ │ │ │ +

#include <tbbEvaluator.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -166,15 +166,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
 Generic static eval stencils function. This function has a same signature as other device kernels have so that it can be called in the same way from OsdMesh template interface. More...
 
 
static void SetNumThreads (int numThreads)
 initialize tbb task schedular (optional: client may use tbb::task_scheduler_init) More...
 
│ │ │ │

Detailed Description

│ │ │ │
│ │ │ │ -

Definition at line 39 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 39 of file tbbEvaluator.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ EvalPatches() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -710,15 +710,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch
instancenot used in the cpu evaluator
deviceContextnot used in the cpu evaluator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 607 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 607 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -834,15 +834,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 517 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 517 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ EvalPatches() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -933,15 +933,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 454 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 454 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1106,15 +1106,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1188 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 1188 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1237,15 +1237,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1100 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 1100 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesFaceVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1340,15 +1340,15 @@ │ │ │ │ fvarChannelface-varying channel │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 1034 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 1034 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1506,15 +1506,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 971 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 971 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1630,15 +1630,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 886 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 886 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalPatchesVarying() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1726,15 +1726,15 @@ │ │ │ │ patchTableCpuPatchTable or equivalent XXX: currently Far::PatchTable can't be used due to interface mismatch │ │ │ │ instancenot used in the cpu evaluator │ │ │ │ deviceContextnot used in the cpu evaluator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 823 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 823 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [1/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2328,15 +2328,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the tbb kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the tbb kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 303 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 303 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [5/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2438,15 +2438,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the tbb kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the tbb kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 168 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 168 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EvalStencils() [6/6]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2523,15 +2523,15 @@ │ │ │ │ stencilTableFar::StencilTable or equivalent │ │ │ │ instancenot used in the tbb kernel (declared as a typed pointer to prevent undesirable template resolution) │ │ │ │ deviceContextnot used in the tbb kernel │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 72 of file tbbEvaluator.h.

│ │ │ │ +

Definition at line 72 of file tbbEvaluator.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetNumThreads()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2593,15 +2593,15 @@ │ │ │ │
│ │ │ │

Other methods

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <crease.h>

│ │ │ │ +

#include <crease.h>

│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

enum  Rule {
│ │ │ │   RULE_UNKNOWN = 0 │ │ │ │ ,
│ │ │ │   RULE_SMOOTH = (1 << 0) │ │ │ │ @@ -173,15 +173,15 @@ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │

Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme.

│ │ │ │

Crease is intended to be a light-weight, trivially constructed class that computes crease-related properties – typically sharpness values and associated interpolation weights. An instance of Crease is defined with a set of options that include current and future variations that will impact computations involving sharpness values.

│ │ │ │

The Crease methods do not use topological neighborhoods as input. The methods here rely more on the sharpness values and less on the topology, so we choose to work directly with the sharpness values. We also follow the trend of using primitive arrays in the interface to encourage local gathering for re-use.

│ │ │ │

Note on the need for and use of sharpness values: In general, mask queries rely on the sharpness values. The common case of a smooth vertex, when known, avoids the need to inspect them, but unless the rules are well understood, users will be expected to provided them – particularly when they expect the mask queries to do all of the work (just determining if a vertex is smooth will require inspection of incident edge sharpness). Mask queries will occasionally require the subdivided sharpness values around the child vertex. So users will be expected to either provide them up front when known, or to be gathered on demand. Any implementation of subdivision with creasing cannot avoid subdividing the sharpness values first, so keeping them available for re-use is a worthwhile consideration.

│ │ │ │ │ │ │ │ -

Definition at line 62 of file crease.h.

│ │ │ │ +

Definition at line 62 of file crease.h.

│ │ │ │

Member Enumeration Documentation

│ │ │ │ │ │ │ │

◆ Rule

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -195,15 +195,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Enumerator
RULE_UNKNOWN 
RULE_SMOOTH 
RULE_DART 
RULE_CREASE 
RULE_CORNER 
│ │ │ │ │ │ │ │ -

Definition at line 82 of file crease.h.

│ │ │ │ +

Definition at line 82 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Crease() [1/2]

│ │ │ │ │ │ │ │ @@ -223,15 +223,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 91 of file crease.h.

│ │ │ │ +

Definition at line 91 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ Crease() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -251,15 +251,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 92 of file crease.h.

│ │ │ │ +

Definition at line 92 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ~Crease()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -278,15 +278,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 93 of file crease.h.

│ │ │ │ +

Definition at line 93 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ ComputeFractionalWeightAtVertex()

│ │ │ │ │ │ │ │ @@ -355,15 +355,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 207 of file crease.h.

│ │ │ │ +

Definition at line 207 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ DetermineVertexVertexRule() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -462,15 +462,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 228 of file crease.h.

│ │ │ │ +

Definition at line 228 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsInfinite()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -490,15 +490,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file crease.h.

│ │ │ │ +

Definition at line 72 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsSemiSharp()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -518,15 +518,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 73 of file crease.h.

│ │ │ │ +

Definition at line 73 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsSharp()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -546,15 +546,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file crease.h.

│ │ │ │ +

Definition at line 71 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsSmooth()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -574,15 +574,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlinestatic │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file crease.h.

│ │ │ │ +

Definition at line 70 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ IsUniform()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -601,15 +601,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 95 of file crease.h.

│ │ │ │ +

Definition at line 95 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SharpenBoundaryEdge()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -630,15 +630,15 @@ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Optional sharp features: Since options treat certain topological features as infinitely sharp – boundaries or (in future) non-manifold features – sharpness values should be adjusted before use. The following methods will adjust (by return) specific values according to the options applied.

│ │ │ │ │ │ │ │ -

Definition at line 189 of file crease.h.

│ │ │ │ +

Definition at line 189 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SharpenBoundaryVertex()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -658,15 +658,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 200 of file crease.h.

│ │ │ │ +

Definition at line 200 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SubdivideEdgeSharpnessAtVertex()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -759,15 +759,15 @@ │ │ │ │
│ │ │ │

Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows:

    │ │ │ │
  • Smooth edges or verts stay Smooth
  • │ │ │ │
  • Sharp edges or verts stay Sharp
  • │ │ │ │
  • semi-sharp edges or verts are decremented by 1.0 but for Chaikin (and potentially future non-uniform schemes that improve upon it) the computation is more involved. In the case of edges in particular, the sharpness of a child edge is determined by the sharpness in the neighborhood of the end vertex corresponding to the child. For this reason, an alternative to subdividing sharpness that computes all child edges around a vertex is given.
  • │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 216 of file crease.h.

│ │ │ │ +

Definition at line 216 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SubdivideVertexSharpness()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -787,15 +787,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 222 of file crease.h.

│ │ │ │ +

Definition at line 222 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ │ │ │ │

◆ SHARPNESS_INFINITE

│ │ │ │ │ │ │ │ @@ -812,15 +812,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ static │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file crease.h.

│ │ │ │ +

Definition at line 68 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SHARPNESS_SMOOTH

│ │ │ │ │ │ │ │
│ │ │ │ @@ -837,20 +837,20 @@ │ │ │ │ │ │ │ │ static │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Constants and related queries of sharpness values:

│ │ │ │ │ │ │ │ -

Definition at line 67 of file crease.h.

│ │ │ │ +

Definition at line 67 of file crease.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/sdc/crease.h
  • │ │ │ │ +
  • opensubdiv/sdc/crease.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

All supported options applying to subdivision scheme. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <options.h>

│ │ │ │ +

#include <options.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

enum  VtxBoundaryInterpolation {
│ │ │ │   VTX_BOUNDARY_NONE = 0 │ │ │ │ ,
│ │ │ │   VTX_BOUNDARY_EDGE_ONLY │ │ │ │ @@ -168,15 +168,15 @@ │ │ │ │
 
│ │ │ │

Detailed Description

│ │ │ │

All supported options applying to subdivision scheme.

│ │ │ │

The Options class contains all supported options that can be applied to a subdivision scheme to affect the shape of the limit surface. These differ from approximations that may be applied at a higher level, i.e. options to limit the level of feature adaptive subdivision, options to ignore fractional creasing, or creasing entirely, etc. These options define the shape of a particular limit surface, including the "shape" of primitive variable data associated with it.

│ │ │ │

The intent is that these sets of options be defined at a high level and propagated into the lowest-level computation in support of each subdivision scheme. Ideally it remains a set of bit-fields (essentially an int) and so remains light weight and easily passed around by value.

│ │ │ │ │ │ │ │ -

Definition at line 51 of file options.h.

│ │ │ │ +

Definition at line 51 of file options.h.

│ │ │ │

Member Enumeration Documentation

│ │ │ │ │ │ │ │

◆ CreasingMethod

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -188,15 +188,15 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
Enumerator
CREASE_UNIFORM 

Catmark rule.

│ │ │ │
CREASE_CHAIKIN 

Chaikin rule.

│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file options.h.

│ │ │ │ +

Definition at line 68 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ FVarLinearInterpolation

│ │ │ │ │ │ │ │
│ │ │ │ @@ -218,15 +218,15 @@ │ │ │ │ │ │ │ │ FVAR_LINEAR_BOUNDARIES 

sharpen all boundaries ("always sharp")

│ │ │ │ │ │ │ │ FVAR_LINEAR_ALL 

bilinear interpolation ("bilinear")

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 60 of file options.h.

│ │ │ │ +

Definition at line 60 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ TriangleSubdivision

│ │ │ │ │ │ │ │
│ │ │ │ @@ -240,15 +240,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Enumerator
TRI_SUB_CATMARK 

Catmark weights (Catmark scheme only)

│ │ │ │
TRI_SUB_SMOOTH 

"smooth triangle" weights (Catmark scheme only)

│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file options.h.

│ │ │ │ +

Definition at line 72 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VtxBoundaryInterpolation

│ │ │ │ │ │ │ │
│ │ │ │ @@ -264,15 +264,15 @@ │ │ │ │ │ │ │ │ VTX_BOUNDARY_EDGE_ONLY 

all boundary edges sharpened and interpolated

│ │ │ │ │ │ │ │ VTX_BOUNDARY_EDGE_AND_CORNER 

all boundary edges and corner vertices sharpened and interpolated

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 53 of file options.h.

│ │ │ │ +

Definition at line 53 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Options()

│ │ │ │ │ │ │ │ @@ -292,15 +292,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file options.h.

│ │ │ │ +

Definition at line 79 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ GetCreasingMethod()

│ │ │ │ │ │ │ │ @@ -322,15 +322,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get edge crease rule.

│ │ │ │ │ │ │ │ -

Definition at line 101 of file options.h.

│ │ │ │ +

Definition at line 101 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetFVarLinearInterpolation()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get face-varying interpolation rule.

│ │ │ │ │ │ │ │ -

Definition at line 95 of file options.h.

│ │ │ │ +

Definition at line 95 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetTriangleSubdivision()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -380,15 +380,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get triangle subdivision weights rule (Catmark scheme only !)

│ │ │ │ │ │ │ │ -

Definition at line 107 of file options.h.

│ │ │ │ +

Definition at line 107 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetVtxBoundaryInterpolation()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -409,15 +409,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Get vertex boundary interpolation rule.

│ │ │ │ │ │ │ │ -

Definition at line 89 of file options.h.

│ │ │ │ +

Definition at line 89 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetCreasingMethod()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -439,15 +439,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set edge crease rule.

│ │ │ │ │ │ │ │ -

Definition at line 104 of file options.h.

│ │ │ │ +

Definition at line 104 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetFVarLinearInterpolation()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -469,15 +469,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set face-varying interpolation rule.

│ │ │ │ │ │ │ │ -

Definition at line 98 of file options.h.

│ │ │ │ +

Definition at line 98 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetTriangleSubdivision()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -499,15 +499,15 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set triangle subdivision weights rule (Catmark scheme only !)

│ │ │ │ │ │ │ │ -

Definition at line 110 of file options.h.

│ │ │ │ +

Definition at line 110 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetVtxBoundaryInterpolation()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -529,20 +529,20 @@ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Set vertex boundary interpolation rule.

│ │ │ │ │ │ │ │ -

Definition at line 92 of file options.h.

│ │ │ │ +

Definition at line 92 of file options.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/sdc/options.h
  • │ │ │ │ +
  • opensubdiv/sdc/options.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
│ │ │ │ │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <scheme.h>

│ │ │ │ +

#include <scheme.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  LocalMask
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -266,15 +266,15 @@ │ │ │ │
template<SchemeType SCHEME_TYPE>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme< SCHEME_TYPE >

Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
│ │ │ │

│ │ │ │

The primary purpose of Scheme is to provide the mask weights for vertices generated by subdivision. Methods to determine the masks are given topological neighborhoods from which to compute the appropriate weights for neighboring components. While these neighborhoods may require sharpness values for creasing, the computation of subdivided crease values is independent of the scheme type and is also made available through the Crease class.

│ │ │ │

Mask queries are assisted by two utility classes – a Neighborhood class defining the set of relevant data in the topological neighborhood of the vertex being subdivided, and a Mask class into which the associated mask weights will be stored. Depending on where and how these queries are used, more or less information may be available. See the details of the Neighborhood classes as appropriate initialization of them is critical. It is generally best to initialize them with what data is known and accessible for immediate and efficient retrieval, but subclasses can be created to gather it lazily if desired.
│ │ │ │

│ │ │ │ │ │ │ │ -

Definition at line 66 of file scheme.h.

│ │ │ │ +

Definition at line 66 of file scheme.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Scheme() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -291,15 +291,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file scheme.h.

│ │ │ │ +

Definition at line 70 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ Scheme() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -319,15 +319,15 @@ │ │ │ │
│ │ │ │ inline
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 72 of file scheme.h.

│ │ │ │ +

Definition at line 72 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ assignCornerLimitMask() [1/4]

│ │ │ │ │ │ │ │ @@ -358,15 +358,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 84 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 84 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerLimitMask() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -396,15 +396,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 208 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 208 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerLimitMask() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -434,15 +434,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 223 of file loopScheme.h.

│ │ │ │ +

Definition at line 223 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerLimitMask() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -514,15 +514,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 118 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 118 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerLimitTangentMasks() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -600,15 +600,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 301 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 301 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerLimitTangentMasks() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -644,15 +644,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 386 of file loopScheme.h.

│ │ │ │ +

Definition at line 386 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerMaskForVertex() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -682,15 +682,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 142 of file loopScheme.h.

│ │ │ │ +

Definition at line 142 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCornerMaskForVertex() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -720,15 +720,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 331 of file scheme.h.

│ │ │ │ +

Definition at line 331 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitMask() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -806,15 +806,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 221 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 221 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitMask() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -850,15 +850,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 236 of file loopScheme.h.

│ │ │ │ +

Definition at line 236 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitMask() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -894,15 +894,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 97 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 97 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitTangentMasks() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -992,15 +992,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 334 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 334 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitTangentMasks() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1042,15 +1042,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 420 of file loopScheme.h.

│ │ │ │ +

Definition at line 420 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseLimitTangentMasks() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1092,15 +1092,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 143 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 143 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseMaskForEdge() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1130,15 +1130,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file loopScheme.h.

│ │ │ │ +

Definition at line 70 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseMaskForEdge() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1168,15 +1168,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 317 of file scheme.h.

│ │ │ │ +

Definition at line 317 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseMaskForVertex() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1254,15 +1254,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 148 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 148 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignCreaseMaskForVertex() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1298,15 +1298,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 155 of file loopScheme.h.

│ │ │ │ +

Definition at line 155 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitMask() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1372,15 +1372,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 106 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 106 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitMask() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1410,15 +1410,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 247 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 247 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitMask() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1448,15 +1448,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 273 of file loopScheme.h.

│ │ │ │ +

Definition at line 273 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitTangentMasks() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1534,15 +1534,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 152 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 152 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitTangentMasks() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1578,15 +1578,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 453 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 453 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothLimitTangentMasks() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1622,15 +1622,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 532 of file loopScheme.h.

│ │ │ │ +

Definition at line 532 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothMaskForEdge() [1/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1660,15 +1660,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 71 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothMaskForEdge() [2/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1698,15 +1698,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 84 of file loopScheme.h.

│ │ │ │ +

Definition at line 84 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothMaskForEdge() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1808,15 +1808,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 173 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 173 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ assignSmoothMaskForVertex() [3/3]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1846,15 +1846,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inlineprotected │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 180 of file loopScheme.h.

│ │ │ │ +

Definition at line 180 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeEdgeVertexMask() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1888,15 +1888,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ const │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 62 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 62 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeEdgeVertexMask() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1933,15 +1933,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accelerate the computation (though the Rule for the parent is trivially determined). In particular, knowing the child rule can avoid the need to subdivide the sharpness of the edge to see if it is a transitional crease that warrants fractional blending.

│ │ │ │

Whether to use the "Rules" in this interface is really debatable – the parent Rule is really based on the edge and its sharpness, while the child Rule is technically based on the neighborhood of the child vertex, but it can be deduced from the two child edges' sharpness. So the Crease methods used to compute these rules differ from those for the vertex-vertex mask. Perhaps a simple pair of new methods for Crease should be added specific to the edge-vertex case, i.e. one that takes a single sharpness (for the parent rule) and one that takes a pair (for the child).

│ │ │ │ │ │ │ │ -

Definition at line 392 of file scheme.h.

│ │ │ │ +

Definition at line 392 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeFaceVertexMask()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -1965,15 +1965,15 @@ │ │ │ │ const │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Face-vertex masks - trivial for all current schemes.

│ │ │ │ │ │ │ │ -

Definition at line 348 of file scheme.h.

│ │ │ │ +

Definition at line 348 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeVertexLimitMask() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2005,15 +2005,15 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Limit masks for vertices – position and tangents These presume that a vertex is suitably isolated for its limit to be well-defined and, unlike the refinement masks, the subdivision Rule for the vertex (presumably at its last level of refinement) is required rather than being optional. In the presence of semi-sharp creasing that has not decayed to zero, the limit is neither sharp nor smooth – in such cases the Rule specified by the caller determines the result.

│ │ │ │

For tangent masks, the direction of the first tangent (T1) is oriented towards the leading edge of the vertex, i.e. the first incident edge of the vertex (beginning the set of incident edges in counter-clockwise order). The second tangent (T2) lies within the tangent plane such that its normal can be computed as T1 x T2. So for a boundary vertex, T1 will point along the boundary in the direction of the leading edge while T2 points inward across the limit surface.

│ │ │ │

As for magnitude, no assumptions should be made of the magnitudes of the resulting tangent vectors. Common formulae often factor out scale factors that contribute to magnitude. While some attempt has been made to make magnitudes more consistent between regular corners, boundaries and the interior, the same has not been done at irregular vertices – at least not yet. This may be addressed in future, as having consistent magnitudes returned here can aid in the construction of patches from limit positions and tangents.

│ │ │ │ │ │ │ │ -

Definition at line 607 of file scheme.h.

│ │ │ │ +

Definition at line 607 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeVertexLimitMask() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2053,15 +2053,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ const │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 629 of file scheme.h.

│ │ │ │ +

Definition at line 629 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeVertexVertexMask() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2095,15 +2095,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ const │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 71 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ComputeVertexVertexMask() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2139,15 +2139,15 @@ │ │ │ │ const │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease transition) to accelerate the computation. Either no Rules, the first, or both should be specified. Specification of only the first Rule implies it to be true for both (wish the compiler would allow such default value specification), i.e. no transition. The case of knowing the parent Rule but deferring determination of the child Rule to this method is not supported.

│ │ │ │ │ │ │ │ -

Definition at line 512 of file scheme.h.

│ │ │ │ +

Definition at line 512 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalNeighborhoodSize() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2166,15 +2166,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 53 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 53 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalNeighborhoodSize() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2193,15 +2193,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 56 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 56 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalNeighborhoodSize() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2220,15 +2220,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 57 of file loopScheme.h.

│ │ │ │ +

Definition at line 57 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetLocalNeighborhoodSize() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2272,15 +2272,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 74 of file scheme.h.

│ │ │ │ +

Definition at line 74 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularFaceSize() [1/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2299,15 +2299,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 47 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularFaceSize() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2326,15 +2326,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 50 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 50 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularFaceSize() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2353,15 +2353,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 51 of file loopScheme.h.

│ │ │ │ +

Definition at line 51 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularFaceSize() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2405,15 +2405,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 50 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 50 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularVertexValence() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2432,15 +2432,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 53 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 53 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularVertexValence() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2459,15 +2459,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file loopScheme.h.

│ │ │ │ +

Definition at line 54 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetRegularVertexValence() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2511,15 +2511,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 44 of file bilinearScheme.h.

│ │ │ │ +

Definition at line 44 of file bilinearScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetTopologicalSplitType() [2/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2538,15 +2538,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file catmarkScheme.h.

│ │ │ │ +

Definition at line 47 of file catmarkScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetTopologicalSplitType() [3/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2565,15 +2565,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 48 of file loopScheme.h.

│ │ │ │ +

Definition at line 48 of file loopScheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetTopologicalSplitType() [4/4]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -2618,20 +2618,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 75 of file scheme.h.

│ │ │ │ +

Definition at line 75 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/sdc/scheme.h
  • │ │ │ │ +
  • opensubdiv/sdc/scheme.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Scheme< SCHEME_TYPE >::LocalMask< WEIGHT > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <scheme.h>

│ │ │ │ +

#include <scheme.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef WEIGHT Weight
 
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ @@ -137,29 +137,29 @@ │ │ │ │

void CombineVertexVertexMasks (Weight thisCoeff, Weight dstCoeff, USER_MASK &dst) const
 
│ │ │ │

Detailed Description

│ │ │ │
template<SchemeType SCHEME_TYPE>
│ │ │ │ template<typename WEIGHT>
│ │ │ │ class OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme< SCHEME_TYPE >::LocalMask< WEIGHT >
│ │ │ │ -

Definition at line 209 of file scheme.h.

│ │ │ │ +

Definition at line 209 of file scheme.h.

│ │ │ │

Member Typedef Documentation

│ │ │ │ │ │ │ │

◆ Weight

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
typedef WEIGHT Weight
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 212 of file scheme.h.

│ │ │ │ +

Definition at line 212 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ LocalMask()

│ │ │ │ │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 215 of file scheme.h.

│ │ │ │ +

Definition at line 215 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ ~LocalMask()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -223,15 +223,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 216 of file scheme.h.

│ │ │ │ +

Definition at line 216 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ AreFaceWeightsForFaceCenters()

│ │ │ │ │ │ │ │ @@ -251,15 +251,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 239 of file scheme.h.

│ │ │ │ +

Definition at line 239 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ CombineVertexVertexMasks()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -295,15 +295,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 249 of file scheme.h.

│ │ │ │ +

Definition at line 249 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EdgeWeight() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -323,15 +323,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 236 of file scheme.h.

│ │ │ │ +

Definition at line 236 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ EdgeWeight() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 232 of file scheme.h.

│ │ │ │ +

Definition at line 232 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ FaceWeight() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -379,15 +379,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 237 of file scheme.h.

│ │ │ │ +

Definition at line 237 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ FaceWeight() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -407,15 +407,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 233 of file scheme.h.

│ │ │ │ +

Definition at line 233 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumEdgeWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -434,15 +434,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 224 of file scheme.h.

│ │ │ │ +

Definition at line 224 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumFaceWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 225 of file scheme.h.

│ │ │ │ +

Definition at line 225 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ GetNumVertexWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -488,15 +488,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 223 of file scheme.h.

│ │ │ │ +

Definition at line 223 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetFaceWeightsForFaceCenters()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -516,15 +516,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 240 of file scheme.h.

│ │ │ │ +

Definition at line 240 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetNumEdgeWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -544,15 +544,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 228 of file scheme.h.

│ │ │ │ +

Definition at line 228 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetNumFaceWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -572,15 +572,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 229 of file scheme.h.

│ │ │ │ +

Definition at line 229 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ SetNumVertexWeights()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -600,15 +600,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 227 of file scheme.h.

│ │ │ │ +

Definition at line 227 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VertexWeight() [1/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -628,15 +628,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 235 of file scheme.h.

│ │ │ │ +

Definition at line 235 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

◆ VertexWeight() [2/2]

│ │ │ │ │ │ │ │
│ │ │ │ @@ -656,20 +656,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ inline │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 231 of file scheme.h.

│ │ │ │ +

Definition at line 231 of file scheme.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • opensubdiv/sdc/scheme.h
  • │ │ │ │ +
  • opensubdiv/sdc/scheme.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
types.h File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include "../version.h"
│ │ │ │ -#include "../far/patchTable.h"
│ │ │ │ +#include "../far/patchTable.h"
│ │ │ │ #include <algorithm>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/a01481_source.html │ │ │ │ @@ -220,18 +220,18 @@ │ │ │ │
143#endif // OPENSUBDIV3_OSD_TYPES_H
│ │ │ │ │ │ │ │
std::vector< PatchParam > PatchParamVector
Definition: types.h:133
│ │ │ │
std::vector< PatchArray > PatchArrayVector
Definition: types.h:132
│ │ │ │ │ │ │ │
Type GetType() const
Returns the type of the patch.
│ │ │ │ │ │ │ │ -
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
Handle that can be used as unique patch identifier within PatchTable.
Definition: patchTable.h:60
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Coordinates set on a patch table.
Definition: types.h:42
│ │ │ │
Far::PatchTable::PatchHandle handle
patch handle
Definition: types.h:62
│ │ │ │ │ │ │ │ │ │ │ │
PatchCoord(Far::PatchTable::PatchHandle handleArg, float sArg, float tArg)
Constructor.
Definition: types.h:53
│ │ │ │
float t
parametric location on patch
Definition: types.h:63
│ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_2483050b711c1829a6434006d0beb10c.html │ │ │ │ @@ -86,91 +86,91 @@ │ │ │ │
│ │ │ │
osd Directory Reference
│ │ │ │
│ │ │ │
│ │ │ │

│ │ │ │ Classes

struct  PatchCoord
│ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Files

file  bufferDescriptor.h [code]
file  bufferDescriptor.h [code]
 
file  clEvaluator.h [code]
file  clEvaluator.h [code]
 
file  clPatchTable.h [code]
file  clPatchTable.h [code]
 
file  clVertexBuffer.h [code]
file  clVertexBuffer.h [code]
 
file  cpuD3D11VertexBuffer.h [code]
file  cpuD3D11VertexBuffer.h [code]
 
file  cpuEvaluator.h [code]
file  cpuEvaluator.h [code]
 
file  cpuGLVertexBuffer.h [code]
file  cpuGLVertexBuffer.h [code]
 
file  cpuPatchTable.h [code]
file  cpuPatchTable.h [code]
 
file  cpuVertexBuffer.h [code]
file  cpuVertexBuffer.h [code]
 
file  cudaEvaluator.h [code]
file  cudaEvaluator.h [code]
 
file  cudaPatchTable.h [code]
file  cudaPatchTable.h [code]
 
file  cudaVertexBuffer.h [code]
file  cudaVertexBuffer.h [code]
 
file  d3d11ComputeEvaluator.h [code]
file  d3d11ComputeEvaluator.h [code]
 
file  d3d11LegacyGregoryPatchTable.h [code]
file  d3d11LegacyGregoryPatchTable.h [code]
 
file  d3d11Mesh.h [code]
file  d3d11Mesh.h [code]
 
file  d3d11PatchTable.h [code]
file  d3d11PatchTable.h [code]
 
file  d3d11VertexBuffer.h [code]
file  d3d11VertexBuffer.h [code]
 
file  glComputeEvaluator.h [code]
file  glComputeEvaluator.h [code]
 
file  glLegacyGregoryPatchTable.h [code]
file  glLegacyGregoryPatchTable.h [code]
 
file  glMesh.h [code]
file  glMesh.h [code]
 
file  glPatchTable.h [code]
file  glPatchTable.h [code]
 
file  glslPatchShaderSource.h [code]
file  glslPatchShaderSource.h [code]
 
file  glVertexBuffer.h [code]
file  glVertexBuffer.h [code]
 
file  glXFBEvaluator.h [code]
file  glXFBEvaluator.h [code]
 
file  hlslPatchShaderSource.h [code]
file  hlslPatchShaderSource.h [code]
 
file  mesh.h [code]
file  mesh.h [code]
 
file  mtlCommon.h [code]
file  mtlCommon.h [code]
 
file  mtlComputeEvaluator.h [code]
file  mtlComputeEvaluator.h [code]
 
file  mtlLegacyGregoryPatchTable.h [code]
file  mtlLegacyGregoryPatchTable.h [code]
 
file  mtlMesh.h [code]
file  mtlMesh.h [code]
 
file  mtlPatchShaderSource.h [code]
file  mtlPatchShaderSource.h [code]
 
file  mtlPatchTable.h [code]
file  mtlPatchTable.h [code]
 
file  mtlVertexBuffer.h [code]
file  mtlVertexBuffer.h [code]
 
file  ompEvaluator.h [code]
file  ompEvaluator.h [code]
 
file  ompKernel.h [code]
file  ompKernel.h [code]
 
file  opencl.h [code]
file  opencl.h [code]
 
file  opengl.h [code]
file  opengl.h [code]
 
file  tbbEvaluator.h [code]
file  tbbEvaluator.h [code]
 
file  tbbKernel.h [code]
file  tbbKernel.h [code]
 
file  types.h [code]
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_2483050b711c1829a6434006d0beb10c.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,42 +1,42 @@ │ │ │ │ │ var dir_2483050b711c1829a6434006d0beb10c = [ │ │ │ │ │ - ["bufferDescriptor.h", "a00899.html", "a00899"], │ │ │ │ │ - ["clEvaluator.h", "a00803.html", "a00803"], │ │ │ │ │ - ["clPatchTable.h", "a00800.html", "a00800"], │ │ │ │ │ - ["clVertexBuffer.h", "a00797.html", "a00797"], │ │ │ │ │ - ["cpuD3D11VertexBuffer.h", "a00845.html", "a00845"], │ │ │ │ │ - ["cpuEvaluator.h", "a00896.html", "a00896"], │ │ │ │ │ - ["cpuGLVertexBuffer.h", "a00869.html", "a00869"], │ │ │ │ │ - ["cpuPatchTable.h", "a00893.html", "a00893"], │ │ │ │ │ - ["cpuVertexBuffer.h", "a00890.html", "a00890"], │ │ │ │ │ - ["cudaEvaluator.h", "a00791.html", "a00791"], │ │ │ │ │ - ["cudaPatchTable.h", "a00788.html", "a00788"], │ │ │ │ │ - ["cudaVertexBuffer.h", "a00902.html", "a00902"], │ │ │ │ │ - ["d3d11ComputeEvaluator.h", "a00842.html", "a00842"], │ │ │ │ │ - ["d3d11LegacyGregoryPatchTable.h", "a00839.html", "a00839"], │ │ │ │ │ - ["d3d11Mesh.h", "a00827.html", "a00827"], │ │ │ │ │ - ["d3d11PatchTable.h", "a00836.html", "a00836"], │ │ │ │ │ - ["d3d11VertexBuffer.h", "a00833.html", "a00833"], │ │ │ │ │ - ["glComputeEvaluator.h", "a00848.html", "a00848"], │ │ │ │ │ - ["glLegacyGregoryPatchTable.h", "a00863.html", "a00863"], │ │ │ │ │ - ["glMesh.h", "a00857.html", "a00857"], │ │ │ │ │ - ["glPatchTable.h", "a00866.html", "a00866"], │ │ │ │ │ - ["glslPatchShaderSource.h", "a00854.html", "a00854"], │ │ │ │ │ - ["glVertexBuffer.h", "a00860.html", "a00860"], │ │ │ │ │ - ["glXFBEvaluator.h", "a00851.html", "a00851"], │ │ │ │ │ - ["hlslPatchShaderSource.h", "a00830.html", "a00830"], │ │ │ │ │ - ["mesh.h", "a00887.html", "a00887"], │ │ │ │ │ - ["mtlCommon.h", "a00806.html", "a00806"], │ │ │ │ │ - ["mtlComputeEvaluator.h", "a00821.html", "a00821"], │ │ │ │ │ - ["mtlLegacyGregoryPatchTable.h", "a00818.html", "a00818"], │ │ │ │ │ - ["mtlMesh.h", "a00809.html", "a00809"], │ │ │ │ │ - ["mtlPatchShaderSource.h", "a00812.html", "a00812"], │ │ │ │ │ - ["mtlPatchTable.h", "a00815.html", "a00815"], │ │ │ │ │ - ["mtlVertexBuffer.h", "a00824.html", "a00824"], │ │ │ │ │ - ["ompEvaluator.h", "a00881.html", "a00881"], │ │ │ │ │ - ["ompKernel.h", "a00878.html", "a00878"], │ │ │ │ │ - ["opencl.h", "a00794.html", null], │ │ │ │ │ - ["opengl.h", "a00884.html", null], │ │ │ │ │ - ["tbbEvaluator.h", "a00875.html", "a00875"], │ │ │ │ │ - ["tbbKernel.h", "a00872.html", "a00872"], │ │ │ │ │ + ["bufferDescriptor.h", "a00881.html", "a00881"], │ │ │ │ │ + ["clEvaluator.h", "a00785.html", "a00785"], │ │ │ │ │ + ["clPatchTable.h", "a00782.html", "a00782"], │ │ │ │ │ + ["clVertexBuffer.h", "a00779.html", "a00779"], │ │ │ │ │ + ["cpuD3D11VertexBuffer.h", "a00824.html", "a00824"], │ │ │ │ │ + ["cpuEvaluator.h", "a00878.html", "a00878"], │ │ │ │ │ + ["cpuGLVertexBuffer.h", "a00851.html", "a00851"], │ │ │ │ │ + ["cpuPatchTable.h", "a00872.html", "a00872"], │ │ │ │ │ + ["cpuVertexBuffer.h", "a00875.html", "a00875"], │ │ │ │ │ + ["cudaEvaluator.h", "a00773.html", "a00773"], │ │ │ │ │ + ["cudaPatchTable.h", "a00770.html", "a00770"], │ │ │ │ │ + ["cudaVertexBuffer.h", "a00884.html", "a00884"], │ │ │ │ │ + ["d3d11ComputeEvaluator.h", "a00827.html", "a00827"], │ │ │ │ │ + ["d3d11LegacyGregoryPatchTable.h", "a00821.html", "a00821"], │ │ │ │ │ + ["d3d11Mesh.h", "a00812.html", "a00812"], │ │ │ │ │ + ["d3d11PatchTable.h", "a00818.html", "a00818"], │ │ │ │ │ + ["d3d11VertexBuffer.h", "a00815.html", "a00815"], │ │ │ │ │ + ["glComputeEvaluator.h", "a00833.html", "a00833"], │ │ │ │ │ + ["glLegacyGregoryPatchTable.h", "a00848.html", "a00848"], │ │ │ │ │ + ["glMesh.h", "a00839.html", "a00839"], │ │ │ │ │ + ["glPatchTable.h", "a00842.html", "a00842"], │ │ │ │ │ + ["glslPatchShaderSource.h", "a00836.html", "a00836"], │ │ │ │ │ + ["glVertexBuffer.h", "a00845.html", "a00845"], │ │ │ │ │ + ["glXFBEvaluator.h", "a00830.html", "a00830"], │ │ │ │ │ + ["hlslPatchShaderSource.h", "a00809.html", "a00809"], │ │ │ │ │ + ["mesh.h", "a00869.html", "a00869"], │ │ │ │ │ + ["mtlCommon.h", "a00788.html", "a00788"], │ │ │ │ │ + ["mtlComputeEvaluator.h", "a00803.html", "a00803"], │ │ │ │ │ + ["mtlLegacyGregoryPatchTable.h", "a00800.html", "a00800"], │ │ │ │ │ + ["mtlMesh.h", "a00794.html", "a00794"], │ │ │ │ │ + ["mtlPatchShaderSource.h", "a00791.html", "a00791"], │ │ │ │ │ + ["mtlPatchTable.h", "a00797.html", "a00797"], │ │ │ │ │ + ["mtlVertexBuffer.h", "a00806.html", "a00806"], │ │ │ │ │ + ["ompEvaluator.h", "a00863.html", "a00863"], │ │ │ │ │ + ["ompKernel.h", "a00860.html", "a00860"], │ │ │ │ │ + ["opencl.h", "a00776.html", null], │ │ │ │ │ + ["opengl.h", "a00866.html", null], │ │ │ │ │ + ["tbbEvaluator.h", "a00857.html", "a00857"], │ │ │ │ │ + ["tbbKernel.h", "a00854.html", "a00854"], │ │ │ │ │ ["types.h", "a01481.html", "a01481"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_7f420b72a822828cfa8b0561c695a5cc.html │ │ │ │ @@ -90,19 +90,19 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -110,17 +110,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Files

file  error.h [code]
 
file  patchDescriptor.h [code]
 
file  patchMap.h [code]
file  patchMap.h [code]
 
file  patchParam.h [code]
 
file  patchTable.h [code]
file  patchTable.h [code]
 
file  patchTableFactory.h [code]
 
file  primvarRefiner.h [code]
 
file  ptexIndices.h [code]
 
 
file  stencilTableFactory.h [code]
 
file  topologyDescriptor.h [code]
 
file  topologyLevel.h [code]
 
file  topologyRefiner.h [code]
file  topologyRefiner.h [code]
 
file  topologyRefinerFactory.h [code]
file  topologyRefinerFactory.h [code]
 
file  types.h [code]
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_7f420b72a822828cfa8b0561c695a5cc.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,17 +1,17 @@ │ │ │ │ │ var dir_7f420b72a822828cfa8b0561c695a5cc = [ │ │ │ │ │ ["error.h", "a00743.html", "a00743"], │ │ │ │ │ ["patchDescriptor.h", "a00740.html", "a00740"], │ │ │ │ │ - ["patchMap.h", "a00734.html", "a00734"], │ │ │ │ │ + ["patchMap.h", "a00731.html", "a00731"], │ │ │ │ │ ["patchParam.h", "a00737.html", "a00737"], │ │ │ │ │ - ["patchTable.h", "a00731.html", "a00731"], │ │ │ │ │ + ["patchTable.h", "a00734.html", "a00734"], │ │ │ │ │ ["patchTableFactory.h", "a00728.html", "a00728"], │ │ │ │ │ ["primvarRefiner.h", "a00725.html", "a00725"], │ │ │ │ │ ["ptexIndices.h", "a00722.html", "a00722"], │ │ │ │ │ ["stencilTable.h", "a00719.html", "a00719"], │ │ │ │ │ ["stencilTableFactory.h", "a00716.html", "a00716"], │ │ │ │ │ ["topologyDescriptor.h", "a00713.html", "a00713"], │ │ │ │ │ ["topologyLevel.h", "a00710.html", "a00710"], │ │ │ │ │ - ["topologyRefiner.h", "a00704.html", "a00704"], │ │ │ │ │ - ["topologyRefinerFactory.h", "a00707.html", "a00707"], │ │ │ │ │ + ["topologyRefiner.h", "a00707.html", "a00707"], │ │ │ │ │ + ["topologyRefinerFactory.h", "a00704.html", "a00704"], │ │ │ │ │ ["types.h", "a01478.html", "a01478"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_bd5473d7d5841d48919aaa9ad0cb1f9b.html │ │ │ │ @@ -98,17 +98,17 @@ │ │ │ │   │ │ │ │ file  fvarRefinement.h [code] │ │ │ │   │ │ │ │ file  level.h [code] │ │ │ │   │ │ │ │ file  refinement.h [code] │ │ │ │   │ │ │ │ -file  sparseSelector.h [code] │ │ │ │ +file  sparseSelector.h [code] │ │ │ │   │ │ │ │ -file  stackBuffer.h [code] │ │ │ │ +file  stackBuffer.h [code] │ │ │ │   │ │ │ │ file  types.h [code] │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_bd5473d7d5841d48919aaa9ad0cb1f9b.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ var dir_bd5473d7d5841d48919aaa9ad0cb1f9b = [ │ │ │ │ │ ["array.h", "a00767.html", "a00767"], │ │ │ │ │ ["componentInterfaces.h", "a00764.html", null], │ │ │ │ │ ["fvarLevel.h", "a00761.html", null], │ │ │ │ │ ["fvarRefinement.h", "a00758.html", null], │ │ │ │ │ ["level.h", "a00755.html", null], │ │ │ │ │ ["refinement.h", "a00752.html", null], │ │ │ │ │ - ["sparseSelector.h", "a00746.html", null], │ │ │ │ │ - ["stackBuffer.h", "a00749.html", null], │ │ │ │ │ + ["sparseSelector.h", "a00749.html", null], │ │ │ │ │ + ["stackBuffer.h", "a00746.html", null], │ │ │ │ │ ["types.h", "a01487.html", "a01487"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_f61368944c63c2c1f8c69bc232e59c39.html │ │ │ │ @@ -86,25 +86,25 @@ │ │ │ │
│ │ │ │
sdc Directory Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Files

file  bilinearScheme.h [code]
file  bilinearScheme.h [code]
 
file  catmarkScheme.h [code]
file  catmarkScheme.h [code]
 
file  crease.h [code]
file  crease.h [code]
 
file  loopScheme.h [code]
file  loopScheme.h [code]
 
file  options.h [code]
file  options.h [code]
 
file  scheme.h [code]
file  scheme.h [code]
 
file  types.h [code]
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_f61368944c63c2c1f8c69bc232e59c39.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,9 +1,9 @@ │ │ │ │ │ var dir_f61368944c63c2c1f8c69bc232e59c39 = [ │ │ │ │ │ - ["bilinearScheme.h", "a00785.html", null], │ │ │ │ │ - ["catmarkScheme.h", "a00782.html", null], │ │ │ │ │ - ["crease.h", "a00776.html", "a00776"], │ │ │ │ │ - ["loopScheme.h", "a00779.html", null], │ │ │ │ │ - ["options.h", "a00770.html", "a00770"], │ │ │ │ │ - ["scheme.h", "a00773.html", "a00773"], │ │ │ │ │ + ["bilinearScheme.h", "a00899.html", null], │ │ │ │ │ + ["catmarkScheme.h", "a00902.html", null], │ │ │ │ │ + ["crease.h", "a00896.html", "a00896"], │ │ │ │ │ + ["loopScheme.h", "a00893.html", null], │ │ │ │ │ + ["options.h", "a00890.html", "a00890"], │ │ │ │ │ + ["scheme.h", "a00887.html", "a00887"], │ │ │ │ │ ["types.h", "a01484.html", "a01484"] │ │ │ │ │ ]; │ │ │ ├── ./usr/share/doc/opensubdiv/doxy_html/dir_fa5edef2a780a73fbfb6a11f1af88ceb.html │ │ │ │ @@ -96,21 +96,21 @@ │ │ │ │   │ │ │ │ file  refinerSurfaceFactory.h [code] │ │ │ │   │ │ │ │ file  surface.h [code] │ │ │ │   │ │ │ │ file  surfaceFactory.h [code] │ │ │ │   │ │ │ │ -file  surfaceFactoryCache.h [code] │ │ │ │ +file  surfaceFactoryCache.h [code] │ │ │ │   │ │ │ │ file  surfaceFactoryMeshAdapter.h [code] │ │ │ │   │ │ │ │ -file  tessellation.h [code] │ │ │ │ +file  tessellation.h [code] │ │ │ │   │ │ │ │ -file  vertexDescriptor.h [code] │ │ │ │ +file  vertexDescriptor.h [code] │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -124,14 +124,14 @@ │ │ │ │ │ esc : hide GUI │ │ │ │ │ f : fit frame │ │ │ │ │ +/- : increase / decrese tessellation rate │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/dxviewer.html │ │ │ │ @@ -220,15 +220,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -85,14 +85,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_overview.html │ │ │ │ @@ -780,15 +780,15 @@ │ │ │ │ controlStencils.UpdateDerivs<StencilType>( &controlPoints[0], &utan[0], &vtan[0] ); │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -475,14 +475,14 @@ │ │ │ │ │ // Update points by applying stencils │ │ │ │ │ controlStencils.UpdateValues( &controlPoints[0], &points[0] ); │ │ │ │ │ │ │ │ │ │ // Update tangents by applying derivative stencils │ │ │ │ │ controlStencils.UpdateDerivs( &controlPoints[0], &utan[0], &vtan │ │ │ │ │ [0] ); │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_1_1.html │ │ │ │ @@ -356,15 +356,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -243,14 +243,14 @@ │ │ │ │ │ delete refiner; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_1_2.html │ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │ delete refiner; │ │ │ │ return EXIT_SUCCESS; │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -345,14 +345,14 @@ │ │ │ │ │ printf("\n"); │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ delete refiner; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_2_1.html │ │ │ │ @@ -411,15 +411,15 @@ │ │ │ │ return refiner; │ │ │ │ } │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -302,14 +302,14 @@ │ │ │ │ │ Far::TopologyRefinerFactory::Options(type, options)); │ │ │ │ │ │ │ │ │ │ return refiner; │ │ │ │ │ } │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_2_2.html │ │ │ │ @@ -528,15 +528,15 @@ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ } │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -425,14 +425,14 @@ │ │ │ │ │ │ │ │ │ │ delete refiner; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_2_3.html │ │ │ │ @@ -696,15 +696,15 @@ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ } │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -613,14 +613,14 @@ │ │ │ │ │ │ │ │ │ │ delete refiner; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_3_1.html │ │ │ │ @@ -662,15 +662,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -562,14 +562,14 @@ │ │ │ │ │ delete refiner; │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_4_1.html │ │ │ │ @@ -351,15 +351,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -237,14 +237,14 @@ │ │ │ │ │ options)); │ │ │ │ │ │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_4_2.html │ │ │ │ @@ -405,15 +405,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -295,14 +295,14 @@ │ │ │ │ │ │ │ │ │ │ return refiner; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_4_3.html │ │ │ │ @@ -405,15 +405,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -293,14 +293,14 @@ │ │ │ │ │ Far::TopologyRefinerFactory::Options(type, options)); │ │ │ │ │ │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_5_1.html │ │ │ │ @@ -504,15 +504,15 @@ │ │ │ │ │ │ │ │ return refiner; │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -395,14 +395,14 @@ │ │ │ │ │ Far::TopologyRefiner * refiner = │ │ │ │ │ Far::TopologyRefinerFactory::Create(desc, │ │ │ │ │ Far::TopologyRefinerFactory::Options(type, options)); │ │ │ │ │ │ │ │ │ │ return refiner; │ │ │ │ │ } │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_5_2.html │ │ │ │ @@ -826,15 +826,15 @@ │ │ │ │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -706,14 +706,14 @@ │ │ │ │ │ } │ │ │ │ │ } │ │ │ │ │ delete baseRefinerPtr; │ │ │ │ │ │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/far_tutorial_5_3.html │ │ │ │ @@ -745,15 +745,15 @@ │ │ │ │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -629,14 +629,14 @@ │ │ │ │ │ delete refinerPtr; │ │ │ │ │ delete patchTablePtr; │ │ │ │ │ delete limitStencilTablePtr; │ │ │ │ │ │ │ │ │ │ return EXIT_SUCCESS; │ │ │ │ │ } │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/getting_started.html │ │ │ │ @@ -321,15 +321,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -144,14 +144,14 @@ │ │ │ │ │ |./documentation/|The reStructuredText source files along with python scripts| │ │ │ │ │ |________________|that_generate_the_HTML_documentation_site._________________| │ │ │ │ │ | |Standalone regression tests and baseline data to help | │ │ │ │ │ |./regression/ |maintain the integrity of our APIs. If GPU SDKs are | │ │ │ │ │ | |detected, some tests will attempt to run computations on | │ │ │ │ │ |________________|those_GPUs.________________________________________________| │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glevallimit.html │ │ │ │ @@ -237,15 +237,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -102,14 +102,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glfvarviewer.html │ │ │ │ @@ -227,15 +227,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -89,14 +89,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glpainttest.html │ │ │ │ @@ -229,15 +229,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -88,14 +88,14 @@ │ │ │ │ │ **** KEYBOARD CONTROLS **** │ │ │ │ │ c : use texture as color │ │ │ │ │ d : use texture as displacement │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glptexviewer.html │ │ │ │ @@ -266,15 +266,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -124,14 +124,14 @@ │ │ │ │ │ +/- : increase / decrease tessellation rate │ │ │ │ │ r : reload and re-compile the shader files │ │ │ │ │ e : draw normals │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glsharetopology.html │ │ │ │ @@ -218,15 +218,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -84,14 +84,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glstencilviewer.html │ │ │ │ @@ -220,15 +220,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -85,14 +85,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/glviewer.html │ │ │ │ @@ -220,15 +220,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -85,14 +85,14 @@ │ │ │ │ │ **** OPTIONS **** │ │ │ │ │ See the description of the common_comand_line_options for the subset of common │ │ │ │ │ options supported here. │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/hbr_overview.html │ │ │ │ @@ -289,15 +289,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -127,14 +127,14 @@ │ │ │ │ │ o the BoundaryNone rule skips all boundary vertices │ │ │ │ │ (results are ''undefined'') │ │ │ │ │ o the AlwaysSharp rule does not apply │ │ │ │ │ * face-varying boundaries: │ │ │ │ │ o the BoundaryNone rule selects bilinear face-varying │ │ │ │ │ interpolation │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/hbr_tutorial_0.html │ │ │ │ @@ -328,15 +328,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -212,14 +212,14 @@ │ │ │ │ │ delete hmesh; │ │ │ │ │ delete catmark; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/hbr_tutorial_1.html │ │ │ │ @@ -363,15 +363,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -252,14 +252,14 @@ │ │ │ │ │ delete hmesh; │ │ │ │ │ delete catmark; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/hbr_tutorial_2.html │ │ │ │ @@ -430,15 +430,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -321,14 +321,14 @@ │ │ │ │ │ return hmesh; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/hedits.html │ │ │ │ @@ -303,15 +303,15 @@ │ │ │ │ │ │ │ │ images/hedit_example5.png │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -161,14 +161,14 @@ │ │ │ │ │ * The "hole" operation introduces holes (missing faces) into the │ │ │ │ │ subdivision mesh at any level in the subdivision hierarchy. The │ │ │ │ │ faces will be deleted, and none of their children will appear │ │ │ │ │ (you cannot "unhole" a face if any ancestor is a "hole"). This │ │ │ │ │ operation takes no float or string arguments. │ │ │ │ │ [images/hedit_example5.png] │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/intro.html │ │ │ │ @@ -312,15 +312,15 @@ │ │ │ │
Pixar Research:
│ │ │ │
Pixar R&D Portal
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -168,14 +168,14 @@ │ │ │ │ │ **** Contributing **** │ │ │ │ │ For details on how to contribute to OpenSubdiv, see the page on Contributing │ │ │ │ │ =============================================================================== │ │ │ │ │ **** External Resources **** │ │ │ │ │ Pixar Research: │ │ │ │ │ Pixar_R&D_Portal │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/license.html │ │ │ │ @@ -222,15 +222,15 @@ │ │ │ │ KIND, either express or implied. See the Apache License for the specific │ │ │ │ language governing permissions and limitations under the Apache License. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -98,14 +98,14 @@ │ │ │ │ │ │ │ │ │ │ Unless required by applicable law or agreed to in writing, software │ │ │ │ │ distributed under the Apache License with the above modification is │ │ │ │ │ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY │ │ │ │ │ KIND, either express or implied. See the Apache License for the specific │ │ │ │ │ language governing permissions and limitations under the Apache License. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/mod_notes.html │ │ │ │ @@ -331,15 +331,15 @@ │ │ │ │ the modeling techniques he uses when modeling props and architecture sets for │ │ │ │ feature films.

│ │ │ │ https://graphics.pixar.com/opensubdiv/videothumbnails/subdiv_modeling_pixar2013.png │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -172,14 +172,14 @@ │ │ │ │ │ =============================================================================== │ │ │ │ │ Ivo Kos, Modelling Technical Director at Pixar Animation Studios, shows some of │ │ │ │ │ the modeling techniques he uses when modeling props and architecture sets for │ │ │ │ │ feature films. │ │ │ │ │ [https://graphics.pixar.com/opensubdiv/videothumbnails/ │ │ │ │ │ subdiv_modeling_pixar2013.png] │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/mtlptexviewer.html │ │ │ │ @@ -223,15 +223,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -87,14 +87,14 @@ │ │ │ │ │ q : quit │ │ │ │ │ f : fit frame │ │ │ │ │ +/- : increase / decrease tessellation rate │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/mtlviewer.html │ │ │ │ @@ -245,15 +245,15 @@ │ │ │ │

SEE ALSO

│ │ │ │

Other examples : │ │ │ │ glViewer, glFVarViewer, glEvalLimit, glStencilViewer, glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -91,14 +91,14 @@ │ │ │ │ │ q : quit │ │ │ │ │ f : fit frame │ │ │ │ │ +/- : increase / decrease tessellation rate │ │ │ │ │ **** SEE ALSO **** │ │ │ │ │ Other examples : glViewer, glFVarViewer, glEvalLimit, glStencilViewer, │ │ │ │ │ glPtexViewer, glPaintTest, glShareTopology, dxViewer, dxPtexViewer, │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/osd_overview.html │ │ │ │ @@ -625,15 +625,15 @@ │ │ │ │ as the drawing API, Osd::CudaGLVertexBuffer fits the case since it implements │ │ │ │ BindCudaBuffer() and BindVBO(). Again, clients can implement their own buffer │ │ │ │ class and pass it to the Evaluators.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -229,14 +229,14 @@ │ │ │ │ │ The buffers can use these methods as a trigger of interop. Osd provides a │ │ │ │ │ default implementation of interop buffer for most of the backend combinations. │ │ │ │ │ For example, if the client wants to use CUDA as a computation backend and use │ │ │ │ │ OpenGL as the drawing API, Osd::CudaGLVertexBuffer fits the case since it │ │ │ │ │ implements BindCudaBuffer() and BindVBO(). Again, clients can implement their │ │ │ │ │ own buffer class and pass it to the Evaluators. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/osd_shader_interface.html │ │ │ │ @@ -461,15 +461,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -277,14 +277,14 @@ │ │ │ │ │ out vec4 tessOuterLo, out vec4 tessOuterHi); │ │ │ │ │ void OsdEvalPatchBezierTriangleTessLevels( │ │ │ │ │ vec3 cv[15], │ │ │ │ │ ivec3 patchParam, │ │ │ │ │ out vec4 tessLevelOuter, out vec2 tessLevelInner, │ │ │ │ │ out vec4 tessOuterLo, out vec4 tessOuterHi); │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/osd_tutorial_0.html │ │ │ │ @@ -331,15 +331,15 @@ │ │ │ │ } │ │ │ │ │ │ │ │ //------------------------------------------------------------------------------ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -215,14 +215,14 @@ │ │ │ │ │ │ │ │ │ │ return refiner; │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ //----------------------------------------------------------------------------- │ │ │ │ │ - │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:41 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/porting.html │ │ │ │ @@ -740,15 +740,15 @@ │ │ │ │ flag "CMAKE_INCDIR_BASE" when configuring cmake (i.e. │ │ │ │ -DCMAKE_INCDIR_BASE=include/opensubdiv3) and then including files from │ │ │ │ "opensubdiv3/..." in client code.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -391,14 +391,14 @@ │ │ │ │ │ build-time search paths. │ │ │ │ │ To support both OpenSubdiv 2.0 and 3.0 in your build environment, you can │ │ │ │ │ prefix the header install directory of OpenSubdiv 3.0. Do this using the build │ │ │ │ │ flag "CMAKE_INCDIR_BASE" when configuring cmake (i.e. - │ │ │ │ │ DCMAKE_INCDIR_BASE=include/opensubdiv3) and then including files from │ │ │ │ │ "opensubdiv3/..." in client code. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/references.html │ │ │ │ @@ -280,15 +280,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -156,14 +156,14 @@ │ │ │ │ │ http://doi.org/10.1145/166117.166121 │ │ │ │ │ │ │ │ │ │ Recursively generated B-spline surfaces on arbitrary topological │ │ │ │ │ meshes │ │ │ │ │ Catmull, E.; Clark, J. Computer-Aided Design 10 (6) (1978) │ │ │ │ │ http://doi.org/10.1016/0010-4485%2878%2990110-0 │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_30.html │ │ │ │ @@ -410,15 +410,15 @@ │ │ │ │ and rules. See Subdivision Compatibility for a │ │ │ │ complete list.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -252,14 +252,14 @@ │ │ │ │ │ Please see the Porting_Guide for help on how to port existing code written for │ │ │ │ │ OpenSubdiv 2.x to the new 3.0 release. │ │ │ │ │ =============================================================================== │ │ │ │ │ *** Subdivision Compatibility *** │ │ │ │ │ The 3.0 release has made some minor changes to the subdivision specification │ │ │ │ │ and rules. See Subdivision_Compatibility for a complete list. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_31.html │ │ │ │ @@ -555,15 +555,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -285,14 +285,14 @@ │ │ │ │ │ *** Bug Fixes *** │ │ │ │ │ * Fixed Ptex version parsing and compatibility issues │ │ │ │ │ * Fixed compatibility issues with VS2015 │ │ │ │ │ * Fixed bug interpolating face-varying data with Bilinear scheme │ │ │ │ │ * Fixed bug with refinement using Chaikin creasing │ │ │ │ │ * Fixed bugs with HUD sliders in the example viewers │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_32.html │ │ │ │ @@ -343,15 +343,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -139,14 +139,14 @@ │ │ │ │ │ * Corrected numerous spelling errors in doxygen comments │ │ │ │ │ * Updated glFVarViewer with improved error detection and command │ │ │ │ │ line parsing │ │ │ │ │ * Added option to build using MSVC with static CRT │ │ │ │ │ *** Bug Fixes *** │ │ │ │ │ * Fixed a double delete of GL program in Osd::GLComputeEvaluator │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_33.html │ │ │ │ @@ -369,15 +369,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -164,14 +164,14 @@ │ │ │ │ │ **** Other Changes **** │ │ │ │ │ *** Improvements *** │ │ │ │ │ * Fixed several instances of local variable shadowing that could │ │ │ │ │ cause build warnings │ │ │ │ │ * Updated continuous-integration build scripts and added testing │ │ │ │ │ on macOS │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_34.html │ │ │ │ @@ -492,15 +492,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -257,14 +257,14 @@ │ │ │ │ │ * Fixed Far::PrimvarRefiner internal limitFVar() prototype │ │ │ │ │ (GitHub #979) │ │ │ │ │ * Fixed Far::StencilTable append when base StencilTable empty │ │ │ │ │ (GitHub #982) │ │ │ │ │ * Patches around non-manifold vertices now free of cracks (GitHub │ │ │ │ │ #1013) │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_35.html │ │ │ │ @@ -375,15 +375,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -172,14 +172,14 @@ │ │ │ │ │ * Fixed GLSL shader source to remove storage qualifiers from │ │ │ │ │ struct members (GitHub #1271) │ │ │ │ │ * Fixed use of CMake variables for Apple builds (GitHub #1235) │ │ │ │ │ * Fixed build errors when using OpenGL without GLFW (GitHub │ │ │ │ │ #1257) │ │ │ │ │ * Fixed links to embedded videos (GitHub #1231) │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_notes.html │ │ │ │ @@ -720,15 +720,15 @@ │ │ │ │
│ │ │ │

Previous 2.x Release Notes

│ │ │ │

Previous releases

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -452,14 +452,14 @@ │ │ │ │ │ focus the API. │ │ │ │ │ * Interpolation of Vertex and Varying primvars in a single pass is no │ │ │ │ │ longer supported. │ │ │ │ │ * The Osd layer was largely refactored. │ │ │ │ │ **** Previous 2.x Release Notes **** │ │ │ │ │ Previous_releases │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/release_notes_2x.html │ │ │ │ @@ -888,15 +888,15 @@ │ │ │ │
│ │ │ │

Release 1.0.0

│ │ │ │

Oringal release:

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -567,14 +567,14 @@ │ │ │ │ │ **** Release 1.1.0 **** │ │ │ │ │ New Features │ │ │ │ │ * release initiated because of the switch to Git Flow │ │ │ │ │ =============================================================================== │ │ │ │ │ **** Release 1.0.0 **** │ │ │ │ │ Oringal release: │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/sdc_overview.html │ │ │ │ @@ -501,15 +501,15 @@ │ │ │ │ edge -- either the vertex opposite the edge for each triangle, or its center │ │ │ │ (which has no other use for Loop).

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -341,14 +341,14 @@ │ │ │ │ │ could be provided on the mask class, with an optional indication of the │ │ │ │ │ incident face topology for the irregular cases. The Loop scheme does not have │ │ │ │ │ "face weights", for a vertex-vertex mask, but for an edge-vertex mask it does │ │ │ │ │ require weights associated with the faces incident the edge -- either the │ │ │ │ │ vertex opposite the edge for each triangle, or its center (which has no other │ │ │ │ │ use for Loop). │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/subdivision_surfaces.html │ │ │ │ @@ -1225,15 +1225,15 @@ │ │ │ │ at either boundary, it is impossible to join the meshes seamlessly

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -783,14 +783,14 @@ │ │ │ │ │ Cylinder example : │ │ │ │ │ [images/smoothtriangles.png] │ │ │ │ │ This rule was empirically determined to make triangles subdivide more smoothly. │ │ │ │ │ However, this rule breaks the nice property that two separate meshes can be │ │ │ │ │ joined seamlessly by overlapping their boundaries; i.e. when there are │ │ │ │ │ triangles at either boundary, it is impossible to join the meshes seamlessly │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/tipuesearch/tipuesearch_content.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -1,343 +1,343 @@ │ │ │ │ │ var tipuesearch = { │ │ │ │ │ "pages": [{ │ │ │ │ │ "title": "osd_tutorial_0.cpp", │ │ │ │ │ - "text": "osd_tutorial_0.cpp osd_tutorial_0.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsosdtutorial_0osd_tutorial_0.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial demonstrates the manipulation of Osd Evaluator and BufferDescriptor. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTableFactory.h include opensubdivosdcpuEvaluator.h include opensubdivosdcpuVertexBuffer.h include cstdio include cstring ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner const createTopologyRefiner int maxlevel ------------------------------------------------------------------------------ int main int , char int maxlevel 2 , nCoarseVerts 0 , nRefinedVerts 0 Setup phase Far StencilTable const stencilTable NULL Setup FarStencilTable Far TopologyRefiner const refiner createTopologyRefiner maxlevel Setup a factory to create FarStencilTable for more details see Far tutorials Far StencilTableFactory Options options options . generateOffsets true options . generateIntermediateLevels false stencilTable Far StencilTableFactory Create refiner , options nCoarseVerts refiner - GetLevel 0 . GetNumVertices nRefinedVerts stencilTable - GetNumStencils We are done with Far cleanup table delete refiner Setup a buffer for vertex primvar data Osd CpuVertexBuffer vbuffer Osd CpuVertexBuffer Create 3 , nCoarseVerts nRefinedVerts Execution phase every frame Pack the control vertex data at the start of the vertex buffer and update every time control data changes vbuffer - UpdateData g_verts , 0 , nCoarseVerts Osd BufferDescriptor srcDesc 0 , 3 , 3 Osd BufferDescriptor dstDesc nCoarseVerts 3 , 3 , 3 Launch the computation Osd CpuEvaluator EvalStencils vbuffer , srcDesc , vbuffer , dstDesc , stencilTable Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle float const refinedVerts vbuffer - BindCpuBuffer 3 nCoarseVerts for int i 0 i nRefinedVerts i float const vert refinedVerts 3 i printf -p f f f n , vert 0 , vert 1 , vert 2 printf -c 1 n delete stencilTable delete vbuffer ------------------------------------------------------------------------------ static Far TopologyRefiner const createTopologyRefiner int maxlevel Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "osd_tutorial_0.cpp osd_tutorial_0.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsosdtutorial_0osd_tutorial_0.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial demonstrates the manipulation of Osd Evaluator and BufferDescriptor. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTableFactory.h include opensubdivosdcpuEvaluator.h include opensubdivosdcpuVertexBuffer.h include cstdio include cstring ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner const createTopologyRefiner int maxlevel ------------------------------------------------------------------------------ int main int , char int maxlevel 2 , nCoarseVerts 0 , nRefinedVerts 0 Setup phase Far StencilTable const stencilTable NULL Setup FarStencilTable Far TopologyRefiner const refiner createTopologyRefiner maxlevel Setup a factory to create FarStencilTable for more details see Far tutorials Far StencilTableFactory Options options options . generateOffsets true options . generateIntermediateLevels false stencilTable Far StencilTableFactory Create refiner , options nCoarseVerts refiner - GetLevel 0 . GetNumVertices nRefinedVerts stencilTable - GetNumStencils We are done with Far cleanup table delete refiner Setup a buffer for vertex primvar data Osd CpuVertexBuffer vbuffer Osd CpuVertexBuffer Create 3 , nCoarseVerts nRefinedVerts Execution phase every frame Pack the control vertex data at the start of the vertex buffer and update every time control data changes vbuffer - UpdateData g_verts , 0 , nCoarseVerts Osd BufferDescriptor srcDesc 0 , 3 , 3 Osd BufferDescriptor dstDesc nCoarseVerts 3 , 3 , 3 Launch the computation Osd CpuEvaluator EvalStencils vbuffer , srcDesc , vbuffer , dstDesc , stencilTable Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle float const refinedVerts vbuffer - BindCpuBuffer 3 nCoarseVerts for int i 0 i nRefinedVerts i float const vert refinedVerts 3 i printf -p f f f n , vert 0 , vert 1 , vert 2 printf -c 1 n delete stencilTable delete vbuffer ------------------------------------------------------------------------------ static Far TopologyRefiner const createTopologyRefiner int maxlevel Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "osd_tutorial_0.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "bfr_tutorial_3_2.cpp", │ │ │ │ │ - "text": "bfr_tutorial_3_2.cpp bfr_tutorial_3_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_3_2bfr_tutorial_3_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial is a variation of tutorials showing simple uniform tessellation. Rather than constructing and evaluating a Surface at a time, this tutorial shows how Surfaces can be created and saved for repeated use. A simple SurfaceCache class is created that creates and stores the Surface for each face, along with the patch points associated with it. The main tessellation function remains essentially the same, but here it access the Surfaces from the SurfaceCache rather than computing them locally. Note that while this example illustrated the retention of all Surfaces for a mesh, this behavior is not recommended. It does not scale well for large meshes and undermines the memory savings that transient use of Surfaces is designed to achieve. Rather than storing Surfaces for all faces, maintaining a priority queue for a fixed number may be a reasonable compromise. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include memory include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args This simple class creates and dispenses Surfaces for all faces of a mesh. It consists primarily of an array of simple structs entries for each face and a single array of patch points for all Surfaces created. There are many ways to create such a cache depending on requirements. This is a simple example, but the interface presents some options that are worth considering. A SurfaceCache is constructed here given the following - a reference to the SurfaceFactory - the cache could just as easily take a reference to the mesh and construct the SurfaceFactory internally - the position data for the mesh - this is needed to compute patch points for the Surfaces - if caching UVs or any other primvar, other data needs to be provided -- along with the interpolation type for that data vertex, face-varying, etc. - option to cache patch points - the cache could store the Surfaces only or also include their patch points - storing patch points takes more memory but will eliminate any preparation time for evaluation of the Surface - option to cache all surfaces - the benefits to caching simple linear or regular surfaces are minimal -- and may even be detrimental - so only caching non-linear irregular surfaces is an option worth considering The SurfaceCache implementation here provides the options noted above. But for simplicity, the actual usage of the SurfaceCache does not deal with the permutations of additional work that is necessary when the Surfaces or their patch points are not cached. class SurfaceCache public typedef Bfr Surface float Surface typedef Bfr RefinerSurfaceFactory SurfaceFactory public SurfaceCache SurfaceFactory const surfaceFactory , std vector float const meshPoints , bool cachePatchPoints true , bool cacheAllSurfaces true SurfaceCache delete SurfaceCache default Public methods to retrieved cached Surfaces and their pre-computed patch points bool FaceHasLimitSurface int face return _entries face . hasLimit Surface const GetSurface int face return _entries face . surface . get float const GetPatchPoints int face return getPatchPoints face private Simple struct to keep track of Surface and more for each face struct FaceEntry FaceEntry surface , hasLimit false , pointOffset -1 std unique_ptr Surface const surface bool hasLimit int pointOffset Non-const version to be used internally to aide assignment float getPatchPoints int face return _entries face . surface _points . empty _points . data _entries face . pointOffset 3 0 private std vector FaceEntry _entries std vector float _points SurfaceCache SurfaceCache SurfaceFactory const surfaceFactory , std vector float const meshPoints , bool cachePatchPoints , bool cacheAllSurfaces int numFaces surfaceFactory . GetNumFaces _entries . resize numFaces int numPointsInCache 0 for int face 0 face numFaces face Surface s surfaceFactory . CreateVertexSurface float face if s FaceEntry entry _entries face entry . hasLimit true if cacheAllSurfaces s - IsRegular s - IsLinear entry . surface . reset s entry . pointOffset numPointsInCache numPointsInCache s - GetNumPatchPoints else delete s if cachePatchPoints _points . resize numPointsInCache 3 for int face 0 face numFaces face float patchPoints getPatchPoints face if patchPoints GetSurface face - PreparePatchPoints meshPoints . data , 3 , patchPoints , 3 The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions Initialize a SurfaceCache to construct Surfaces for all faces. From this point forward the SurfaceFactory is no longer used to access Surfaces. Note also that usage below is specific to the options used to initialize the SurfaceCache bool cachePatchPoints true bool cacheAllSurfaces true SurfaceCache surfaceCache meshSurfaceFactory , meshVertexPositions , cachePatchPoints , cacheAllSurfaces As with previous tutorials, output data associated with the face can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Retrieve the Surface for this face when present if surfaceCache . FaceHasLimitSurface faceIndex continue Surface const faceSurface surfaceCache . GetSurface faceIndex Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Retrieve the patch points for the Surface, then use them to evaluate output points for all identified coordinates float const facePatchPoints surfaceCache . GetPatchPoints faceIndex int pointSize 3 outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_3_2.cpp bfr_tutorial_3_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_3_2bfr_tutorial_3_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial is a variation of tutorials showing simple uniform tessellation. Rather than constructing and evaluating a Surface at a time, this tutorial shows how Surfaces can be created and saved for repeated use. A simple SurfaceCache class is created that creates and stores the Surface for each face, along with the patch points associated with it. The main tessellation function remains essentially the same, but here it access the Surfaces from the SurfaceCache rather than computing them locally. Note that while this example illustrated the retention of all Surfaces for a mesh, this behavior is not recommended. It does not scale well for large meshes and undermines the memory savings that transient use of Surfaces is designed to achieve. Rather than storing Surfaces for all faces, maintaining a priority queue for a fixed number may be a reasonable compromise. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include memory include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args This simple class creates and dispenses Surfaces for all faces of a mesh. It consists primarily of an array of simple structs entries for each face and a single array of patch points for all Surfaces created. There are many ways to create such a cache depending on requirements. This is a simple example, but the interface presents some options that are worth considering. A SurfaceCache is constructed here given the following - a reference to the SurfaceFactory - the cache could just as easily take a reference to the mesh and construct the SurfaceFactory internally - the position data for the mesh - this is needed to compute patch points for the Surfaces - if caching UVs or any other primvar, other data needs to be provided -- along with the interpolation type for that data vertex, face-varying, etc. - option to cache patch points - the cache could store the Surfaces only or also include their patch points - storing patch points takes more memory but will eliminate any preparation time for evaluation of the Surface - option to cache all surfaces - the benefits to caching simple linear or regular surfaces are minimal -- and may even be detrimental - so only caching non-linear irregular surfaces is an option worth considering The SurfaceCache implementation here provides the options noted above. But for simplicity, the actual usage of the SurfaceCache does not deal with the permutations of additional work that is necessary when the Surfaces or their patch points are not cached. class SurfaceCache public typedef Bfr Surface float Surface typedef Bfr RefinerSurfaceFactory SurfaceFactory public SurfaceCache SurfaceFactory const surfaceFactory , std vector float const meshPoints , bool cachePatchPoints true , bool cacheAllSurfaces true SurfaceCache delete SurfaceCache default Public methods to retrieved cached Surfaces and their pre-computed patch points bool FaceHasLimitSurface int face return _entries face . hasLimit Surface const GetSurface int face return _entries face . surface . get float const GetPatchPoints int face return getPatchPoints face private Simple struct to keep track of Surface and more for each face struct FaceEntry FaceEntry surface , hasLimit false , pointOffset -1 std unique_ptr Surface const surface bool hasLimit int pointOffset Non-const version to be used internally to aide assignment float getPatchPoints int face return _entries face . surface _points . empty _points . data _entries face . pointOffset 3 0 private std vector FaceEntry _entries std vector float _points SurfaceCache SurfaceCache SurfaceFactory const surfaceFactory , std vector float const meshPoints , bool cachePatchPoints , bool cacheAllSurfaces int numFaces surfaceFactory . GetNumFaces _entries . resize numFaces int numPointsInCache 0 for int face 0 face numFaces face Surface s surfaceFactory . CreateVertexSurface float face if s FaceEntry entry _entries face entry . hasLimit true if cacheAllSurfaces s - IsRegular s - IsLinear entry . surface . reset s entry . pointOffset numPointsInCache numPointsInCache s - GetNumPatchPoints else delete s if cachePatchPoints _points . resize numPointsInCache 3 for int face 0 face numFaces face float patchPoints getPatchPoints face if patchPoints GetSurface face - PreparePatchPoints meshPoints . data , 3 , patchPoints , 3 The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions Initialize a SurfaceCache to construct Surfaces for all faces. From this point forward the SurfaceFactory is no longer used to access Surfaces. Note also that usage below is specific to the options used to initialize the SurfaceCache bool cachePatchPoints true bool cacheAllSurfaces true SurfaceCache surfaceCache meshSurfaceFactory , meshVertexPositions , cachePatchPoints , cacheAllSurfaces As with previous tutorials, output data associated with the face can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Retrieve the Surface for this face when present if surfaceCache . FaceHasLimitSurface faceIndex continue Surface const faceSurface surfaceCache . GetSurface faceIndex Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Retrieve the patch points for the Surface, then use them to evaluate output points for all identified coordinates float const facePatchPoints surfaceCache . GetPatchPoints faceIndex int pointSize 3 outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_3_2.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "bfr_tutorial_3_1.cpp", │ │ │ │ │ - "text": "bfr_tutorial_3_1.cpp bfr_tutorial_3_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_3_1bfr_tutorial_3_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates the definition of a custom subclass of BfrSurfaceFactory -- providing a class with the SurfaceFactory interface adapted to a connected mesh representation. The bulk of this code is therefore identical to a previous tutorial 1.3 which illustrates simple use of a BfrSurface factory. The only difference here lies in the explicit local definition of the subclass of BfrSurfaceFactory for FarTopologyRefiner -- named CustomSurfaceFactory in this case. include .customSurfaceFactory.h include opensubdivfartopologyRefiner.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , std vector float const meshFaceVaryingUVs , Args const options Use simpler local type names for the Surface and its factory typedef CustomSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. bool meshHasUVs meshTopology . GetNumFVarChannels 0 SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize 3 facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays posSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize 2 facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays uvSurface . PreparePatchPoints meshFaceVaryingUVs . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , meshFVarUVs , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_3_1.cpp bfr_tutorial_3_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_3_1bfr_tutorial_3_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates the definition of a custom subclass of BfrSurfaceFactory -- providing a class with the SurfaceFactory interface adapted to a connected mesh representation. The bulk of this code is therefore identical to a previous tutorial 1.3 which illustrates simple use of a BfrSurface factory. The only difference here lies in the explicit local definition of the subclass of BfrSurfaceFactory for FarTopologyRefiner -- named CustomSurfaceFactory in this case. include .customSurfaceFactory.h include opensubdivfartopologyRefiner.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , std vector float const meshFaceVaryingUVs , Args const options Use simpler local type names for the Surface and its factory typedef CustomSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. bool meshHasUVs meshTopology . GetNumFVarChannels 0 SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize 3 facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays posSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize 2 facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays uvSurface . PreparePatchPoints meshFaceVaryingUVs . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , meshFVarUVs , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_3_1.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "bfr_tutorial_2_2.cpp", │ │ │ │ │ - "text": "bfr_tutorial_2_2.cpp bfr_tutorial_2_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_2_2bfr_tutorial_2_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on others using the SurfaceFactory, Surface and Tessellation classes by using more of the functionality of the Tessellation class to construct a tessellation of the mesh that is topologically watertight, i.e. resulting points evaluated along shared edges or vertices are shared and not duplicated. Since Tessellation provides points around its boundary first, the evaluated points for shared vertices and edges are identified when constructed and reused when shared later. The boundary of the tessellation of a face is therefore a collection of shared points and methods of Tessellation help to remap the faces generated to the shared set of points. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio include cassert Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv using Far Index using Far IndexArray using Far ConstIndexArray Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args Simple local structs supporting shared points for vertices and edges namespace struct SharedVertex SharedVertex pointIndex -1 bool IsSet const return pointIndex 0 void Set int index pointIndex index int pointIndex struct SharedEdge SharedEdge pointIndex -1 , numPoints 0 bool IsSet const return pointIndex 0 void Set int index , int n pointIndex index , numPoints n int pointIndex int numPoints end namespace The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. This tessellation function differs from earlier tutorials in that it computes and reuses shared points at vertices and edges of the mesh. There are several ways to compute these shared points, and which is best depends on context. Dealing with shared data poses complications for threading in general, so computing all points for the vertices and edges up front may be preferred -- despite the fact that faces will be visited more than once first when generating potentially shared vertex or edge points, and later when generating any interior points. The loops for vertices and edges can be threaded and the indexing of the shared points is simpler. For the single-threaded case here, the faces are each processed in order and any shared points will be computed and used as needed. So each face is visited once and so each Surface initialized once but the bookkeeping to deal with indices of shared points becomes more complicated. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Declare vectors to identify shared tessellation points at vertices and edges and their indices around the boundary of a face Far TopologyLevel const baseLevel meshTopology . GetLevel 0 std vector SharedVertex sharedVerts baseLevel . GetNumVertices std vector SharedEdge sharedEdges baseLevel . GetNumEdges std vector int tessBoundaryIndices Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numMeshPointsEvaluated 0 int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate the patch point array faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize Evaluate the sample points of the Tessellation First traverse the boundary of the face to determine whether to evaluate or share points on vertices and edges of the face. Both pre-existing and new boundary points are identified by index in an array for later use. The interior points are all trivially computed after the boundary is dealt with. Identify the boundary and interior coords and initialize the index array for the potentially shared boundary points int numBoundaryCoords tessPattern . GetNumBoundaryCoords int numInteriorCoords numOutCoords - numBoundaryCoords float const tessBoundaryCoords outCoords 0 float const tessInteriorCoords outCoords numBoundaryCoords 2 ConstIndexArray fVerts baseLevel . GetFaceVertices faceIndex ConstIndexArray fEdges baseLevel . GetFaceEdges faceIndex tessBoundaryIndices . resize numBoundaryCoords Walk around the face, inspecting each vertex and outgoing edge, and populating the index array of boundary points float patchPointData facePatchPoints . data int boundaryIndex 0 int numFacePointsEvaluated 0 for int i 0 i fVerts . size i Index vertIndex fVerts i Index edgeIndex fEdges i int edgeRate options . tessUniformRate Evaluateassign or retrieve the shared point for the vertex SharedVertex sharedVertex sharedVerts vertIndex if sharedVertex . IsSet Identify indices of the new shared point in both the mesh and face and increment their inventory int indexInMesh numMeshPointsEvaluated int indexInFace numFacePointsEvaluated sharedVertex . Set indexInMesh Evaluate new shared point and assign index to boundary float const uv tessBoundaryCoords boundaryIndex 2 int pIndex indexInFace pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex tessBoundaryIndices boundaryIndex indexInMesh else Assign shared vertex point index to boundary tessBoundaryIndices boundaryIndex sharedVertex . pointIndex Evaluateassign or retrieve all shared points for the edge To keep this simple, assume the edge is manifold. So the second face sharing the edge has that edge in the opposite direction in its boundary relative to the first face -- making it necessary to reverse the order of shared points for the boundary of the second face. To support a non-manifold edge, all subsequent faces that share the assigned shared edge must determine if their orientation of that edge is reversed relative to the first face for which the shared edge points were evaluated. So a little more book-keeping andor inspection is required. if edgeRate 1 int pointsPerEdge edgeRate - 1 SharedEdge sharedEdge sharedEdges edgeIndex if sharedEdge . IsSet Identify indices of the new shared points in both the mesh and face and increment their inventory int nextInMesh numMeshPointsEvaluated int nextInFace numFacePointsEvaluated numFacePointsEvaluated pointsPerEdge numMeshPointsEvaluated pointsPerEdge sharedEdge . Set nextInMesh , pointsPerEdge Evaluate shared points and assign indices to boundary float const uv tessBoundaryCoords boundaryIndex 2 for int j 0 j pointsPerEdge j , uv 2 int pIndex nextInFace pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex tessBoundaryIndices boundaryIndex nextInMesh else See note above on simplification for manifold edges assert baseLevel . IsEdgeNonManifold edgeIndex Assign shared points to boundary in reverse order int nextInMesh sharedEdge . pointIndex pointsPerEdge - 1 for int j 0 j pointsPerEdge j tessBoundaryIndices boundaryIndex nextInMesh -- Evaluate any interior points unique to this face -- appending them to those shared points computed above for the boundary if numInteriorCoords float const uv tessInteriorCoords int iLast numFacePointsEvaluated numInteriorCoords for int i numFacePointsEvaluated i iLast i , uv 2 int pIndex i pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex numFacePointsEvaluated numInteriorCoords numMeshPointsEvaluated numInteriorCoords Remember to trimresize the arrays storing evaluation results for new points to reflect the size actually populated. outPos . resize numFacePointsEvaluated pointSize outDu . resize numFacePointsEvaluated pointSize outDv . resize numFacePointsEvaluated pointSize Identify the faces of the Tessellation Note that the coordinate indices used by the facets are local to the face i.e. they range from 0..N-1, where N is the number of coordinates in the pattern and so need to be offset when writing to Obj format. For more advanced use, the coordinates associated with the boundary and interior of the pattern are distinguishable so that those on the boundary can be easily remapped to refer to shared edge or corner points, while those in the interior can be separately offset or similarly remapped. So transform the indices of the facets here as needed using the indices of shared boundary points assembled above and a suitable offset for the new interior points added int tessInteriorOffset numMeshPointsEvaluated - numOutCoords int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , tessBoundaryIndices . data , tessInteriorOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_2_2.cpp bfr_tutorial_2_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_2_2bfr_tutorial_2_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on others using the SurfaceFactory, Surface and Tessellation classes by using more of the functionality of the Tessellation class to construct a tessellation of the mesh that is topologically watertight, i.e. resulting points evaluated along shared edges or vertices are shared and not duplicated. Since Tessellation provides points around its boundary first, the evaluated points for shared vertices and edges are identified when constructed and reused when shared later. The boundary of the tessellation of a face is therefore a collection of shared points and methods of Tessellation help to remap the faces generated to the shared set of points. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio include cassert Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv using Far Index using Far IndexArray using Far ConstIndexArray Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args Simple local structs supporting shared points for vertices and edges namespace struct SharedVertex SharedVertex pointIndex -1 bool IsSet const return pointIndex 0 void Set int index pointIndex index int pointIndex struct SharedEdge SharedEdge pointIndex -1 , numPoints 0 bool IsSet const return pointIndex 0 void Set int index , int n pointIndex index , numPoints n int pointIndex int numPoints end namespace The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. This tessellation function differs from earlier tutorials in that it computes and reuses shared points at vertices and edges of the mesh. There are several ways to compute these shared points, and which is best depends on context. Dealing with shared data poses complications for threading in general, so computing all points for the vertices and edges up front may be preferred -- despite the fact that faces will be visited more than once first when generating potentially shared vertex or edge points, and later when generating any interior points. The loops for vertices and edges can be threaded and the indexing of the shared points is simpler. For the single-threaded case here, the faces are each processed in order and any shared points will be computed and used as needed. So each face is visited once and so each Surface initialized once but the bookkeeping to deal with indices of shared points becomes more complicated. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Declare vectors to identify shared tessellation points at vertices and edges and their indices around the boundary of a face Far TopologyLevel const baseLevel meshTopology . GetLevel 0 std vector SharedVertex sharedVerts baseLevel . GetNumVertices std vector SharedEdge sharedEdges baseLevel . GetNumEdges std vector int tessBoundaryIndices Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numMeshPointsEvaluated 0 int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate the patch point array faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize Evaluate the sample points of the Tessellation First traverse the boundary of the face to determine whether to evaluate or share points on vertices and edges of the face. Both pre-existing and new boundary points are identified by index in an array for later use. The interior points are all trivially computed after the boundary is dealt with. Identify the boundary and interior coords and initialize the index array for the potentially shared boundary points int numBoundaryCoords tessPattern . GetNumBoundaryCoords int numInteriorCoords numOutCoords - numBoundaryCoords float const tessBoundaryCoords outCoords 0 float const tessInteriorCoords outCoords numBoundaryCoords 2 ConstIndexArray fVerts baseLevel . GetFaceVertices faceIndex ConstIndexArray fEdges baseLevel . GetFaceEdges faceIndex tessBoundaryIndices . resize numBoundaryCoords Walk around the face, inspecting each vertex and outgoing edge, and populating the index array of boundary points float patchPointData facePatchPoints . data int boundaryIndex 0 int numFacePointsEvaluated 0 for int i 0 i fVerts . size i Index vertIndex fVerts i Index edgeIndex fEdges i int edgeRate options . tessUniformRate Evaluateassign or retrieve the shared point for the vertex SharedVertex sharedVertex sharedVerts vertIndex if sharedVertex . IsSet Identify indices of the new shared point in both the mesh and face and increment their inventory int indexInMesh numMeshPointsEvaluated int indexInFace numFacePointsEvaluated sharedVertex . Set indexInMesh Evaluate new shared point and assign index to boundary float const uv tessBoundaryCoords boundaryIndex 2 int pIndex indexInFace pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex tessBoundaryIndices boundaryIndex indexInMesh else Assign shared vertex point index to boundary tessBoundaryIndices boundaryIndex sharedVertex . pointIndex Evaluateassign or retrieve all shared points for the edge To keep this simple, assume the edge is manifold. So the second face sharing the edge has that edge in the opposite direction in its boundary relative to the first face -- making it necessary to reverse the order of shared points for the boundary of the second face. To support a non-manifold edge, all subsequent faces that share the assigned shared edge must determine if their orientation of that edge is reversed relative to the first face for which the shared edge points were evaluated. So a little more book-keeping andor inspection is required. if edgeRate 1 int pointsPerEdge edgeRate - 1 SharedEdge sharedEdge sharedEdges edgeIndex if sharedEdge . IsSet Identify indices of the new shared points in both the mesh and face and increment their inventory int nextInMesh numMeshPointsEvaluated int nextInFace numFacePointsEvaluated numFacePointsEvaluated pointsPerEdge numMeshPointsEvaluated pointsPerEdge sharedEdge . Set nextInMesh , pointsPerEdge Evaluate shared points and assign indices to boundary float const uv tessBoundaryCoords boundaryIndex 2 for int j 0 j pointsPerEdge j , uv 2 int pIndex nextInFace pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex tessBoundaryIndices boundaryIndex nextInMesh else See note above on simplification for manifold edges assert baseLevel . IsEdgeNonManifold edgeIndex Assign shared points to boundary in reverse order int nextInMesh sharedEdge . pointIndex pointsPerEdge - 1 for int j 0 j pointsPerEdge j tessBoundaryIndices boundaryIndex nextInMesh -- Evaluate any interior points unique to this face -- appending them to those shared points computed above for the boundary if numInteriorCoords float const uv tessInteriorCoords int iLast numFacePointsEvaluated numInteriorCoords for int i numFacePointsEvaluated i iLast i , uv 2 int pIndex i pointSize faceSurface . Evaluate uv , patchPointData , pointSize , outPos pIndex , outDu pIndex , outDv pIndex numFacePointsEvaluated numInteriorCoords numMeshPointsEvaluated numInteriorCoords Remember to trimresize the arrays storing evaluation results for new points to reflect the size actually populated. outPos . resize numFacePointsEvaluated pointSize outDu . resize numFacePointsEvaluated pointSize outDv . resize numFacePointsEvaluated pointSize Identify the faces of the Tessellation Note that the coordinate indices used by the facets are local to the face i.e. they range from 0..N-1, where N is the number of coordinates in the pattern and so need to be offset when writing to Obj format. For more advanced use, the coordinates associated with the boundary and interior of the pattern are distinguishable so that those on the boundary can be easily remapped to refer to shared edge or corner points, while those in the interior can be separately offset or similarly remapped. So transform the indices of the facets here as needed using the indices of shared boundary points assembled above and a suitable offset for the new interior points added int tessInteriorOffset numMeshPointsEvaluated - numOutCoords int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , tessBoundaryIndices . data , tessInteriorOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_2_2.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "bfr_tutorial_2_1.cpp", │ │ │ │ │ - "text": "bfr_tutorial_2_1.cpp bfr_tutorial_2_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_2_1bfr_tutorial_2_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes by illustrating the use of non-uniform tessellation parameters with Tessellation. Tessellation rates for the edges of a face are determined by a length associated with each edge. That length may be computed using either the control hull or the limit surface. The length of a tessellation interval is required and will be inferred if not explicitly specified as a command line option. The tessellation rate for an edge is computed as its length divided by the length of the tessellation interval. A maximum tessellation rate is imposed to prevent accidental unbounded tessellation, but can easily be raised as needed. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio include cmath include algorithm Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType float tessInterval int tessRateMax bool useHullFlag bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessInterval 0.0f , tessRateMax 10 , useHullFlag false , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -length if i argc tessInterval float atof argv i else if strcmp argv i , -max if i argc tessRateMax atoi argv i else if strcmp argv i , -hull useHullFlag true else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args Local trivial functions for simple edge length calculations and the determination of associated tessellation rates inline float EdgeLength float const v0 , float const v1 float dv 3 dv 0 std abs v0 0 - v1 0 dv 1 std abs v0 1 - v1 1 dv 2 std abs v0 2 - v1 2 return std sqrt dv 0 dv 0 dv 1 dv 1 dv 2 dv 2 float FindLongestEdge Far TopologyRefiner const mesh , std vector float const vertPos , int pointSize float maxLength 0.0f int numEdges mesh . GetLevel 0 . GetNumEdges for int i 0 i numEdges i Far ConstIndexArray edgeVerts mesh . GetLevel 0 . GetEdgeVertices i float edgeLength EdgeLength vertPos edgeVerts 0 pointSize , vertPos edgeVerts 1 pointSize maxLength std max maxLength , edgeLength return maxLength void GetEdgeTessRates std vector float const vertPos , int pointSize , Args const options , int edgeRates int numEdges int vertPos . size pointSize for int i 0 i numEdges i int j i 1 numEdges float edgeLength EdgeLength vertPos i pointSize , vertPos j pointSize edgeRates i 1 int edgeLength options . tessInterval edgeRates i std min edgeRates i , options . tessRateMax The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector int faceTessRates std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Prepare the Surface patch points first as it may be evaluated to determine suitable edge-rates for Tessellation int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize For each of the N edges of the face, a tessellation rate is determined to initialize a non-uniform Tessellation pattern. Many metrics are possible -- some based on the geometry itself size, curvature, others dependent on viewpoint screen space size, center of view, etc. and many more. Simple techniques are chosen here for illustration and can easily be replaced. Here two methods are shown using lengths between the corners of the face -- the first using the vertex positions of the face and the second using points evaluated at the corners of its limit surface. Use of the control hull is more efficient avoiding the evaluation but may prove less effective in some cases though both estimates have their limitations. int N faceSurface . GetFaceSize Use the output array temporarily to hold the N positions outPos . resize N pointSize if options . useHullFlag Far ConstIndexArray verts meshTopology . GetLevel 0 . GetFaceVertices faceIndex for int i 0 , j 0 i N i , j pointSize float const vPos meshVertexPositions verts i pointSize outPos j vPos 0 outPos j 1 vPos 1 outPos j 2 vPos 2 else Bfr Parameterization faceParam faceSurface . GetParameterization for int i 0 , j 0 i N i , j pointSize float uv 2 faceParam . GetVertexCoord i , uv faceSurface . Evaluate uv , facePatchPoints . data , pointSize , outPos j faceTessRates . resize N GetEdgeTessRates outPos , pointSize , options , faceTessRates . data Declare a non-uniform Tessellation using the rates for each edge and identify coordinates of the points to evaluate Additional interior rates can be optionally provided 2 for quads, 1 for others but will be inferred in their absence. Bfr Tessellation tessPattern faceSurface . GetParameterization , N , faceTessRates . data , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Resize the output arrays and evaluate outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE If no interval length was specified, set one by finding the longest edge of the mesh and dividing it by the maximum tessellation rate if args . tessInterval 0.0f args . tessInterval FindLongestEdge meshTopology , meshVtxPositions , 3 float args . tessRateMax tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_2_1.cpp bfr_tutorial_2_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_2_1bfr_tutorial_2_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes by illustrating the use of non-uniform tessellation parameters with Tessellation. Tessellation rates for the edges of a face are determined by a length associated with each edge. That length may be computed using either the control hull or the limit surface. The length of a tessellation interval is required and will be inferred if not explicitly specified as a command line option. The tessellation rate for an edge is computed as its length divided by the length of the tessellation interval. A maximum tessellation rate is imposed to prevent accidental unbounded tessellation, but can easily be raised as needed. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio include cmath include algorithm Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType float tessInterval int tessRateMax bool useHullFlag bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessInterval 0.0f , tessRateMax 10 , useHullFlag false , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -length if i argc tessInterval float atof argv i else if strcmp argv i , -max if i argc tessRateMax atoi argv i else if strcmp argv i , -hull useHullFlag true else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args Local trivial functions for simple edge length calculations and the determination of associated tessellation rates inline float EdgeLength float const v0 , float const v1 float dv 3 dv 0 std abs v0 0 - v1 0 dv 1 std abs v0 1 - v1 1 dv 2 std abs v0 2 - v1 2 return std sqrt dv 0 dv 0 dv 1 dv 1 dv 2 dv 2 float FindLongestEdge Far TopologyRefiner const mesh , std vector float const vertPos , int pointSize float maxLength 0.0f int numEdges mesh . GetLevel 0 . GetNumEdges for int i 0 i numEdges i Far ConstIndexArray edgeVerts mesh . GetLevel 0 . GetEdgeVertices i float edgeLength EdgeLength vertPos edgeVerts 0 pointSize , vertPos edgeVerts 1 pointSize maxLength std max maxLength , edgeLength return maxLength void GetEdgeTessRates std vector float const vertPos , int pointSize , Args const options , int edgeRates int numEdges int vertPos . size pointSize for int i 0 i numEdges i int j i 1 numEdges float edgeLength EdgeLength vertPos i pointSize , vertPos j pointSize edgeRates i 1 int edgeLength options . tessInterval edgeRates i std min edgeRates i , options . tessRateMax The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector int faceTessRates std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Prepare the Surface patch points first as it may be evaluated to determine suitable edge-rates for Tessellation int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize For each of the N edges of the face, a tessellation rate is determined to initialize a non-uniform Tessellation pattern. Many metrics are possible -- some based on the geometry itself size, curvature, others dependent on viewpoint screen space size, center of view, etc. and many more. Simple techniques are chosen here for illustration and can easily be replaced. Here two methods are shown using lengths between the corners of the face -- the first using the vertex positions of the face and the second using points evaluated at the corners of its limit surface. Use of the control hull is more efficient avoiding the evaluation but may prove less effective in some cases though both estimates have their limitations. int N faceSurface . GetFaceSize Use the output array temporarily to hold the N positions outPos . resize N pointSize if options . useHullFlag Far ConstIndexArray verts meshTopology . GetLevel 0 . GetFaceVertices faceIndex for int i 0 , j 0 i N i , j pointSize float const vPos meshVertexPositions verts i pointSize outPos j vPos 0 outPos j 1 vPos 1 outPos j 2 vPos 2 else Bfr Parameterization faceParam faceSurface . GetParameterization for int i 0 , j 0 i N i , j pointSize float uv 2 faceParam . GetVertexCoord i , uv faceSurface . Evaluate uv , facePatchPoints . data , pointSize , outPos j faceTessRates . resize N GetEdgeTessRates outPos , pointSize , options , faceTessRates . data Declare a non-uniform Tessellation using the rates for each edge and identify coordinates of the points to evaluate Additional interior rates can be optionally provided 2 for quads, 1 for others but will be inferred in their absence. Bfr Tessellation tessPattern faceSurface . GetParameterization , N , faceTessRates . data , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Resize the output arrays and evaluate outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE If no interval length was specified, set one by finding the longest edge of the mesh and dividing it by the maximum tessellation rate if args . tessInterval 0.0f args . tessInterval FindLongestEdge meshTopology , meshVtxPositions , 3 float args . tessRateMax tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_2_1.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "bfr_tutorial_1_3.cpp", │ │ │ │ │ - "text": "bfr_tutorial_1_3.cpp bfr_tutorial_1_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_3bfr_tutorial_1_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes for evaluating and tessellating the limit surface of faces of a mesh by adding support for the evaluation of face-varying UVs. If UVs exist in the given mesh, they will be evaluated and included with the vertex positions and normals previously illustrated as part of the tessellation written to the Obj file. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , std vector float const meshFaceVaryingUVs , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. bool meshHasUVs meshTopology . GetNumFVarChannels 0 SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize 3 facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays posSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize 2 facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays uvSurface . PreparePatchPoints meshFaceVaryingUVs . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , meshFVarUVs , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "bfr_tutorial_1_3.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "bfr_tutorial_1_4.cpp", │ │ │ │ │ - "text": "bfr_tutorial_1_4.cpp bfr_tutorial_1_4.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_4bfr_tutorial_1_4.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes for evaluating and tessellating the limit surface of faces of a mesh by illustrating how the presence of additional data in the mesh arrays is handled. As in the previous tutorial, vertex positions and face-varying UVs are provided with the mesh to be evaluated. But here an additional color is interleaved with the position in the vertex data of the mesh and a third component is added to face-varying UV data making it u,v,w. To evaluate the position and 2D UVs while avoiding the color and unused third UV coordinate, the SurfacePointDescriptor class is used to describe the size and stride of the desired data to be evaluated in the arrays of mesh data. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVtxData , int vtxDataSize , std vector float const meshFVarData , int fvarDataSize , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface typedef Surface PointDescriptor SurfacePoint Identify the source positions and UVs within more general data arrays for the mesh. If position andor UV are not at the start of the vtx andor fvar data, simply offset the head of the array here accordingly bool meshHasUVs meshTopology . GetNumFVarChannels 0 float const meshPosData meshVtxData . data SurfacePoint meshPosPoint 3 , vtxDataSize float const meshUVData meshHasUVs meshFVarData . data 0 SurfacePoint meshUVPoint 2 , fvarDataSize Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize meshPosPoint . size facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays float patchPosData facePatchPoints . data SurfacePoint patchPosPoint pointSize posSurface . PreparePatchPoints meshPosData , meshPosPoint , patchPosData , patchPosPoint for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , patchPosData , patchPosPoint , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize meshUVPoint . size facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays float patchUVData facePatchPoints . data SurfacePoint patchUVPoint pointSize uvSurface . PreparePatchPoints meshUVData , meshUVPoint , patchUVData , patchUVPoint for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , patchUVData , patchUVPoint , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE Expand the loaded position and UV arrays to include additional data initialized with -1 for distinction, e.g. add a 4-tuple for RGBA color to the vertex data and add a third field w to the face-varying data int numPos int meshVtxPositions . size 3 int vtxSize 7 std vector float vtxData numPos vtxSize , -1.0f for int i 0 i numPos i vtxData i vtxSize meshVtxPositions i 3 vtxData i vtxSize 1 meshVtxPositions i 3 1 vtxData i vtxSize 2 meshVtxPositions i 3 2 int numUVs int meshFVarUVs . size 2 int fvarSize 3 std vector float fvarData numUVs fvarSize , -1.0f for int i 0 i numUVs i fvarData i fvarSize meshFVarUVs i 2 fvarData i fvarSize 1 meshFVarUVs i 2 1 Pass the expanded data arrays along with their respective strides tessellateToObj meshTopology , vtxData , vtxSize , fvarData , fvarSize , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_1_4.cpp bfr_tutorial_1_4.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_4bfr_tutorial_1_4.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes for evaluating and tessellating the limit surface of faces of a mesh by illustrating how the presence of additional data in the mesh arrays is handled. As in the previous tutorial, vertex positions and face-varying UVs are provided with the mesh to be evaluated. But here an additional color is interleaved with the position in the vertex data of the mesh and a third component is added to face-varying UV data making it u,v,w. To evaluate the position and 2D UVs while avoiding the color and unused third UV coordinate, the SurfacePointDescriptor class is used to describe the size and stride of the desired data to be evaluated in the arrays of mesh data. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVtxData , int vtxDataSize , std vector float const meshFVarData , int fvarDataSize , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface typedef Surface PointDescriptor SurfacePoint Identify the source positions and UVs within more general data arrays for the mesh. If position andor UV are not at the start of the vtx andor fvar data, simply offset the head of the array here accordingly bool meshHasUVs meshTopology . GetNumFVarChannels 0 float const meshPosData meshVtxData . data SurfacePoint meshPosPoint 3 , vtxDataSize float const meshUVData meshHasUVs meshFVarData . data 0 SurfacePoint meshUVPoint 2 , fvarDataSize Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize meshPosPoint . size facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays float patchPosData facePatchPoints . data SurfacePoint patchPosPoint pointSize posSurface . PreparePatchPoints meshPosData , meshPosPoint , patchPosData , patchPosPoint for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , patchPosData , patchPosPoint , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize meshUVPoint . size facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays float patchUVData facePatchPoints . data SurfacePoint patchUVPoint pointSize uvSurface . PreparePatchPoints meshUVData , meshUVPoint , patchUVData , patchUVPoint for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , patchUVData , patchUVPoint , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE Expand the loaded position and UV arrays to include additional data initialized with -1 for distinction, e.g. add a 4-tuple for RGBA color to the vertex data and add a third field w to the face-varying data int numPos int meshVtxPositions . size 3 int vtxSize 7 std vector float vtxData numPos vtxSize , -1.0f for int i 0 i numPos i vtxData i vtxSize meshVtxPositions i 3 vtxData i vtxSize 1 meshVtxPositions i 3 1 vtxData i vtxSize 2 meshVtxPositions i 3 2 int numUVs int meshFVarUVs . size 2 int fvarSize 3 std vector float fvarData numUVs fvarSize , -1.0f for int i 0 i numUVs i fvarData i fvarSize meshFVarUVs i 2 fvarData i fvarSize 1 meshFVarUVs i 2 1 Pass the expanded data arrays along with their respective strides tessellateToObj meshTopology , vtxData , vtxSize , fvarData , fvarSize , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_1_4.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "bfr_tutorial_1_5.cpp", │ │ │ │ │ - "text": "bfr_tutorial_1_5.cpp bfr_tutorial_1_5.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_5bfr_tutorial_1_5.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial is an alternative to an earlier tutorial that showed uniform tessellation. This version differs by evaluating the points of the tessellation using limit stencils instead of the standard Surface evaluation methods. Limit stencils factor the evaluation into a set of coefficients for each control point affecting the Surface. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float faceControlPoints std vector float limitStencils std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Resize stencils and control point arrays based on the number of control points for the Surface int numControlPoints faceSurface . GetNumControlPoints limitStencils . resize 3 numControlPoints float pStencil limitStencils . data float duStencil limitStencils . data numControlPoints float dvStencil limitStencils . data numControlPoints 2 Limit stencils can be applied using the control points in a local array or directy from the mesh. Both are shown here, so if using the local array, resize and populate it bool gatherControlPoints true if gatherControlPoints faceControlPoints . resize numControlPoints 3 faceSurface . GatherControlPoints meshVertexPositions . data , 3 , faceControlPoints . data , 3 Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Evaluate and apply stencils to compute points of the tessellation outPos . resize numOutCoords 3 outDu . resize numOutCoords 3 outDv . resize numOutCoords 3 for int i 0 i numOutCoords i float const uv outCoords . data i 2 faceSurface . EvaluateStencil uv , pStencil , duStencil , dvStencil float p outPos . data i 3 float du outDu . data i 3 float dv outDv . data i 3 if gatherControlPoints float const controlPoints faceControlPoints . data faceSurface . ApplyStencil pStencil , controlPoints , 3 , p faceSurface . ApplyStencil duStencil , controlPoints , 3 , du faceSurface . ApplyStencil dvStencil , controlPoints , 3 , dv else float const meshPoints meshVertexPositions . data faceSurface . ApplyStencilFromMesh pStencil , meshPoints , 3 , p faceSurface . ApplyStencilFromMesh duStencil , meshPoints , 3 , du faceSurface . ApplyStencilFromMesh dvStencil , meshPoints , 3 , dv Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "bfr_tutorial_1_5.cpp bfr_tutorial_1_5.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_5bfr_tutorial_1_5.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial is an alternative to an earlier tutorial that showed uniform tessellation. This version differs by evaluating the points of the tessellation using limit stencils instead of the standard Surface evaluation methods. Limit stencils factor the evaluation into a set of coefficients for each control point affecting the Surface. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float faceControlPoints std vector float limitStencils std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Resize stencils and control point arrays based on the number of control points for the Surface int numControlPoints faceSurface . GetNumControlPoints limitStencils . resize 3 numControlPoints float pStencil limitStencils . data float duStencil limitStencils . data numControlPoints float dvStencil limitStencils . data numControlPoints 2 Limit stencils can be applied using the control points in a local array or directy from the mesh. Both are shown here, so if using the local array, resize and populate it bool gatherControlPoints true if gatherControlPoints faceControlPoints . resize numControlPoints 3 faceSurface . GatherControlPoints meshVertexPositions . data , 3 , faceControlPoints . data , 3 Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Evaluate and apply stencils to compute points of the tessellation outPos . resize numOutCoords 3 outDu . resize numOutCoords 3 outDv . resize numOutCoords 3 for int i 0 i numOutCoords i float const uv outCoords . data i 2 faceSurface . EvaluateStencil uv , pStencil , duStencil , dvStencil float p outPos . data i 3 float du outDu . data i 3 float dv outDv . data i 3 if gatherControlPoints float const controlPoints faceControlPoints . data faceSurface . ApplyStencil pStencil , controlPoints , 3 , p faceSurface . ApplyStencil duStencil , controlPoints , 3 , du faceSurface . ApplyStencil dvStencil , controlPoints , 3 , dv else float const meshPoints meshVertexPositions . data faceSurface . ApplyStencilFromMesh pStencil , meshPoints , 3 , p faceSurface . ApplyStencilFromMesh duStencil , meshPoints , 3 , du faceSurface . ApplyStencilFromMesh dvStencil , meshPoints , 3 , dv Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_tutorial_1_5.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "bfr_tutorial_1_2.cpp", │ │ │ │ │ - "text": "bfr_tutorial_1_2.cpp bfr_tutorial_1_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_2bfr_tutorial_1_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory and Surface for evaluating the limit surface of faces by using the Tessellation class to determine the points to evaluate and the faces that connect them. The Tessellation class replaces the explicit determination of points and faces for the triangle fan of the previous example. Given a uniform tessellation rate via a command line option, Tessellation returns the set of coordinates to evaluate, and separately returns the faces that connect them. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "bfr_tutorial_1_2.html" │ │ │ │ │ - }, { │ │ │ │ │ - "title": "far_tutorial_5_3.cpp", │ │ │ │ │ - "text": "far_tutorial_5_3.cpp far_tutorial_5_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_3far_tutorial_5_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to use a FarLimitStenciTable to repeatedly and efficiently evaluate a set of points and optionally derivatives on the limit surface. A LimitStencilTable derives from StencilTable but is specialized to factor the evaluation of limit positions and derivatives into stencils. This allows a set of limit properties to be efficiently recomputed in response to changes to the vertices of the base mesh. Constructing the different kinds of StencilTables can have a high cost, so whether that cost is worth it will depend on your usage e.g. if points are only computed once, using stencil tables is typically not worth the added cost. Any points on the limit surface can be identified for evaluation. In this example we create a crude tessellation similar to tutorial_5_2. The midpoint of each face and points near the corners of the face are evaluated and a triangle fan connects them. include ......regressioncommonarg_utils.h include ......regressioncommonfar_utils.h include opensubdivfartopologyDescriptor.h include opensubdivfarpatchTableFactory.h include opensubdivfarstencilTableFactory.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include fstream include sstream using namespace OpenSubdiv using Far Index Global utilities in this namespace are not relevant to the tutorial. They simply serve to construct some default geometry to be processed in the form of a TopologyRefiner and vector of vertex positions. namespace Simple structs for x,y,z position and a 3-tuple for the set of vertices of a triangle struct Pos Pos Pos float x , float y , float z p 0 x , p 1 y , p 2 z Pos operator Pos const op const return Pos p 0 op . p 0 , p 1 op . p 1 , p 2 op . p 2 Clear and AddWithWeight required for interpolation void Clear void 0 p 0 p 1 p 2 0.0f void AddWithWeight Pos const src , float weight p 0 weight src . p 0 p 1 weight src . p 1 p 2 weight src . p 2 float p 3 typedef std vector Pos PosVector struct Tri Tri Tri int a , int b , int c v 0 a , v 1 b , v 2 c int v 3 typedef std vector Tri TriVector Functions to populate the topology and geometry arrays a simple shape whose positions may be transformed void createCube std vector int vertsPerFace , std vector Index faceVertsPerFace , std vector Pos positionsPerVert Local topology and position of a cube centered at origin static float const cubePositions 8 3 -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f static int const cubeFaceVerts 6 4 0 , 3 , 2 , 1 , 4 , 5 , 6 , 7 , 0 , 4 , 7 , 3 , 1 , 2 , 6 , 5 , 0 , 1 , 5 , 4 , 3 , 7 , 6 , 2 Initialize verts-per-face and face-vertices for each face vertsPerFace . resize 6 faceVertsPerFace . resize 24 for int i 0 i 6 i vertsPerFace i 4 for int j 0 j 4 j faceVertsPerFace i 4 j cubeFaceVerts i j Initialize vertex positions positionsPerVert . resize 8 for int i 0 i 8 i float const p cubePositions i positionsPerVert i Pos p 0 , p 1 , p 2 Create a TopologyRefiner from default geometry created above Far TopologyRefiner createTopologyRefinerDefault PosVector posVector std vector int topVertsPerFace std vector Index topFaceVerts createCube topVertsPerFace , topFaceVerts , posVector typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_AND_CORNER Descriptor desc desc . numVertices int posVector . size desc . numFaces int topVertsPerFace . size desc . numVertsPerFace topVertsPerFace 0 desc . vertIndicesPerFace topFaceVerts 0 Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options assert refiner return refiner Create a TopologyRefiner from a specified Obj file geometry created internally Far TopologyRefiner createTopologyRefinerFromObj std string const objFileName , Sdc SchemeType schemeType , PosVector posVector const char filename objFileName . c_str const Shape shape 0 std ifstream ifs filename if ifs std stringstream ss ss ifs . rdbuf ifs . close std string shapeString ss . str shape Shape parseObj shapeString . c_str , ConvertSdcTypeToShapeScheme schemeType , false if shape 0 fprintf stderr , Error Cannot create Shape from .obj file s n , filename return 0 else fprintf stderr , Error Cannot open .obj file s n , filename return 0 Sdc SchemeType sdcType GetSdcType shape Sdc Options sdcOptions GetSdcOptions shape Far TopologyRefiner refiner Far TopologyRefinerFactory Shape Create shape , Far TopologyRefinerFactory Shape Options sdcType , sdcOptions if refiner 0 fprintf stderr , Error Unable to construct TopologyRefiner from .obj file s n , filename return 0 int numVertices refiner - GetNumVerticesTotal posVector . resize numVertices std memcpy posVector 0 . p 0 , shape - verts 0 , numVertices 3 sizeof float delete shape return refiner Simple function to export an Obj file for the limit points -- which provides a simple tessllation similar to tutorial_5_2. int writeToObj Far TopologyLevel const baseLevel , std vector Pos const vertexPositions , int nextObjVertexIndex for size_t i 0 i vertexPositions . size i float const p vertexPositions i . p printf v f f f n , p 0 , p 1 , p 2 Connect the sequences of limit points center followed by corners into triangle fans for each base face for int i 0 i baseLevel . GetNumFaces i int faceSize baseLevel . GetFaceVertices i . size int vCenter nextObjVertexIndex 1 int vCorner vCenter 1 for int k 0 k faceSize k printf f d d d n , vCenter , vCorner k , vCorner k 1 faceSize nextObjVertexIndex faceSize 1 return nextObjVertexIndex end namespace Command line arguments parsed to provide run-time options class Args public std string inputObjFile Sdc SchemeType schemeType int maxPatchDepth int numPoses Pos poseOffset bool deriv1Flag bool noPatchesFlag bool noOutputFlag public Args int argc , char argv inputObjFile , schemeType Sdc SCHEME_CATMARK , maxPatchDepth 3 , numPoses 0 , poseOffset 1.0f , 0.0f , 0.0f , deriv1Flag false , noPatchesFlag false , noOutputFlag false Parse and assign standard arguments and Obj files ArgOptions args args . Parse argc , argv maxPatchDepth args . GetLevel schemeType ConvertShapeSchemeToSdcType args . GetDefaultScheme const std vector const char objFiles args . GetObjFiles if objFiles . empty for size_t i 1 i objFiles . size i fprintf stderr , Warning .obj file s ignored n , objFiles i inputObjFile std string objFiles 0 Parse remaining arguments specific to this example const std vector const char rargs args . GetRemainingArgs for size_t i 0 i rargs . size i if strcmp rargs i , -d1 deriv1Flag true else if strcmp rargs i , -nopatches noPatchesFlag true else if strcmp rargs i , -poses if i rargs . size numPoses atoi rargs i else if strcmp rargs i , -offset if i rargs . size poseOffset . p 0 float atof rargs i if i rargs . size poseOffset . p 1 float atof rargs i if i rargs . size poseOffset . p 2 float atof rargs i else if strcmp rargs i , -nooutput noOutputFlag true else fprintf stderr , Warning Argument s ignored n , rargs i private Args Assemble the set of locations for the limit points. The resulting vector of LocationArrays can contain arbitrary locations on the limit surface -- with multiple locations for the same patch grouped into a single array. In this case, for each base face, coordinates for the center and its corners are specified -- from which we will construct a triangle fan providing a crude tessellation similar to tutorial_5_2. typedef Far LimitStencilTableFactory LocationArray LocationArray int assembleLimitPointLocations Far TopologyRefiner const refiner , std vector LocationArray locations Coordinates for the center of the face and its corners slightly inset. Unlike most of the public interface for patches, the LocationArray refers to parameteric coordinates as s,t, so that convention will be followed here. Note that the s,t coordinates in a LocationArray are referred to by reference. The memory holding these s,t values must persist while the LimitStencilTable is constructed -- the arrays here are declared as static for that purpose. static float const quadSCoords 5 0.5f , 0.05f , 0.95f , 0.95f , 0.05f static float const quadTCoords 5 0.5f , 0.05f , 0.05f , 0.95f , 0.95f static float const triSCoords 4 0.33f , 0.05f , 0.95f , 0.05f static float const triTCoords 4 0.33f , 0.05f , 0.00f , 0.95f static float const irregSCoords 2 1.0f , 0.05f static float const irregTCoords 2 1.0f , 0.05f Since these are references to patches to be evaluated, we require use of the Ptex indices to identify the top-most parameterized patch, which is essential to dealing with non-quad faces in the case of Catmark. Far TopologyLevel const baseLevel refiner . GetLevel 0 Far PtexIndices basePtexIndices refiner int regFaceSize Sdc SchemeTypeTraits GetRegularFaceSize refiner . GetSchemeType For each base face, simply refer to the s,t arrays for regular quad and triangular patches with a single LocationArray. Otherwise, for irregular faces, the corners of the face come from different patches and so must be referenced in separate LocationArrays. locations . clear int numLimitPoints 0 for int i 0 i baseLevel . GetNumFaces i int baseFaceSize baseLevel . GetFaceVertices i . size int basePtexId basePtexIndices . GetFaceId i bool faceIsRegular baseFaceSize regFaceSize if faceIsRegular All coordinates are on the same top-level patch LocationArray loc loc . ptexIdx basePtexId loc . numLocations baseFaceSize 1 if baseFaceSize 4 loc . s quadSCoords loc . t quadTCoords else loc . s triSCoords loc . t triTCoords locations . push_back loc else Center coordinate is on the first sub-patch while those on near the corners are on each successive sub-patch LocationArray loc loc . numLocations 1 for int j 0 j baseFaceSize j bool isPerimeter j 0 loc . ptexIdx basePtexId isPerimeter j -1 0 loc . s irregSCoords isPerimeter loc . t irregTCoords isPerimeter locations . push_back loc numLimitPoints baseFaceSize 1 return numLimitPoints Load command line arguments and geometry, build the LimitStencilTable for a set of points on the limit surface and compute those points for several orientations of the mesh int main int argc , char argv Args args argc , argv Create or load the base geometry command line arguments allow a .obj file to be specified, providing a TopologyRefiner and a set of base vertex positions to work with std vector Pos basePositions Far TopologyRefiner refinerPtr args . inputObjFile . empty createTopologyRefinerDefault basePositions createTopologyRefinerFromObj args . inputObjFile , args . schemeType , basePositions assert refinerPtr Far TopologyRefiner refiner refinerPtr Far TopologyLevel const baseLevel refiner . GetLevel 0 Use of LimitStencilTable requires either explicit or implicit use of a PatchTable. A PatchTable is not required to construct a LimitStencilTable -- one will be constructed internally for use and discarded -- but explicit construction is recommended to control the many legacy options for PatchTable, rather than relying on internal defaults. Adaptive refinement is required in both cases to indicate the accuracy of the patches. Note that if a TopologyRefiner and PatchTable are not used for any other purpose than computing the limit points, that specifying the subset of faces containing those limit points in the adaptive refinement and PatchTable construction can avoid unnecessary overhead. Far PatchTable patchTablePtr 0 if args . noPatchesFlag refiner . RefineAdaptive Far TopologyRefiner AdaptiveOptions args . maxPatchDepth else Far PatchTableFactory Options patchOptions args . maxPatchDepth patchOptions . useInfSharpPatch true patchOptions . generateLegacySharpCornerPatches false patchOptions . generateVaryingTables false patchOptions . generateFVarTables false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS refiner . RefineAdaptive patchOptions . GetRefineAdaptiveOptions patchTablePtr Far PatchTableFactory Create refiner , patchOptions assert patchTablePtr Assemble the set of locations for the limit points. For each base face, coordinates for the center and its corners are specified -- from which we will construct a triangle fan providing a crude tessellation similar to tutorial_5_2. std vector LocationArray locations int numLimitPoints assembleLimitPointLocations refiner , locations Construct a LimitStencilTable from the refiner, patch table optional and the collection of limit point locations. Stencils can optionally be created for computing dervatives -- the default is to compute 1st derivative stencils, so be sure to disable that if not necessary Far LimitStencilTableFactory Options limitOptions limitOptions . generate1stDerivatives args . deriv1Flag Far LimitStencilTable const limitStencilTablePtr Far LimitStencilTableFactory Create refiner , locations , 0 , optional StencilTable for the refined points patchTablePtr , optional PatchTable limitOptions assert limitStencilTablePtr Far LimitStencilTable const limitStencilTable limitStencilTablePtr Apply the constructed LimitStencilTable to compute limit positions from the base level vertex positions. This is trivial if computing all positions in one invokation. The UpdateValues method and those for derivatives are overloaded to optionally accept a subrange of indices to distribute the computation std vector Pos limitPositions numLimitPoints limitStencilTable . UpdateValues basePositions , limitPositions Call with the optional subrange limitStencilTable . UpdateValues basePositions , limitPositions , 0 , numLimitPoints 2 limitStencilTable . UpdateValues basePositions , limitPositions , numLimitPoints 2 1 , numLimitPoints Write vertices and faces in Obj format for the original limit points int objVertCount 0 if args . noOutputFlag printf g base_mesh n objVertCount writeToObj baseLevel , limitPositions , objVertCount Recompute the limit points and output faces for different poses of the original mesh -- in this case simply translated. Also optionally compute 1st derivatives though they are not used here std vector Pos posePositions basePositions std vector Pos limitDu args . deriv1Flag numLimitPoints 0 std vector Pos limitDv args . deriv1Flag numLimitPoints 0 for int i 0 i args . numPoses i Trivially transform the base vertex positions and re-compute for size_t j 0 j basePositions . size j posePositions j posePositions j args . poseOffset limitStencilTable . UpdateValues posePositions , limitPositions if args . deriv1Flag limitStencilTable . UpdateDerivs posePositions , limitDu , limitDv if args . noOutputFlag printf n g pose_d n , i objVertCount writeToObj baseLevel , limitPositions , objVertCount delete refinerPtr delete patchTablePtr delete limitStencilTablePtr return EXIT_SUCCESS Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "far_tutorial_5_3.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "far_tutorial_5_2.cpp", │ │ │ │ │ - "text": "far_tutorial_5_2.cpp far_tutorial_5_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_2far_tutorial_5_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to manage the limit surface of a potentially large mesh by creating groups of patches for selected faces of the mesh. Familiarity with construction and evaluation of a PatchTable is assumed see tutorial_5_1. When the patches for a mesh do not need to be retained for further use, e.g. when simply computing points for a tessellation, the time and space required to construct a single large PatchTable can be considerable. By constructing, evaluating and discarding smaller PatchTables for subsets of the mesh, the high transient memory cost can be avoided when computed serially. When computed in parallel, there may be little memory savings, but the construction time can then be distributed. This tutorial creates simple geometry currently a lattice of cubes that can be expanded in complexity with a simple multiplier. The collection of faces are then divided into a specified number of groups from which patches will be constructed and evaluated. A simple tessellation a triangle fan around the midpoint of each face is then written in Obj format to the standard output. include ......regressioncommonarg_utils.h include ......regressioncommonfar_utils.h include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include opensubdivfarpatchTableFactory.h include opensubdivfarpatchMap.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include fstream include sstream using namespace OpenSubdiv using Far Index Global utilities in this namespace are not relevant to the tutorial. They simply serve to construct some default geometry to be processed in the form of a TopologyRefiner and vector of vertex positions. namespace Simple structs for x,y,z position and a 3-tuple for the set of vertices of a triangle struct Pos Pos Pos float x , float y , float z p 0 x , p 1 y , p 2 z Pos operator Pos const op const return Pos p 0 op . p 0 , p 1 op . p 1 , p 2 op . p 2 Clear and AddWithWeight required for interpolation void Clear void 0 p 0 p 1 p 2 0.0f void AddWithWeight Pos const src , float weight p 0 weight src . p 0 p 1 weight src . p 1 p 2 weight src . p 2 float p 3 typedef std vector Pos PosVector struct Tri Tri Tri int a , int b , int c v 0 a , v 1 b , v 2 c int v 3 typedef std vector Tri TriVector Functions to populate the topology and geometry arrays with simple shapes that we can multiply to increase complexity void appendDefaultPrimitive Pos const origin , std vector int vertsPerFace , std vector Index faceVerts , std vector Pos positionsPerVert Local topology and position of a cube centered at origin static float const cubePositions 8 3 -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f static int const cubeFaceVerts 6 4 0 , 3 , 2 , 1 , 4 , 5 , 6 , 7 , 0 , 4 , 7 , 3 , 1 , 2 , 6 , 5 , 0 , 1 , 5 , 4 , 3 , 7 , 6 , 2 Identify the next vertex before appending vertex positions int baseVertex int positionsPerVert . size for int i 0 i 8 i float const p cubePositions i positionsPerVert . push_back origin Pos p 0 , p 1 , p 2 Append number of verts-per-face and face-vertices for each face for int i 0 i 6 i vertsPerFace . push_back 4 for int j 0 j 4 j faceVerts . push_back baseVertex cubeFaceVerts i j void createDefaultGeometry int multiplier , std vector int vertsPerFace , std vector Index faceVerts , std vector Pos positionsPerVert Default primitive is currently a cube int const vertsPerPrimitive 8 int const facesPerPrimitive 6 int const faceVertsPerPrimitive 24 int nPrimitives multiplier multiplier multiplier positionsPerVert . reserve nPrimitives vertsPerPrimitive vertsPerFace . reserve nPrimitives facesPerPrimitive faceVerts . reserve nPrimitives faceVertsPerPrimitive for int x 0 x multiplier x for int y 0 y multiplier y for int z 0 z multiplier z appendDefaultPrimitive Pos float x 2.0f , float y 2.0f , float z 2.0f , vertsPerFace , faceVerts , positionsPerVert Create a TopologyRefiner from default geometry created above Far TopologyRefiner createTopologyRefinerDefault int multiplier , PosVector posVector std vector int topVertsPerFace std vector Index topFaceVerts createDefaultGeometry multiplier , topVertsPerFace , topFaceVerts , posVector typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_AND_CORNER Descriptor desc desc . numVertices int posVector . size desc . numFaces int topVertsPerFace . size desc . numVertsPerFace topVertsPerFace 0 desc . vertIndicesPerFace topFaceVerts 0 Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options if refiner 0 exit EXIT_FAILURE bool dumpDefaultGeometryToObj false if dumpDefaultGeometryToObj int nVerts int posVector . size for int i 0 i nVerts i float const p posVector i . p printf v f f f n , p 0 , p 1 , p 2 int const fVerts topFaceVerts 0 int nFaces int topVertsPerFace . size for int i 0 i nFaces i printf f for int j 0 j topVertsPerFace i j printf d , 1 fVerts printf n exit EXIT_SUCCESS return refiner Create a TopologyRefiner from a specified Obj file geometry created internally Far TopologyRefiner createTopologyRefinerFromObj std string const objFileName , Sdc SchemeType schemeType , PosVector posVector const char filename objFileName . c_str const Shape shape 0 std ifstream ifs filename if ifs std stringstream ss ss ifs . rdbuf ifs . close std string shapeString ss . str shape Shape parseObj shapeString . c_str , ConvertSdcTypeToShapeScheme schemeType , false if shape 0 fprintf stderr , Error Cannot create Shape from .obj file s n , filename return 0 else fprintf stderr , Error Cannot open .obj file s n , filename return 0 Sdc SchemeType sdcType GetSdcType shape Sdc Options sdcOptions GetSdcOptions shape Far TopologyRefiner refiner Far TopologyRefinerFactory Shape Create shape , Far TopologyRefinerFactory Shape Options sdcType , sdcOptions if refiner 0 fprintf stderr , Error Unable to construct TopologyRefiner from .obj file s n , filename return 0 int numVertices refiner - GetNumVerticesTotal posVector . resize numVertices std memcpy posVector 0 . p 0 , shape - verts 0 , numVertices 3 sizeof float delete shape return refiner end namespace The PatchGroup bundles objects used to create and evaluate a sparse set of patches. Its construction creates a PatchTable and all other objects necessary to evaluate patches associated with the specified subset of faces provided. A simple method to tessellate a specified face is provided. Note that, since the data buffers for the base level and refined levels are separate we want to avoid copying primvar data for the base level of a potentially large mesh, that patch evaluation needs to account for the separation when combining control points. struct PatchGroup PatchGroup Far PatchTableFactory Options patchOptions , Far TopologyRefiner const baseRefinerArg , Far PtexIndices const basePtexIndicesArg , std vector Pos const basePositionsArg , std vector Index const baseFacesArg PatchGroup void TessellateBaseFace int face , PosVector tessPoints , TriVector tessTris const Const reference members Far TopologyRefiner const baseRefiner Far PtexIndices const basePtexIndices std vector Pos const basePositions std vector Index const baseFaces Members constructed to evaluate patches Far PatchTable patchTable Far PatchMap patchMap int patchFaceSize std vector Pos localPositions PatchGroup PatchGroup Far PatchTableFactory Options patchOptions , Far TopologyRefiner const baseRefinerArg , Far PtexIndices const basePtexIndicesArg , std vector Pos const basePositionsArg , std vector Index const baseFacesArg baseRefiner baseRefinerArg , basePtexIndices basePtexIndicesArg , basePositions basePositionsArg , baseFaces baseFacesArg Create a local refiner sharing the base level, apply adaptive refinement to the given subset of base faces, and construct a patch table and its associated map for the same set of faces Far ConstIndexArray groupFaces baseFaces 0 , int baseFaces . size Far TopologyRefiner localRefiner Far TopologyRefinerFactory Far TopologyDescriptor Create baseRefiner localRefiner - RefineAdaptive patchOptions . GetRefineAdaptiveOptions , groupFaces patchTable Far PatchTableFactory Create localRefiner , patchOptions , groupFaces patchMap new Far PatchMap patchTable patchFaceSize Sdc SchemeTypeTraits GetRegularFaceSize baseRefiner . GetSchemeType Compute the number of refined and local points needed to evaluate the patches, allocate and interpolate. This varies from tutorial_5_1 in that the primvar buffer for the base vertices is separate from the refined vertices and local patch points which must also be accounted for when evaluating the patches. int nBaseVertices localRefiner - GetLevel 0 . GetNumVertices int nRefinedVertices localRefiner - GetNumVerticesTotal - nBaseVertices int nLocalPoints patchTable - GetNumLocalPoints localPositions . resize nRefinedVertices nLocalPoints if nRefinedVertices Far PrimvarRefiner primvarRefiner localRefiner Pos const src basePositions 0 Pos dst localPositions 0 for int level 1 level localRefiner - GetNumLevels level primvarRefiner . Interpolate level , src , dst src dst dst localRefiner - GetLevel level . GetNumVertices if nLocalPoints patchTable - GetLocalPointStencilTable - UpdateValues basePositions 0 , nBaseVertices , localPositions 0 , localPositions nRefinedVertices delete localRefiner PatchGroup PatchGroup delete patchTable delete patchMap void PatchGroup TessellateBaseFace int face , PosVector tessPoints , TriVector tessTris const Tesselate the face with points at the midpoint of the face and at each corner, and triangles connecting the midpoint to each edge. Irregular faces require an aribrary number of corners points, but all are at the origin of the child face of the irregular base face float const quadPoints 5 2 0.5f , 0.5f , 0.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 0.0f , 1.0f float const triPoints 4 2 0.5f , 0.5f , 0.0f , 0.0f , 1.0f , 0.0f , 0.0f , 1.0f float const irregPoints 4 2 1.0f , 1.0f , 0.0f , 0.0f Determine the topology of the given base face and the resulting tessellation points and faces to generate int baseFace baseFaces face int faceSize baseRefiner . GetLevel 0 . GetFaceVertices baseFace . size bool faceIsIrregular faceSize patchFaceSize int nTessPoints faceSize 1 int nTessFaces faceSize tessPoints . resize nTessPoints tessTris . resize nTessFaces Compute the mid and corner points -- remember that for an irregular face, we must reference the individual ptex faces for each corner int ptexFace basePtexIndices . GetFaceId baseFace int numBaseVerts int basePositions . size for int i 0 i nTessPoints i Choose the s,t coordinate from the fixed tessellation float const st faceIsIrregular irregPoints i 0 faceSize 4 quadPoints i triPoints i Locate the patch corresponding to the face ptex idx and s,t and evaluate int patchFace ptexFace if faceIsIrregular i 0 patchFace i - 1 Far PatchTable PatchHandle const handle patchMap - FindPatch patchFace , st 0 , st 1 assert handle float pWeights 20 patchTable - EvaluateBasis handle , st 0 , st 1 , pWeights Identify the patch cvs and combine with the evaluated weights -- remember to distinguish cvs in the base level Far ConstIndexArray cvIndices patchTable - GetPatchVertices handle Pos pos tessPoints i pos . Clear for int cv 0 cv cvIndices . size cv int cvIndex cvIndices cv if cvIndex numBaseVerts pos . AddWithWeight basePositions cvIndex , pWeights cv else pos . AddWithWeight localPositions cvIndex - numBaseVerts , pWeights cv Assign triangles connecting the midpoint of the base face to the points computed at the ends of each of its edges for int i 0 i nTessFaces i tessTris i Tri 0 , 1 i , 1 i 1 faceSize Command line arguments parsed to provide run-time options class Args public std string inputObjFile Sdc SchemeType schemeType int geoMultiplier int maxPatchDepth int numPatchGroups bool noTessFlag bool noOutputFlag public Args int argc , char argv inputObjFile , schemeType Sdc SCHEME_CATMARK , geoMultiplier 10 , maxPatchDepth 3 , numPatchGroups 10 , noTessFlag false , noOutputFlag false Parse and assign standard arguments and Obj files ArgOptions args args . Parse argc , argv maxPatchDepth args . GetLevel schemeType ConvertShapeSchemeToSdcType args . GetDefaultScheme const std vector const char objFiles args . GetObjFiles if objFiles . empty for size_t i 1 i objFiles . size i fprintf stderr , Warning .obj file s ignored n , objFiles i inputObjFile std string objFiles 0 Parse remaining arguments specific to this example const std vector const char rargs args . GetRemainingArgs for size_t i 0 i rargs . size i if strcmp rargs i , -groups if i rargs . size numPatchGroups atoi rargs i else if strcmp rargs i , -mult if i rargs . size geoMultiplier atoi rargs i else if strcmp rargs i , -notess noTessFlag true else if strcmp rargs i , -nooutput noOutputFlag true else fprintf stderr , Warning Argument s ignored n , rargs i private Args Load command line arguments and geometry, then divide the mesh into groups of faces from which to create and tessellate patches int main int argc , char argv Args args argc , argv Create or load the base geometry command line arguments allow a .obj file to be specified. In addition to the TopologyRefiner and set of positions for the base vertices, a set of PtexIndices is also required to evaluate patches, so build it here once for use elsewhere std vector Pos basePositions Far TopologyRefiner baseRefinerPtr args . inputObjFile . empty createTopologyRefinerDefault args . geoMultiplier , basePositions createTopologyRefinerFromObj args . inputObjFile , args . schemeType , basePositions assert baseRefinerPtr Far TopologyRefiner baseRefiner baseRefinerPtr Far PtexIndices basePtexIndices baseRefiner Determine the sizes of the patch groups specified -- there will be two sizes that differ by one to account for unequal division int numBaseFaces baseRefiner . GetNumFacesTotal int numPatchGroups args . numPatchGroups if numPatchGroups numBaseFaces numPatchGroups numBaseFaces else if numPatchGroups 1 numPatchGroups 1 int lesserGroupSize numBaseFaces numPatchGroups int numLargerGroups numBaseFaces - numPatchGroups lesserGroupSize Define the options used to construct the patches for each group. Unless suppressed, a tessellation in Obj format will also be printed to standard output, so keep track of the vertex indices. Far PatchTableFactory Options patchOptions args . maxPatchDepth patchOptions . generateVaryingTables false patchOptions . shareEndCapPatchPoints false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS int objVertCount 0 PosVector tessPoints TriVector tessFaces for int i 0 i numPatchGroups i Initialize a vector with a group of base faces from which to create and evaluate patches Index minFace i lesserGroupSize std min i , numLargerGroups Index maxFace minFace lesserGroupSize i numLargerGroups std vector Far Index baseFaces maxFace - minFace for int face minFace face maxFace face baseFaces face - minFace face Declare a PatchGroup and tessellate its base faces -- generating vertices and faces in Obj format to standard output PatchGroup patchGroup patchOptions , baseRefiner , basePtexIndices , basePositions , baseFaces if args . noTessFlag continue if args . noOutputFlag printf g patchGroup_d n , i for int j 0 j int baseFaces . size j patchGroup . TessellateBaseFace j , tessPoints , tessFaces if args . noOutputFlag int nVerts int tessPoints . size for int k 0 k nVerts k float const p tessPoints k . p printf v f f f n , p 0 , p 1 , p 2 int nTris int tessFaces . size int vBase 1 objVertCount for int k 0 k nTris k int const v tessFaces k . v printf f d d d n , vBase v 0 , vBase v 1 , vBase v 2 objVertCount nVerts delete baseRefinerPtr return EXIT_SUCCESS Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_5_2.cpp far_tutorial_5_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_2far_tutorial_5_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to manage the limit surface of a potentially large mesh by creating groups of patches for selected faces of the mesh. Familiarity with construction and evaluation of a PatchTable is assumed see tutorial_5_1. When the patches for a mesh do not need to be retained for further use, e.g. when simply computing points for a tessellation, the time and space required to construct a single large PatchTable can be considerable. By constructing, evaluating and discarding smaller PatchTables for subsets of the mesh, the high transient memory cost can be avoided when computed serially. When computed in parallel, there may be little memory savings, but the construction time can then be distributed. This tutorial creates simple geometry currently a lattice of cubes that can be expanded in complexity with a simple multiplier. The collection of faces are then divided into a specified number of groups from which patches will be constructed and evaluated. A simple tessellation a triangle fan around the midpoint of each face is then written in Obj format to the standard output. include ......regressioncommonarg_utils.h include ......regressioncommonfar_utils.h include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include opensubdivfarpatchTableFactory.h include opensubdivfarpatchMap.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include fstream include sstream using namespace OpenSubdiv using Far Index Global utilities in this namespace are not relevant to the tutorial. They simply serve to construct some default geometry to be processed in the form of a TopologyRefiner and vector of vertex positions. namespace Simple structs for x,y,z position and a 3-tuple for the set of vertices of a triangle struct Pos Pos Pos float x , float y , float z p 0 x , p 1 y , p 2 z Pos operator Pos const op const return Pos p 0 op . p 0 , p 1 op . p 1 , p 2 op . p 2 Clear and AddWithWeight required for interpolation void Clear void 0 p 0 p 1 p 2 0.0f void AddWithWeight Pos const src , float weight p 0 weight src . p 0 p 1 weight src . p 1 p 2 weight src . p 2 float p 3 typedef std vector Pos PosVector struct Tri Tri Tri int a , int b , int c v 0 a , v 1 b , v 2 c int v 3 typedef std vector Tri TriVector Functions to populate the topology and geometry arrays with simple shapes that we can multiply to increase complexity void appendDefaultPrimitive Pos const origin , std vector int vertsPerFace , std vector Index faceVerts , std vector Pos positionsPerVert Local topology and position of a cube centered at origin static float const cubePositions 8 3 -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f static int const cubeFaceVerts 6 4 0 , 3 , 2 , 1 , 4 , 5 , 6 , 7 , 0 , 4 , 7 , 3 , 1 , 2 , 6 , 5 , 0 , 1 , 5 , 4 , 3 , 7 , 6 , 2 Identify the next vertex before appending vertex positions int baseVertex int positionsPerVert . size for int i 0 i 8 i float const p cubePositions i positionsPerVert . push_back origin Pos p 0 , p 1 , p 2 Append number of verts-per-face and face-vertices for each face for int i 0 i 6 i vertsPerFace . push_back 4 for int j 0 j 4 j faceVerts . push_back baseVertex cubeFaceVerts i j void createDefaultGeometry int multiplier , std vector int vertsPerFace , std vector Index faceVerts , std vector Pos positionsPerVert Default primitive is currently a cube int const vertsPerPrimitive 8 int const facesPerPrimitive 6 int const faceVertsPerPrimitive 24 int nPrimitives multiplier multiplier multiplier positionsPerVert . reserve nPrimitives vertsPerPrimitive vertsPerFace . reserve nPrimitives facesPerPrimitive faceVerts . reserve nPrimitives faceVertsPerPrimitive for int x 0 x multiplier x for int y 0 y multiplier y for int z 0 z multiplier z appendDefaultPrimitive Pos float x 2.0f , float y 2.0f , float z 2.0f , vertsPerFace , faceVerts , positionsPerVert Create a TopologyRefiner from default geometry created above Far TopologyRefiner createTopologyRefinerDefault int multiplier , PosVector posVector std vector int topVertsPerFace std vector Index topFaceVerts createDefaultGeometry multiplier , topVertsPerFace , topFaceVerts , posVector typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_AND_CORNER Descriptor desc desc . numVertices int posVector . size desc . numFaces int topVertsPerFace . size desc . numVertsPerFace topVertsPerFace 0 desc . vertIndicesPerFace topFaceVerts 0 Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options if refiner 0 exit EXIT_FAILURE bool dumpDefaultGeometryToObj false if dumpDefaultGeometryToObj int nVerts int posVector . size for int i 0 i nVerts i float const p posVector i . p printf v f f f n , p 0 , p 1 , p 2 int const fVerts topFaceVerts 0 int nFaces int topVertsPerFace . size for int i 0 i nFaces i printf f for int j 0 j topVertsPerFace i j printf d , 1 fVerts printf n exit EXIT_SUCCESS return refiner Create a TopologyRefiner from a specified Obj file geometry created internally Far TopologyRefiner createTopologyRefinerFromObj std string const objFileName , Sdc SchemeType schemeType , PosVector posVector const char filename objFileName . c_str const Shape shape 0 std ifstream ifs filename if ifs std stringstream ss ss ifs . rdbuf ifs . close std string shapeString ss . str shape Shape parseObj shapeString . c_str , ConvertSdcTypeToShapeScheme schemeType , false if shape 0 fprintf stderr , Error Cannot create Shape from .obj file s n , filename return 0 else fprintf stderr , Error Cannot open .obj file s n , filename return 0 Sdc SchemeType sdcType GetSdcType shape Sdc Options sdcOptions GetSdcOptions shape Far TopologyRefiner refiner Far TopologyRefinerFactory Shape Create shape , Far TopologyRefinerFactory Shape Options sdcType , sdcOptions if refiner 0 fprintf stderr , Error Unable to construct TopologyRefiner from .obj file s n , filename return 0 int numVertices refiner - GetNumVerticesTotal posVector . resize numVertices std memcpy posVector 0 . p 0 , shape - verts 0 , numVertices 3 sizeof float delete shape return refiner end namespace The PatchGroup bundles objects used to create and evaluate a sparse set of patches. Its construction creates a PatchTable and all other objects necessary to evaluate patches associated with the specified subset of faces provided. A simple method to tessellate a specified face is provided. Note that, since the data buffers for the base level and refined levels are separate we want to avoid copying primvar data for the base level of a potentially large mesh, that patch evaluation needs to account for the separation when combining control points. struct PatchGroup PatchGroup Far PatchTableFactory Options patchOptions , Far TopologyRefiner const baseRefinerArg , Far PtexIndices const basePtexIndicesArg , std vector Pos const basePositionsArg , std vector Index const baseFacesArg PatchGroup void TessellateBaseFace int face , PosVector tessPoints , TriVector tessTris const Const reference members Far TopologyRefiner const baseRefiner Far PtexIndices const basePtexIndices std vector Pos const basePositions std vector Index const baseFaces Members constructed to evaluate patches Far PatchTable patchTable Far PatchMap patchMap int patchFaceSize std vector Pos localPositions PatchGroup PatchGroup Far PatchTableFactory Options patchOptions , Far TopologyRefiner const baseRefinerArg , Far PtexIndices const basePtexIndicesArg , std vector Pos const basePositionsArg , std vector Index const baseFacesArg baseRefiner baseRefinerArg , basePtexIndices basePtexIndicesArg , basePositions basePositionsArg , baseFaces baseFacesArg Create a local refiner sharing the base level, apply adaptive refinement to the given subset of base faces, and construct a patch table and its associated map for the same set of faces Far ConstIndexArray groupFaces baseFaces 0 , int baseFaces . size Far TopologyRefiner localRefiner Far TopologyRefinerFactory Far TopologyDescriptor Create baseRefiner localRefiner - RefineAdaptive patchOptions . GetRefineAdaptiveOptions , groupFaces patchTable Far PatchTableFactory Create localRefiner , patchOptions , groupFaces patchMap new Far PatchMap patchTable patchFaceSize Sdc SchemeTypeTraits GetRegularFaceSize baseRefiner . GetSchemeType Compute the number of refined and local points needed to evaluate the patches, allocate and interpolate. This varies from tutorial_5_1 in that the primvar buffer for the base vertices is separate from the refined vertices and local patch points which must also be accounted for when evaluating the patches. int nBaseVertices localRefiner - GetLevel 0 . GetNumVertices int nRefinedVertices localRefiner - GetNumVerticesTotal - nBaseVertices int nLocalPoints patchTable - GetNumLocalPoints localPositions . resize nRefinedVertices nLocalPoints if nRefinedVertices Far PrimvarRefiner primvarRefiner localRefiner Pos const src basePositions 0 Pos dst localPositions 0 for int level 1 level localRefiner - GetNumLevels level primvarRefiner . Interpolate level , src , dst src dst dst localRefiner - GetLevel level . GetNumVertices if nLocalPoints patchTable - GetLocalPointStencilTable - UpdateValues basePositions 0 , nBaseVertices , localPositions 0 , localPositions nRefinedVertices delete localRefiner PatchGroup PatchGroup delete patchTable delete patchMap void PatchGroup TessellateBaseFace int face , PosVector tessPoints , TriVector tessTris const Tesselate the face with points at the midpoint of the face and at each corner, and triangles connecting the midpoint to each edge. Irregular faces require an aribrary number of corners points, but all are at the origin of the child face of the irregular base face float const quadPoints 5 2 0.5f , 0.5f , 0.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 0.0f , 1.0f float const triPoints 4 2 0.5f , 0.5f , 0.0f , 0.0f , 1.0f , 0.0f , 0.0f , 1.0f float const irregPoints 4 2 1.0f , 1.0f , 0.0f , 0.0f Determine the topology of the given base face and the resulting tessellation points and faces to generate int baseFace baseFaces face int faceSize baseRefiner . GetLevel 0 . GetFaceVertices baseFace . size bool faceIsIrregular faceSize patchFaceSize int nTessPoints faceSize 1 int nTessFaces faceSize tessPoints . resize nTessPoints tessTris . resize nTessFaces Compute the mid and corner points -- remember that for an irregular face, we must reference the individual ptex faces for each corner int ptexFace basePtexIndices . GetFaceId baseFace int numBaseVerts int basePositions . size for int i 0 i nTessPoints i Choose the s,t coordinate from the fixed tessellation float const st faceIsIrregular irregPoints i 0 faceSize 4 quadPoints i triPoints i Locate the patch corresponding to the face ptex idx and s,t and evaluate int patchFace ptexFace if faceIsIrregular i 0 patchFace i - 1 Far PatchTable PatchHandle const handle patchMap - FindPatch patchFace , st 0 , st 1 assert handle float pWeights 20 patchTable - EvaluateBasis handle , st 0 , st 1 , pWeights Identify the patch cvs and combine with the evaluated weights -- remember to distinguish cvs in the base level Far ConstIndexArray cvIndices patchTable - GetPatchVertices handle Pos pos tessPoints i pos . Clear for int cv 0 cv cvIndices . size cv int cvIndex cvIndices cv if cvIndex numBaseVerts pos . AddWithWeight basePositions cvIndex , pWeights cv else pos . AddWithWeight localPositions cvIndex - numBaseVerts , pWeights cv Assign triangles connecting the midpoint of the base face to the points computed at the ends of each of its edges for int i 0 i nTessFaces i tessTris i Tri 0 , 1 i , 1 i 1 faceSize Command line arguments parsed to provide run-time options class Args public std string inputObjFile Sdc SchemeType schemeType int geoMultiplier int maxPatchDepth int numPatchGroups bool noTessFlag bool noOutputFlag public Args int argc , char argv inputObjFile , schemeType Sdc SCHEME_CATMARK , geoMultiplier 10 , maxPatchDepth 3 , numPatchGroups 10 , noTessFlag false , noOutputFlag false Parse and assign standard arguments and Obj files ArgOptions args args . Parse argc , argv maxPatchDepth args . GetLevel schemeType ConvertShapeSchemeToSdcType args . GetDefaultScheme const std vector const char objFiles args . GetObjFiles if objFiles . empty for size_t i 1 i objFiles . size i fprintf stderr , Warning .obj file s ignored n , objFiles i inputObjFile std string objFiles 0 Parse remaining arguments specific to this example const std vector const char rargs args . GetRemainingArgs for size_t i 0 i rargs . size i if strcmp rargs i , -groups if i rargs . size numPatchGroups atoi rargs i else if strcmp rargs i , -mult if i rargs . size geoMultiplier atoi rargs i else if strcmp rargs i , -notess noTessFlag true else if strcmp rargs i , -nooutput noOutputFlag true else fprintf stderr , Warning Argument s ignored n , rargs i private Args Load command line arguments and geometry, then divide the mesh into groups of faces from which to create and tessellate patches int main int argc , char argv Args args argc , argv Create or load the base geometry command line arguments allow a .obj file to be specified. In addition to the TopologyRefiner and set of positions for the base vertices, a set of PtexIndices is also required to evaluate patches, so build it here once for use elsewhere std vector Pos basePositions Far TopologyRefiner baseRefinerPtr args . inputObjFile . empty createTopologyRefinerDefault args . geoMultiplier , basePositions createTopologyRefinerFromObj args . inputObjFile , args . schemeType , basePositions assert baseRefinerPtr Far TopologyRefiner baseRefiner baseRefinerPtr Far PtexIndices basePtexIndices baseRefiner Determine the sizes of the patch groups specified -- there will be two sizes that differ by one to account for unequal division int numBaseFaces baseRefiner . GetNumFacesTotal int numPatchGroups args . numPatchGroups if numPatchGroups numBaseFaces numPatchGroups numBaseFaces else if numPatchGroups 1 numPatchGroups 1 int lesserGroupSize numBaseFaces numPatchGroups int numLargerGroups numBaseFaces - numPatchGroups lesserGroupSize Define the options used to construct the patches for each group. Unless suppressed, a tessellation in Obj format will also be printed to standard output, so keep track of the vertex indices. Far PatchTableFactory Options patchOptions args . maxPatchDepth patchOptions . generateVaryingTables false patchOptions . shareEndCapPatchPoints false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS int objVertCount 0 PosVector tessPoints TriVector tessFaces for int i 0 i numPatchGroups i Initialize a vector with a group of base faces from which to create and evaluate patches Index minFace i lesserGroupSize std min i , numLargerGroups Index maxFace minFace lesserGroupSize i numLargerGroups std vector Far Index baseFaces maxFace - minFace for int face minFace face maxFace face baseFaces face - minFace face Declare a PatchGroup and tessellate its base faces -- generating vertices and faces in Obj format to standard output PatchGroup patchGroup patchOptions , baseRefiner , basePtexIndices , basePositions , baseFaces if args . noTessFlag continue if args . noOutputFlag printf g patchGroup_d n , i for int j 0 j int baseFaces . size j patchGroup . TessellateBaseFace j , tessPoints , tessFaces if args . noOutputFlag int nVerts int tessPoints . size for int k 0 k nVerts k float const p tessPoints k . p printf v f f f n , p 0 , p 1 , p 2 int nTris int tessFaces . size int vBase 1 objVertCount for int k 0 k nTris k int const v tessFaces k . v printf f d d d n , vBase v 0 , vBase v 1 , vBase v 2 objVertCount nVerts delete baseRefinerPtr return EXIT_SUCCESS Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_5_2.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "bfr_tutorial_1_1.cpp", │ │ │ │ │ - "text": "bfr_tutorial_1_1.cpp bfr_tutorial_1_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_1bfr_tutorial_1_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates the use of the SurfaceFactory, Surface and Parameterization classes for creating and evaluating the limit surface associated with each base face of a mesh. Following the creation of a connected mesh for a shape using a FarTopologyRefiner, as illustrated in Far tutorials, an instance of a SurfaceFactory is declared to process its faces. Each face of the mesh is evaluated and tessellated independently with a simple triangle fan, with results written out in Obj format for inspection. These classes make it simple to evaluate and tessellate all faces quads, tris or others while supporting the full set of subdivision options. While a triangle fan may be a trivial tessellation and so not very useful later examples using the Tessellation class provide more useful results with the same simplicity. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outTriangles Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Get the Parameterization of the Surface and use it to identify coordinates for evaluation -- in this case, at the vertices and center of the face to create a fan of triangles Bfr Parameterization faceParam faceSurface . GetParameterization int faceSize faceParam . GetFaceSize int numOutCoords faceSize 1 outCoords . resize numOutCoords 2 for int i 0 i faceSize i faceParam . GetVertexCoord i , outCoords i 2 faceParam . GetCenterCoord outCoords faceSize 2 Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the tessellation, i.e. the triangle fan connecting points at the vertices to the center last point Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. int objVertexIndexOffset objWriter . GetNumVertices outTriangles . resize faceSize 3 int outTriangle outTriangles . data for int i 0 i faceSize i , outTriangle 3 outTriangle 0 objVertexIndexOffset i outTriangle 1 objVertexIndexOffset i 1 faceSize outTriangle 2 objVertexIndexOffset faceSize Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outTriangles , 3 , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "bfr_tutorial_1_3.cpp", │ │ │ │ │ + "text": "bfr_tutorial_1_3.cpp bfr_tutorial_1_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_3bfr_tutorial_1_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory, Surface and Tessellation classes for evaluating and tessellating the limit surface of faces of a mesh by adding support for the evaluation of face-varying UVs. If UVs exist in the given mesh, they will be evaluated and included with the vertex positions and normals previously illustrated as part of the tessellation written to the Obj file. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag bool uv2xyzFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false , uv2xyzFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else if strcmp argv i , -uv2xyz uv2xyzFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , std vector float const meshFaceVaryingUVs , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing When dealing with face-varying data, an identifier is necessary when constructing Surfaces in order to distinguish the different face-varying data channels. To avoid repeatedly specifying that identifier when only one is present or of interest, it can be specified via the Options. bool meshHasUVs meshTopology . GetNumFVarChannels 0 SurfaceFactory Options surfaceOptions if meshHasUVs surfaceOptions . SetDefaultFVarID 0 SurfaceFactory surfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface posSurface Surface uvSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector float outUV std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces surfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surfaces for position and UVs of this face. There are two ways to do this -- both illustrated here Creating Surfaces for the different data interpolation types independently is clear and convenient, but considerable work may be duplicated in the construction process in the case of non-linear face-varying Surfaces. So unless it is known that face-varying interpolation is linear, use of InitSurfaces is generally preferred. Remember also that the face-varying identifier is omitted from the initialization methods here as it was previously assigned to the SurfaceFactoryOptions. In the absence of an assignment of the default FVarID to the Options, a failure to specify the FVarID here will result in failure. The cases below are expanded for illustration purposes, and validity of the resulting Surface is tested here, rather than the return value of initialization methods. bool createSurfacesTogether true if meshHasUVs surfaceFactory . InitVertexSurface faceIndex , posSurface else if createSurfacesTogether surfaceFactory . InitSurfaces faceIndex , posSurface , uvSurface else if surfaceFactory . InitVertexSurface faceIndex , posSurface surfaceFactory . InitFaceVaryingSurface faceIndex , uvSurface if posSurface . IsValid continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern posSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Evaluate vertex positions Resize patch point and output arrays int pointSize 3 facePatchPoints . resize posSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays posSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize posSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Evaluate face-varying UVs when present if meshHasUVs Resize patch point and output arrays - note reuse of the same patch point array as position int pointSize 2 facePatchPoints . resize uvSurface . GetNumPatchPoints pointSize outUV . resize numOutCoords pointSize Populate patch point and output arrays uvSurface . PreparePatchPoints meshFaceVaryingUVs . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize uvSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outUV j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex if meshHasUVs options . uv2xyzFlag objWriter . WriteVertexPositions outUV , 2 objWriter . WriteFaces outFacets , tessFacetSize , false , false else objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv if meshHasUVs objWriter . WriteVertexUVs outUV objWriter . WriteFaces outFacets , tessFacetSize , true , meshHasUVs Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , meshFVarUVs , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "bfr_tutorial_1_1.html" │ │ │ │ │ + "loc": "bfr_tutorial_1_3.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_5_1.cpp", │ │ │ │ │ - "text": "far_tutorial_5_1.cpp far_tutorial_5_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_1far_tutorial_5_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to interpolate surface limits at arbitrary parametric locations using feature adaptive FarPatchTables. The evaluation of the limit surface at arbitrary locations requires the adaptive isolation of topological features. This process converts the input polygonal control cage into a collection of bi-cubic patches. We can then evaluate the patches at random parametric locations and obtain analytical positions and tangents on the limit surface. The results are dumped into a MEL script that draws streak particle systems that show the tangent and bi-tangent at the random samples locations. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include opensubdivfarpatchTableFactory.h include opensubdivfarpatchMap.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include cfloat using namespace OpenSubdiv typedef double Real pyramid geometry from catmark_pyramid_crease0.h static int const g_nverts 5 static Real const g_verts 24 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f , static int const g_vertsperface 5 3 , 3 , 3 , 3 , 4 static int const g_nfaces 5 static int const g_faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 static int const g_ncreases 4 static int const g_creaseverts 8 4 , 3 , 3 , 2 , 2 , 1 , 1 , 4 static float const g_creaseweights 4 3.0f , 3.0f , 3.0f , 3.0f Creates a FarTopologyRefiner from the pyramid shape above static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex void Clear void 0 point 0 point 1 point 2 0.0f void AddWithWeight Vertex const src , Real weight point 0 weight src . point 0 point 1 weight src . point 1 point 2 weight src . point 2 Real point 3 ------------------------------------------------------------------------------ Limit frame container implementation -- this interface is not strictly required but follows a similar pattern to Vertex. struct LimitFrame void Clear void 0 point 0 point 1 point 2 0.0f deriv1 0 deriv1 1 deriv1 2 0.0f deriv2 0 deriv2 1 deriv2 2 0.0f void AddWithWeight Vertex const src , Real weight , Real d1Weight , Real d2Weight point 0 weight src . point 0 point 1 weight src . point 1 point 2 weight src . point 2 deriv1 0 d1Weight src . point 0 deriv1 1 d1Weight src . point 1 deriv1 2 d1Weight src . point 2 deriv2 0 d2Weight src . point 0 deriv2 1 d2Weight src . point 1 deriv2 2 d2Weight src . point 2 Real point 3 , deriv1 3 , deriv2 3 ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Patches are constructed from adaptively refined faces, but the processes of constructing the PatchTable and of applying adaptive refinement have historically been separate. Adaptive refinement is applied purely to satisfy the needs of the desired PatchTable, so options associated with adaptive refinement should be derived from those specified for the PatchTable. This is not a strict requirement, but it will avoid problems arising from specifyingcoordinating the two independently especially when dealing with face-varying patches. Initialize options for the PatchTable Choose patches adaptively refined to level 3 since the sharpest crease in the shape is 3.0f in g_creaseweights, and include the inf-sharp crease option just to illustrate the need to syncronize options. int maxPatchLevel 3 Far PatchTableFactory Options patchOptions maxPatchLevel patchOptions . SetPatchPrecision Real patchOptions . useInfSharpPatch true patchOptions . generateVaryingTables false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS Initialize corresonding options for adaptive refinement Far TopologyRefiner AdaptiveOptions adaptiveOptions maxPatchLevel bool assignAdaptiveOptionsExplicitly false if assignAdaptiveOptionsExplicitly adaptiveOptions . useInfSharpPatch true else Be sure patch options were intialized with the desired max level adaptiveOptions patchOptions . GetRefineAdaptiveOptions assert adaptiveOptions . useInfSharpPatch patchOptions . useInfSharpPatch Apply adaptive refinement and construct the associated PatchTable to evaluate the limit surface refiner - RefineAdaptive adaptiveOptions Far PatchTable const patchTable Far PatchTableFactory Create refiner , patchOptions Compute the total number of points we need to evaluate the PatchTable. Approximations at irregular or extraordinary features require the use of additional points associated with the patches that are referred to as local points i.e. local to the PatchTable. int nRefinerVertices refiner - GetNumVerticesTotal int nLocalPoints patchTable - GetNumLocalPoints Create a buffer to hold the position of the refined verts and local points, then copy the coarse positions at the beginning. std vector Vertex verts nRefinerVertices nLocalPoints std memcpy verts 0 , g_verts , g_nverts 3 sizeof Real Adaptive refinement may result in fewer levels than the max specified. int nRefinedLevels refiner - GetNumLevels Interpolate vertex primvar data they are the control vertices of the limit patches see tutorial_1_1 for details Far PrimvarRefinerReal Real primvarRefiner refiner Vertex src verts 0 for int level 1 level nRefinedLevels level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Evaluate local points from interpolated vertex primvars. if nLocalPoints patchTable - GetLocalPointStencilTable Real - UpdateValues verts 0 , verts nRefinerVertices Create a FarPatchMap to help locating patches in the table Far PatchMap patchmap patchTable Create a FarPtexIndices to help find indices of ptex faces. Far PtexIndices ptexIndices refiner Generate random samples on each ptex face int nsamplesPerFace 200 , nfaces ptexIndices . GetNumFaces std vector LimitFrame samples nsamplesPerFace nfaces srand static_cast int 2147483647 Real pWeights 20 , dsWeights 20 , dtWeights 20 for int face 0 , count 0 face nfaces face for int sample 0 sample nsamplesPerFace sample , count Real s Real rand Real RAND_MAX , t Real rand Real RAND_MAX Locate the patch corresponding to the face ptex idx and s,t Far PatchTable PatchHandle const handle patchmap . FindPatch face , s , t assert handle Evaluate the patch weights, identify the CVs and compute the limit frame patchTable - EvaluateBasis handle , s , t , pWeights , dsWeights , dtWeights Far ConstIndexArray cvs patchTable - GetPatchVertices handle LimitFrame dst samples count dst . Clear for int cv 0 cv cvs . size cv dst . AddWithWeight verts cvs cv , pWeights cv , dsWeights cv , dtWeights cv Visualization with Maya print a MEL script that generates particles at the location of the limit vertices int nsamples int samples . size printf file -f -new n Output particle positions for the tangent printf particle -n deriv1 for int sample 0 sample nsamples sample Real const pos samples sample . point printf -p f f f n , pos 0 , pos 1 , pos 2 printf n Set per-particle direction using the limit tangent display as Streak printf setAttr deriv1.particleRenderType 6 n printf setAttr deriv1.velocity -type vectorArray d , nsamples for int sample 0 sample nsamples sample Real const tan1 samples sample . deriv1 printf f f f n , tan1 0 , tan1 1 , tan1 2 printf n Output particle positions for the bi-tangent printf particle -n deriv2 for int sample 0 sample nsamples sample Real const pos samples sample . point printf -p f f f n , pos 0 , pos 1 , pos 2 printf n printf setAttr deriv2.particleRenderType 6 n printf setAttr deriv2.velocity -type vectorArray d , nsamples for int sample 0 sample nsamples sample Real const tan2 samples sample . deriv2 printf f f f n , tan2 0 , tan2 1 , tan2 2 printf n Exercise to the reader cross tangent bi-tangent for limit surface normal... Force Maya DAG update to see the result in the viewport printf currentTime -edit currentTime -q n printf select deriv1Shape deriv2Shape n delete refiner delete patchTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_faceverts desc . numCreases g_ncreases desc . creaseVertexIndexPairs g_creaseverts desc . creaseWeights g_creaseweights Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_5_1.cpp far_tutorial_5_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_1far_tutorial_5_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to interpolate surface limits at arbitrary parametric locations using feature adaptive FarPatchTables. The evaluation of the limit surface at arbitrary locations requires the adaptive isolation of topological features. This process converts the input polygonal control cage into a collection of bi-cubic patches. We can then evaluate the patches at random parametric locations and obtain analytical positions and tangents on the limit surface. The results are dumped into a MEL script that draws streak particle systems that show the tangent and bi-tangent at the random samples locations. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include opensubdivfarpatchTableFactory.h include opensubdivfarpatchMap.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include cfloat using namespace OpenSubdiv typedef double Real pyramid geometry from catmark_pyramid_crease0.h static int const g_nverts 5 static Real const g_verts 24 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f , static int const g_vertsperface 5 3 , 3 , 3 , 3 , 4 static int const g_nfaces 5 static int const g_faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 static int const g_ncreases 4 static int const g_creaseverts 8 4 , 3 , 3 , 2 , 2 , 1 , 1 , 4 static float const g_creaseweights 4 3.0f , 3.0f , 3.0f , 3.0f Creates a FarTopologyRefiner from the pyramid shape above static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex void Clear void 0 point 0 point 1 point 2 0.0f void AddWithWeight Vertex const src , Real weight point 0 weight src . point 0 point 1 weight src . point 1 point 2 weight src . point 2 Real point 3 ------------------------------------------------------------------------------ Limit frame container implementation -- this interface is not strictly required but follows a similar pattern to Vertex. struct LimitFrame void Clear void 0 point 0 point 1 point 2 0.0f deriv1 0 deriv1 1 deriv1 2 0.0f deriv2 0 deriv2 1 deriv2 2 0.0f void AddWithWeight Vertex const src , Real weight , Real d1Weight , Real d2Weight point 0 weight src . point 0 point 1 weight src . point 1 point 2 weight src . point 2 deriv1 0 d1Weight src . point 0 deriv1 1 d1Weight src . point 1 deriv1 2 d1Weight src . point 2 deriv2 0 d2Weight src . point 0 deriv2 1 d2Weight src . point 1 deriv2 2 d2Weight src . point 2 Real point 3 , deriv1 3 , deriv2 3 ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Patches are constructed from adaptively refined faces, but the processes of constructing the PatchTable and of applying adaptive refinement have historically been separate. Adaptive refinement is applied purely to satisfy the needs of the desired PatchTable, so options associated with adaptive refinement should be derived from those specified for the PatchTable. This is not a strict requirement, but it will avoid problems arising from specifyingcoordinating the two independently especially when dealing with face-varying patches. Initialize options for the PatchTable Choose patches adaptively refined to level 3 since the sharpest crease in the shape is 3.0f in g_creaseweights, and include the inf-sharp crease option just to illustrate the need to syncronize options. int maxPatchLevel 3 Far PatchTableFactory Options patchOptions maxPatchLevel patchOptions . SetPatchPrecision Real patchOptions . useInfSharpPatch true patchOptions . generateVaryingTables false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS Initialize corresonding options for adaptive refinement Far TopologyRefiner AdaptiveOptions adaptiveOptions maxPatchLevel bool assignAdaptiveOptionsExplicitly false if assignAdaptiveOptionsExplicitly adaptiveOptions . useInfSharpPatch true else Be sure patch options were intialized with the desired max level adaptiveOptions patchOptions . GetRefineAdaptiveOptions assert adaptiveOptions . useInfSharpPatch patchOptions . useInfSharpPatch Apply adaptive refinement and construct the associated PatchTable to evaluate the limit surface refiner - RefineAdaptive adaptiveOptions Far PatchTable const patchTable Far PatchTableFactory Create refiner , patchOptions Compute the total number of points we need to evaluate the PatchTable. Approximations at irregular or extraordinary features require the use of additional points associated with the patches that are referred to as local points i.e. local to the PatchTable. int nRefinerVertices refiner - GetNumVerticesTotal int nLocalPoints patchTable - GetNumLocalPoints Create a buffer to hold the position of the refined verts and local points, then copy the coarse positions at the beginning. std vector Vertex verts nRefinerVertices nLocalPoints std memcpy verts 0 , g_verts , g_nverts 3 sizeof Real Adaptive refinement may result in fewer levels than the max specified. int nRefinedLevels refiner - GetNumLevels Interpolate vertex primvar data they are the control vertices of the limit patches see tutorial_1_1 for details Far PrimvarRefinerReal Real primvarRefiner refiner Vertex src verts 0 for int level 1 level nRefinedLevels level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Evaluate local points from interpolated vertex primvars. if nLocalPoints patchTable - GetLocalPointStencilTable Real - UpdateValues verts 0 , verts nRefinerVertices Create a FarPatchMap to help locating patches in the table Far PatchMap patchmap patchTable Create a FarPtexIndices to help find indices of ptex faces. Far PtexIndices ptexIndices refiner Generate random samples on each ptex face int nsamplesPerFace 200 , nfaces ptexIndices . GetNumFaces std vector LimitFrame samples nsamplesPerFace nfaces srand static_cast int 2147483647 Real pWeights 20 , dsWeights 20 , dtWeights 20 for int face 0 , count 0 face nfaces face for int sample 0 sample nsamplesPerFace sample , count Real s Real rand Real RAND_MAX , t Real rand Real RAND_MAX Locate the patch corresponding to the face ptex idx and s,t Far PatchTable PatchHandle const handle patchmap . FindPatch face , s , t assert handle Evaluate the patch weights, identify the CVs and compute the limit frame patchTable - EvaluateBasis handle , s , t , pWeights , dsWeights , dtWeights Far ConstIndexArray cvs patchTable - GetPatchVertices handle LimitFrame dst samples count dst . Clear for int cv 0 cv cvs . size cv dst . AddWithWeight verts cvs cv , pWeights cv , dsWeights cv , dtWeights cv Visualization with Maya print a MEL script that generates particles at the location of the limit vertices int nsamples int samples . size printf file -f -new n Output particle positions for the tangent printf particle -n deriv1 for int sample 0 sample nsamples sample Real const pos samples sample . point printf -p f f f n , pos 0 , pos 1 , pos 2 printf n Set per-particle direction using the limit tangent display as Streak printf setAttr deriv1.particleRenderType 6 n printf setAttr deriv1.velocity -type vectorArray d , nsamples for int sample 0 sample nsamples sample Real const tan1 samples sample . deriv1 printf f f f n , tan1 0 , tan1 1 , tan1 2 printf n Output particle positions for the bi-tangent printf particle -n deriv2 for int sample 0 sample nsamples sample Real const pos samples sample . point printf -p f f f n , pos 0 , pos 1 , pos 2 printf n printf setAttr deriv2.particleRenderType 6 n printf setAttr deriv2.velocity -type vectorArray d , nsamples for int sample 0 sample nsamples sample Real const tan2 samples sample . deriv2 printf f f f n , tan2 0 , tan2 1 , tan2 2 printf n Exercise to the reader cross tangent bi-tangent for limit surface normal... Force Maya DAG update to see the result in the viewport printf currentTime -edit currentTime -q n printf select deriv1Shape deriv2Shape n delete refiner delete patchTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_faceverts desc . numCreases g_ncreases desc . creaseVertexIndexPairs g_creaseverts desc . creaseWeights g_creaseweights Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_5_1.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "far_tutorial_3_1.cpp", │ │ │ │ │ - "text": "far_tutorial_3_1.cpp far_tutorial_3_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_3_1far_tutorial_3_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to interface a high-level topology representation with Far for better efficiency. In tutorial 0, we showed how to instantiate topology from a simple face-vertex list. Here we will show how to take advantage of more complex data structures. Many client applications that manipulate geometry use advanced data structures such as half-edge, quad-edge or winged-edge in order to represent complex topological relationships beyond the usual face-vertex lists. We can take advantage of this information. Far provides an advanced interface that allows such a client application to communicate advanced component relationships directly and avoid having Far rebuilding them redundantly. include opensubdivfartopologyRefinerFactory.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ using namespace OpenSubdiv ------------------------------------------------------------------------------ For this tutorial, we provide the complete topological representation of a simple pyramid. In our case, we store it as a simple sequence of integers, with the understanding that client-code would provide a fully implemented data-structure such as quad-edges or winged-edges. Pyramid geometry from catmark_pyramid.h - extended for this tutorial static int g_nverts 5 , g_nedges 8 , g_nfaces 5 vertex positions static float g_verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f number of vertices in each face static int g_facenverts 5 3 , 3 , 3 , 3 , 4 index of face vertices static int g_faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 index of edge vertices 2 per edge static int g_edgeverts 16 0 , 1 , 1 , 2 , 2 , 0 , 2 , 3 , 3 , 0 , 3 , 4 , 4 , 0 , 4 , 1 index of face edges static int g_faceedges 16 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 6 , 6 , 7 , 0 , 5 , 3 , 1 , 7 number of faces adjacent to each edge static int g_edgenfaces 8 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 index of faces incident to a given edge static int g_edgefaces 16 0 , 3 , 0 , 4 , 0 , 1 , 1 , 4 , 1 , 2 , 2 , 4 , 2 , 3 , 3 , 4 number of faces incident to each vertex static int g_vertexnfaces 5 4 , 3 , 3 , 3 , 3 index of faces incident to each vertex static int g_vertexfaces 25 0 , 1 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 1 , 4 , 2 , 2 , 4 , 3 number of edges incident to each vertex static int g_vertexnedges 5 4 , 3 , 3 , 3 , 3 index of edges incident to each vertex static int g_vertexedges 25 0 , 2 , 4 , 6 , 1 , 0 , 7 , 2 , 1 , 3 , 4 , 3 , 5 , 6 , 5 , 7 Edge crease sharpness static float g_edgeCreases 8 0.0f , 2.5f , 0.0f , 2.5f , 0.0f , 2.5f , 0.0f , 2.5f ------------------------------------------------------------------------------ Because existing client-code may not provide an exact match for the topological queries required by Fars interface, we can provide a converter class. This can be particularly useful for instance if the client data-structure requires additional relationships to be mapped. For instance, half-edge representations do not store unique edge indices and it can be difficult to traverse edges or faces adjacent to a given vertex. Using an intermediate wrapper class allows us to leverage existing relationships information from a mesh, and generate the missing components temporarily. For a practical example, you can look at the file hbr_to_vtr.h in the same tutorial directory. This example implements a OsdHbrConverter class as a way of interfacing PRmans half-edge representation to Far. struct Converter public Sdc SchemeType GetType const return Sdc SCHEME_CATMARK Sdc Options GetOptions const Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY return options int GetNumFaces const return g_nfaces int GetNumEdges const return g_nedges int GetNumVertices const return g_nverts Face relationships int GetNumFaceVerts int face const return g_facenverts face int const GetFaceVerts int face const return g_faceverts getCompOffset g_facenverts , face int const GetFaceEdges int face const return g_faceedges getCompOffset g_facenverts , face Edge relationships int const GetEdgeVertices int edge const return g_edgeverts edge 2 int GetNumEdgeFaces int edge const return g_edgenfaces edge int const GetEdgeFaces int edge const return g_edgefaces getCompOffset g_edgenfaces , edge Vertex relationships int GetNumVertexEdges int vert const return g_vertexnedges vert int const GetVertexEdges int vert const return g_vertexedges getCompOffset g_vertexnedges , vert int GetNumVertexFaces int vert const return g_vertexnfaces vert int const GetVertexFaces int vert const return g_vertexfaces getCompOffset g_vertexnfaces , vert private int getCompOffset int const comps , int comp const int ofs 0 for int i 0 i comp i ofs comps i return ofs ------------------------------------------------------------------------------ namespace OpenSubdiv namespace OPENSUBDIV_VERSION namespace Far template bool TopologyRefinerFactory Converter resizeComponentTopology TopologyRefiner refiner , Converter const conv Faces and face-verts int nfaces conv . GetNumFaces setNumBaseFaces refiner , nfaces for int face 0 face nfaces face int nv conv . GetNumFaceVerts face setNumBaseFaceVertices refiner , face , nv Edges and edge-faces int nedges conv . GetNumEdges setNumBaseEdges refiner , nedges for int edge 0 edge nedges edge int nf conv . GetNumEdgeFaces edge setNumBaseEdgeFaces refiner , edge , nf Vertices and vert-faces and vert-edges int nverts conv . GetNumVertices setNumBaseVertices refiner , nverts for int vert 0 vert nverts vert int ne conv . GetNumVertexEdges vert , nf conv . GetNumVertexFaces vert setNumBaseVertexEdges refiner , vert , ne setNumBaseVertexFaces refiner , vert , nf return true template bool TopologyRefinerFactory Converter assignComponentTopology TopologyRefiner refiner , Converter const conv using Far IndexArray Face relations int nfaces conv . GetNumFaces for int face 0 face nfaces face IndexArray dstFaceVerts getBaseFaceVertices refiner , face IndexArray dstFaceEdges getBaseFaceEdges refiner , face int const faceverts conv . GetFaceVerts face int const faceedges conv . GetFaceEdges face for int vert 0 vert conv . GetNumFaceVerts face vert dstFaceVerts vert faceverts vert dstFaceEdges vert faceedges vert Edge relations Note if your representation is unable to provide edge relationships ex half-edges, you can comment out this section and Far will automatically generate the missing information. int nedges conv . GetNumEdges for int edge 0 edge nedges edge Edge-vertices IndexArray dstEdgeVerts getBaseEdgeVertices refiner , edge dstEdgeVerts 0 conv . GetEdgeVertices edge 0 dstEdgeVerts 1 conv . GetEdgeVertices edge 1 Edge-faces IndexArray dstEdgeFaces getBaseEdgeFaces refiner , edge for int face 0 face conv . GetNumEdgeFaces face face dstEdgeFaces face conv . GetEdgeFaces edge face Vertex relations int nverts conv . GetNumVertices for int vert 0 vert nverts vert Vert-Faces IndexArray vertFaces getBaseVertexFaces refiner , vert LocalIndexArray vertInFaceIndices getBaseVertexFaceLocalIndicesrefiner, vert for int face 0 face conv . GetNumVertexFaces vert face vertFaces face conv . GetVertexFaces vert face Vert-Edges IndexArray vertEdges getBaseVertexEdges refiner , vert LocalIndexArray vertInEdgeIndices getBaseVertexEdgeLocalIndicesrefiner, vert for int edge 0 edge conv . GetNumVertexEdges vert edge vertEdges edge conv . GetVertexEdges vert edge populateBaseLocalIndices refiner return true template bool TopologyRefinerFactory Converter assignComponentTags TopologyRefiner refiner , Converter const conv arbitrarily sharpen the 4 bottom edges of the pyramid to 2.5f for int edge 0 edge conv . GetNumEdges edge setBaseEdgeSharpness refiner , edge , g_edgeCreases edge return true ifdef _MSC_VER template void TopologyRefinerFactory Converter reportInvalidTopology TopologyError errCode , char const msg , Converter const mesh Optional topology validation error reporting This method is called whenever the factory encounters topology validation errors. By default, nothing is reported Warning msg template bool TopologyRefinerFactory Converter assignFaceVaryingTopology TopologyRefiner refiner , Converter const conv Because of the way MSVC specializes templated functions, we had to remove the default stubs in FarTopologyRefinerFactory. In this example, no face-varying data is being added, but we still need to implement a template specialization or MSVC linker fails. return true endif namespace Far namespace OPENSUBDIV_VERSION namespace OpenSubdiv ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ int main int , char Converter conv Far TopologyRefiner refiner Far TopologyRefinerFactory Converter Create conv , Far TopologyRefinerFactory Converter Options conv . GetType , conv . GetOptions int maxlevel 5 Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate a buffer for vertex primvar data. The buffer length is set to be the sum of all children vertices up to the highest level of refinement. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 Initialize coarse mesh positions int nCoarseVerts g_nverts for int i 0 i nCoarseVerts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Vertex src verts for int level 1 level maxlevel level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert 1 OBJ uses 1-based arrays... printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "far_tutorial_5_3.cpp", │ │ │ │ │ + "text": "far_tutorial_5_3.cpp far_tutorial_5_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_5_3far_tutorial_5_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to use a FarLimitStenciTable to repeatedly and efficiently evaluate a set of points and optionally derivatives on the limit surface. A LimitStencilTable derives from StencilTable but is specialized to factor the evaluation of limit positions and derivatives into stencils. This allows a set of limit properties to be efficiently recomputed in response to changes to the vertices of the base mesh. Constructing the different kinds of StencilTables can have a high cost, so whether that cost is worth it will depend on your usage e.g. if points are only computed once, using stencil tables is typically not worth the added cost. Any points on the limit surface can be identified for evaluation. In this example we create a crude tessellation similar to tutorial_5_2. The midpoint of each face and points near the corners of the face are evaluated and a triangle fan connects them. include ......regressioncommonarg_utils.h include ......regressioncommonfar_utils.h include opensubdivfartopologyDescriptor.h include opensubdivfarpatchTableFactory.h include opensubdivfarstencilTableFactory.h include opensubdivfarptexIndices.h include cassert include cstdio include cstring include fstream include sstream using namespace OpenSubdiv using Far Index Global utilities in this namespace are not relevant to the tutorial. They simply serve to construct some default geometry to be processed in the form of a TopologyRefiner and vector of vertex positions. namespace Simple structs for x,y,z position and a 3-tuple for the set of vertices of a triangle struct Pos Pos Pos float x , float y , float z p 0 x , p 1 y , p 2 z Pos operator Pos const op const return Pos p 0 op . p 0 , p 1 op . p 1 , p 2 op . p 2 Clear and AddWithWeight required for interpolation void Clear void 0 p 0 p 1 p 2 0.0f void AddWithWeight Pos const src , float weight p 0 weight src . p 0 p 1 weight src . p 1 p 2 weight src . p 2 float p 3 typedef std vector Pos PosVector struct Tri Tri Tri int a , int b , int c v 0 a , v 1 b , v 2 c int v 3 typedef std vector Tri TriVector Functions to populate the topology and geometry arrays a simple shape whose positions may be transformed void createCube std vector int vertsPerFace , std vector Index faceVertsPerFace , std vector Pos positionsPerVert Local topology and position of a cube centered at origin static float const cubePositions 8 3 -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f static int const cubeFaceVerts 6 4 0 , 3 , 2 , 1 , 4 , 5 , 6 , 7 , 0 , 4 , 7 , 3 , 1 , 2 , 6 , 5 , 0 , 1 , 5 , 4 , 3 , 7 , 6 , 2 Initialize verts-per-face and face-vertices for each face vertsPerFace . resize 6 faceVertsPerFace . resize 24 for int i 0 i 6 i vertsPerFace i 4 for int j 0 j 4 j faceVertsPerFace i 4 j cubeFaceVerts i j Initialize vertex positions positionsPerVert . resize 8 for int i 0 i 8 i float const p cubePositions i positionsPerVert i Pos p 0 , p 1 , p 2 Create a TopologyRefiner from default geometry created above Far TopologyRefiner createTopologyRefinerDefault PosVector posVector std vector int topVertsPerFace std vector Index topFaceVerts createCube topVertsPerFace , topFaceVerts , posVector typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_AND_CORNER Descriptor desc desc . numVertices int posVector . size desc . numFaces int topVertsPerFace . size desc . numVertsPerFace topVertsPerFace 0 desc . vertIndicesPerFace topFaceVerts 0 Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options assert refiner return refiner Create a TopologyRefiner from a specified Obj file geometry created internally Far TopologyRefiner createTopologyRefinerFromObj std string const objFileName , Sdc SchemeType schemeType , PosVector posVector const char filename objFileName . c_str const Shape shape 0 std ifstream ifs filename if ifs std stringstream ss ss ifs . rdbuf ifs . close std string shapeString ss . str shape Shape parseObj shapeString . c_str , ConvertSdcTypeToShapeScheme schemeType , false if shape 0 fprintf stderr , Error Cannot create Shape from .obj file s n , filename return 0 else fprintf stderr , Error Cannot open .obj file s n , filename return 0 Sdc SchemeType sdcType GetSdcType shape Sdc Options sdcOptions GetSdcOptions shape Far TopologyRefiner refiner Far TopologyRefinerFactory Shape Create shape , Far TopologyRefinerFactory Shape Options sdcType , sdcOptions if refiner 0 fprintf stderr , Error Unable to construct TopologyRefiner from .obj file s n , filename return 0 int numVertices refiner - GetNumVerticesTotal posVector . resize numVertices std memcpy posVector 0 . p 0 , shape - verts 0 , numVertices 3 sizeof float delete shape return refiner Simple function to export an Obj file for the limit points -- which provides a simple tessllation similar to tutorial_5_2. int writeToObj Far TopologyLevel const baseLevel , std vector Pos const vertexPositions , int nextObjVertexIndex for size_t i 0 i vertexPositions . size i float const p vertexPositions i . p printf v f f f n , p 0 , p 1 , p 2 Connect the sequences of limit points center followed by corners into triangle fans for each base face for int i 0 i baseLevel . GetNumFaces i int faceSize baseLevel . GetFaceVertices i . size int vCenter nextObjVertexIndex 1 int vCorner vCenter 1 for int k 0 k faceSize k printf f d d d n , vCenter , vCorner k , vCorner k 1 faceSize nextObjVertexIndex faceSize 1 return nextObjVertexIndex end namespace Command line arguments parsed to provide run-time options class Args public std string inputObjFile Sdc SchemeType schemeType int maxPatchDepth int numPoses Pos poseOffset bool deriv1Flag bool noPatchesFlag bool noOutputFlag public Args int argc , char argv inputObjFile , schemeType Sdc SCHEME_CATMARK , maxPatchDepth 3 , numPoses 0 , poseOffset 1.0f , 0.0f , 0.0f , deriv1Flag false , noPatchesFlag false , noOutputFlag false Parse and assign standard arguments and Obj files ArgOptions args args . Parse argc , argv maxPatchDepth args . GetLevel schemeType ConvertShapeSchemeToSdcType args . GetDefaultScheme const std vector const char objFiles args . GetObjFiles if objFiles . empty for size_t i 1 i objFiles . size i fprintf stderr , Warning .obj file s ignored n , objFiles i inputObjFile std string objFiles 0 Parse remaining arguments specific to this example const std vector const char rargs args . GetRemainingArgs for size_t i 0 i rargs . size i if strcmp rargs i , -d1 deriv1Flag true else if strcmp rargs i , -nopatches noPatchesFlag true else if strcmp rargs i , -poses if i rargs . size numPoses atoi rargs i else if strcmp rargs i , -offset if i rargs . size poseOffset . p 0 float atof rargs i if i rargs . size poseOffset . p 1 float atof rargs i if i rargs . size poseOffset . p 2 float atof rargs i else if strcmp rargs i , -nooutput noOutputFlag true else fprintf stderr , Warning Argument s ignored n , rargs i private Args Assemble the set of locations for the limit points. The resulting vector of LocationArrays can contain arbitrary locations on the limit surface -- with multiple locations for the same patch grouped into a single array. In this case, for each base face, coordinates for the center and its corners are specified -- from which we will construct a triangle fan providing a crude tessellation similar to tutorial_5_2. typedef Far LimitStencilTableFactory LocationArray LocationArray int assembleLimitPointLocations Far TopologyRefiner const refiner , std vector LocationArray locations Coordinates for the center of the face and its corners slightly inset. Unlike most of the public interface for patches, the LocationArray refers to parameteric coordinates as s,t, so that convention will be followed here. Note that the s,t coordinates in a LocationArray are referred to by reference. The memory holding these s,t values must persist while the LimitStencilTable is constructed -- the arrays here are declared as static for that purpose. static float const quadSCoords 5 0.5f , 0.05f , 0.95f , 0.95f , 0.05f static float const quadTCoords 5 0.5f , 0.05f , 0.05f , 0.95f , 0.95f static float const triSCoords 4 0.33f , 0.05f , 0.95f , 0.05f static float const triTCoords 4 0.33f , 0.05f , 0.00f , 0.95f static float const irregSCoords 2 1.0f , 0.05f static float const irregTCoords 2 1.0f , 0.05f Since these are references to patches to be evaluated, we require use of the Ptex indices to identify the top-most parameterized patch, which is essential to dealing with non-quad faces in the case of Catmark. Far TopologyLevel const baseLevel refiner . GetLevel 0 Far PtexIndices basePtexIndices refiner int regFaceSize Sdc SchemeTypeTraits GetRegularFaceSize refiner . GetSchemeType For each base face, simply refer to the s,t arrays for regular quad and triangular patches with a single LocationArray. Otherwise, for irregular faces, the corners of the face come from different patches and so must be referenced in separate LocationArrays. locations . clear int numLimitPoints 0 for int i 0 i baseLevel . GetNumFaces i int baseFaceSize baseLevel . GetFaceVertices i . size int basePtexId basePtexIndices . GetFaceId i bool faceIsRegular baseFaceSize regFaceSize if faceIsRegular All coordinates are on the same top-level patch LocationArray loc loc . ptexIdx basePtexId loc . numLocations baseFaceSize 1 if baseFaceSize 4 loc . s quadSCoords loc . t quadTCoords else loc . s triSCoords loc . t triTCoords locations . push_back loc else Center coordinate is on the first sub-patch while those on near the corners are on each successive sub-patch LocationArray loc loc . numLocations 1 for int j 0 j baseFaceSize j bool isPerimeter j 0 loc . ptexIdx basePtexId isPerimeter j -1 0 loc . s irregSCoords isPerimeter loc . t irregTCoords isPerimeter locations . push_back loc numLimitPoints baseFaceSize 1 return numLimitPoints Load command line arguments and geometry, build the LimitStencilTable for a set of points on the limit surface and compute those points for several orientations of the mesh int main int argc , char argv Args args argc , argv Create or load the base geometry command line arguments allow a .obj file to be specified, providing a TopologyRefiner and a set of base vertex positions to work with std vector Pos basePositions Far TopologyRefiner refinerPtr args . inputObjFile . empty createTopologyRefinerDefault basePositions createTopologyRefinerFromObj args . inputObjFile , args . schemeType , basePositions assert refinerPtr Far TopologyRefiner refiner refinerPtr Far TopologyLevel const baseLevel refiner . GetLevel 0 Use of LimitStencilTable requires either explicit or implicit use of a PatchTable. A PatchTable is not required to construct a LimitStencilTable -- one will be constructed internally for use and discarded -- but explicit construction is recommended to control the many legacy options for PatchTable, rather than relying on internal defaults. Adaptive refinement is required in both cases to indicate the accuracy of the patches. Note that if a TopologyRefiner and PatchTable are not used for any other purpose than computing the limit points, that specifying the subset of faces containing those limit points in the adaptive refinement and PatchTable construction can avoid unnecessary overhead. Far PatchTable patchTablePtr 0 if args . noPatchesFlag refiner . RefineAdaptive Far TopologyRefiner AdaptiveOptions args . maxPatchDepth else Far PatchTableFactory Options patchOptions args . maxPatchDepth patchOptions . useInfSharpPatch true patchOptions . generateLegacySharpCornerPatches false patchOptions . generateVaryingTables false patchOptions . generateFVarTables false patchOptions . endCapType Far PatchTableFactory Options ENDCAP_GREGORY_BASIS refiner . RefineAdaptive patchOptions . GetRefineAdaptiveOptions patchTablePtr Far PatchTableFactory Create refiner , patchOptions assert patchTablePtr Assemble the set of locations for the limit points. For each base face, coordinates for the center and its corners are specified -- from which we will construct a triangle fan providing a crude tessellation similar to tutorial_5_2. std vector LocationArray locations int numLimitPoints assembleLimitPointLocations refiner , locations Construct a LimitStencilTable from the refiner, patch table optional and the collection of limit point locations. Stencils can optionally be created for computing dervatives -- the default is to compute 1st derivative stencils, so be sure to disable that if not necessary Far LimitStencilTableFactory Options limitOptions limitOptions . generate1stDerivatives args . deriv1Flag Far LimitStencilTable const limitStencilTablePtr Far LimitStencilTableFactory Create refiner , locations , 0 , optional StencilTable for the refined points patchTablePtr , optional PatchTable limitOptions assert limitStencilTablePtr Far LimitStencilTable const limitStencilTable limitStencilTablePtr Apply the constructed LimitStencilTable to compute limit positions from the base level vertex positions. This is trivial if computing all positions in one invokation. The UpdateValues method and those for derivatives are overloaded to optionally accept a subrange of indices to distribute the computation std vector Pos limitPositions numLimitPoints limitStencilTable . UpdateValues basePositions , limitPositions Call with the optional subrange limitStencilTable . UpdateValues basePositions , limitPositions , 0 , numLimitPoints 2 limitStencilTable . UpdateValues basePositions , limitPositions , numLimitPoints 2 1 , numLimitPoints Write vertices and faces in Obj format for the original limit points int objVertCount 0 if args . noOutputFlag printf g base_mesh n objVertCount writeToObj baseLevel , limitPositions , objVertCount Recompute the limit points and output faces for different poses of the original mesh -- in this case simply translated. Also optionally compute 1st derivatives though they are not used here std vector Pos posePositions basePositions std vector Pos limitDu args . deriv1Flag numLimitPoints 0 std vector Pos limitDv args . deriv1Flag numLimitPoints 0 for int i 0 i args . numPoses i Trivially transform the base vertex positions and re-compute for size_t j 0 j basePositions . size j posePositions j posePositions j args . poseOffset limitStencilTable . UpdateValues posePositions , limitPositions if args . deriv1Flag limitStencilTable . UpdateDerivs posePositions , limitDu , limitDv if args . noOutputFlag printf n g pose_d n , i objVertCount writeToObj baseLevel , limitPositions , objVertCount delete refinerPtr delete patchTablePtr delete limitStencilTablePtr return EXIT_SUCCESS Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "far_tutorial_3_1.html" │ │ │ │ │ + "loc": "far_tutorial_5_3.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "far_tutorial_2_3.cpp", │ │ │ │ │ - "text": "far_tutorial_2_3.cpp far_tutorial_2_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_3far_tutorial_2_3.cpp ------------------------------------------------------------------------------ Tutorial description NOTE The following approaches are approximations to compute smooth normals, for highest fidelity patches should be used for positions and normals, which form the true limit surface. Building on tutorial 3, this example shows how to instantiate a simple mesh, refine it uniformly, interpolate both vertex and face-varying primvar data, and finally calculate approximated smooth normals. The resulting interpolated data is output in obj format. Currently, this tutorial supports 3 methods to approximate smooth normals CrossTriangle Calculates smooth normals accumulating per vertex using 3 verts to generate 2 vectors. This approximation has trouble when working with quads which can be non-planar since it only takes into account half of each face. CrossQuad Calculates smooth normals accumulating per vertex but this time, instead of taking into account only 3 verts it creates 2 vectors crossing the quad. This approximation builds upon CrossTriangle but takes into account the 4 verts of the face. Limit Calculates the normals at the limit for each vert at the last level of subdivision. These are the true limit normals, however, in this example they are used with verts that are not at the limit. This can lead to new visual artifacts since the normals and the positions dont match. Additionally, this approach requires extra computation to calculate the limit normals. For this reason, we strongly suggest using limit positions with limit normals. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Math helpers. Returns the normalized version of the input vector inline void normalize float n float rn 1.0f sqrtf n 0 n 0 n 1 n 1 n 2 n 2 n 0 rn n 1 rn n 2 rn Returns the cross product of p v1 and p v2. void cross float const v1 , float const v2 , float vOut vOut 0 v1 1 v2 2 - v1 2 v2 1 vOut 1 v1 2 v2 0 - v1 0 v2 2 vOut 2 v1 0 v2 1 - v1 1 v2 0 ------------------------------------------------------------------------------ Face-varying implementation. struct Vertex Minimal required interface ---------------------- Vertex Clear Vertex Vertex const src position 0 src . position 0 position 1 src . position 1 position 2 src . position 2 void Clear position 0 position 1 position 2 0.0f void AddWithWeight Vertex const src , float weight position 0 weight src . position 0 position 1 weight src . position 1 position 2 weight src . position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z position 0 x position 1 y position 2 z const float GetPosition const return position float position 3 ------------------------------------------------------------------------------ Face-varying container implementation. We are using a uv texture layout as a face-varying primtiive variable attribute. Because face-varying data is specified per-face-per-vertex, we cannot use the same container that we use for vertex or varying data. We specify a new container, which only carries u,v coordinates. Similarly to our Vertex container, we add a minimaliztic interpolation interface with a Clear and AddWithWeight methods. struct FVarVertexUV Minimal required interface ---------------------- void Clear u v 0.0f void AddWithWeight FVarVertexUV const src , float weight u weight src . u v weight src . v Basic uv layout channel float u , v struct FVarVertexColor Minimal required interface ---------------------- void Clear r g b a 0.0f void AddWithWeight FVarVertexColor const src , float weight r weight src . r g weight src . g b weight src . b a weight src . a Basic color layout channel float r , g , b , a ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h vertex primitive variable data topology static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 face-varying primitive variable data topology for UVs static float g_uvs 14 2 0.375 , 0.00 , 0.625 , 0.00 , 0.375 , 0.25 , 0.625 , 0.25 , 0.375 , 0.50 , 0.625 , 0.50 , 0.375 , 0.75 , 0.625 , 0.75 , 0.375 , 1.00 , 0.625 , 1.00 , 0.875 , 0.00 , 0.875 , 0.25 , 0.125 , 0.00 , 0.125 , 0.25 static int g_nuvs 14 static int g_uvIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 9 , 8 , 1 , 10 , 11 , 3 , 12 , 0 , 2 , 13 face-varying primitive variable data topology for color static float g_colors 24 4 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 static int g_ncolors 24 static int g_colorIndices 24 0 , 3 , 9 , 6 , 7 , 10 , 15 , 12 , 13 , 16 , 21 , 18 , 19 , 22 , 4 , 1 , 5 , 23 , 17 , 11 , 20 , 2 , 8 , 14 using namespace OpenSubdiv Approximation methods for smooth normal computations enum NormalApproximation CrossTriangle , CrossQuad , Limit ------------------------------------------------------------------------------ int main int argc , char argv const int maxlevel 2 enum NormalApproximation normalApproximation CrossTriangle Parsing command line parameters to see if the user wants to use a specific method to calculate normals for int i 1 i argc i if strstr argv i , -limit normalApproximation Limit else if strcmp argv i , -crossquad normalApproximation CrossQuad else if strcmp argv i , -crosstriangle normalApproximation CrossTriangle else printf Parameters n printf -crosstriangle use the cross product of vectors n printf generated from 3 verts default. n printf -crossquad use the cross product of vectors n printf generated from 4 verts. n printf -limit use normals calculated from the limit. n return 0 typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY options . SetFVarLinearInterpolation Sdc Options FVAR_LINEAR_NONE Populate a topology descriptor with our raw data Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Create a face-varying channel descriptor const int numChannels 2 const int channelUV 0 const int channelColor 1 Descriptor FVarChannel channels numChannels channels channelUV . numValues g_nuvs channels channelUV . valueIndices g_uvIndices channels channelColor . numValues g_ncolors channels channelColor . valueIndices g_colorIndices Add the channel topology to the main descriptor desc . numFVarChannels numChannels desc . fvarChannels channels Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topolgy up to maxlevel note fullTopologyInLastLevel must be true to work with face-varying data Far TopologyRefiner UniformOptions refineOptions maxlevel refineOptions . fullTopologyInLastLevel true refiner - RefineUniform refineOptions Allocate and initialize the vertex primvar data see tutorial 2 for more details. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 for int i 0 i g_nverts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Allocate initialize the first channel of face-varying primvars UVs std vector FVarVertexUV fvBufferUV refiner - GetNumFVarValuesTotal channelUV FVarVertexUV fvVertsUV fvBufferUV 0 for int i 0 i g_nuvs i fvVertsUV i . u g_uvs i 0 fvVertsUV i . v g_uvs i 1 Allocate interpolate the face-varying primvar data colors std vector FVarVertexColor fvBufferColor refiner - GetNumFVarValuesTotal channelColor FVarVertexColor fvVertsColor fvBufferColor 0 for int i 0 i g_ncolors i fvVertsColor i . r g_colors i 0 fvVertsColor i . g g_colors i 1 fvVertsColor i . b g_colors i 2 fvVertsColor i . a g_colors i 3 Interpolate both vertex and face-varying primvar data Far PrimvarRefiner primvarRefiner refiner Vertex srcVert verts FVarVertexUV srcFVarUV fvVertsUV FVarVertexColor srcFVarColor fvVertsColor for int level 1 level maxlevel level Vertex dstVert srcVert refiner - GetLevel level -1 . GetNumVertices FVarVertexUV dstFVarUV srcFVarUV refiner - GetLevel level -1 . GetNumFVarValues channelUV FVarVertexColor dstFVarColor srcFVarColor refiner - GetLevel level -1 . GetNumFVarValues channelColor primvarRefiner . Interpolate level , srcVert , dstVert primvarRefiner . InterpolateFaceVarying level , srcFVarUV , dstFVarUV , channelUV primvarRefiner . InterpolateFaceVarying level , srcFVarColor , dstFVarColor , channelColor srcVert dstVert srcFVarUV dstFVarUV srcFVarColor dstFVarColor Approximate normals Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces int firstOfLastVerts refiner - GetNumVerticesTotal - nverts std vector Vertex normals nverts Different ways to approximate smooth normals For details check the description at the beginning of the file if normalApproximation Limit Approximation using the normal at the limit with verts that are not at the limit For details check the description at the beginning of the file std vector Vertex fineLimitPos nverts std vector Vertex fineDu nverts std vector Vertex fineDv nverts primvarRefiner . Limit verts firstOfLastVerts , fineLimitPos , fineDu , fineDv for int vert 0 vert nverts vert float const du fineDu vert . GetPosition float const dv fineDv vert . GetPosition float norm 3 cross du , dv , norm normals vert . SetPosition norm 0 , norm 1 , norm 2 else if normalApproximation CrossQuad Approximate smooth normals by accumulating normal vectors computed as the cross product of two vectors generated by the 4 verts that form each quad For details check the description at the beginning of the file for int f 0 f nfaces f Far ConstIndexArray faceVertices refLastLevel . GetFaceVertices f We will use the first three verts to calculate a normal const float v0 verts firstOfLastVerts faceVertices 0 . GetPosition const float v1 verts firstOfLastVerts faceVertices 1 . GetPosition const float v2 verts firstOfLastVerts faceVertices 2 . GetPosition const float v3 verts firstOfLastVerts faceVertices 3 . GetPosition Calculate the cross product between the vectors formed by v1-v0 and v2-v0, and then normalize the result float normalCalculated 0.0 , 0.0 , 0.0 float a 3 v2 0 - v0 0 , v2 1 - v0 1 , v2 2 - v0 2 float b 3 v3 0 - v1 0 , v3 1 - v1 1 , v3 2 - v1 2 cross a , b , normalCalculated normalize normalCalculated Accumulate that normal on all verts that are part of that face for int vInFace 0 vInFace faceVertices . size vInFace int vertexIndex faceVertices vInFace normals vertexIndex . position 0 normalCalculated 0 normals vertexIndex . position 1 normalCalculated 1 normals vertexIndex . position 2 normalCalculated 2 else if normalApproximation CrossTriangle Approximate smooth normals by accumulating normal vectors computed as the cross product of two vectors generated by 3 verts of the quad For details check the description at the beginning of the file for int f 0 f nfaces f Far ConstIndexArray faceVertices refLastLevel . GetFaceVertices f We will use the first three verts to calculate a normal const float v0 verts firstOfLastVerts faceVertices 0 . GetPosition const float v1 verts firstOfLastVerts faceVertices 1 . GetPosition const float v2 verts firstOfLastVerts faceVertices 2 . GetPosition Calculate the cross product between the vectors formed by v1-v0 and v2-v0, and then normalize the result float normalCalculated 0.0 , 0.0 , 0.0 float a 3 v1 0 - v0 0 , v1 1 - v0 1 , v1 2 - v0 2 float b 3 v2 0 - v0 0 , v2 1 - v0 1 , v2 2 - v0 2 cross a , b , normalCalculated normalize normalCalculated Accumulate that normal on all verts that are part of that face for int vInFace 0 vInFace faceVertices . size vInFace int vertexIndex faceVertices vInFace normals vertexIndex . position 0 normalCalculated 0 normals vertexIndex . position 1 normalCalculated 1 normals vertexIndex . position 2 normalCalculated 2 Finally we just need to normalize the accumulated normals for int vert 0 vert nverts vert normalize normals vert . position 0 Output OBJ of the highest level refined ----------- Print vertex positions for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print vertex normals for int vert 0 vert nverts vert float const pos normals vert . GetPosition printf vn f f f n , pos 0 , pos 1 , pos 2 Print uvs int nuvs refLastLevel . GetNumFVarValues channelUV int firstOfLastUvs refiner - GetNumFVarValuesTotal channelUV - nuvs for int fvvert 0 fvvert nuvs fvvert FVarVertexUV const uv fvVertsUV firstOfLastUvs fvvert printf vt f f n , uv . u , uv . v Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face Far ConstIndexArray fuvs refLastLevel . GetFaceFVarValues face , channelUV all refined Catmark faces should be quads assert fverts . size 4 fuvs . size 4 printf f for int vert 0 vert fverts . size vert OBJ uses 1-based arrays... printf ddd , fverts vert 1 , fuvs vert 1 , fverts vert 1 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "bfr_tutorial_1_2.cpp", │ │ │ │ │ + "text": "bfr_tutorial_1_2.cpp bfr_tutorial_1_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_2bfr_tutorial_1_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial builds on the previous tutorial that makes use of the SurfaceFactory and Surface for evaluating the limit surface of faces by using the Tessellation class to determine the points to evaluate and the faces that connect them. The Tessellation class replaces the explicit determination of points and faces for the triangle fan of the previous example. Given a uniform tessellation rate via a command line option, Tessellation returns the set of coordinates to evaluate, and separately returns the faces that connect them. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include opensubdivbfrtessellation.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType int tessUniformRate bool tessQuadsFlag public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK , tessUniformRate 5 , tessQuadsFlag false for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else if strcmp argv i , -res if i argc tessUniformRate atoi argv i else if strcmp argv i , -quads tessQuadsFlag true else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outFacets Assign Tessellation Options applied for all faces. Tessellations allow the creating of either 3- or 4-sided faces -- both of which are supported here via a command line option int const tessFacetSize 3 options . tessQuadsFlag Bfr Tessellation Options tessOptions tessOptions . SetFacetSize tessFacetSize tessOptions . PreserveQuads options . tessQuadsFlag Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Declare a simple uniform Tessellation for the Parameterization of this face and identify coordinates of the points to evaluate Bfr Tessellation tessPattern faceSurface . GetParameterization , options . tessUniformRate , tessOptions int numOutCoords tessPattern . GetNumCoords outCoords . resize numOutCoords 2 tessPattern . GetCoords outCoords . data Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the Tessellation Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. One of several Tessellation methods to transform the facet indices simply translates all indices by the desired offset. int objVertexIndexOffset objWriter . GetNumVertices int numFacets tessPattern . GetNumFacets outFacets . resize numFacets tessFacetSize tessPattern . GetFacets outFacets . data tessPattern . TransformFacetCoordIndices outFacets . data , objVertexIndexOffset Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outFacets , tessFacetSize , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "far_tutorial_2_3.html" │ │ │ │ │ + "loc": "bfr_tutorial_1_2.html" │ │ │ │ │ + }, { │ │ │ │ │ + "title": "bfr_tutorial_1_1.cpp", │ │ │ │ │ + "text": "bfr_tutorial_1_1.cpp bfr_tutorial_1_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsbfrtutorial_1_1bfr_tutorial_1_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates the use of the SurfaceFactory, Surface and Parameterization classes for creating and evaluating the limit surface associated with each base face of a mesh. Following the creation of a connected mesh for a shape using a FarTopologyRefiner, as illustrated in Far tutorials, an instance of a SurfaceFactory is declared to process its faces. Each face of the mesh is evaluated and tessellated independently with a simple triangle fan, with results written out in Obj format for inspection. These classes make it simple to evaluate and tessellate all faces quads, tris or others while supporting the full set of subdivision options. While a triangle fan may be a trivial tessellation and so not very useful later examples using the Tessellation class provide more useful results with the same simplicity. include opensubdivfartopologyRefiner.h include opensubdivbfrrefinerSurfaceFactory.h include opensubdivbfrsurface.h include vector include string include cstring include cstdio Local headers with support for this tutorial in namespace tutorial include .meshLoader.h include .objWriter.h using namespace OpenSubdiv Simple command line arguments to provide input and run-time options class Args public std string inputObjFile std string outputObjFile Sdc SchemeType schemeType public Args int argc , char argv inputObjFile , outputObjFile , schemeType Sdc SCHEME_CATMARK for int i 1 i argc i if strstr argv i , .obj if inputObjFile . empty inputObjFile std string argv i else fprintf stderr , Warning Extra Obj file s ignored n , argv i else if strcmp argv i , -o if i argc outputObjFile std string argv i else if strcmp argv i , -bilinear schemeType Sdc SCHEME_BILINEAR else if strcmp argv i , -catmark schemeType Sdc SCHEME_CATMARK else if strcmp argv i , -loop schemeType Sdc SCHEME_LOOP else fprintf stderr , Warning Unrecognized argument s ignored n , argv i private Args The main tessellation function given a mesh and vertex positions, tessellate each face -- writing results in Obj format. void tessellateToObj Far TopologyRefiner const meshTopology , std vector float const meshVertexPositions , Args const options Use simpler local type names for the Surface and its factory typedef Bfr RefinerSurfaceFactory SurfaceFactory typedef Bfr Surface float Surface Initialize the SurfaceFactory for the given base mesh very low cost in terms of both time and space and tessellate each face independently i.e. no shared vertices Note that the SurfaceFactory is not thread-safe by default due to use of an internal cache. Creating a separate instance of the SurfaceFactory for each thread is one way to safely parallelize this loop. Another preferred is to assign a thread-safe cache to the single instance. First declare any evaluation options when initializing though none are used in this simple case SurfaceFactory Options surfaceOptions SurfaceFactory meshSurfaceFactory meshTopology , surfaceOptions The Surface to be constructed and evaluated for each face -- as well as the intermediate and output data associated with it -- can be declared in the scope local to each face. But since dynamic memory is involved with these variables, it is preferred to declare them outside that loop to preserve and reuse that dynamic memory. Surface faceSurface std vector float facePatchPoints std vector float outCoords std vector float outPos , outDu , outDv std vector int outTriangles Process each face, writing the output of each in Obj format tutorial ObjWriter objWriter options . outputObjFile int numFaces meshSurfaceFactory . GetNumFaces for int faceIndex 0 faceIndex numFaces faceIndex Initialize the Surface for this face -- if valid skipping holes and boundary faces in some rare cases if meshSurfaceFactory . InitVertexSurface faceIndex , faceSurface continue Get the Parameterization of the Surface and use it to identify coordinates for evaluation -- in this case, at the vertices and center of the face to create a fan of triangles Bfr Parameterization faceParam faceSurface . GetParameterization int faceSize faceParam . GetFaceSize int numOutCoords faceSize 1 outCoords . resize numOutCoords 2 for int i 0 i faceSize i faceParam . GetVertexCoord i , outCoords i 2 faceParam . GetCenterCoord outCoords faceSize 2 Prepare the patch points for the Surface, then use them to evaluate output points for all identified coordinates Resize patch point and output arrays int pointSize 3 facePatchPoints . resize faceSurface . GetNumPatchPoints pointSize outPos . resize numOutCoords pointSize outDu . resize numOutCoords pointSize outDv . resize numOutCoords pointSize Populate patch point and output arrays faceSurface . PreparePatchPoints meshVertexPositions . data , pointSize , facePatchPoints . data , pointSize for int i 0 , j 0 i numOutCoords i , j pointSize faceSurface . Evaluate outCoords i 2 , facePatchPoints . data , pointSize , outPos j , outDu j , outDv j Identify the faces of the tessellation, i.e. the triangle fan connecting points at the vertices to the center last point Note the need to offset vertex indices for the output faces -- using the number of vertices generated prior to this face. int objVertexIndexOffset objWriter . GetNumVertices outTriangles . resize faceSize 3 int outTriangle outTriangles . data for int i 0 i faceSize i , outTriangle 3 outTriangle 0 objVertexIndexOffset i outTriangle 1 objVertexIndexOffset i 1 faceSize outTriangle 2 objVertexIndexOffset faceSize Write the evaluated points and faces connecting them as Obj objWriter . WriteGroupName baseFace_ , faceIndex objWriter . WriteVertexPositions outPos objWriter . WriteVertexNormals outDu , outDv objWriter . WriteFaces outTriangles , 3 , true , false Load command line arguments, specified or default geometry and process int main int argc , char argv Args args argc , argv Far TopologyRefiner meshTopology 0 std vector float meshVtxPositions std vector float meshFVarUVs meshTopology tutorial createTopologyRefiner args . inputObjFile , args . schemeType , meshVtxPositions , meshFVarUVs if meshTopology 0 return EXIT_FAILURE tessellateToObj meshTopology , meshVtxPositions , args delete meshTopology return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "bfr_tutorial_1_1.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_4_3.cpp", │ │ │ │ │ - "text": "far_tutorial_4_3.cpp far_tutorial_4_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_3far_tutorial_4_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate table of cascading stencils. We initialize a FarTopologyRefiner with a cube and apply uniform refinement. We then use a FarStencilTableFactory to generate a stencil table. We set the factory Options to not factorize intermediate levels, thus giving a table of cascading stencils. We then apply the stencils to the vertex position primvar data, and insert a hierarchical edit at level 1. This edit is smoothed by the application of the subsequent stencil cascades. The results are dumped into an OBJ file that shows the intermediate levels of refinement of the original cube. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z float const GetPosition const return _position float GetPosition return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 4 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Use the FarStencilTable factory to create cascading stencil table note we want stencils for each refinement level cascade mode is achieved by setting factorizeIntermediateLevels to false Far StencilTableFactory Options options options . generateIntermediateLevels true options . factorizeIntermediateLevels false options . generateOffsets true Far StencilTable const stencilTable Far StencilTableFactory Create refiner , options std vector Vertex vertexBuffer refiner - GetNumVerticesTotal - g_nverts Vertex destVerts vertexBuffer 0 int start 0 , end 0 stencil batches for each level of subdivision for int level 0 level maxlevel level int nverts refiner - GetLevel level 1 . GetNumVertices Vertex const srcVerts reinterpret_cast Vertex g_verts if level 0 srcVerts vertexBuffer start start end end nverts stencilTable - UpdateValues srcVerts , destVerts , start , end apply 2 hierarchical edits on level 1 vertices if level 1 float pos destVerts start 5 . GetPosition pos 1 0.5f pos destVerts start 20 . GetPosition pos 0 0.25f Output OBJ of the highest level refined ----------- Vertex verts vertexBuffer 0 Print vertex positions for int level 1 , firstvert 0 level maxlevel level Far TopologyLevel const refLevel refiner - GetLevel level printf g level_d n , level int nverts refLevel . GetNumVertices for int vert 0 vert nverts vert float const pos verts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 verts nverts Print faces for int face 0 face refLevel . GetNumFaces face Far ConstIndexArray fverts refLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert firstvert 1 OBJ uses 1-based arrays... printf n firstvert nverts delete refiner delete stencilTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. return Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_4_3.cpp far_tutorial_4_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_3far_tutorial_4_3.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate table of cascading stencils. We initialize a FarTopologyRefiner with a cube and apply uniform refinement. We then use a FarStencilTableFactory to generate a stencil table. We set the factory Options to not factorize intermediate levels, thus giving a table of cascading stencils. We then apply the stencils to the vertex position primvar data, and insert a hierarchical edit at level 1. This edit is smoothed by the application of the subsequent stencil cascades. The results are dumped into an OBJ file that shows the intermediate levels of refinement of the original cube. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z float const GetPosition const return _position float GetPosition return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 4 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Use the FarStencilTable factory to create cascading stencil table note we want stencils for each refinement level cascade mode is achieved by setting factorizeIntermediateLevels to false Far StencilTableFactory Options options options . generateIntermediateLevels true options . factorizeIntermediateLevels false options . generateOffsets true Far StencilTable const stencilTable Far StencilTableFactory Create refiner , options std vector Vertex vertexBuffer refiner - GetNumVerticesTotal - g_nverts Vertex destVerts vertexBuffer 0 int start 0 , end 0 stencil batches for each level of subdivision for int level 0 level maxlevel level int nverts refiner - GetLevel level 1 . GetNumVertices Vertex const srcVerts reinterpret_cast Vertex g_verts if level 0 srcVerts vertexBuffer start start end end nverts stencilTable - UpdateValues srcVerts , destVerts , start , end apply 2 hierarchical edits on level 1 vertices if level 1 float pos destVerts start 5 . GetPosition pos 1 0.5f pos destVerts start 20 . GetPosition pos 0 0.25f Output OBJ of the highest level refined ----------- Vertex verts vertexBuffer 0 Print vertex positions for int level 1 , firstvert 0 level maxlevel level Far TopologyLevel const refLevel refiner - GetLevel level printf g level_d n , level int nverts refLevel . GetNumVertices for int vert 0 vert nverts vert float const pos verts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 verts nverts Print faces for int face 0 face refLevel . GetNumFaces face Far ConstIndexArray fverts refLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert firstvert 1 OBJ uses 1-based arrays... printf n firstvert nverts delete refiner delete stencilTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. return Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_4_3.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "far_tutorial_3_1.cpp", │ │ │ │ │ + "text": "far_tutorial_3_1.cpp far_tutorial_3_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_3_1far_tutorial_3_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to interface a high-level topology representation with Far for better efficiency. In tutorial 0, we showed how to instantiate topology from a simple face-vertex list. Here we will show how to take advantage of more complex data structures. Many client applications that manipulate geometry use advanced data structures such as half-edge, quad-edge or winged-edge in order to represent complex topological relationships beyond the usual face-vertex lists. We can take advantage of this information. Far provides an advanced interface that allows such a client application to communicate advanced component relationships directly and avoid having Far rebuilding them redundantly. include opensubdivfartopologyRefinerFactory.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ using namespace OpenSubdiv ------------------------------------------------------------------------------ For this tutorial, we provide the complete topological representation of a simple pyramid. In our case, we store it as a simple sequence of integers, with the understanding that client-code would provide a fully implemented data-structure such as quad-edges or winged-edges. Pyramid geometry from catmark_pyramid.h - extended for this tutorial static int g_nverts 5 , g_nedges 8 , g_nfaces 5 vertex positions static float g_verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f number of vertices in each face static int g_facenverts 5 3 , 3 , 3 , 3 , 4 index of face vertices static int g_faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 index of edge vertices 2 per edge static int g_edgeverts 16 0 , 1 , 1 , 2 , 2 , 0 , 2 , 3 , 3 , 0 , 3 , 4 , 4 , 0 , 4 , 1 index of face edges static int g_faceedges 16 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 6 , 6 , 7 , 0 , 5 , 3 , 1 , 7 number of faces adjacent to each edge static int g_edgenfaces 8 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 index of faces incident to a given edge static int g_edgefaces 16 0 , 3 , 0 , 4 , 0 , 1 , 1 , 4 , 1 , 2 , 2 , 4 , 2 , 3 , 3 , 4 number of faces incident to each vertex static int g_vertexnfaces 5 4 , 3 , 3 , 3 , 3 index of faces incident to each vertex static int g_vertexfaces 25 0 , 1 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 1 , 4 , 2 , 2 , 4 , 3 number of edges incident to each vertex static int g_vertexnedges 5 4 , 3 , 3 , 3 , 3 index of edges incident to each vertex static int g_vertexedges 25 0 , 2 , 4 , 6 , 1 , 0 , 7 , 2 , 1 , 3 , 4 , 3 , 5 , 6 , 5 , 7 Edge crease sharpness static float g_edgeCreases 8 0.0f , 2.5f , 0.0f , 2.5f , 0.0f , 2.5f , 0.0f , 2.5f ------------------------------------------------------------------------------ Because existing client-code may not provide an exact match for the topological queries required by Fars interface, we can provide a converter class. This can be particularly useful for instance if the client data-structure requires additional relationships to be mapped. For instance, half-edge representations do not store unique edge indices and it can be difficult to traverse edges or faces adjacent to a given vertex. Using an intermediate wrapper class allows us to leverage existing relationships information from a mesh, and generate the missing components temporarily. For a practical example, you can look at the file hbr_to_vtr.h in the same tutorial directory. This example implements a OsdHbrConverter class as a way of interfacing PRmans half-edge representation to Far. struct Converter public Sdc SchemeType GetType const return Sdc SCHEME_CATMARK Sdc Options GetOptions const Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY return options int GetNumFaces const return g_nfaces int GetNumEdges const return g_nedges int GetNumVertices const return g_nverts Face relationships int GetNumFaceVerts int face const return g_facenverts face int const GetFaceVerts int face const return g_faceverts getCompOffset g_facenverts , face int const GetFaceEdges int face const return g_faceedges getCompOffset g_facenverts , face Edge relationships int const GetEdgeVertices int edge const return g_edgeverts edge 2 int GetNumEdgeFaces int edge const return g_edgenfaces edge int const GetEdgeFaces int edge const return g_edgefaces getCompOffset g_edgenfaces , edge Vertex relationships int GetNumVertexEdges int vert const return g_vertexnedges vert int const GetVertexEdges int vert const return g_vertexedges getCompOffset g_vertexnedges , vert int GetNumVertexFaces int vert const return g_vertexnfaces vert int const GetVertexFaces int vert const return g_vertexfaces getCompOffset g_vertexnfaces , vert private int getCompOffset int const comps , int comp const int ofs 0 for int i 0 i comp i ofs comps i return ofs ------------------------------------------------------------------------------ namespace OpenSubdiv namespace OPENSUBDIV_VERSION namespace Far template bool TopologyRefinerFactory Converter resizeComponentTopology TopologyRefiner refiner , Converter const conv Faces and face-verts int nfaces conv . GetNumFaces setNumBaseFaces refiner , nfaces for int face 0 face nfaces face int nv conv . GetNumFaceVerts face setNumBaseFaceVertices refiner , face , nv Edges and edge-faces int nedges conv . GetNumEdges setNumBaseEdges refiner , nedges for int edge 0 edge nedges edge int nf conv . GetNumEdgeFaces edge setNumBaseEdgeFaces refiner , edge , nf Vertices and vert-faces and vert-edges int nverts conv . GetNumVertices setNumBaseVertices refiner , nverts for int vert 0 vert nverts vert int ne conv . GetNumVertexEdges vert , nf conv . GetNumVertexFaces vert setNumBaseVertexEdges refiner , vert , ne setNumBaseVertexFaces refiner , vert , nf return true template bool TopologyRefinerFactory Converter assignComponentTopology TopologyRefiner refiner , Converter const conv using Far IndexArray Face relations int nfaces conv . GetNumFaces for int face 0 face nfaces face IndexArray dstFaceVerts getBaseFaceVertices refiner , face IndexArray dstFaceEdges getBaseFaceEdges refiner , face int const faceverts conv . GetFaceVerts face int const faceedges conv . GetFaceEdges face for int vert 0 vert conv . GetNumFaceVerts face vert dstFaceVerts vert faceverts vert dstFaceEdges vert faceedges vert Edge relations Note if your representation is unable to provide edge relationships ex half-edges, you can comment out this section and Far will automatically generate the missing information. int nedges conv . GetNumEdges for int edge 0 edge nedges edge Edge-vertices IndexArray dstEdgeVerts getBaseEdgeVertices refiner , edge dstEdgeVerts 0 conv . GetEdgeVertices edge 0 dstEdgeVerts 1 conv . GetEdgeVertices edge 1 Edge-faces IndexArray dstEdgeFaces getBaseEdgeFaces refiner , edge for int face 0 face conv . GetNumEdgeFaces face face dstEdgeFaces face conv . GetEdgeFaces edge face Vertex relations int nverts conv . GetNumVertices for int vert 0 vert nverts vert Vert-Faces IndexArray vertFaces getBaseVertexFaces refiner , vert LocalIndexArray vertInFaceIndices getBaseVertexFaceLocalIndicesrefiner, vert for int face 0 face conv . GetNumVertexFaces vert face vertFaces face conv . GetVertexFaces vert face Vert-Edges IndexArray vertEdges getBaseVertexEdges refiner , vert LocalIndexArray vertInEdgeIndices getBaseVertexEdgeLocalIndicesrefiner, vert for int edge 0 edge conv . GetNumVertexEdges vert edge vertEdges edge conv . GetVertexEdges vert edge populateBaseLocalIndices refiner return true template bool TopologyRefinerFactory Converter assignComponentTags TopologyRefiner refiner , Converter const conv arbitrarily sharpen the 4 bottom edges of the pyramid to 2.5f for int edge 0 edge conv . GetNumEdges edge setBaseEdgeSharpness refiner , edge , g_edgeCreases edge return true ifdef _MSC_VER template void TopologyRefinerFactory Converter reportInvalidTopology TopologyError errCode , char const msg , Converter const mesh Optional topology validation error reporting This method is called whenever the factory encounters topology validation errors. By default, nothing is reported Warning msg template bool TopologyRefinerFactory Converter assignFaceVaryingTopology TopologyRefiner refiner , Converter const conv Because of the way MSVC specializes templated functions, we had to remove the default stubs in FarTopologyRefinerFactory. In this example, no face-varying data is being added, but we still need to implement a template specialization or MSVC linker fails. return true endif namespace Far namespace OPENSUBDIV_VERSION namespace OpenSubdiv ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ int main int , char Converter conv Far TopologyRefiner refiner Far TopologyRefinerFactory Converter Create conv , Far TopologyRefinerFactory Converter Options conv . GetType , conv . GetOptions int maxlevel 5 Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate a buffer for vertex primvar data. The buffer length is set to be the sum of all children vertices up to the highest level of refinement. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 Initialize coarse mesh positions int nCoarseVerts g_nverts for int i 0 i nCoarseVerts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Vertex src verts for int level 1 level maxlevel level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert 1 OBJ uses 1-based arrays... printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "far_tutorial_3_1.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "far_tutorial_4_2.cpp", │ │ │ │ │ - "text": "far_tutorial_4_2.cpp far_tutorial_4_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_2far_tutorial_4_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate both vertex and varying FarStencilTable to interpolate 2 primvar data buffers vertex positions and vertex colors. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _data 0 src . _data 0 _data 1 src . _data 1 _data 2 src . _data 2 void Clear void 0 _data 0 _data 1 _data 2 0.0f void AddWithWeight Vertex const src , float weight _data 0 weight src . _data 0 _data 1 weight src . _data 1 _data 2 weight src . _data 2 Public interface ------------------------------------ float const GetData const return _data private float _data 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f Per-vertex RGB color data static float g_colors 24 1.0f , 0.0f , 0.5f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 4 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel int nverts refiner - GetLevel maxlevel . GetNumVertices Use the FarStencilTable factory to create discrete stencil table Far StencilTableFactory Options options options . generateIntermediateLevels false only the highest refinement level. options . generateOffsets true Vertex primvar data Create stencils table for vertex interpolation options . interpolationMode Far StencilTableFactory INTERPOLATE_VERTEX Far StencilTable const vertexStencils Far StencilTableFactory Create refiner , options assert nverts vertexStencils - GetNumStencils Allocate vertex primvar buffer 1 stencil for each vertex std vector Vertex vertexBuffer vertexStencils - GetNumStencils Use the cube vertex positions as vertex primvar data Vertex vertexCVs reinterpret_cast Vertex g_verts Varying primvar data Create stencils table for varying interpolation options . interpolationMode Far StencilTableFactory INTERPOLATE_VARYING Far StencilTable const varyingStencils Far StencilTableFactory Create refiner , options assert nverts varyingStencils - GetNumStencils Allocate varying primvar buffer 1 stencil for each vertex std vector Vertex varyingBuffer varyingStencils - GetNumStencils Use per-vertex array of RGB colors as varying primvar data Vertex varyingCVs reinterpret_cast Vertex g_colors delete refiner Apply stencils in frame loop This section would be applied every frame after control vertices have been moved. Apply stencils on the control vertex data to update the primvar data of the refined vertices. vertexStencils - UpdateValues vertexCVs , vertexBuffer 0 varyingStencils - UpdateValues varyingCVs , varyingBuffer 0 Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle for int vert 0 vert int nverts vert float const pos vertexBuffer vert . GetData printf -p f f f n , pos 0 , pos 1 , pos 2 printf -c 1 n Set particle point size 20 -- very large printf addAttr -is true -ln pointSize -at long -dv 20 particleShape1 n Add per-particle color attribute rgbPP printf addAttr -ln rgbPP -dt vectorArray particleShape1 n Set per-particle color values from our varying primvar data printf setAttr particleShape1.rgbPP -type vectorArray d , nverts for int vert 0 vert nverts vert float const color varyingBuffer vert . GetData printf f f f n , color 0 , color 1 , color 2 printf n delete vertexStencils delete varyingStencils return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_4_2.cpp far_tutorial_4_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_2far_tutorial_4_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate both vertex and varying FarStencilTable to interpolate 2 primvar data buffers vertex positions and vertex colors. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _data 0 src . _data 0 _data 1 src . _data 1 _data 2 src . _data 2 void Clear void 0 _data 0 _data 1 _data 2 0.0f void AddWithWeight Vertex const src , float weight _data 0 weight src . _data 0 _data 1 weight src . _data 1 _data 2 weight src . _data 2 Public interface ------------------------------------ float const GetData const return _data private float _data 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f Per-vertex RGB color data static float g_colors 24 1.0f , 0.0f , 0.5f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 4 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel int nverts refiner - GetLevel maxlevel . GetNumVertices Use the FarStencilTable factory to create discrete stencil table Far StencilTableFactory Options options options . generateIntermediateLevels false only the highest refinement level. options . generateOffsets true Vertex primvar data Create stencils table for vertex interpolation options . interpolationMode Far StencilTableFactory INTERPOLATE_VERTEX Far StencilTable const vertexStencils Far StencilTableFactory Create refiner , options assert nverts vertexStencils - GetNumStencils Allocate vertex primvar buffer 1 stencil for each vertex std vector Vertex vertexBuffer vertexStencils - GetNumStencils Use the cube vertex positions as vertex primvar data Vertex vertexCVs reinterpret_cast Vertex g_verts Varying primvar data Create stencils table for varying interpolation options . interpolationMode Far StencilTableFactory INTERPOLATE_VARYING Far StencilTable const varyingStencils Far StencilTableFactory Create refiner , options assert nverts varyingStencils - GetNumStencils Allocate varying primvar buffer 1 stencil for each vertex std vector Vertex varyingBuffer varyingStencils - GetNumStencils Use per-vertex array of RGB colors as varying primvar data Vertex varyingCVs reinterpret_cast Vertex g_colors delete refiner Apply stencils in frame loop This section would be applied every frame after control vertices have been moved. Apply stencils on the control vertex data to update the primvar data of the refined vertices. vertexStencils - UpdateValues vertexCVs , vertexBuffer 0 varyingStencils - UpdateValues varyingCVs , varyingBuffer 0 Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle for int vert 0 vert int nverts vert float const pos vertexBuffer vert . GetData printf -p f f f n , pos 0 , pos 1 , pos 2 printf -c 1 n Set particle point size 20 -- very large printf addAttr -is true -ln pointSize -at long -dv 20 particleShape1 n Add per-particle color attribute rgbPP printf addAttr -ln rgbPP -dt vectorArray particleShape1 n Set per-particle color values from our varying primvar data printf setAttr particleShape1.rgbPP -type vectorArray d , nverts for int vert 0 vert nverts vert float const color varyingBuffer vert . GetData printf f f f n , color 0 , color 1 , color 2 printf n delete vertexStencils delete varyingStencils return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_4_2.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "far_tutorial_2_3.cpp", │ │ │ │ │ + "text": "far_tutorial_2_3.cpp far_tutorial_2_3.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_3far_tutorial_2_3.cpp ------------------------------------------------------------------------------ Tutorial description NOTE The following approaches are approximations to compute smooth normals, for highest fidelity patches should be used for positions and normals, which form the true limit surface. Building on tutorial 3, this example shows how to instantiate a simple mesh, refine it uniformly, interpolate both vertex and face-varying primvar data, and finally calculate approximated smooth normals. The resulting interpolated data is output in obj format. Currently, this tutorial supports 3 methods to approximate smooth normals CrossTriangle Calculates smooth normals accumulating per vertex using 3 verts to generate 2 vectors. This approximation has trouble when working with quads which can be non-planar since it only takes into account half of each face. CrossQuad Calculates smooth normals accumulating per vertex but this time, instead of taking into account only 3 verts it creates 2 vectors crossing the quad. This approximation builds upon CrossTriangle but takes into account the 4 verts of the face. Limit Calculates the normals at the limit for each vert at the last level of subdivision. These are the true limit normals, however, in this example they are used with verts that are not at the limit. This can lead to new visual artifacts since the normals and the positions dont match. Additionally, this approach requires extra computation to calculate the limit normals. For this reason, we strongly suggest using limit positions with limit normals. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Math helpers. Returns the normalized version of the input vector inline void normalize float n float rn 1.0f sqrtf n 0 n 0 n 1 n 1 n 2 n 2 n 0 rn n 1 rn n 2 rn Returns the cross product of p v1 and p v2. void cross float const v1 , float const v2 , float vOut vOut 0 v1 1 v2 2 - v1 2 v2 1 vOut 1 v1 2 v2 0 - v1 0 v2 2 vOut 2 v1 0 v2 1 - v1 1 v2 0 ------------------------------------------------------------------------------ Face-varying implementation. struct Vertex Minimal required interface ---------------------- Vertex Clear Vertex Vertex const src position 0 src . position 0 position 1 src . position 1 position 2 src . position 2 void Clear position 0 position 1 position 2 0.0f void AddWithWeight Vertex const src , float weight position 0 weight src . position 0 position 1 weight src . position 1 position 2 weight src . position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z position 0 x position 1 y position 2 z const float GetPosition const return position float position 3 ------------------------------------------------------------------------------ Face-varying container implementation. We are using a uv texture layout as a face-varying primtiive variable attribute. Because face-varying data is specified per-face-per-vertex, we cannot use the same container that we use for vertex or varying data. We specify a new container, which only carries u,v coordinates. Similarly to our Vertex container, we add a minimaliztic interpolation interface with a Clear and AddWithWeight methods. struct FVarVertexUV Minimal required interface ---------------------- void Clear u v 0.0f void AddWithWeight FVarVertexUV const src , float weight u weight src . u v weight src . v Basic uv layout channel float u , v struct FVarVertexColor Minimal required interface ---------------------- void Clear r g b a 0.0f void AddWithWeight FVarVertexColor const src , float weight r weight src . r g weight src . g b weight src . b a weight src . a Basic color layout channel float r , g , b , a ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h vertex primitive variable data topology static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 face-varying primitive variable data topology for UVs static float g_uvs 14 2 0.375 , 0.00 , 0.625 , 0.00 , 0.375 , 0.25 , 0.625 , 0.25 , 0.375 , 0.50 , 0.625 , 0.50 , 0.375 , 0.75 , 0.625 , 0.75 , 0.375 , 1.00 , 0.625 , 1.00 , 0.875 , 0.00 , 0.875 , 0.25 , 0.125 , 0.00 , 0.125 , 0.25 static int g_nuvs 14 static int g_uvIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 9 , 8 , 1 , 10 , 11 , 3 , 12 , 0 , 2 , 13 face-varying primitive variable data topology for color static float g_colors 24 4 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 static int g_ncolors 24 static int g_colorIndices 24 0 , 3 , 9 , 6 , 7 , 10 , 15 , 12 , 13 , 16 , 21 , 18 , 19 , 22 , 4 , 1 , 5 , 23 , 17 , 11 , 20 , 2 , 8 , 14 using namespace OpenSubdiv Approximation methods for smooth normal computations enum NormalApproximation CrossTriangle , CrossQuad , Limit ------------------------------------------------------------------------------ int main int argc , char argv const int maxlevel 2 enum NormalApproximation normalApproximation CrossTriangle Parsing command line parameters to see if the user wants to use a specific method to calculate normals for int i 1 i argc i if strstr argv i , -limit normalApproximation Limit else if strcmp argv i , -crossquad normalApproximation CrossQuad else if strcmp argv i , -crosstriangle normalApproximation CrossTriangle else printf Parameters n printf -crosstriangle use the cross product of vectors n printf generated from 3 verts default. n printf -crossquad use the cross product of vectors n printf generated from 4 verts. n printf -limit use normals calculated from the limit. n return 0 typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY options . SetFVarLinearInterpolation Sdc Options FVAR_LINEAR_NONE Populate a topology descriptor with our raw data Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Create a face-varying channel descriptor const int numChannels 2 const int channelUV 0 const int channelColor 1 Descriptor FVarChannel channels numChannels channels channelUV . numValues g_nuvs channels channelUV . valueIndices g_uvIndices channels channelColor . numValues g_ncolors channels channelColor . valueIndices g_colorIndices Add the channel topology to the main descriptor desc . numFVarChannels numChannels desc . fvarChannels channels Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topolgy up to maxlevel note fullTopologyInLastLevel must be true to work with face-varying data Far TopologyRefiner UniformOptions refineOptions maxlevel refineOptions . fullTopologyInLastLevel true refiner - RefineUniform refineOptions Allocate and initialize the vertex primvar data see tutorial 2 for more details. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 for int i 0 i g_nverts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Allocate initialize the first channel of face-varying primvars UVs std vector FVarVertexUV fvBufferUV refiner - GetNumFVarValuesTotal channelUV FVarVertexUV fvVertsUV fvBufferUV 0 for int i 0 i g_nuvs i fvVertsUV i . u g_uvs i 0 fvVertsUV i . v g_uvs i 1 Allocate interpolate the face-varying primvar data colors std vector FVarVertexColor fvBufferColor refiner - GetNumFVarValuesTotal channelColor FVarVertexColor fvVertsColor fvBufferColor 0 for int i 0 i g_ncolors i fvVertsColor i . r g_colors i 0 fvVertsColor i . g g_colors i 1 fvVertsColor i . b g_colors i 2 fvVertsColor i . a g_colors i 3 Interpolate both vertex and face-varying primvar data Far PrimvarRefiner primvarRefiner refiner Vertex srcVert verts FVarVertexUV srcFVarUV fvVertsUV FVarVertexColor srcFVarColor fvVertsColor for int level 1 level maxlevel level Vertex dstVert srcVert refiner - GetLevel level -1 . GetNumVertices FVarVertexUV dstFVarUV srcFVarUV refiner - GetLevel level -1 . GetNumFVarValues channelUV FVarVertexColor dstFVarColor srcFVarColor refiner - GetLevel level -1 . GetNumFVarValues channelColor primvarRefiner . Interpolate level , srcVert , dstVert primvarRefiner . InterpolateFaceVarying level , srcFVarUV , dstFVarUV , channelUV primvarRefiner . InterpolateFaceVarying level , srcFVarColor , dstFVarColor , channelColor srcVert dstVert srcFVarUV dstFVarUV srcFVarColor dstFVarColor Approximate normals Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces int firstOfLastVerts refiner - GetNumVerticesTotal - nverts std vector Vertex normals nverts Different ways to approximate smooth normals For details check the description at the beginning of the file if normalApproximation Limit Approximation using the normal at the limit with verts that are not at the limit For details check the description at the beginning of the file std vector Vertex fineLimitPos nverts std vector Vertex fineDu nverts std vector Vertex fineDv nverts primvarRefiner . Limit verts firstOfLastVerts , fineLimitPos , fineDu , fineDv for int vert 0 vert nverts vert float const du fineDu vert . GetPosition float const dv fineDv vert . GetPosition float norm 3 cross du , dv , norm normals vert . SetPosition norm 0 , norm 1 , norm 2 else if normalApproximation CrossQuad Approximate smooth normals by accumulating normal vectors computed as the cross product of two vectors generated by the 4 verts that form each quad For details check the description at the beginning of the file for int f 0 f nfaces f Far ConstIndexArray faceVertices refLastLevel . GetFaceVertices f We will use the first three verts to calculate a normal const float v0 verts firstOfLastVerts faceVertices 0 . GetPosition const float v1 verts firstOfLastVerts faceVertices 1 . GetPosition const float v2 verts firstOfLastVerts faceVertices 2 . GetPosition const float v3 verts firstOfLastVerts faceVertices 3 . GetPosition Calculate the cross product between the vectors formed by v1-v0 and v2-v0, and then normalize the result float normalCalculated 0.0 , 0.0 , 0.0 float a 3 v2 0 - v0 0 , v2 1 - v0 1 , v2 2 - v0 2 float b 3 v3 0 - v1 0 , v3 1 - v1 1 , v3 2 - v1 2 cross a , b , normalCalculated normalize normalCalculated Accumulate that normal on all verts that are part of that face for int vInFace 0 vInFace faceVertices . size vInFace int vertexIndex faceVertices vInFace normals vertexIndex . position 0 normalCalculated 0 normals vertexIndex . position 1 normalCalculated 1 normals vertexIndex . position 2 normalCalculated 2 else if normalApproximation CrossTriangle Approximate smooth normals by accumulating normal vectors computed as the cross product of two vectors generated by 3 verts of the quad For details check the description at the beginning of the file for int f 0 f nfaces f Far ConstIndexArray faceVertices refLastLevel . GetFaceVertices f We will use the first three verts to calculate a normal const float v0 verts firstOfLastVerts faceVertices 0 . GetPosition const float v1 verts firstOfLastVerts faceVertices 1 . GetPosition const float v2 verts firstOfLastVerts faceVertices 2 . GetPosition Calculate the cross product between the vectors formed by v1-v0 and v2-v0, and then normalize the result float normalCalculated 0.0 , 0.0 , 0.0 float a 3 v1 0 - v0 0 , v1 1 - v0 1 , v1 2 - v0 2 float b 3 v2 0 - v0 0 , v2 1 - v0 1 , v2 2 - v0 2 cross a , b , normalCalculated normalize normalCalculated Accumulate that normal on all verts that are part of that face for int vInFace 0 vInFace faceVertices . size vInFace int vertexIndex faceVertices vInFace normals vertexIndex . position 0 normalCalculated 0 normals vertexIndex . position 1 normalCalculated 1 normals vertexIndex . position 2 normalCalculated 2 Finally we just need to normalize the accumulated normals for int vert 0 vert nverts vert normalize normals vert . position 0 Output OBJ of the highest level refined ----------- Print vertex positions for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print vertex normals for int vert 0 vert nverts vert float const pos normals vert . GetPosition printf vn f f f n , pos 0 , pos 1 , pos 2 Print uvs int nuvs refLastLevel . GetNumFVarValues channelUV int firstOfLastUvs refiner - GetNumFVarValuesTotal channelUV - nuvs for int fvvert 0 fvvert nuvs fvvert FVarVertexUV const uv fvVertsUV firstOfLastUvs fvvert printf vt f f n , uv . u , uv . v Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face Far ConstIndexArray fuvs refLastLevel . GetFaceFVarValues face , channelUV all refined Catmark faces should be quads assert fverts . size 4 fuvs . size 4 printf f for int vert 0 vert fverts . size vert OBJ uses 1-based arrays... printf ddd , fverts vert 1 , fuvs vert 1 , fverts vert 1 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "far_tutorial_2_3.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "far_tutorial_4_1.cpp", │ │ │ │ │ - "text": "far_tutorial_4_1.cpp far_tutorial_4_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_1far_tutorial_4_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate FarStencilTable. We use the factorized stencils to interpolate vertex primvar data buffers. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z float const GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 3 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Use the FarStencilTable factory to create discrete stencil table note we only want stencils for the highest refinement level. Far StencilTableFactory Options options options . generateIntermediateLevels false options . generateOffsets true Far StencilTable const stencilTable Far StencilTableFactory Create refiner , options Allocate vertex primvar buffer 1 stencil for each vertex int nstencils stencilTable - GetNumStencils std vector Vertex vertexBuffer nstencils Quick dirty re-cast of the primvar data from our cube this is where you would drive shape deformations every frame Vertex controlValues reinterpret_cast Vertex g_verts This section would be applied every frame after control vertices have been moved. Apply stencils on the control vertex data to update the primvar data of the refined vertices. stencilTable - UpdateValues controlValues , vertexBuffer 0 Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle for int i 0 i int vertexBuffer . size i float const pos vertexBuffer i . GetPosition printf -p f f f n , pos 0 , pos 1 , pos 2 printf -c 1 n delete refiner delete stencilTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. return Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options ------------------------------------------------------------------------------ Generated on 2024-01-08 0941 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_4_1.cpp far_tutorial_4_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_4_1far_tutorial_4_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to create and manipulate FarStencilTable. We use the factorized stencils to interpolate vertex primvar data buffers. include opensubdivfartopologyDescriptor.h include opensubdivfarstencilTable.h include opensubdivfarstencilTableFactory.h include cstdio include cstring ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z float const GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 24 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createTopologyRefiner ------------------------------------------------------------------------------ int main int , char Generate a FarTopologyRefiner see tutorial_1_1 for details. Far TopologyRefiner refiner createTopologyRefiner Uniformly refine the topology up to maxlevel. int maxlevel 3 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Use the FarStencilTable factory to create discrete stencil table note we only want stencils for the highest refinement level. Far StencilTableFactory Options options options . generateIntermediateLevels false options . generateOffsets true Far StencilTable const stencilTable Far StencilTableFactory Create refiner , options Allocate vertex primvar buffer 1 stencil for each vertex int nstencils stencilTable - GetNumStencils std vector Vertex vertexBuffer nstencils Quick dirty re-cast of the primvar data from our cube this is where you would drive shape deformations every frame Vertex controlValues reinterpret_cast Vertex g_verts This section would be applied every frame after control vertices have been moved. Apply stencils on the control vertex data to update the primvar data of the refined vertices. stencilTable - UpdateValues controlValues , vertexBuffer 0 Visualization with Maya print a MEL script that generates particles at the location of the refined vertices printf particle for int i 0 i int vertexBuffer . size i float const pos vertexBuffer i . GetPosition printf -p f f f n , pos 0 , pos 1 , pos 2 printf -c 1 n delete refiner delete stencilTable return EXIT_SUCCESS ------------------------------------------------------------------------------ static Far TopologyRefiner createTopologyRefiner Populate a topology descriptor with our raw data. typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor. return Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_4_1.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_2_2.cpp", │ │ │ │ │ - "text": "far_tutorial_2_2.cpp far_tutorial_2_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_2far_tutorial_2_2.cpp ------------------------------------------------------------------------------ Tutorial description Building on tutorial 0, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and face-varying primvar data. The resulting interpolated data is output as an obj file, with the face-varying data recorded in the uv texture layout. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Face-varying implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Face-varying container implementation. We are using a uv texture layout as a face-varying primitive variable attribute. Because face-varying data is specified per-face-per-vertex, we cannot use the same container that we use for vertex or varying data. We specify a new container, which only carries u,v coordinates. Similarly to our Vertex container, we add a minimalistic interpolation interface with a Clear and AddWithWeight methods. struct FVarVertexUV Minimal required interface ---------------------- void Clear u v 0.0f void AddWithWeight FVarVertexUV const src , float weight u weight src . u v weight src . v Basic uv layout channel float u , v struct FVarVertexColor Minimal required interface ---------------------- void Clear r g b a 0.0f void AddWithWeight FVarVertexColor const src , float weight r weight src . r g weight src . g b weight src . b a weight src . a Basic color layout channel float r , g , b , a ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h vertex primitive variable data topology static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 face-varying primitive variable data topology for UVs static float g_uvs 14 2 0.375 , 0.00 , 0.625 , 0.00 , 0.375 , 0.25 , 0.625 , 0.25 , 0.375 , 0.50 , 0.625 , 0.50 , 0.375 , 0.75 , 0.625 , 0.75 , 0.375 , 1.00 , 0.625 , 1.00 , 0.875 , 0.00 , 0.875 , 0.25 , 0.125 , 0.00 , 0.125 , 0.25 static int g_nuvs 14 static int g_uvIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 9 , 8 , 1 , 10 , 11 , 3 , 12 , 0 , 2 , 13 face-varying primitive variable data topology for color static float g_colors 24 4 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 static int g_ncolors 24 static int g_colorIndices 24 0 , 3 , 9 , 6 , 7 , 10 , 15 , 12 , 13 , 16 , 21 , 18 , 19 , 22 , 4 , 1 , 5 , 23 , 17 , 11 , 20 , 2 , 8 , 14 using namespace OpenSubdiv ------------------------------------------------------------------------------ int main int , char int maxlevel 3 typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY options . SetFVarLinearInterpolation Sdc Options FVAR_LINEAR_NONE Populate a topology descriptor with our raw data Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices int channelUV 0 int channelColor 1 Create a face-varying channel descriptor Descriptor FVarChannel channels 2 channels channelUV . numValues g_nuvs channels channelUV . valueIndices g_uvIndices channels channelColor . numValues g_ncolors channels channelColor . valueIndices g_colorIndices Add the channel topology to the main descriptor desc . numFVarChannels 2 desc . fvarChannels channels Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topology up to maxlevel note fullTopologyInLastLevel must be true to work with face-varying data Far TopologyRefiner UniformOptions refineOptions maxlevel refineOptions . fullTopologyInLastLevel true refiner - RefineUniform refineOptions Allocate and initialize the vertex primvar data see tutorial 2 for more details. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 for int i 0 i g_nverts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Allocate and initialize the first channel of face-varying primvar data UVs std vector FVarVertexUV fvBufferUV refiner - GetNumFVarValuesTotal channelUV FVarVertexUV fvVertsUV fvBufferUV 0 for int i 0 i g_nuvs i fvVertsUV i . u g_uvs i 0 fvVertsUV i . v g_uvs i 1 Allocate interpolate the face-varying primvar data colors std vector FVarVertexColor fvBufferColor refiner - GetNumFVarValuesTotal channelColor FVarVertexColor fvVertsColor fvBufferColor 0 for int i 0 i g_ncolors i fvVertsColor i . r g_colors i 0 fvVertsColor i . g g_colors i 1 fvVertsColor i . b g_colors i 2 fvVertsColor i . a g_colors i 3 Interpolate both vertex and face-varying primvar data Far PrimvarRefiner primvarRefiner refiner Vertex srcVert verts FVarVertexUV srcFVarUV fvVertsUV FVarVertexColor srcFVarColor fvVertsColor for int level 1 level maxlevel level Vertex dstVert srcVert refiner - GetLevel level -1 . GetNumVertices FVarVertexUV dstFVarUV srcFVarUV refiner - GetLevel level -1 . GetNumFVarValues channelUV FVarVertexColor dstFVarColor srcFVarColor refiner - GetLevel level -1 . GetNumFVarValues channelColor primvarRefiner . Interpolate level , srcVert , dstVert primvarRefiner . InterpolateFaceVarying level , srcFVarUV , dstFVarUV , channelUV primvarRefiner . InterpolateFaceVarying level , srcFVarColor , dstFVarColor , channelColor srcVert dstVert srcFVarUV dstFVarUV srcFVarColor dstFVarColor Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nuvs refLastLevel . GetNumFVarValues channelUV int ncolors refLastLevel . GetNumFVarValues channelColor int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print uvs int firstOfLastUvs refiner - GetNumFVarValuesTotal channelUV - nuvs for int fvvert 0 fvvert nuvs fvvert FVarVertexUV const uv fvVertsUV firstOfLastUvs fvvert printf vt f f n , uv . u , uv . v Print colors int firstOfLastColors refiner - GetNumFVarValuesTotal channelColor - ncolors for int fvvert 0 fvvert ncolors fvvert FVarVertexColor const c fvVertsColor firstOfLastColors fvvert printf c f f f f n , c . r , c . g , c . b , c . a Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face Far ConstIndexArray fuvs refLastLevel . GetFaceFVarValues face , channelUV all refined Catmark faces should be quads assert fverts . size 4 fuvs . size 4 printf f for int vert 0 vert fverts . size vert OBJ uses 1-based arrays... printf dd , fverts vert 1 , fuvs vert 1 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_2_2.cpp far_tutorial_2_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_2far_tutorial_2_2.cpp ------------------------------------------------------------------------------ Tutorial description Building on tutorial 0, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and face-varying primvar data. The resulting interpolated data is output as an obj file, with the face-varying data recorded in the uv texture layout. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Face-varying implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Face-varying container implementation. We are using a uv texture layout as a face-varying primitive variable attribute. Because face-varying data is specified per-face-per-vertex, we cannot use the same container that we use for vertex or varying data. We specify a new container, which only carries u,v coordinates. Similarly to our Vertex container, we add a minimalistic interpolation interface with a Clear and AddWithWeight methods. struct FVarVertexUV Minimal required interface ---------------------- void Clear u v 0.0f void AddWithWeight FVarVertexUV const src , float weight u weight src . u v weight src . v Basic uv layout channel float u , v struct FVarVertexColor Minimal required interface ---------------------- void Clear r g b a 0.0f void AddWithWeight FVarVertexColor const src , float weight r weight src . r g weight src . g b weight src . b a weight src . a Basic color layout channel float r , g , b , a ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h vertex primitive variable data topology static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 face-varying primitive variable data topology for UVs static float g_uvs 14 2 0.375 , 0.00 , 0.625 , 0.00 , 0.375 , 0.25 , 0.625 , 0.25 , 0.375 , 0.50 , 0.625 , 0.50 , 0.375 , 0.75 , 0.625 , 0.75 , 0.375 , 1.00 , 0.625 , 1.00 , 0.875 , 0.00 , 0.875 , 0.25 , 0.125 , 0.00 , 0.125 , 0.25 static int g_nuvs 14 static int g_uvIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 9 , 8 , 1 , 10 , 11 , 3 , 12 , 0 , 2 , 13 face-varying primitive variable data topology for color static float g_colors 24 4 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 static int g_ncolors 24 static int g_colorIndices 24 0 , 3 , 9 , 6 , 7 , 10 , 15 , 12 , 13 , 16 , 21 , 18 , 19 , 22 , 4 , 1 , 5 , 23 , 17 , 11 , 20 , 2 , 8 , 14 using namespace OpenSubdiv ------------------------------------------------------------------------------ int main int , char int maxlevel 3 typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY options . SetFVarLinearInterpolation Sdc Options FVAR_LINEAR_NONE Populate a topology descriptor with our raw data Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices int channelUV 0 int channelColor 1 Create a face-varying channel descriptor Descriptor FVarChannel channels 2 channels channelUV . numValues g_nuvs channels channelUV . valueIndices g_uvIndices channels channelColor . numValues g_ncolors channels channelColor . valueIndices g_colorIndices Add the channel topology to the main descriptor desc . numFVarChannels 2 desc . fvarChannels channels Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options Uniformly refine the topology up to maxlevel note fullTopologyInLastLevel must be true to work with face-varying data Far TopologyRefiner UniformOptions refineOptions maxlevel refineOptions . fullTopologyInLastLevel true refiner - RefineUniform refineOptions Allocate and initialize the vertex primvar data see tutorial 2 for more details. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 for int i 0 i g_nverts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Allocate and initialize the first channel of face-varying primvar data UVs std vector FVarVertexUV fvBufferUV refiner - GetNumFVarValuesTotal channelUV FVarVertexUV fvVertsUV fvBufferUV 0 for int i 0 i g_nuvs i fvVertsUV i . u g_uvs i 0 fvVertsUV i . v g_uvs i 1 Allocate interpolate the face-varying primvar data colors std vector FVarVertexColor fvBufferColor refiner - GetNumFVarValuesTotal channelColor FVarVertexColor fvVertsColor fvBufferColor 0 for int i 0 i g_ncolors i fvVertsColor i . r g_colors i 0 fvVertsColor i . g g_colors i 1 fvVertsColor i . b g_colors i 2 fvVertsColor i . a g_colors i 3 Interpolate both vertex and face-varying primvar data Far PrimvarRefiner primvarRefiner refiner Vertex srcVert verts FVarVertexUV srcFVarUV fvVertsUV FVarVertexColor srcFVarColor fvVertsColor for int level 1 level maxlevel level Vertex dstVert srcVert refiner - GetLevel level -1 . GetNumVertices FVarVertexUV dstFVarUV srcFVarUV refiner - GetLevel level -1 . GetNumFVarValues channelUV FVarVertexColor dstFVarColor srcFVarColor refiner - GetLevel level -1 . GetNumFVarValues channelColor primvarRefiner . Interpolate level , srcVert , dstVert primvarRefiner . InterpolateFaceVarying level , srcFVarUV , dstFVarUV , channelUV primvarRefiner . InterpolateFaceVarying level , srcFVarColor , dstFVarColor , channelColor srcVert dstVert srcFVarUV dstFVarUV srcFVarColor dstFVarColor Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nuvs refLastLevel . GetNumFVarValues channelUV int ncolors refLastLevel . GetNumFVarValues channelColor int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print uvs int firstOfLastUvs refiner - GetNumFVarValuesTotal channelUV - nuvs for int fvvert 0 fvvert nuvs fvvert FVarVertexUV const uv fvVertsUV firstOfLastUvs fvvert printf vt f f n , uv . u , uv . v Print colors int firstOfLastColors refiner - GetNumFVarValuesTotal channelColor - ncolors for int fvvert 0 fvvert ncolors fvvert FVarVertexColor const c fvVertsColor firstOfLastColors fvvert printf c f f f f n , c . r , c . g , c . b , c . a Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face Far ConstIndexArray fuvs refLastLevel . GetFaceFVarValues face , channelUV all refined Catmark faces should be quads assert fverts . size 4 fuvs . size 4 printf f for int vert 0 vert fverts . size vert OBJ uses 1-based arrays... printf dd , fverts vert 1 , fuvs vert 1 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_2_2.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_2_1.cpp", │ │ │ │ │ - "text": "far_tutorial_2_1.cpp far_tutorial_2_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_1far_tutorial_2_1.cpp ------------------------------------------------------------------------------ Tutorial description Building on tutorial 0, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate additional sets of primvar data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. We are adding a per-vertex color attribute to our primvar data. While they are separate properties and exist in separate buffers as when read from an Alembic file they are both of the form float3 and so we can use the same underlying type. While color and position may be the same, well make the color a varying primvar, e.g. it is constrained to being linearly interpolated between vertices, rather than smoothly like position and other vertex data. struct Point3 Minimal required interface ---------------------- Point3 void Clear void 0 _point 0 _point 1 _point 2 0.0f void AddWithWeight Point3 const src , float weight _point 0 weight src . _point 0 _point 1 weight src . _point 1 _point 2 weight src . _point 2 Public interface ------------------------------------ void SetPoint float x , float y , float z _point 0 x _point 1 y _point 2 z const float GetPoint const return _point private float _point 3 typedef Point3 VertexPosition typedef Point3 VertexColor ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f Per-vertex RGB color data static float g_colors 8 3 1.0f , 0.0f , 0.5f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createFarTopologyRefiner ------------------------------------------------------------------------------ int main int , char int maxlevel 5 Far TopologyRefiner refiner createFarTopologyRefiner Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate buffers for vertex primvar data. We assume we received the coarse data for the mesh in separate buffers from some other source, e.g. an Alembic file. Meanwhile, we want buffers for the lastfinest subdivision level to persist. We have no interest in the intermediate levels. Determine the sizes for our needs int nCoarseVerts g_nverts int nFineVerts refiner - GetLevel maxlevel . GetNumVertices int nTotalVerts refiner - GetNumVerticesTotal int nTempVerts nTotalVerts - nCoarseVerts - nFineVerts Allocate and initialize the primvar data for the original coarse vertices std vector VertexPosition coarsePosBuffer nCoarseVerts std vector VertexColor coarseClrBuffer nCoarseVerts for int i 0 i nCoarseVerts i coarsePosBuffer i . SetPoint g_verts i 0 , g_verts i 1 , g_verts i 2 coarseClrBuffer i . SetPoint g_colors i 0 , g_colors i 1 , g_colors i 2 Allocate intermediate and final storage to be populated std vector VertexPosition tempPosBuffer nTempVerts std vector VertexPosition finePosBuffer nFineVerts std vector VertexColor tempClrBuffer nTempVerts std vector VertexColor fineClrBuffer nFineVerts Interpolate all primvar data -- separate buffers can be populated on separate threads if desired VertexPosition srcPos coarsePosBuffer 0 VertexPosition dstPos tempPosBuffer 0 VertexColor srcClr coarseClrBuffer 0 VertexColor dstClr tempClrBuffer 0 Far PrimvarRefiner primvarRefiner refiner for int level 1 level maxlevel level primvarRefiner . Interpolate level , srcPos , dstPos primvarRefiner . InterpolateVarying level , srcClr , dstClr srcPos dstPos , dstPos refiner - GetLevel level . GetNumVertices srcClr dstClr , dstClr refiner - GetLevel level . GetNumVertices Interpolate the last level into the separate buffers for our final data primvarRefiner . Interpolate maxlevel , srcPos , finePosBuffer primvarRefiner . InterpolateVarying maxlevel , srcClr , fineClrBuffer Visualization with Maya print a MEL script that generates colored particles at the location of the refined vertices dont forget to turn shading on in the viewport to see the colors int nverts nFineVerts Output particle positions printf particle for int vert 0 vert nverts vert float const pos finePosBuffer vert . GetPoint printf -p f f f n , pos 0 , pos 1 , pos 2 printf n Set particle point size 20 -- very large printf addAttr -is true -ln pointSize -at long -dv 20 particleShape1 n Add per-particle color attribute rgbPP printf addAttr -ln rgbPP -dt vectorArray particleShape1 n Set per-particle color values from our primvar data printf setAttr particleShape1.rgbPP -type vectorArray d , nverts for int vert 0 vert nverts vert float const color fineClrBuffer vert . GetPoint printf f f f n , color 0 , color 1 , color 2 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Creates FarTopologyRefiner from raw geometry see tutorial_1_1 for more details static Far TopologyRefiner createFarTopologyRefiner Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_2_1.cpp far_tutorial_2_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_2_1far_tutorial_2_1.cpp ------------------------------------------------------------------------------ Tutorial description Building on tutorial 0, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate additional sets of primvar data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. We are adding a per-vertex color attribute to our primvar data. While they are separate properties and exist in separate buffers as when read from an Alembic file they are both of the form float3 and so we can use the same underlying type. While color and position may be the same, well make the color a varying primvar, e.g. it is constrained to being linearly interpolated between vertices, rather than smoothly like position and other vertex data. struct Point3 Minimal required interface ---------------------- Point3 void Clear void 0 _point 0 _point 1 _point 2 0.0f void AddWithWeight Point3 const src , float weight _point 0 weight src . _point 0 _point 1 weight src . _point 1 _point 2 weight src . _point 2 Public interface ------------------------------------ void SetPoint float x , float y , float z _point 0 x _point 1 y _point 2 z const float GetPoint const return _point private float _point 3 typedef Point3 VertexPosition typedef Point3 VertexColor ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f Per-vertex RGB color data static float g_colors 8 3 1.0f , 0.0f , 0.5f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 0.0f , 0.0f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv static Far TopologyRefiner createFarTopologyRefiner ------------------------------------------------------------------------------ int main int , char int maxlevel 5 Far TopologyRefiner refiner createFarTopologyRefiner Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate buffers for vertex primvar data. We assume we received the coarse data for the mesh in separate buffers from some other source, e.g. an Alembic file. Meanwhile, we want buffers for the lastfinest subdivision level to persist. We have no interest in the intermediate levels. Determine the sizes for our needs int nCoarseVerts g_nverts int nFineVerts refiner - GetLevel maxlevel . GetNumVertices int nTotalVerts refiner - GetNumVerticesTotal int nTempVerts nTotalVerts - nCoarseVerts - nFineVerts Allocate and initialize the primvar data for the original coarse vertices std vector VertexPosition coarsePosBuffer nCoarseVerts std vector VertexColor coarseClrBuffer nCoarseVerts for int i 0 i nCoarseVerts i coarsePosBuffer i . SetPoint g_verts i 0 , g_verts i 1 , g_verts i 2 coarseClrBuffer i . SetPoint g_colors i 0 , g_colors i 1 , g_colors i 2 Allocate intermediate and final storage to be populated std vector VertexPosition tempPosBuffer nTempVerts std vector VertexPosition finePosBuffer nFineVerts std vector VertexColor tempClrBuffer nTempVerts std vector VertexColor fineClrBuffer nFineVerts Interpolate all primvar data -- separate buffers can be populated on separate threads if desired VertexPosition srcPos coarsePosBuffer 0 VertexPosition dstPos tempPosBuffer 0 VertexColor srcClr coarseClrBuffer 0 VertexColor dstClr tempClrBuffer 0 Far PrimvarRefiner primvarRefiner refiner for int level 1 level maxlevel level primvarRefiner . Interpolate level , srcPos , dstPos primvarRefiner . InterpolateVarying level , srcClr , dstClr srcPos dstPos , dstPos refiner - GetLevel level . GetNumVertices srcClr dstClr , dstClr refiner - GetLevel level . GetNumVertices Interpolate the last level into the separate buffers for our final data primvarRefiner . Interpolate maxlevel , srcPos , finePosBuffer primvarRefiner . InterpolateVarying maxlevel , srcClr , fineClrBuffer Visualization with Maya print a MEL script that generates colored particles at the location of the refined vertices dont forget to turn shading on in the viewport to see the colors int nverts nFineVerts Output particle positions printf particle for int vert 0 vert nverts vert float const pos finePosBuffer vert . GetPoint printf -p f f f n , pos 0 , pos 1 , pos 2 printf n Set particle point size 20 -- very large printf addAttr -is true -ln pointSize -at long -dv 20 particleShape1 n Add per-particle color attribute rgbPP printf addAttr -ln rgbPP -dt vectorArray particleShape1 n Set per-particle color values from our primvar data printf setAttr particleShape1.rgbPP -type vectorArray d , nverts for int vert 0 vert nverts vert float const color fineClrBuffer vert . GetPoint printf f f f n , color 0 , color 1 , color 2 printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Creates FarTopologyRefiner from raw geometry see tutorial_1_1 for more details static Far TopologyRefiner createFarTopologyRefiner Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_2_1.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_1_2.cpp", │ │ │ │ │ - "text": "far_tutorial_1_2.cpp far_tutorial_1_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_1_2far_tutorial_1_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates two different styles of defining classes for interpolating primvar data with the template methods in Far. The most common usage involves data of a fixed size, so the focus here is on an alternative supporting variable length data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio using namespace OpenSubdiv Vertex data containers for interpolation - Coord3 is fixed to support 3 floats - Coord2 is fixed to support 2 floats - CoordBuffer can support a specified number of floats struct Coord3 Coord3 Coord3 float x , float y , float z _xyz 0 x , _xyz 1 y , _xyz 2 z void Clear _xyz 0 _xyz 1 _xyz 2 0.0f void AddWithWeight Coord3 const src , float weight _xyz 0 weight src . _xyz 0 _xyz 1 weight src . _xyz 1 _xyz 2 weight src . _xyz 2 float const Coords const return _xyz 0 private float _xyz 3 struct Coord2 Coord2 Coord2 float u , float v _uv 0 u , _uv 1 v void Clear _uv 0 _uv 1 0.0f void AddWithWeight Coord2 const src , float weight _uv 0 weight src . _uv 0 _uv 1 weight src . _uv 1 float const Coords const return _uv 0 private float _uv 2 struct CoordBuffer The head of an external buffer and stride is specified on construction CoordBuffer float data , int size _data data , _size size CoordBuffer _data 0 , _size 0 void Clear for int i 0 i _size i _data i 0.0f void AddWithWeight CoordBuffer const src , float weight assert src . _size _size for int i 0 i _size i _data i weight src . _data i float const Coords const return _data Defining to return a location elsewhere in the buffer is the key requirement to supporting interpolatible data of varying size CoordBuffer operator int index const return CoordBuffer _data index _size , _size private float _data int _size Global cube geometry from catmark_cube.h Topology static int g_nverts 8 static int g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 Primvar data static float g_verts 8 3 0.0f , 0.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 0.0f , 0.0f , 0.0f , 0.0f , 1.0f , 0.0f , 0.0f Creates FarTopologyRefiner from raw geometry above see tutorial_1_1 for more details static Far TopologyRefiner createFarTopologyRefiner typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner Overview of main - create a FarTopologyRefiner and uniformly refine it - allocate separate and combined data buffers for vertex positions and UVs - populate all refined data buffers and compare results - write the result in Obj format Disable warnings for exact floating point comparisons ifdef __INTEL_COMPILER pragma warning disable 1572 endif int main int , char Instantiate a FarTopologyRefiner from the global geometry Far TopologyRefiner refiner createFarTopologyRefiner Uniformly refine the topology up to maxlevel int maxlevel 2 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate and populate data buffers for vertex primvar data -- positions and UVs. We assign UV coordiantes by simply projectingassigning XY values. The position and UV buffers use their associated data types, while the combined buffer uses 5 floats per vertex. int numBaseVertices g_nverts int numTotalVertices refiner - GetNumVerticesTotal std vector Coord3 posData numTotalVertices std vector Coord2 uvData numTotalVertices int combinedStride 3 2 std vector float combinedData numTotalVertices combinedStride for int i 0 i numBaseVertices i posData i Coord3 g_verts i 0 , g_verts i 1 , g_verts i 2 uvData i Coord2 g_verts i 0 , g_verts i 1 float coordCombined combinedData i combinedStride coordCombined 0 g_verts i 0 coordCombined 1 g_verts i 1 coordCombined 2 g_verts i 2 coordCombined 3 g_verts i 0 coordCombined 4 g_verts i 1 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Coord3 posSrc posData 0 Coord2 uvSrc uvData 0 CoordBuffer combinedSrc combinedData 0 , combinedStride for int level 1 level maxlevel level int numLevelVerts refiner - GetLevel level -1 . GetNumVertices Coord3 posDst posSrc numLevelVerts Coord2 uvDst uvSrc numLevelVerts CoordBuffer combinedDst combinedSrc numLevelVerts primvarRefiner . Interpolate level , posSrc , posDst primvarRefiner . Interpolate level , uvSrc , uvDst primvarRefiner . Interpolate level , combinedSrc , combinedDst posSrc posDst uvSrc uvDst combinedSrc combinedDst Verify that the combined coords match the separate results for int i numBaseVertices i numTotalVertices i float const posCoords posData i . Coords float const uvCoords uvData i . Coords float const combCoords combinedData combinedStride i assert combCoords 0 posCoords 0 assert combCoords 1 posCoords 1 assert combCoords 2 posCoords 2 assert combCoords 3 uvCoords 0 assert combCoords 4 uvCoords 1 Output OBJ of the highest level refined Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int firstOfLastVerts numTotalVertices - refLastLevel . GetNumVertices Print vertex positions printf Vertices n for int vert firstOfLastVerts vert numTotalVertices vert float const pos combinedData vert combinedStride printf v f f f n , pos 0 , pos 1 , pos 2 printf UV coordinates n for int vert firstOfLastVerts vert numTotalVertices vert float const uv combinedData vert combinedStride 3 printf vt f f n , uv 0 , uv 1 Print faces int numFaces refLastLevel . GetNumFaces printf Faces n for int face 0 face numFaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face printf f for int fvert 0 fvert fverts . size fvert int objIndex 1 fverts fvert OBJ uses 1-based arrays... printf dd , objIndex , objIndex printf n delete refiner return EXIT_SUCCESS Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_1_2.cpp far_tutorial_1_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_1_2far_tutorial_1_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial illustrates two different styles of defining classes for interpolating primvar data with the template methods in Far. The most common usage involves data of a fixed size, so the focus here is on an alternative supporting variable length data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio using namespace OpenSubdiv Vertex data containers for interpolation - Coord3 is fixed to support 3 floats - Coord2 is fixed to support 2 floats - CoordBuffer can support a specified number of floats struct Coord3 Coord3 Coord3 float x , float y , float z _xyz 0 x , _xyz 1 y , _xyz 2 z void Clear _xyz 0 _xyz 1 _xyz 2 0.0f void AddWithWeight Coord3 const src , float weight _xyz 0 weight src . _xyz 0 _xyz 1 weight src . _xyz 1 _xyz 2 weight src . _xyz 2 float const Coords const return _xyz 0 private float _xyz 3 struct Coord2 Coord2 Coord2 float u , float v _uv 0 u , _uv 1 v void Clear _uv 0 _uv 1 0.0f void AddWithWeight Coord2 const src , float weight _uv 0 weight src . _uv 0 _uv 1 weight src . _uv 1 float const Coords const return _uv 0 private float _uv 2 struct CoordBuffer The head of an external buffer and stride is specified on construction CoordBuffer float data , int size _data data , _size size CoordBuffer _data 0 , _size 0 void Clear for int i 0 i _size i _data i 0.0f void AddWithWeight CoordBuffer const src , float weight assert src . _size _size for int i 0 i _size i _data i weight src . _data i float const Coords const return _data Defining to return a location elsewhere in the buffer is the key requirement to supporting interpolatible data of varying size CoordBuffer operator int index const return CoordBuffer _data index _size , _size private float _data int _size Global cube geometry from catmark_cube.h Topology static int g_nverts 8 static int g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 Primvar data static float g_verts 8 3 0.0f , 0.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f , 1.0f , 1.0f , 0.0f , 0.0f , 0.0f , 0.0f , 1.0f , 0.0f , 0.0f Creates FarTopologyRefiner from raw geometry above see tutorial_1_1 for more details static Far TopologyRefiner createFarTopologyRefiner typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options return refiner Overview of main - create a FarTopologyRefiner and uniformly refine it - allocate separate and combined data buffers for vertex positions and UVs - populate all refined data buffers and compare results - write the result in Obj format Disable warnings for exact floating point comparisons ifdef __INTEL_COMPILER pragma warning disable 1572 endif int main int , char Instantiate a FarTopologyRefiner from the global geometry Far TopologyRefiner refiner createFarTopologyRefiner Uniformly refine the topology up to maxlevel int maxlevel 2 refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate and populate data buffers for vertex primvar data -- positions and UVs. We assign UV coordiantes by simply projectingassigning XY values. The position and UV buffers use their associated data types, while the combined buffer uses 5 floats per vertex. int numBaseVertices g_nverts int numTotalVertices refiner - GetNumVerticesTotal std vector Coord3 posData numTotalVertices std vector Coord2 uvData numTotalVertices int combinedStride 3 2 std vector float combinedData numTotalVertices combinedStride for int i 0 i numBaseVertices i posData i Coord3 g_verts i 0 , g_verts i 1 , g_verts i 2 uvData i Coord2 g_verts i 0 , g_verts i 1 float coordCombined combinedData i combinedStride coordCombined 0 g_verts i 0 coordCombined 1 g_verts i 1 coordCombined 2 g_verts i 2 coordCombined 3 g_verts i 0 coordCombined 4 g_verts i 1 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Coord3 posSrc posData 0 Coord2 uvSrc uvData 0 CoordBuffer combinedSrc combinedData 0 , combinedStride for int level 1 level maxlevel level int numLevelVerts refiner - GetLevel level -1 . GetNumVertices Coord3 posDst posSrc numLevelVerts Coord2 uvDst uvSrc numLevelVerts CoordBuffer combinedDst combinedSrc numLevelVerts primvarRefiner . Interpolate level , posSrc , posDst primvarRefiner . Interpolate level , uvSrc , uvDst primvarRefiner . Interpolate level , combinedSrc , combinedDst posSrc posDst uvSrc uvDst combinedSrc combinedDst Verify that the combined coords match the separate results for int i numBaseVertices i numTotalVertices i float const posCoords posData i . Coords float const uvCoords uvData i . Coords float const combCoords combinedData combinedStride i assert combCoords 0 posCoords 0 assert combCoords 1 posCoords 1 assert combCoords 2 posCoords 2 assert combCoords 3 uvCoords 0 assert combCoords 4 uvCoords 1 Output OBJ of the highest level refined Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int firstOfLastVerts numTotalVertices - refLastLevel . GetNumVertices Print vertex positions printf Vertices n for int vert firstOfLastVerts vert numTotalVertices vert float const pos combinedData vert combinedStride printf v f f f n , pos 0 , pos 1 , pos 2 printf UV coordinates n for int vert firstOfLastVerts vert numTotalVertices vert float const uv combinedData vert combinedStride 3 printf vt f f n , uv 0 , uv 1 Print faces int numFaces refLastLevel . GetNumFaces printf Faces n for int face 0 face numFaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face printf f for int fvert 0 fvert fverts . size fvert int objIndex 1 fverts fvert OBJ uses 1-based arrays... printf dd , objIndex , objIndex printf n delete refiner return EXIT_SUCCESS Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_1_2.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "far_tutorial_1_1.cpp", │ │ │ │ │ - "text": "far_tutorial_1_1.cpp far_tutorial_1_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_1_1far_tutorial_1_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial presents in a very succinct way the requisite steps to instantiate and refine a mesh with Far from simple topological data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv ------------------------------------------------------------------------------ int main int , char Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options int maxlevel 2 Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate a buffer for vertex primvar data. The buffer length is set to be the sum of all children vertices up to the highest level of refinement. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 Initialize coarse mesh positions int nCoarseVerts g_nverts for int i 0 i nCoarseVerts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Vertex src verts for int level 1 level maxlevel level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert 1 OBJ uses 1-based arrays... printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "far_tutorial_1_1.cpp far_tutorial_1_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialsfartutorial_1_1far_tutorial_1_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial presents in a very succinct way the requisite steps to instantiate and refine a mesh with Far from simple topological data. include opensubdivfartopologyDescriptor.h include opensubdivfarprimvarRefiner.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. struct Vertex Minimal required interface ---------------------- Vertex Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 ------------------------------------------------------------------------------ Cube geometry from catmark_cube.h static float g_verts 8 3 -0.5f , -0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , 0.5f , 0.5f , 0.5f , -0.5f , 0.5f , -0.5f , 0.5f , 0.5f , -0.5f , -0.5f , -0.5f , -0.5f , 0.5f , -0.5f , -0.5f static int g_nverts 8 , g_nfaces 6 static int g_vertsperface 6 4 , 4 , 4 , 4 , 4 , 4 static int g_vertIndices 24 0 , 1 , 3 , 2 , 2 , 3 , 5 , 4 , 4 , 5 , 7 , 6 , 6 , 7 , 1 , 0 , 1 , 7 , 5 , 3 , 6 , 0 , 2 , 4 using namespace OpenSubdiv ------------------------------------------------------------------------------ int main int , char Populate a topology descriptor with our raw data typedef Far TopologyDescriptor Descriptor Sdc SchemeType type OpenSubdiv Sdc SCHEME_CATMARK Sdc Options options options . SetVtxBoundaryInterpolation Sdc Options VTX_BOUNDARY_EDGE_ONLY Descriptor desc desc . numVertices g_nverts desc . numFaces g_nfaces desc . numVertsPerFace g_vertsperface desc . vertIndicesPerFace g_vertIndices Instantiate a FarTopologyRefiner from the descriptor Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc , Far TopologyRefinerFactory Descriptor Options type , options int maxlevel 2 Uniformly refine the topology up to maxlevel refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel Allocate a buffer for vertex primvar data. The buffer length is set to be the sum of all children vertices up to the highest level of refinement. std vector Vertex vbuffer refiner - GetNumVerticesTotal Vertex verts vbuffer 0 Initialize coarse mesh positions int nCoarseVerts g_nverts for int i 0 i nCoarseVerts i verts i . SetPosition g_verts i 0 , g_verts i 1 , g_verts i 2 Interpolate vertex primvar data Far PrimvarRefiner primvarRefiner refiner Vertex src verts for int level 1 level maxlevel level Vertex dst src refiner - GetLevel level -1 . GetNumVertices primvarRefiner . Interpolate level , src , dst src dst Output OBJ of the highest level refined ----------- Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces Print vertex positions int firstOfLastVerts refiner - GetNumVerticesTotal - nverts for int vert 0 vert nverts vert float const pos verts firstOfLastVerts vert . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face all refined Catmark faces should be quads assert fverts . size 4 printf f for int vert 0 vert fverts . size vert printf d , fverts vert 1 OBJ uses 1-based arrays... printf n delete refiner return EXIT_SUCCESS ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_tutorial_1_1.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "hbr_tutorial_1.cpp", │ │ │ │ │ - "text": "hbr_tutorial_1.cpp hbr_tutorial_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_1hbr_tutorial_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to safely create Hbr meshes from arbitrary topology. Because Hbr is a half-edge data structure, it cannot represent non-manifold topology. Ensuring that the geometry used is manifold is a requirement to use Hbr safely. This tutorial presents some simple tests to detect inappropriate topology. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cstdio ------------------------------------------------------------------------------ struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 void AddWithWeight Vertex const , float void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge ------------------------------------------------------------------------------ Non-manifold geometry from catmark_fan.h o o f2 o------------o------------o f0 f1 o------------ o------------o The shared edge of a fan is adjacent to 3 faces, and therefore non-manifold. static float verts 8 3 -1.0 , 0.0 , -1.0 , -1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 0.0 , -1.0 , 0.0 , 1.0 , 0.0 , 0.0 , 1.0 , -1.0 static int nverts 8 , nfaces 3 static int facenverts 3 4 , 4 , 4 static int faceverts 12 0 , 1 , 2 , 3 , 3 , 2 , 4 , 5 , 3 , 2 , 6 , 7 ------------------------------------------------------------------------------ int main int , char OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Hmesh hmesh new Hmesh catmark Vertex v for int i 0 i nverts i v . SetPosition verts i 0 , verts i 1 , verts i 2 hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i bool valid true for int j 0 j nv j Hvertex const origin hmesh - GetVertex fv j , destination hmesh - GetVertex fv j 1 nv Hhalfedge const opposite destination - GetEdge origin Make sure that the vertices exist in the mesh if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n valid false break Check for a degenerate edge if origin destination printf An edge was specified that connected a vertex to itself n valid false break Check that no more than 2 faces are adjacent to the edge if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n valid false break Check that the edge is unique and oriented properly if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n valid false break if valid hmesh - NewFace nv , fv , 0 else printf Skipped face d n , i fv nv hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly hmesh - Finish printf Created a fan with d faces and d vertices. n , hmesh - GetNumFaces , hmesh - GetNumVertices delete hmesh delete catmark ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "hbr_tutorial_1.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "hbr_tutorial_2.cpp", │ │ │ │ │ - "text": "hbr_tutorial_2.cpp hbr_tutorial_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_2hbr_tutorial_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to subdivide uniformly a simple Hbr mesh. We are building upon previous tutorials and assuming a fully instantiated mesh we start with an HbrMesh pointer initialized from the same pyramid shape used in hbr_tutorial_0. We then apply the Refine function sequentially to all the faces in the mesh to generate several levels of uniform subdivision. The resulting data is then dumped to the terminal in Wavefront OBJ format for inspection. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cassert include cstdio ------------------------------------------------------------------------------ For this tutorial, we have to flesh out the Vertex class further. Note that now the copy constructor, Clear and AddwithWeight methods have been implemented to interpolate our float3 position data. This vertex specialization pattern leaves client-code free to implement arbitrary vertex primvar data schemes or none at all to conserve efficiency struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge Hmesh createMesh ------------------------------------------------------------------------------ int main int , char Hmesh hmesh createMesh int maxlevel 2 , 2 levels of subdivision firstface 0 , marker to the first face index of level 2 firstvertex 0 marker to the first vertex index of level 2 Refine the mesh to maxlevel for int level 0 level maxlevel level Total number of faces in the mesh, across all levels Note this function iterates over the list of faces and can be slow int nfaces hmesh - GetNumFaces if level maxlevel -1 Save our vertex marker firstvertex hmesh - GetNumVertices Iterate over the faces of the current level of subdivision for int face firstface face nfaces face Hface f hmesh - GetFace face Note hole tags would have to be dealt with here. f - Refine Save our face index marker for the next level firstface nfaces Output OBJ of the highest level refined ----------- Print vertex positions int nverts hmesh - GetNumVertices for int vert firstvertex vert nverts vert float const pos hmesh - GetVertex vert - GetData . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face firstface face hmesh - GetNumFaces face Hface f hmesh - GetFace face assert f - GetNumVertices 4 printf f for int vert 0 vert 4 vert OBJ uses 1-based arrays printf d , f - GetVertex vert - GetID - firstvertex 1 printf n ------------------------------------------------------------------------------ Creates an Hbr mesh see hbr_tutorial_0 and hbr_tutorial_1 for more details Hmesh createMesh Pyramid geometry from catmark_pyramid.h static float verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f static int nverts 5 , nfaces 5 static int facenverts 5 3 , 3 , 3 , 3 , 4 static int faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Hmesh hmesh new Hmesh catmark Populate the vertices Vertex v for int i 0 i nverts i v . SetPosition verts i 0 , verts i 1 , verts i 2 hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i bool valid true for int j 0 j nv j Hvertex const origin hmesh - GetVertex fv j , destination hmesh - GetVertex fv j 1 nv Hhalfedge const opposite destination - GetEdge origin Make sure that the vertices exist in the mesh if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n valid false break Check for a degenerate edge if origin destination printf An edge was specified that connected a vertex to itself n valid false break Check that no more than 2 faces are adjacent to the edge if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n valid false break Check that the edge is unique and oriented properly if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n valid false break if valid hmesh - NewFace nv , fv , 0 else printf Skipped face d n , i fv nv hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly hmesh - Finish return hmesh ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "hbr_tutorial_2.cpp hbr_tutorial_2.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_2hbr_tutorial_2.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to subdivide uniformly a simple Hbr mesh. We are building upon previous tutorials and assuming a fully instantiated mesh we start with an HbrMesh pointer initialized from the same pyramid shape used in hbr_tutorial_0. We then apply the Refine function sequentially to all the faces in the mesh to generate several levels of uniform subdivision. The resulting data is then dumped to the terminal in Wavefront OBJ format for inspection. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cassert include cstdio ------------------------------------------------------------------------------ For this tutorial, we have to flesh out the Vertex class further. Note that now the copy constructor, Clear and AddwithWeight methods have been implemented to interpolate our float3 position data. This vertex specialization pattern leaves client-code free to implement arbitrary vertex primvar data schemes or none at all to conserve efficiency struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 _position 0 _position 1 _position 2 0.0f void AddWithWeight Vertex const src , float weight _position 0 weight src . _position 0 _position 1 weight src . _position 1 _position 2 weight src . _position 2 void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge Hmesh createMesh ------------------------------------------------------------------------------ int main int , char Hmesh hmesh createMesh int maxlevel 2 , 2 levels of subdivision firstface 0 , marker to the first face index of level 2 firstvertex 0 marker to the first vertex index of level 2 Refine the mesh to maxlevel for int level 0 level maxlevel level Total number of faces in the mesh, across all levels Note this function iterates over the list of faces and can be slow int nfaces hmesh - GetNumFaces if level maxlevel -1 Save our vertex marker firstvertex hmesh - GetNumVertices Iterate over the faces of the current level of subdivision for int face firstface face nfaces face Hface f hmesh - GetFace face Note hole tags would have to be dealt with here. f - Refine Save our face index marker for the next level firstface nfaces Output OBJ of the highest level refined ----------- Print vertex positions int nverts hmesh - GetNumVertices for int vert firstvertex vert nverts vert float const pos hmesh - GetVertex vert - GetData . GetPosition printf v f f f n , pos 0 , pos 1 , pos 2 Print faces for int face firstface face hmesh - GetNumFaces face Hface f hmesh - GetFace face assert f - GetNumVertices 4 printf f for int vert 0 vert 4 vert OBJ uses 1-based arrays printf d , f - GetVertex vert - GetID - firstvertex 1 printf n ------------------------------------------------------------------------------ Creates an Hbr mesh see hbr_tutorial_0 and hbr_tutorial_1 for more details Hmesh createMesh Pyramid geometry from catmark_pyramid.h static float verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f static int nverts 5 , nfaces 5 static int facenverts 5 3 , 3 , 3 , 3 , 4 static int faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Hmesh hmesh new Hmesh catmark Populate the vertices Vertex v for int i 0 i nverts i v . SetPosition verts i 0 , verts i 1 , verts i 2 hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i bool valid true for int j 0 j nv j Hvertex const origin hmesh - GetVertex fv j , destination hmesh - GetVertex fv j 1 nv Hhalfedge const opposite destination - GetEdge origin Make sure that the vertices exist in the mesh if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n valid false break Check for a degenerate edge if origin destination printf An edge was specified that connected a vertex to itself n valid false break Check that no more than 2 faces are adjacent to the edge if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n valid false break Check that the edge is unique and oriented properly if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n valid false break if valid hmesh - NewFace nv , fv , 0 else printf Skipped face d n , i fv nv hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly hmesh - Finish return hmesh ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "hbr_tutorial_2.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "Using Hbr", │ │ │ │ │ - "text": "Using Hbr Using Hbr 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Vertex Template API Creating a Mesh Instantiating an HbrMesh Creating Vertices Creating Faces Wrapping Things Up Boundary Interpolation Rules Adding Creases Vertex Creases Edge Creases Holes Hierarchical Edits Face-varying Data Instantiating the HbrMesh Setting the Face-Varying Data Retrieving the Face-Varying Data Valence Operators Managing Singular Vertices Note As of OpenSubdiv 3.0, all Hbr dependencies have been removed from the core APIs Sdc , Vtr , Far , Osd . The legacy source code of Hbr is provided purely for regression and legacy purposes. If your code is currently depending on Hbr functionality, we recommend migrating to the newer APIs as we cannot guarantee that this code will be maintained in future releases. For more information see the 3.0 release notes Vertex Template API The Hbr API abstracts the vertex class through templating. Client-code is expected to provide a vertex class that implements the requisite interpolation functionality. Here is an example of a simple vertex class that accounts for 3D position, but does not support arbitrary variables or varying interpolation. struct Vertex Vertex Vertex int i Vertex const Vertex src _pos 0 src . _pos 0 _pos 1 src . _pos 1 _pos 2 src . _pos 2 Vertex void AddWithWeight const Vertex src , float weight , void 0 _pos 0 weight src . _pos 0 _pos 1 weight src . _pos 1 _pos 2 weight src . _pos 2 void AddVaryingWithWeight const Vertex , float , void 0 void Clear void 0 _pos 0 _pos 1 _pos 2 0.0f void SetPosition float x , float y , float z _pos 0 x _pos 1 y _pos 2 z void ApplyVertexEdit const OpenSubdiv HbrVertexEdit Vertex edit const float src edit . GetEdit switch edit . GetOperation case OpenSubdiv HbrHierarchicalEdit Vertex Set _pos 0 src 0 _pos 1 src 1 _pos 2 src 2 break case OpenSubdiv HbrHierarchicalEdit Vertex Add _pos 0 src 0 _pos 1 src 1 _pos 2 src 2 break case OpenSubdiv HbrHierarchicalEdit Vertex Subtract _pos 0 - src 0 _pos 1 - src 1 _pos 2 - src 2 break void ApplyMovingVertexEdit const OpenSubdiv HbrMovingVertexEdit Vertex custom functions data not required by Hbr ------------------------- Vertex float x , float y , float z _pos 0 x _pos 1 y _pos 2 z const float GetPos const return _pos float _pos 3 In some cases, if only topological analysis is required, the class can be left un-implemented. Far and Osd for instance store vertex data in serialized interleaved vectors. Here is the OsdVertex class for reference class Vertex public Vertex Vertex int index Vertex Vertex const src void AddWithWeight Vertex const i , float weight , void 0 void AddVaryingWithWeight const Vertex i , float weight , void 0 void Clear void 0 void ApplyVertexEdit FarVertexEdit const Creating a Mesh The following tutorial walks through the steps of instantiating a simple Hbr mesh. The code found in regressioncommonshape_utils.h can also be used as an example. While this implementation covers many of Hbr s features, it does not provide coverage for the complete Renderman specification though. Instantiating an HbrMesh First we need to instantiate a mesh object. Hbr supports 3 subdivision schemes Catmull-Clark catmark Loop Bilinear The scheme is selected by passing an specialized instance of HbrSubdivisionT , HbrCatmarkSubdivisionT in this case. The scheme can be shared across multiple mesh objects, so we only need a single instance. static OpenSubdiv HbrCatmarkSubdivision Vertex _scheme OpenSubdiv HbrMesh Vertex mesh new OpenSubdiv HbrMesh Vertex _scheme Creating Vertices Adding vertices to the mesh is accomplished using the HbrMeshNewVertex method. Because Hbr uses a dedicated vertex allocator to help alleviate the performance impact of intensive fragmented memory allocations. This optimization results in the following design pattern Vertex vtx for int i 0 i numVerts i Vertex v mesh - NewVertex i , vtx v-SetPosition We instantiate a single default vertex object named vtx on the stack. We then recover the pointer to the actual vertex created in the mesh from the NewVertex method. Once we have recovered that pointer, we can set the data for our vertex by using any of the custom accessors. Creating Faces Once all the vertices have been registered in the mesh, we can start adding the faces with HbrMeshNewFace . Assuming we had an obj style reader, we need to know the number of vertices in the face and the indices of these vertices. for int f 0 f numFaces f int nverts obj - GetNumVertices f const int faceverts obj - GetFaceVerts f mesh - NewFace nv , fv , 0 However, Hbr is not able to handle non-manifold geometry. In order to avoid tripping asserts or causing memory violations, lets rewrite the previous loop with some some prototype code to check the validity of the topology. for int f 0 f numFaces f int nv obj - GetNumVertices f const int fv obj - GetFaceVerts f triangles only for Loop subdivision if scheme kLoop and nv 3 printf Trying to create a Loop subd with non-triangle face n continue now check the half-edges connectivity for int j 0 j nv j OpenSubdiv HbrVertex T origin mesh - GetVertex fv j OpenSubdiv HbrVertex T destination mesh - GetVertex fv j 1 nv OpenSubdiv HbrHalfedge T opposite destination - GetEdge origin if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n continue if origin destination printf An edge was specified that connected a vertex to itself n continue if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n continue if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n continue mesh - NewFace nv , fv , 0 Wrapping Things Up Once we have vertices and faces set in our mesh, we still need to wrap things up by calling HbrMeshFinish mesh - Finish Finish iterates over the mesh to apply the boundary interpolation rules and checks for singular vertices. At this point, there is one final topology check remaining to validate the mesh mesh - Finish if mesh - GetNumDisconnectedVertices printf The specified subdivmesh contains disconnected surface components. n abort or iterate over the mesh to remove the offending vertices Boundary Interpolation Rules The rule-set can be selected using the following accessors Vertex and varying data mesh - SetInterpolateBoundaryMethod OpenSubdiv HbrMesh Vertex k_InterpolateBoundaryEdgeOnly Face-varying data mesh - SetFVarInterpolateBoundaryMethod OpenSubdiv HbrMesh Vertex k_InterpolateBoundaryEdgeOnly Additional information on boundary interpolation rules can be found here Warning The boundary interpolation rules must be set before the call to HbrMeshFinish , which sets the sharpness values to boundary edges and vertices based on these rules. Adding Creases Hbr supports a sharpness attribute on both edges and vertices. Sharpness is set using the SetSharpnessfloat accessors. Vertex Creases Given an index, vertices are very easy to access in the mesh. int idx vertex index float sharp the edge sharpness OpenSubdiv HbrVertex Vertex v mesh - GetVertex idx if v v - SetSharpness std max 0.0f , sharp else printf cannot find vertex for corner tag d n , idx Edge Creases Usually, edge creases are described with a vertex indices pair. Here is some sample code to locate the matching half-edge and set a crease sharpness. int v0 , v1 vertex indices float sharp the edge sharpness OpenSubdiv HbrVertex Vertex v mesh - GetVertex v0 , w mesh - GetVertex v1 OpenSubdiv HbrHalfedge Vertex e 0 if v w if e v - GetEdge w 0 e w - GetEdge v if e e - SetSharpness std max 0.0f , sharp else printf cannot find edge for crease tag d,d n , v0 , v1 Holes Hbr faces support a hole tag. int idx the face index OpenSubdiv HbrFace Vertex f mesh - GetFace idx if f f - SetHole else printf cannot find face for hole tag d n , idx Note The hole tag is hierarchical sub-faces can also be marked as holes. See Hierarchical Edits Hierarchical Edits Hbr supports the following types of hierarchical edits Type Function Corner edits Modify vertex sharpness Crease edits Modify edge sharpness FaceEdit Modify custom face data FVarEdit Modify face-varying data VertexEdit Modify vertex and varying data HoleEdit Set hole tag Modifications are one of the following 3 operations Operation Set Add Subtract Here is a simple example that creates a hierarchical vertex edit. path 655, 2, 3, 0 int faceid 655 , nsubfaces 2 , subfaces 2 2 , 3 , vertexid 0 int offset 0 , offset to the vertex or varying data numElems 3 number of elements to apply the modifier to x,y,z 3 bool isP false shortcut to identify modifications to the vertex position P OpenSubdiv HbrHierarchicalEdit Vertex Operation op OpenSubdiv HbrHierarchicalEdit T Set float values 3 1.0f , 0.5f , 0.0f edit values OpenSubdiv HbrVertexEdit T edit new OpenSubdiv HbrVertexEdit T faceid , nsubfaces , subfaces , vertexid , offset , floatwidth , isP , op , values Face-varying Data Here is a walk-through of how to store face-varying data for a u,v pair. Unlike vertex and varying data which is accessed through the templated vertex API, face-varying data is directly aggregated as vectors of float data. Instantiating the HbrMesh The HbrMesh needs to retain some knowledge about the face-varying data that it carries in order to refine it correctly. int fvarwidth 2 total width of the fvar data static int indices 1 0 , 1 offset set to 0 widths 1 2 2 floats in a u,v pair int const fvarcount fvarwidth 0 1 0 , fvarindices fvarwidth 0 indices NULL , fvarwidths fvarwidth 0 widths NULL mesh new OpenSubdiv HbrMesh T _scheme , fvarcount , fvarindices , fvarwidths , fvarwidth Setting the Face-Varying Data After the topology has been created, Hbr is ready to accept face-varying data. Here is some sample code for int i 0 , idx 0 i numFaces i OpenSubdiv HbrFace Vertex f mesh - GetFace i int nv f - GetNumVertices note this is not the fastest way OpenSubdiv HbrHalfedge Vertex e f - GetFirstEdge for int j 0 j nv j , e e - GetNext OpenSubdiv HbrFVarData Vertex fvt e - GetOrgVertex - GetFVarData f float const fvdata GetFaceVaryingData i , j if not fvt . IsInitialized if no fvar daa exists yet on the vertex fvt . SetAllData 2 , fvdata else if not fvt . CompareAll 2 , fvdata if there already is fvar data and there is a boundary add the new data OpenSubdiv HbrFVarData T nfvt e - GetOrgVertex - NewFVarData f nfvt . SetAllData 2 , fvdata Retrieving the Face-Varying Data The HbrFVarData structures are expanded during the refinement process, with every sub-face being assigned a set of interpolated face-varying data. This data can be accessed in 2 ways From a face, passing a vertex index OpenSubdivHbrFaceVertex f OpenSubdiv HbrFVarData const fv f . GetFVarData vindex const float data fv . GetData From a vertex, passing a pointer to an incident face OpenSubdivHbrFaceVertex f OpenSubdiv HbrFVarData const fv myVertex . GetFVarData f const float data fv . GetData Valence Operators When manipulating meshes, it is often necessary to iterate over neighboring faces or vertices. Rather than gather lists of pointers and return them, Hbr exposes an operator pattern that guarantees consistent mesh traversals. The following example shows how to use an operator to count the number of neighboring vertices use HbrVertexGetValence for proper valence counts OpenSubdivHbrVertexVertex v class MyOperator public OpenSubdiv HbrVertexOperator Vertex public int count MyOperator count 0 virtual void operator OpenSubdiv HbrVertex Vertex v count MyOperator op v - ApplyOperatorSurroundingVertices op Managing Singular Vertices Certain topological configurations would force vertices to share multiple half-edge cycles. Because Hbr is a half-edge representation, these singular vertices have to be duplicated as part of the HbrMeshFinish phase of the instantiation. These duplicated vertices can cause problems for client-code that tries to populate buffers of vertex or varying data. The following sample code shows how to match the vertex data to singular vertex splits Populating an OsdCpuVertexBuffer with vertex data positions,... float const vtxData inMeshFn . getRawPoints returnStatus OpenSubdiv OsdCpuVertexBuffer vertexBuffer OpenSubdiv OsdCpuVertexBuffer Create numVertexElements , numFarVerts vertexBuffer - UpdateData vtxData , 0 , numVertices Duplicate the vertex data into the split singular vertices std vector std pair int , int const splits hbrMesh - GetSplitVertices for int i 0 i int splits . size i vertexBuffer - UpdateData vtxData splits i . second numVertexElements , splits i . first , 1 Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "hbr_tutorial_1.cpp", │ │ │ │ │ + "text": "hbr_tutorial_1.cpp hbr_tutorial_1.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_1hbr_tutorial_1.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial shows how to safely create Hbr meshes from arbitrary topology. Because Hbr is a half-edge data structure, it cannot represent non-manifold topology. Ensuring that the geometry used is manifold is a requirement to use Hbr safely. This tutorial presents some simple tests to detect inappropriate topology. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cstdio ------------------------------------------------------------------------------ struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 void AddWithWeight Vertex const , float void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge ------------------------------------------------------------------------------ Non-manifold geometry from catmark_fan.h o o f2 o------------o------------o f0 f1 o------------ o------------o The shared edge of a fan is adjacent to 3 faces, and therefore non-manifold. static float verts 8 3 -1.0 , 0.0 , -1.0 , -1.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 0.0 , -1.0 , 0.0 , 1.0 , 0.0 , 0.0 , 1.0 , -1.0 static int nverts 8 , nfaces 3 static int facenverts 3 4 , 4 , 4 static int faceverts 12 0 , 1 , 2 , 3 , 3 , 2 , 4 , 5 , 3 , 2 , 6 , 7 ------------------------------------------------------------------------------ int main int , char OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Hmesh hmesh new Hmesh catmark Vertex v for int i 0 i nverts i v . SetPosition verts i 0 , verts i 1 , verts i 2 hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i bool valid true for int j 0 j nv j Hvertex const origin hmesh - GetVertex fv j , destination hmesh - GetVertex fv j 1 nv Hhalfedge const opposite destination - GetEdge origin Make sure that the vertices exist in the mesh if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n valid false break Check for a degenerate edge if origin destination printf An edge was specified that connected a vertex to itself n valid false break Check that no more than 2 faces are adjacent to the edge if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n valid false break Check that the edge is unique and oriented properly if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n valid false break if valid hmesh - NewFace nv , fv , 0 else printf Skipped face d n , i fv nv hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly hmesh - Finish printf Created a fan with d faces and d vertices. n , hmesh - GetNumFaces , hmesh - GetNumVertices delete hmesh delete catmark ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "using_osd_hbr.html" │ │ │ │ │ + "loc": "hbr_tutorial_1.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "hbr_tutorial_0.cpp", │ │ │ │ │ - "text": "hbr_tutorial_0.cpp hbr_tutorial_0.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_0hbr_tutorial_0.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial presents in a very succinct way the requisite steps to instantiate an Hbr mesh from simple topological data. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. The HbrMeshT class is a templated interface that expects a vertex class to perform interpolation on arbitrary vertex data. For the template specialization of the HbrMesh interface to be met, our Vertex object to implement a minimal set of constructors and member functions. Since we are not going to subdivide the mesh, the struct presented here has been left minimalistic. The only customization added to our container was to provide storage and accessors for the position of a 3D vertex. struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 void AddWithWeight Vertex const , float void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge ------------------------------------------------------------------------------ Pyramid geometry from catmark_pyramid.h static float verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f static int nverts 5 , nfaces 5 static int facenverts 5 3 , 3 , 3 , 3 , 4 static int faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 ------------------------------------------------------------------------------ int main int , char Create a subdivision scheme Catmull-Clark here OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Create an empty Hbr mesh Hmesh hmesh new Hmesh catmark Populate the vertices Vertex v for int i 0 i nverts i Primitive variable data must be set here in our case we set the 3D position of the vertex. v . SetPosition verts i 0 , verts i 1 , verts i 2 Add the vertex to the mesh. hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i hmesh - NewFace nv , fv , 0 fv nv Set subdivision options By default vertex interpolation is set to none on boundaries, which can produce un-expected results, so we change it to edge-only. hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly Call Finish to finalize the data structures before using the mesh. hmesh - Finish printf Created a pyramid with d faces and d vertices. n , hmesh - GetNumFaces , hmesh - GetNumVertices delete hmesh delete catmark ------------------------------------------------------------------------------ Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "hbr_tutorial_0.cpp hbr_tutorial_0.cpp 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE httpsgithub.comPixarAnimationStudiosOpenSubdivblobreleasetutorialshbrtutorial_0hbr_tutorial_0.cpp ------------------------------------------------------------------------------ Tutorial description This tutorial presents in a very succinct way the requisite steps to instantiate an Hbr mesh from simple topological data. include opensubdivhbrmesh.h include opensubdivhbrcatmark.h include cstdio ------------------------------------------------------------------------------ Vertex container implementation. The HbrMeshT class is a templated interface that expects a vertex class to perform interpolation on arbitrary vertex data. For the template specialization of the HbrMesh interface to be met, our Vertex object to implement a minimal set of constructors and member functions. Since we are not going to subdivide the mesh, the struct presented here has been left minimalistic. The only customization added to our container was to provide storage and accessors for the position of a 3D vertex. struct Vertex Hbr minimal required interface ---------------------- Vertex Vertex int i Vertex Vertex const src _position 0 src . _position 0 _position 1 src . _position 1 _position 2 src . _position 2 void Clear void 0 void AddWithWeight Vertex const , float void AddVaryingWithWeight Vertex const , float Public interface ------------------------------------ void SetPosition float x , float y , float z _position 0 x _position 1 y _position 2 z const float GetPosition const return _position private float _position 3 typedef OpenSubdiv HbrMesh Vertex Hmesh typedef OpenSubdiv HbrFace Vertex Hface typedef OpenSubdiv HbrVertex Vertex Hvertex typedef OpenSubdiv HbrHalfedge Vertex Hhalfedge ------------------------------------------------------------------------------ Pyramid geometry from catmark_pyramid.h static float verts 5 3 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 2.0f , 0.0f , 0.0f , 0.0f , 2.0f , 0.0f , -2.0f , 0.0f , 0.0f static int nverts 5 , nfaces 5 static int facenverts 5 3 , 3 , 3 , 3 , 4 static int faceverts 16 0 , 1 , 2 , 0 , 2 , 3 , 0 , 3 , 4 , 0 , 4 , 1 , 4 , 3 , 2 , 1 ------------------------------------------------------------------------------ int main int , char Create a subdivision scheme Catmull-Clark here OpenSubdiv HbrCatmarkSubdivision Vertex catmark new OpenSubdiv HbrCatmarkSubdivision Vertex Create an empty Hbr mesh Hmesh hmesh new Hmesh catmark Populate the vertices Vertex v for int i 0 i nverts i Primitive variable data must be set here in our case we set the 3D position of the vertex. v . SetPosition verts i 0 , verts i 1 , verts i 2 Add the vertex to the mesh. hmesh - NewVertex i , v Create the topology int fv faceverts for int i 0 i nfaces i int nv facenverts i hmesh - NewFace nv , fv , 0 fv nv Set subdivision options By default vertex interpolation is set to none on boundaries, which can produce un-expected results, so we change it to edge-only. hmesh - SetInterpolateBoundaryMethod Hmesh k_InterpolateBoundaryEdgeOnly Call Finish to finalize the data structures before using the mesh. hmesh - Finish printf Created a pyramid with d faces and d vertices. n , hmesh - GetNumFaces , hmesh - GetNumVertices delete hmesh delete catmark ------------------------------------------------------------------------------ Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "hbr_tutorial_0.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "Using Hbr", │ │ │ │ │ + "text": "Using Hbr Using Hbr 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Vertex Template API Creating a Mesh Instantiating an HbrMesh Creating Vertices Creating Faces Wrapping Things Up Boundary Interpolation Rules Adding Creases Vertex Creases Edge Creases Holes Hierarchical Edits Face-varying Data Instantiating the HbrMesh Setting the Face-Varying Data Retrieving the Face-Varying Data Valence Operators Managing Singular Vertices Note As of OpenSubdiv 3.0, all Hbr dependencies have been removed from the core APIs Sdc , Vtr , Far , Osd . The legacy source code of Hbr is provided purely for regression and legacy purposes. If your code is currently depending on Hbr functionality, we recommend migrating to the newer APIs as we cannot guarantee that this code will be maintained in future releases. For more information see the 3.0 release notes Vertex Template API The Hbr API abstracts the vertex class through templating. Client-code is expected to provide a vertex class that implements the requisite interpolation functionality. Here is an example of a simple vertex class that accounts for 3D position, but does not support arbitrary variables or varying interpolation. struct Vertex Vertex Vertex int i Vertex const Vertex src _pos 0 src . _pos 0 _pos 1 src . _pos 1 _pos 2 src . _pos 2 Vertex void AddWithWeight const Vertex src , float weight , void 0 _pos 0 weight src . _pos 0 _pos 1 weight src . _pos 1 _pos 2 weight src . _pos 2 void AddVaryingWithWeight const Vertex , float , void 0 void Clear void 0 _pos 0 _pos 1 _pos 2 0.0f void SetPosition float x , float y , float z _pos 0 x _pos 1 y _pos 2 z void ApplyVertexEdit const OpenSubdiv HbrVertexEdit Vertex edit const float src edit . GetEdit switch edit . GetOperation case OpenSubdiv HbrHierarchicalEdit Vertex Set _pos 0 src 0 _pos 1 src 1 _pos 2 src 2 break case OpenSubdiv HbrHierarchicalEdit Vertex Add _pos 0 src 0 _pos 1 src 1 _pos 2 src 2 break case OpenSubdiv HbrHierarchicalEdit Vertex Subtract _pos 0 - src 0 _pos 1 - src 1 _pos 2 - src 2 break void ApplyMovingVertexEdit const OpenSubdiv HbrMovingVertexEdit Vertex custom functions data not required by Hbr ------------------------- Vertex float x , float y , float z _pos 0 x _pos 1 y _pos 2 z const float GetPos const return _pos float _pos 3 In some cases, if only topological analysis is required, the class can be left un-implemented. Far and Osd for instance store vertex data in serialized interleaved vectors. Here is the OsdVertex class for reference class Vertex public Vertex Vertex int index Vertex Vertex const src void AddWithWeight Vertex const i , float weight , void 0 void AddVaryingWithWeight const Vertex i , float weight , void 0 void Clear void 0 void ApplyVertexEdit FarVertexEdit const Creating a Mesh The following tutorial walks through the steps of instantiating a simple Hbr mesh. The code found in regressioncommonshape_utils.h can also be used as an example. While this implementation covers many of Hbr s features, it does not provide coverage for the complete Renderman specification though. Instantiating an HbrMesh First we need to instantiate a mesh object. Hbr supports 3 subdivision schemes Catmull-Clark catmark Loop Bilinear The scheme is selected by passing an specialized instance of HbrSubdivisionT , HbrCatmarkSubdivisionT in this case. The scheme can be shared across multiple mesh objects, so we only need a single instance. static OpenSubdiv HbrCatmarkSubdivision Vertex _scheme OpenSubdiv HbrMesh Vertex mesh new OpenSubdiv HbrMesh Vertex _scheme Creating Vertices Adding vertices to the mesh is accomplished using the HbrMeshNewVertex method. Because Hbr uses a dedicated vertex allocator to help alleviate the performance impact of intensive fragmented memory allocations. This optimization results in the following design pattern Vertex vtx for int i 0 i numVerts i Vertex v mesh - NewVertex i , vtx v-SetPosition We instantiate a single default vertex object named vtx on the stack. We then recover the pointer to the actual vertex created in the mesh from the NewVertex method. Once we have recovered that pointer, we can set the data for our vertex by using any of the custom accessors. Creating Faces Once all the vertices have been registered in the mesh, we can start adding the faces with HbrMeshNewFace . Assuming we had an obj style reader, we need to know the number of vertices in the face and the indices of these vertices. for int f 0 f numFaces f int nverts obj - GetNumVertices f const int faceverts obj - GetFaceVerts f mesh - NewFace nv , fv , 0 However, Hbr is not able to handle non-manifold geometry. In order to avoid tripping asserts or causing memory violations, lets rewrite the previous loop with some some prototype code to check the validity of the topology. for int f 0 f numFaces f int nv obj - GetNumVertices f const int fv obj - GetFaceVerts f triangles only for Loop subdivision if scheme kLoop and nv 3 printf Trying to create a Loop subd with non-triangle face n continue now check the half-edges connectivity for int j 0 j nv j OpenSubdiv HbrVertex T origin mesh - GetVertex fv j OpenSubdiv HbrVertex T destination mesh - GetVertex fv j 1 nv OpenSubdiv HbrHalfedge T opposite destination - GetEdge origin if origin NULL destination NULL printf An edge was specified that connected a nonexistent vertex n continue if origin destination printf An edge was specified that connected a vertex to itself n continue if opposite opposite - GetOpposite printf A non-manifold edge incident to more than 2 faces was found n continue if origin - GetEdge destination printf An edge connecting two vertices was specified more than once. Its likely that an incident face was flipped n continue mesh - NewFace nv , fv , 0 Wrapping Things Up Once we have vertices and faces set in our mesh, we still need to wrap things up by calling HbrMeshFinish mesh - Finish Finish iterates over the mesh to apply the boundary interpolation rules and checks for singular vertices. At this point, there is one final topology check remaining to validate the mesh mesh - Finish if mesh - GetNumDisconnectedVertices printf The specified subdivmesh contains disconnected surface components. n abort or iterate over the mesh to remove the offending vertices Boundary Interpolation Rules The rule-set can be selected using the following accessors Vertex and varying data mesh - SetInterpolateBoundaryMethod OpenSubdiv HbrMesh Vertex k_InterpolateBoundaryEdgeOnly Face-varying data mesh - SetFVarInterpolateBoundaryMethod OpenSubdiv HbrMesh Vertex k_InterpolateBoundaryEdgeOnly Additional information on boundary interpolation rules can be found here Warning The boundary interpolation rules must be set before the call to HbrMeshFinish , which sets the sharpness values to boundary edges and vertices based on these rules. Adding Creases Hbr supports a sharpness attribute on both edges and vertices. Sharpness is set using the SetSharpnessfloat accessors. Vertex Creases Given an index, vertices are very easy to access in the mesh. int idx vertex index float sharp the edge sharpness OpenSubdiv HbrVertex Vertex v mesh - GetVertex idx if v v - SetSharpness std max 0.0f , sharp else printf cannot find vertex for corner tag d n , idx Edge Creases Usually, edge creases are described with a vertex indices pair. Here is some sample code to locate the matching half-edge and set a crease sharpness. int v0 , v1 vertex indices float sharp the edge sharpness OpenSubdiv HbrVertex Vertex v mesh - GetVertex v0 , w mesh - GetVertex v1 OpenSubdiv HbrHalfedge Vertex e 0 if v w if e v - GetEdge w 0 e w - GetEdge v if e e - SetSharpness std max 0.0f , sharp else printf cannot find edge for crease tag d,d n , v0 , v1 Holes Hbr faces support a hole tag. int idx the face index OpenSubdiv HbrFace Vertex f mesh - GetFace idx if f f - SetHole else printf cannot find face for hole tag d n , idx Note The hole tag is hierarchical sub-faces can also be marked as holes. See Hierarchical Edits Hierarchical Edits Hbr supports the following types of hierarchical edits Type Function Corner edits Modify vertex sharpness Crease edits Modify edge sharpness FaceEdit Modify custom face data FVarEdit Modify face-varying data VertexEdit Modify vertex and varying data HoleEdit Set hole tag Modifications are one of the following 3 operations Operation Set Add Subtract Here is a simple example that creates a hierarchical vertex edit. path 655, 2, 3, 0 int faceid 655 , nsubfaces 2 , subfaces 2 2 , 3 , vertexid 0 int offset 0 , offset to the vertex or varying data numElems 3 number of elements to apply the modifier to x,y,z 3 bool isP false shortcut to identify modifications to the vertex position P OpenSubdiv HbrHierarchicalEdit Vertex Operation op OpenSubdiv HbrHierarchicalEdit T Set float values 3 1.0f , 0.5f , 0.0f edit values OpenSubdiv HbrVertexEdit T edit new OpenSubdiv HbrVertexEdit T faceid , nsubfaces , subfaces , vertexid , offset , floatwidth , isP , op , values Face-varying Data Here is a walk-through of how to store face-varying data for a u,v pair. Unlike vertex and varying data which is accessed through the templated vertex API, face-varying data is directly aggregated as vectors of float data. Instantiating the HbrMesh The HbrMesh needs to retain some knowledge about the face-varying data that it carries in order to refine it correctly. int fvarwidth 2 total width of the fvar data static int indices 1 0 , 1 offset set to 0 widths 1 2 2 floats in a u,v pair int const fvarcount fvarwidth 0 1 0 , fvarindices fvarwidth 0 indices NULL , fvarwidths fvarwidth 0 widths NULL mesh new OpenSubdiv HbrMesh T _scheme , fvarcount , fvarindices , fvarwidths , fvarwidth Setting the Face-Varying Data After the topology has been created, Hbr is ready to accept face-varying data. Here is some sample code for int i 0 , idx 0 i numFaces i OpenSubdiv HbrFace Vertex f mesh - GetFace i int nv f - GetNumVertices note this is not the fastest way OpenSubdiv HbrHalfedge Vertex e f - GetFirstEdge for int j 0 j nv j , e e - GetNext OpenSubdiv HbrFVarData Vertex fvt e - GetOrgVertex - GetFVarData f float const fvdata GetFaceVaryingData i , j if not fvt . IsInitialized if no fvar daa exists yet on the vertex fvt . SetAllData 2 , fvdata else if not fvt . CompareAll 2 , fvdata if there already is fvar data and there is a boundary add the new data OpenSubdiv HbrFVarData T nfvt e - GetOrgVertex - NewFVarData f nfvt . SetAllData 2 , fvdata Retrieving the Face-Varying Data The HbrFVarData structures are expanded during the refinement process, with every sub-face being assigned a set of interpolated face-varying data. This data can be accessed in 2 ways From a face, passing a vertex index OpenSubdivHbrFaceVertex f OpenSubdiv HbrFVarData const fv f . GetFVarData vindex const float data fv . GetData From a vertex, passing a pointer to an incident face OpenSubdivHbrFaceVertex f OpenSubdiv HbrFVarData const fv myVertex . GetFVarData f const float data fv . GetData Valence Operators When manipulating meshes, it is often necessary to iterate over neighboring faces or vertices. Rather than gather lists of pointers and return them, Hbr exposes an operator pattern that guarantees consistent mesh traversals. The following example shows how to use an operator to count the number of neighboring vertices use HbrVertexGetValence for proper valence counts OpenSubdivHbrVertexVertex v class MyOperator public OpenSubdiv HbrVertexOperator Vertex public int count MyOperator count 0 virtual void operator OpenSubdiv HbrVertex Vertex v count MyOperator op v - ApplyOperatorSurroundingVertices op Managing Singular Vertices Certain topological configurations would force vertices to share multiple half-edge cycles. Because Hbr is a half-edge representation, these singular vertices have to be duplicated as part of the HbrMeshFinish phase of the instantiation. These duplicated vertices can cause problems for client-code that tries to populate buffers of vertex or varying data. The following sample code shows how to match the vertex data to singular vertex splits Populating an OsdCpuVertexBuffer with vertex data positions,... float const vtxData inMeshFn . getRawPoints returnStatus OpenSubdiv OsdCpuVertexBuffer vertexBuffer OpenSubdiv OsdCpuVertexBuffer Create numVertexElements , numFarVerts vertexBuffer - UpdateData vtxData , 0 , numVertices Duplicate the vertex data into the split singular vertices std vector std pair int , int const splits hbrMesh - GetSplitVertices for int i 0 i int splits . size i vertexBuffer - UpdateData vtxData splits i . second numVertexElements , splits i . first , 1 Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "using_osd_hbr.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "Vtr Overview", │ │ │ │ │ - "text": "Vtr Overview Vtr Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Vectorized Topology Representation Vtr VtrLevel Topological Relationships Memory Efficiency VtrRefinement Parent-child and child-parent relationships Data flexibility Vectorized Topology Representation Vtr Vtr consists of a suite of classes that collectively provide an intermediate representation of topology that supports efficient refinement. Vtr is intended for internal use only and is currently accessed through the Far layer by the FarTopologyRefiner , which assembles these Vtr classes to meet the topological and refinement needs of the Far layer. What follows is therefore more intended to provide insite into the underlying architecture than to describe particular usage. For documentation more relevant to direct usage, proceed to the Far section previously noted. Vtr is vectorized in that its topological data is stored more as a collection of vectors of primitive elements rather than as the faces, vertices and edges that make up many other topological representations. It is essentially a structure-of-arrays SOA approach to topology in contrast to the more common array-of-structures pattern found in many other topological representations. Vtrs use of vectors allows it to be fairly efficient in its use of memory and similarly efficient to refine, but the topology is fixed once defined. Vtr classes are purely topological. They are even more independent of the representation of vertices, faces, etc. than Hbr in that they are not even parameterized by an interface to such components. So the same set of Vtr objects can eventually be used to serve more than one representation of these components. The primary requirement is that a mesh be expressable as an indexable set i.e. a vector or array of vertices, edges and faces. The index of a component uniquely identifies it and properties are retrieved by referring to it by index. Its worth qualifying the term topological here and elsewhere -- we generally refer to topology as subdivision topology rather than mesh topology. A subdivision hierarchy is impacted by the presence of semi-sharp creasing, as the subdivision rules change in response to that creasing. So subdivision topology includes the sharpness values assigned to edges and vertices that affect the semi-sharp creasing. The two primary classes in Vtr consist of VtrLevel - a class representing complete vertex topology for a level VtrRefinement - a class mapping a parent VtrLevel to a child level Others exist to represent the following selection and appropriate tagging of components for sparse refinement divergence of face-varying topology from the vertex topology mapping between face-varying topology at successive levels common low-level utilities, e.g. simple array classes VtrLevel VtrLevel is a complete topological description of a subdivision level, with the topological relations, sharpness values and component tags all stored in vectors literally stdvectors, but easily changed via typedefs. There are no classes or objects for the mesh component types i.e. faces, edges and vertices but simply an integer index to identify each. It can be viewed as a structure-of-arrays representation of the topology any property related to a particular component is stored in an array and accessible using the index identifying that component. So with no classes the for the components, its difficult to say what constitutes a vertex or a face they are each the sum of all the fields scattered amongst the many vectors included. Level represents a single level of a potential hierarchy and is capable of representing the complete base mesh. There are no members that relate data in one level to any other, either below or above. As such, any Level can be used as the base level for a new subdivision hierarchy potentially more than one. All relationships between separate levels are maintained in the VtrRefinement class. Topological Relationships Level requires the definition of and associations between a fixed set of indexable components for all three component types, i.e. an explicit edge list in addition to the expected set of vertices and faces. There are no explicit component objects in the representation, only an integer index VtrIndex identifying each component within the set and data associated with that component in the various vectors. The topology is stored as six sets of incident relations between the components two each for the two other component types incident each component type, i.e. for each face, its incident vertices and incident edges for each edge, its incident vertices and incident faces for each vertex, its incident edges and incident faces The collection of incidence relations is a vectorized variation of AIF the Adjacency and Incidence Framework. The set of these six incidence relations is not minimal only four are required, but that set excludes the most desired face-vertex relation but all six are kept and maintained to facilitate faster refinement. While the sizes of several vectors are directly proportional to the number of vertices, edges or faces to which the data is associated, the sizes of some of the vectors for these relations is more cumulative and so additional vectors of offsets is required typical of the face-vertex list commonly used as the minimal definition of mesh topology. Vectors for the sharpness values associated with crease edges and corner vertices are included and so sized according to the number of edges and vertices, along with additional tags for the components that may be helpful to refinement i.e. the type of subdivision Rule associated with each vertex. A Level is really just a container for data in a subdivision level, and so its public methods are primarily to access that data. Modification of the data is protected and only made available to classes that are intended to construct Levels currently the Far factory class that is responsible for building the base level, and the VtrRefinement class that constructs subsequent levels during refinement. Memory Efficiency One of the advantages in storing data in what is essentially a structure-of-arrays, rather than the array-of-structures more typical of topological representations, is that we can be more selective about memory usage in some cases. Particularly in the case of uniform refinement, when the data in subsequent levels is typically 4x its predecessor, we can minimize what we either generate or keep around at each level. For instance, if only a face-list is required at the finest level, we only need to generate one of the six topological relations the vertices incident each face. When we do keep Levels around in memory as is the case with the FarTopologyRefiner we do have do have the opportunity to prune what is not strictly necessary after the refinement. Just as with construction, whatever classes are privileged to construct a Level are likely those that will be privileged to prune its contents when needed. The current implementation of Level is far from optimal though -- there are opportunities for improvement. After one level of subdivision, the faces in a Level will be either all quads or tris. Having specializations for these cases and using the more general case in support of N-sided faces for the base level only is one possibility. Levels also allocate dozens of vectors in which to store all data. Since these vectors are of fixed size once created, they could be aggregated by partitioning one or a smaller number of larger block of memory into the desired pieces. The desire to make some of these improvements is part of why Vtr is not directly exposed for public use and instead exposed via Far. VtrRefinement While VtrLevel contains the topology for each subdivision level, VtrRefinement is responsible for creating a new level via refinement of an existing one, and for maintaining the relationships between the components in the parent and child levels. So a simplified view of a subdivision hierarchy with Vtr is a set of Levels with a Refinement between each successive pair. Refinement is a friend of Level and will populate a child level from a parent given a set of refinement parameters. Aside from parameters related to data or depth, there are two kinds of refinement supported uniform and sparse. The latter sparse refinement requires selection of an arbitrary set of components -- any dependent or neighboring components that are required for the limit will be automatically included. So feature-adaptive refinement is just one form of this selective sparse refinement, the criteria being the topological features of interest creases and extra-ordinary vertices. The intent is to eventually provide more flexibility to facilitate the refinement of particular regions of interest or more dynamicadaptive needs. Refinement has also been subclassed according to the type of topological split being performed, i.e. splitting all faces into quads or tris via the QuadRefinement and TriRefinement subclasses. As noted with VtrLevel , there is further room for improvement in memory andor performance here by combining more optimal specializations for both Refinement and Level -- with consideration of separating the uniform and sparse cases. Parent-child and child-parent relationships While Refinement populates a new child Level as part of its refinement operation, it also accumulates the relationships between the parent and child level and as with Level , this data is stored in vectors indexable by the components. The associations between components in the two levels was initially only uni-directional child components were associated with incident components of a parent component based on the parent components topology, so we had a parent-to-child mapping one to many. Storing the reverse child-to-parent mapping was avoided to reduce memory particularly in the case of uniform refinement as it often was not necessary, but a growing need for it, particularly in the case of sparse feature-adaptive refinement, lead to it being included. Data flexibility One of the advantages of the structure-of-arrays representation in both Level and Refinement is that we can make more dynamic choices about what type of data we choose to allocate and use based on needs. For instance, we can choose between maintaining the parent-child or child-parent mapping in Refinement , or both if needed, and we can remove one if no longer necessary. An active example of this is uniform refinement if we only require the face-vertex list at the finest subdivision level, there is no need to generate a complete topological description of that level as would be required of more traditional representations, and given that level is 4x the magnitude of its parent, the savings are considerable. Currently there is nothing specific to a subdivision scheme in the refinement other than the type of topological splitting to apply. The refinement does subdivide sharpness values for creasing, but that too is independent of scheme. Tags were added to the base level that are propagated through the refinement and these too are dependent on the scheme, but are applied externally. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Vtr Overview Vtr Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Vectorized Topology Representation Vtr VtrLevel Topological Relationships Memory Efficiency VtrRefinement Parent-child and child-parent relationships Data flexibility Vectorized Topology Representation Vtr Vtr consists of a suite of classes that collectively provide an intermediate representation of topology that supports efficient refinement. Vtr is intended for internal use only and is currently accessed through the Far layer by the FarTopologyRefiner , which assembles these Vtr classes to meet the topological and refinement needs of the Far layer. What follows is therefore more intended to provide insite into the underlying architecture than to describe particular usage. For documentation more relevant to direct usage, proceed to the Far section previously noted. Vtr is vectorized in that its topological data is stored more as a collection of vectors of primitive elements rather than as the faces, vertices and edges that make up many other topological representations. It is essentially a structure-of-arrays SOA approach to topology in contrast to the more common array-of-structures pattern found in many other topological representations. Vtrs use of vectors allows it to be fairly efficient in its use of memory and similarly efficient to refine, but the topology is fixed once defined. Vtr classes are purely topological. They are even more independent of the representation of vertices, faces, etc. than Hbr in that they are not even parameterized by an interface to such components. So the same set of Vtr objects can eventually be used to serve more than one representation of these components. The primary requirement is that a mesh be expressable as an indexable set i.e. a vector or array of vertices, edges and faces. The index of a component uniquely identifies it and properties are retrieved by referring to it by index. Its worth qualifying the term topological here and elsewhere -- we generally refer to topology as subdivision topology rather than mesh topology. A subdivision hierarchy is impacted by the presence of semi-sharp creasing, as the subdivision rules change in response to that creasing. So subdivision topology includes the sharpness values assigned to edges and vertices that affect the semi-sharp creasing. The two primary classes in Vtr consist of VtrLevel - a class representing complete vertex topology for a level VtrRefinement - a class mapping a parent VtrLevel to a child level Others exist to represent the following selection and appropriate tagging of components for sparse refinement divergence of face-varying topology from the vertex topology mapping between face-varying topology at successive levels common low-level utilities, e.g. simple array classes VtrLevel VtrLevel is a complete topological description of a subdivision level, with the topological relations, sharpness values and component tags all stored in vectors literally stdvectors, but easily changed via typedefs. There are no classes or objects for the mesh component types i.e. faces, edges and vertices but simply an integer index to identify each. It can be viewed as a structure-of-arrays representation of the topology any property related to a particular component is stored in an array and accessible using the index identifying that component. So with no classes the for the components, its difficult to say what constitutes a vertex or a face they are each the sum of all the fields scattered amongst the many vectors included. Level represents a single level of a potential hierarchy and is capable of representing the complete base mesh. There are no members that relate data in one level to any other, either below or above. As such, any Level can be used as the base level for a new subdivision hierarchy potentially more than one. All relationships between separate levels are maintained in the VtrRefinement class. Topological Relationships Level requires the definition of and associations between a fixed set of indexable components for all three component types, i.e. an explicit edge list in addition to the expected set of vertices and faces. There are no explicit component objects in the representation, only an integer index VtrIndex identifying each component within the set and data associated with that component in the various vectors. The topology is stored as six sets of incident relations between the components two each for the two other component types incident each component type, i.e. for each face, its incident vertices and incident edges for each edge, its incident vertices and incident faces for each vertex, its incident edges and incident faces The collection of incidence relations is a vectorized variation of AIF the Adjacency and Incidence Framework. The set of these six incidence relations is not minimal only four are required, but that set excludes the most desired face-vertex relation but all six are kept and maintained to facilitate faster refinement. While the sizes of several vectors are directly proportional to the number of vertices, edges or faces to which the data is associated, the sizes of some of the vectors for these relations is more cumulative and so additional vectors of offsets is required typical of the face-vertex list commonly used as the minimal definition of mesh topology. Vectors for the sharpness values associated with crease edges and corner vertices are included and so sized according to the number of edges and vertices, along with additional tags for the components that may be helpful to refinement i.e. the type of subdivision Rule associated with each vertex. A Level is really just a container for data in a subdivision level, and so its public methods are primarily to access that data. Modification of the data is protected and only made available to classes that are intended to construct Levels currently the Far factory class that is responsible for building the base level, and the VtrRefinement class that constructs subsequent levels during refinement. Memory Efficiency One of the advantages in storing data in what is essentially a structure-of-arrays, rather than the array-of-structures more typical of topological representations, is that we can be more selective about memory usage in some cases. Particularly in the case of uniform refinement, when the data in subsequent levels is typically 4x its predecessor, we can minimize what we either generate or keep around at each level. For instance, if only a face-list is required at the finest level, we only need to generate one of the six topological relations the vertices incident each face. When we do keep Levels around in memory as is the case with the FarTopologyRefiner we do have do have the opportunity to prune what is not strictly necessary after the refinement. Just as with construction, whatever classes are privileged to construct a Level are likely those that will be privileged to prune its contents when needed. The current implementation of Level is far from optimal though -- there are opportunities for improvement. After one level of subdivision, the faces in a Level will be either all quads or tris. Having specializations for these cases and using the more general case in support of N-sided faces for the base level only is one possibility. Levels also allocate dozens of vectors in which to store all data. Since these vectors are of fixed size once created, they could be aggregated by partitioning one or a smaller number of larger block of memory into the desired pieces. The desire to make some of these improvements is part of why Vtr is not directly exposed for public use and instead exposed via Far. VtrRefinement While VtrLevel contains the topology for each subdivision level, VtrRefinement is responsible for creating a new level via refinement of an existing one, and for maintaining the relationships between the components in the parent and child levels. So a simplified view of a subdivision hierarchy with Vtr is a set of Levels with a Refinement between each successive pair. Refinement is a friend of Level and will populate a child level from a parent given a set of refinement parameters. Aside from parameters related to data or depth, there are two kinds of refinement supported uniform and sparse. The latter sparse refinement requires selection of an arbitrary set of components -- any dependent or neighboring components that are required for the limit will be automatically included. So feature-adaptive refinement is just one form of this selective sparse refinement, the criteria being the topological features of interest creases and extra-ordinary vertices. The intent is to eventually provide more flexibility to facilitate the refinement of particular regions of interest or more dynamicadaptive needs. Refinement has also been subclassed according to the type of topological split being performed, i.e. splitting all faces into quads or tris via the QuadRefinement and TriRefinement subclasses. As noted with VtrLevel , there is further room for improvement in memory andor performance here by combining more optimal specializations for both Refinement and Level -- with consideration of separating the uniform and sparse cases. Parent-child and child-parent relationships While Refinement populates a new child Level as part of its refinement operation, it also accumulates the relationships between the parent and child level and as with Level , this data is stored in vectors indexable by the components. The associations between components in the two levels was initially only uni-directional child components were associated with incident components of a parent component based on the parent components topology, so we had a parent-to-child mapping one to many. Storing the reverse child-to-parent mapping was avoided to reduce memory particularly in the case of uniform refinement as it often was not necessary, but a growing need for it, particularly in the case of sparse feature-adaptive refinement, lead to it being included. Data flexibility One of the advantages of the structure-of-arrays representation in both Level and Refinement is that we can make more dynamic choices about what type of data we choose to allocate and use based on needs. For instance, we can choose between maintaining the parent-child or child-parent mapping in Refinement , or both if needed, and we can remove one if no longer necessary. An active example of this is uniform refinement if we only require the face-vertex list at the finest subdivision level, there is no need to generate a complete topological description of that level as would be required of more traditional representations, and given that level is 4x the magnitude of its parent, the savings are considerable. Currently there is nothing specific to a subdivision scheme in the refinement other than the type of topological splitting to apply. The refinement does subdivide sharpness values for creasing, but that too is independent of scheme. Tags were added to the base level that are propagated through the refinement and these too are dependent on the scheme, but are applied externally. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "vtr_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Tutorials", │ │ │ │ │ - "text": "Tutorials Tutorials 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Bfr Tutorials 1. Basic Evaluation and Tessellation Tutorial 1.1 Tutorial 1.2 Tutorial 1.3 Tutorial 1.4 Tutorial 1.5 2. More on Tessellation Tutorial 2.1 Tutorial 2.2 3. Additional Topics Tutorial 3.1 Tutorial 3.2 Far Tutorials 1. Basic Construction and Interpolation Tutorial 1.1 Tutorial 1.2 2. Uniform Refinement and Primvar Data Types Tutorial 2.1 Tutorial 2.2 Tutorial 2.3 3. Creating a Custom FarTopologyRefinerFactory Tutorial 3.1 4. Construction and Usage of FarStencilTables Tutorial 4.1 Tutorial 4.2 Tutorial 4.3 5. Construction and Usage of FarPatchTables Tutorial 5.1 Tutorial 5.2 Tutorial 5.3 Osd Tutorials Tutorial 0 Hbr Tutorials Tutorial 0 Tutorial 1 Tutorial 2 The tutorial source code can be found in the github.com repository or in your local repository roottutorials . Bfr Tutorials All tutorials for the Bfr interface follow a similar pattern without any command line arguments, a default mesh usually a cube is used and the results printed to standard output in Obj format. Command line arguments can be used to specify an alternate mesh for input, as well as directing the output to a specified Obj file. Some tutorials may offer additional command line options to trigger internal options relevant to the topic, e.g. those illustrating tessellation may support a -quads option to use the option to tessellate quad-bases subdivision meshes with quads. 1. Basic Evaluation and Tessellation Tutorial 1.1 This tutorial illustrates the use of BfrSurfaceFactory and BfrSurface to evaluate points on the limit of each face. The limit positions at all corners of the face are evaluated and connected to the limit position in the center of the face -- creating a simple triangular tessellation. code Tutorial 1.2 This tutorial shows the added use of BfrTessellation to identify the set of points and connectivity for a uniform tessellation. Both a Surface and Tessellation is identified for each face, with the Tessellation indicating which points are to be evaluated by the Surface. code Tessellation patterns for quad-based subdivision schemes can optionally preserve quads left or be fully triangulated center, while triangular schemes always yield triangles right Tutorial 1.3 This tutorial extends the previous tutorial on uniform Tessellation by adding face-varying Surfaces to compute corresponding UVs for each evaluated position. code Tutorial 1.4 This tutorial extends the previous tutorial on uniform tessellation of position and UV by illustrating how additional mesh data interleaved with the position and UV data is easily handled. code Tutorial 1.5 This tutorial is similar to the first tutorial showing uniform tessellation of position but makes use of limit stencils for its evaluation of points of the tessellation pattern. code 2. More on Tessellation Tutorial 2.1 This tutorial extends the use of Tessellation to illustrate the use of non-uniform tessellation rates per edge. A simple edge-length metric is used to determine the tessellation rate for each edge of a face. code The following contrasts uniform tessellation left with the resulting length-based tessellations -- preserving quads center and fully triangulated right Tutorial 2.2 This tutorial is a more complex extension of the use of Tessellation that illustrates how the separation and association of tessellation data with the boundary and interior of the face can be used. Limit points evaluated on the vertices and edges of a face the boundary of the Tessellation are computed once and shared with adjacent faces -- creating a topologically watertight tessellation of the mesh. code 3. Additional Topics Tutorial 3.1 This tutorial shows a basic example of the more advanced topic of creating a subclass of SurfaceFactory adapted to a connected mesh representation -- requiring an implementation of the SurfaceFactoryMeshAdapter interface for that mesh. A simplified version of the implementation of FarTopologyRefiner is provided. Note that the code imported here is that of the main program, not the separate header and source files of the custom subclass illustrated -- which current documentation scripts cannot import. Tutorial 3.2 This tutorial shows how to initialize and retain Surfaces for later use. The simple uniform tessellation tutorial is modified to first create and populate a simple caching structure that initializes and stores the Surfaces for all faces of the mesh. The loop for each face of the mesh then retrieves its Surface and associated patch points from the cache. code Far Tutorials 1. Basic Construction and Interpolation Tutorial 1.1 This tutorial presents the requisite steps to instantiate a mesh as a FarTopologyRefiner from simple topological data and to interpolate vertex data associated with the mesh. code Tutorial 1.2 This tutorial makes use of a different vertex data definition for use when vertex data is of arbitrary width. Uniform refinement is applied to data buffers of three types two of fixed but different sizes and the third a union of the two that is dynamically sized and constructed. code 2. Uniform Refinement and Primvar Data Types Tutorial 2.1 Building on the basic tutorial, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and varying primvar data. code Tutorial 2.2 Building on the previous tutorial, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and face-varying primvar data. The resulting interpolated data is output in Obj format, with the face-varying data recorded in the UV texture layout. code Tutorial 2.3 Building on previous tutorials, this example shows how to instantiate a simple mesh, refine it uniformly, interpolate both vertex and face-varying primvar data, and finally calculate approximated smooth normals. The resulting interpolated data is output in Obj format. code 3. Creating a Custom FarTopologyRefinerFactory Tutorial 3.1 Previous tutorials have instantiated topology from a simple face-vertex list via the FarTopologyDescriptor and its TopologyRefinerFactory. This tutorial shows how to more efficiently convert an existing high-level topology representation to a FarTopologyDescriptor with a custom factory class. code 4. Construction and Usage of FarStencilTables Tutorial 4.1 This tutorial shows how to create and manipulate a StencilTable. Factorized stencils are used to efficiently interpolate vertex primvar data buffers. code Tutorial 4.2 This tutorial shows how to create and manipulate StencilTables for both vertex and varying primvar data buffers vertex positions and varying colors. code Tutorial 4.3 This tutorial shows how to create and manipulate tables of cascading stencils to apply hierarchical vertex edits. code 5. Construction and Usage of FarPatchTables Tutorial 5.1 This tutorial shows how to compute points on the limit surface at arbitrary parametric locations using a FarPatchTable constructed from adaptive refinement. code Tutorial 5.2 Building on the previous tutorial, this example shows how to manage the limit surface of a potentially large mesh by creating and evaluating separate PatchTables for selected groups of faces of the mesh. code Tutorial 5.3 Building on the previous tutorials for both PatchTables and StencilTables, this example shows how to construct a LimitStencilTable to repeatedly evaluate an arbitrary collection of points on the limit surface. code Osd Tutorials Tutorial 0 This tutorial demonstrates the manipulation of Osd Evaluator and BufferDescriptor. code Hbr Tutorials Use of Hbr is no longer recommended -- these tutorials are included solely for historical reference. Tutorial 0 This tutorial presents, in a very succinct way, the requisite steps to instantiate an Hbr mesh from simple topological data. code Tutorial 1 This tutorial shows how to safely create Hbr meshes from arbitrary topology. Because Hbr is a half-edge data structure, it cannot represent non-manifold topology. Ensuring that the geometry used is manifold is a requirement to use Hbr safely. This tutorial presents some simple tests to detect inappropriate topology. code Tutorial 2 This tutorial shows how to subdivide uniformly a simple Hbr mesh. We are building upon previous tutorials and assuming a fully instantiated mesh we start with an HbrMesh pointer initialized from the same pyramid shape used in hbr_tutorial_0. We then apply the Refine function sequentially to all the faces in the mesh to generate several levels of uniform subdivision. The resulting data is then dumped to the terminal in Wavefront OBJ format for inspection. code Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Tutorials Tutorials 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Bfr Tutorials 1. Basic Evaluation and Tessellation Tutorial 1.1 Tutorial 1.2 Tutorial 1.3 Tutorial 1.4 Tutorial 1.5 2. More on Tessellation Tutorial 2.1 Tutorial 2.2 3. Additional Topics Tutorial 3.1 Tutorial 3.2 Far Tutorials 1. Basic Construction and Interpolation Tutorial 1.1 Tutorial 1.2 2. Uniform Refinement and Primvar Data Types Tutorial 2.1 Tutorial 2.2 Tutorial 2.3 3. Creating a Custom FarTopologyRefinerFactory Tutorial 3.1 4. Construction and Usage of FarStencilTables Tutorial 4.1 Tutorial 4.2 Tutorial 4.3 5. Construction and Usage of FarPatchTables Tutorial 5.1 Tutorial 5.2 Tutorial 5.3 Osd Tutorials Tutorial 0 Hbr Tutorials Tutorial 0 Tutorial 1 Tutorial 2 The tutorial source code can be found in the github.com repository or in your local repository roottutorials . Bfr Tutorials All tutorials for the Bfr interface follow a similar pattern without any command line arguments, a default mesh usually a cube is used and the results printed to standard output in Obj format. Command line arguments can be used to specify an alternate mesh for input, as well as directing the output to a specified Obj file. Some tutorials may offer additional command line options to trigger internal options relevant to the topic, e.g. those illustrating tessellation may support a -quads option to use the option to tessellate quad-bases subdivision meshes with quads. 1. Basic Evaluation and Tessellation Tutorial 1.1 This tutorial illustrates the use of BfrSurfaceFactory and BfrSurface to evaluate points on the limit of each face. The limit positions at all corners of the face are evaluated and connected to the limit position in the center of the face -- creating a simple triangular tessellation. code Tutorial 1.2 This tutorial shows the added use of BfrTessellation to identify the set of points and connectivity for a uniform tessellation. Both a Surface and Tessellation is identified for each face, with the Tessellation indicating which points are to be evaluated by the Surface. code Tessellation patterns for quad-based subdivision schemes can optionally preserve quads left or be fully triangulated center, while triangular schemes always yield triangles right Tutorial 1.3 This tutorial extends the previous tutorial on uniform Tessellation by adding face-varying Surfaces to compute corresponding UVs for each evaluated position. code Tutorial 1.4 This tutorial extends the previous tutorial on uniform tessellation of position and UV by illustrating how additional mesh data interleaved with the position and UV data is easily handled. code Tutorial 1.5 This tutorial is similar to the first tutorial showing uniform tessellation of position but makes use of limit stencils for its evaluation of points of the tessellation pattern. code 2. More on Tessellation Tutorial 2.1 This tutorial extends the use of Tessellation to illustrate the use of non-uniform tessellation rates per edge. A simple edge-length metric is used to determine the tessellation rate for each edge of a face. code The following contrasts uniform tessellation left with the resulting length-based tessellations -- preserving quads center and fully triangulated right Tutorial 2.2 This tutorial is a more complex extension of the use of Tessellation that illustrates how the separation and association of tessellation data with the boundary and interior of the face can be used. Limit points evaluated on the vertices and edges of a face the boundary of the Tessellation are computed once and shared with adjacent faces -- creating a topologically watertight tessellation of the mesh. code 3. Additional Topics Tutorial 3.1 This tutorial shows a basic example of the more advanced topic of creating a subclass of SurfaceFactory adapted to a connected mesh representation -- requiring an implementation of the SurfaceFactoryMeshAdapter interface for that mesh. A simplified version of the implementation of FarTopologyRefiner is provided. Note that the code imported here is that of the main program, not the separate header and source files of the custom subclass illustrated -- which current documentation scripts cannot import. Tutorial 3.2 This tutorial shows how to initialize and retain Surfaces for later use. The simple uniform tessellation tutorial is modified to first create and populate a simple caching structure that initializes and stores the Surfaces for all faces of the mesh. The loop for each face of the mesh then retrieves its Surface and associated patch points from the cache. code Far Tutorials 1. Basic Construction and Interpolation Tutorial 1.1 This tutorial presents the requisite steps to instantiate a mesh as a FarTopologyRefiner from simple topological data and to interpolate vertex data associated with the mesh. code Tutorial 1.2 This tutorial makes use of a different vertex data definition for use when vertex data is of arbitrary width. Uniform refinement is applied to data buffers of three types two of fixed but different sizes and the third a union of the two that is dynamically sized and constructed. code 2. Uniform Refinement and Primvar Data Types Tutorial 2.1 Building on the basic tutorial, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and varying primvar data. code Tutorial 2.2 Building on the previous tutorial, this example shows how to instantiate a simple mesh, refine it uniformly and then interpolate both vertex and face-varying primvar data. The resulting interpolated data is output in Obj format, with the face-varying data recorded in the UV texture layout. code Tutorial 2.3 Building on previous tutorials, this example shows how to instantiate a simple mesh, refine it uniformly, interpolate both vertex and face-varying primvar data, and finally calculate approximated smooth normals. The resulting interpolated data is output in Obj format. code 3. Creating a Custom FarTopologyRefinerFactory Tutorial 3.1 Previous tutorials have instantiated topology from a simple face-vertex list via the FarTopologyDescriptor and its TopologyRefinerFactory. This tutorial shows how to more efficiently convert an existing high-level topology representation to a FarTopologyDescriptor with a custom factory class. code 4. Construction and Usage of FarStencilTables Tutorial 4.1 This tutorial shows how to create and manipulate a StencilTable. Factorized stencils are used to efficiently interpolate vertex primvar data buffers. code Tutorial 4.2 This tutorial shows how to create and manipulate StencilTables for both vertex and varying primvar data buffers vertex positions and varying colors. code Tutorial 4.3 This tutorial shows how to create and manipulate tables of cascading stencils to apply hierarchical vertex edits. code 5. Construction and Usage of FarPatchTables Tutorial 5.1 This tutorial shows how to compute points on the limit surface at arbitrary parametric locations using a FarPatchTable constructed from adaptive refinement. code Tutorial 5.2 Building on the previous tutorial, this example shows how to manage the limit surface of a potentially large mesh by creating and evaluating separate PatchTables for selected groups of faces of the mesh. code Tutorial 5.3 Building on the previous tutorials for both PatchTables and StencilTables, this example shows how to construct a LimitStencilTable to repeatedly evaluate an arbitrary collection of points on the limit surface. code Osd Tutorials Tutorial 0 This tutorial demonstrates the manipulation of Osd Evaluator and BufferDescriptor. code Hbr Tutorials Use of Hbr is no longer recommended -- these tutorials are included solely for historical reference. Tutorial 0 This tutorial presents, in a very succinct way, the requisite steps to instantiate an Hbr mesh from simple topological data. code Tutorial 1 This tutorial shows how to safely create Hbr meshes from arbitrary topology. Because Hbr is a half-edge data structure, it cannot represent non-manifold topology. Ensuring that the geometry used is manifold is a requirement to use Hbr safely. This tutorial presents some simple tests to detect inappropriate topology. code Tutorial 2 This tutorial shows how to subdivide uniformly a simple Hbr mesh. We are building upon previous tutorials and assuming a fully instantiated mesh we start with an HbrMesh pointer initialized from the same pyramid shape used in hbr_tutorial_0. We then apply the Refine function sequentially to all the faces in the mesh to generate several levels of uniform subdivision. The resulting data is then dumped to the terminal in Wavefront OBJ format for inspection. code Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "tutorials.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Subdivision Surfaces", │ │ │ │ │ - "text": "Subdivision Surfaces Subdivision Surfaces 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Overview Piecewise Parametric Surfaces Parametric Patches Piecewise Surfaces Arbitrary Topology Regular versus Irregular Features Non-manifold Topology Subdivision versus Tessellation Subdivision Tessellation Which to Use Mesh Data and Topology Separating Data from Topology Vertex and Varying Data Face-Varying Data and Topology Schemes and Options Subdivision Schemes Boundary Interpolation Rules Face-varying Interpolation Rules Semi-Sharp Creases Other Options Chaikin Rule Triangle Subdivision Rule Overview Subdivision surfaces are a common modeling primitive that has gained popularity in animation and visual effects over the past decades. As the name suggests, subdivision surfaces are fundamentally surfaces . More specifically, subdivision surfaces are piecewise parametric surfaces defined over meshes of arbitrary topology -- both concepts that will be described in the sections that follow. Subdivision is both an operation that can be applied to a polygonal mesh to refine it, and a mathematical tool that defines the underlying smooth surface to which repeated subdivision of the mesh converges. Explicit subdivision is simple to apply some number of times to provide a smoother mesh, and that simplicity has historically lead to many tools representing the shape this way. In contrast, deriving the smooth surface that ultimately defines the shape -- its limit surface -- is considerably more complex but provides greater accuracy and flexibility. These differences have led to confusion in how some tools expose subdivision surfaces. The ultimate goal is to have all tools use subdivision surfaces as true surface primitives. The focus here is therefore less on subdivision and more on the nature of the surface that results from it. In addition to providing a consistent implementation of subdivision -- one that includes a number of widely used feature extensions -- a significant value of OpenSubdiv is that it makes the limit surface more accessible. Since its introduction, OpenSubdiv has received interest from users and developers with a wide variety of skills, interests and backgrounds. This document is intended to present subdivision surfaces from a perspective helpful in making use of OpenSubdiv. One purpose it serves is to provide a high level overview for those with less experience with the algorithms or mathematics of subdivision. The other is to provide an overview of the feature set available with OpenSubdiv, and to introduce those capabilities with the terminology used by OpenSubdiv as much of it is overloaded. Piecewise Parametric Surfaces Piecewise parametric surfaces are arguably the most widely used geometric representation in industrial design, entertainment and many other areas. Many of the objects we deal with everyday -- cars, mobile phones, laptops -- were all designed and visualized first as piecewise parametric surfaces before those designs were approved and pursued. Piecewise parametric surfaces are ultimately just collections of simpler modeling primitives referred to as patches. Patches constitute the pieces of the larger surface in much the same way as a face or polygon constitutes a piece of a polygonal mesh. Parametric Patches Patches are the building blocks of piecewise smooth surfaces, and many different kinds of patches have evolved to meet the needs of geometric modeling. Two of the more effective and common patches are illustrated below Single bicubic B-Spline patch Single bicubic Bezier patch Patches consist of a set of points or vertices that affect a rectangular piece of smooth surface triangular patches also exist. That rectangle is parameterized in its two directions, transforming a simple 2D rectangle into the 3D surface u,v 2D domain of a patch Mapping from u,v to x,y,z The points that control the shape of the surface are usually referred to as control points or control vertices, and the collection of the entire set defining a patch as the control mesh, the control hull, the control cage or simply the hull, the cage, etc. For the sake of brevity we will frequently use the term cage, which serves us more generally later. So a patch essentially consist of two entities its control points and the surface affected by them. The way the control points affect the surface is what makes the different types of patches unique. Even patches defined by the same number of points can have different behavior. Note that all 16 points of the B-Spline patch above are relatively far from the surface they define compared to the similar Bezier patch. The two patches in that example actually represent exactly the same piece of surface -- each with a set of control points having different effects on it. In mathematical terms, each control point has a basis function associated with it that affects the surface in a particular way when only that point is moved Bicubic B-Spline basis function Bicubic Bezier basis funciton It is these basis functions that often give rise to the names of the different patches. There are pros and cons to these different properties of the control points of patches, which become more apparent as we assemble patches into piecewise surfaces. Piecewise Surfaces Piecewise parametric surfaces are collections of patches. For rectangular patches, one of the simplest ways to construct a collection is to define a set of patches using a rectangular grid of control points Piecewise B-Spline surface Piecewise Bezier surface Note that we can overlap the points of adjacent B-spline patches. This overlapping means that moving one control point affects multiple patches -- but it also ensures that those patches always meet smoothly this was a design intention and not true for other patch types. Adjacent Bezier patches only share points at their boundaries and coordinating the points across those boundaries to keep the surface smooth is possible, but awkward. This makes B-splines a more favorable surface representation for interactive modeling, but Bezier patches serve many other useful purposes. A more complicated B-spline surface Part of a more complicated B-Spline surface Just as a patch consisted of a cage and a surface, the same is now true of the collection. The control cage is manipulated by a designer and the surface of each of the patches involved is displayed so they can assess its effect. Arbitrary Topology Piecewise surfaces discussed thus far have been restricted to collections of patches over regular grids of control points. There is a certain simplicity with rectangular parametric surfaces that is appealing, but a surface representation that supports arbitrary topology has many other advantages. Rectangular parametric surfaces gained widespread adoption despite their topological limitations, and their popularity continues today in some areas. Complex objects often need many such surfaces to represent them and a variety of techniques have evolved to assemble them effectively, including stitching multiple surfaces together or cutting holes into them trimming. These are complicated techniques, and while effective in some contexts e.g. industrial design they become cumbersome in others e.g. animation and visual effects. A single polygonal mesh can represent shapes with far more complexity than a single rectangular piecewise surface, but its faceted nature eventually becomes a problem. Subdivision surfaces combine the topological flexibility of polygonal meshes with the underlying smoothness of piecewise parametric surfaces. Just as rectangular piecewise parametric surfaces have a collection of control points its cage stored as a grid and an underlying surface, subdivision surfaces also have a collection of control points its cage stored as a mesh and an underlying surface often referred as its limit surface. Regular versus Irregular Features A mesh contains the vertices and faces that form the cage for the underlying surface, and the topology of that mesh can be arbitrarily complex. In areas where the faces and vertices of the mesh are connected to form rectangular grids, the limit surface becomes one of the rectangular piecewise parametric surfaces previously mentioned. These regions of the mesh are said to be regular they provide behavior familiar from the use of similar rectangular surfaces and their limit surface is relatively simple to deal with. All other areas are considered irregular they provide the desired topological flexibility and so are less familiar and less predictable in some cases and their limit surface can be much more complicated. Irregular features come in a number of forms. The most widely referred to is an extra-ordinary vertex, i.e. a vertex which, in the case of a quad subdivision scheme like Catmull-Clark, does not have four incident faces. Irregular vertex and incident faces Regular and irregular regions of the surface The presence of these irregular features makes the limit surface around them similarly irregular, i.e. it cannot be represented as simply as it can for regular regions. Its worth noting that irregular regions shrink in size and become more isolated as subdivision is applied. A face with a lot of extra-ordinary vertices around it makes for a very complicated surface, and isolating these features is a way to help deal with that complexity Two valence-5 vertices nearby Isolation subdivided once Isolation subdivided twice Its generally necessary to perform some kind of local subdivision in these areas to break these pieces of surface into smaller, more manageable pieces, and the term feature adaptive subdivision has become popular in recent years to describe this process. Whether this is done explicitly or implicitly, globally or locally, what matters most is that there is an underlying piece of limit surface for each face -- albeit a potentially complicated one at an irregular feature -- that can be evaluated in much the same way as rectangular piecewise surfaces. Patches of the regular regions Patches of the irregular region While supporting a smooth surface in these irregular areas is the main advantage of subdivision surfaces, both the complexity of the resulting surfaces and their quality are reasons to use them with care. When the topology is largely irregular, there is a higher cost associated with its surface, so minimizing irregularities is advantageous. And in some cases the surface quality, i.e. the perceived smoothness, of the irregular surfaces can lead to undesirable artefacts. An arbitrary polygonal mesh will often not make a good subdivision cage, regardless of how good that polygonal mesh appears. As with rectangular piecewise parametric surfaces, the cage should be shaped to affect the underlying surface it is intended to represent. See Modeling Tips for related recommendations. Non-manifold Topology Since the cage of a subdivision surface is stored in a mesh, and often manipulated in the same context as polygonal meshes, the topic of manifold versus non-manifold topology warrants some attention. There are many definitions or descriptions of what distinguishes a manifold mesh from one that is not. These range from concise but abstract mathematical definitions to sets of examples showing manifold and non-manifold meshes -- all have their value and an appropriate audience. The following is not a strict definition but serves well to illustrate most local topological configurations that cause a mesh to be non-manifold. Consider standing on the faces of a mesh and walking around each vertex in turn. Assuming a right-hand winding order of faces, stand on the side of the face in the positive normal direction. And when walking, step across each incident edge in a counter-clockwise direction to the next incident face. For an interior vertex start at the corner of any incident face walk around the vertex across each incident edge to the next unvisited face repeat if you arrive back where you started and any incident faces or edges were not visited, the mesh is non-manifold Similarly, for a boundary vertex start at the corner of the face containing the leading boundary edge walk around the vertex across each incident edge to the next unvisited face repeat if you arrive at another boundary edge and any incident faces or edges were not visited, the mesh is non-manifold If you can walk around all vertices this way and dont encounter any non-manifold features, the mesh is likely manifold. Obviously if a vertex has no faces, there is nothing to walk around and this test cant succeed, so it is again non-manifold. All of the faces around a vertex should also be in the same orientation, otherwise two adjacent faces have normals in opposite directions and the mesh will be considered non-manifold, so we should really include that constraint when stepping to the next face to be more strict. Consider walking around the indicated vertices of the following non-manifold meshes Edges with 2 incident faces Faces sharing a vertex but no edges As mentioned earlier, many tools do not support non-manifold meshes, and in some contexts, e.g. 3D printing, they should be strictly avoided. Sometimes a manifold mesh may be desired and enforced as an end result, but the mesh may temporarily become non-manifold due to a particular sequence of modeling operations. Rather than supporting or advocating the use of non-manifold meshes, OpenSubdiv strives to be robust in the presence of non-manifold features to simplify the usage of its clients -- sparing them the need for topological analysis to determine when OpenSubdiv can or cannot be used. Although subdivision rules are not as well standardized in areas where the mesh is not manifold, OpenSubdiv provides simple rules and a reasonable limit surface in most cases. Surface around edges with 2 incident faces Surface for faces sharing a vertex but no edges As with the case of regular versus irregular features, since every face has a corresponding piece of surface associated with it -- whether locally manifold or not -- the term arbitrary topology can be said to include non-manifold topology. Subdivision versus Tessellation The preceding sections illustrate subdivision surfaces as piecewise parametric surfaces of arbitrary topology. As piecewise parametric surfaces, they consist of a cage and the underlying surface defined by that cage. Two techniques used to display subdivision surfaces are subdivision and tessellation. Both have their legitimate uses, but there is an important distinction between them subdivision operates on a cage and produces a refined cage tessellation operates on a surface and produces a discretization of that surface The existence and relative simplicity of the subdivision algorithm makes it easy to apply repeatedly to approximate the shape of the surface, but with the result being a refined cage, that approximation is not always very accurate. When compared to a cage refined to a different level, or a tessellation that uses points evaluated directly on the limit surface, the discrepancies can be confusing. Subdivision Subdivision is the process that gives subdivision surfaces their name, but it is not unique to them. Being piecewise parametric surfaces, lets first look at subdivision in the context of the simpler parametric patches that comprise them. Subdivision is a special case of refinement , which is key to the success of some of the most widely used types of parametric patches and their aggregate surfaces. A surface can be refined when an algorithm exists such that more control points can be introduced while keeping the shape of the surface exactly the same . For interactive and design purposes, this allows a designer to introduce more resolution for finer control without introducing undesired side effects in the shape. For more analytical purposes, it allows the surface to be broken into pieces, often adaptively, while being faithful to the original shape. One reason why both B-spline and Bezier patches are so widely used is that both of them can be refined. Uniform subdivision -- the process of splitting each of the patches in one or both of its directions -- is a special case of refinement that both of these patch types support B-Spline surface and its cage Cage subdivided 1x Cage subdivided 2x In the cases illustrated above for B-Splines, the uniformly refined cages produce the same limit surface as the original granted in more pieces. So it is fair to say that both uniform B-splines and Bezier surfaces are subdivision surfaces. The limit surface remains the same with the many more control points roughly 4x with each iteration of subdivision, and those points are closer to but not on the surface. It may be tempting to use these new control points to represent the surface, but using the same number of points evaluated at corresponding uniformly spaced parametric locations on the surface is usually simpler and more effective. Note also that points of the cage typically do not have any normal vectors associated with them, though we can evaluate normals explicitly for arbitrary locations on the surface just as we do for position. So if displaying a cage as a shaded surface, normal vectors at each of the control points must be contrived. Both the positions and normals of the points on the finer cage are therefore both approximations. For more general subdivision surfaces, the same is true. Subdivision will refine a mesh of arbitrary topology, but the resulting points will not lie on the limit surface and any normal vectors contrived from and associated with these points will only be approximations to those of the limit surface. Tessellation There is little need to use subdivision to approximate a parametric surface when it can be computed directly, i.e. it can be tessellated. We can evaluate at arbitrary locations on the surface and connect the resulting points to form a tessellation -- a discretization of the limit surface -- that is far more flexible than the results achieved from uniform subdivision Uniform 3x3 tessellation of B-spline surface Curvature-adaptive tessellation of B-spline surface For a simple parametric surface, the direct evaluation of the limit surface is also simple, but for more complicated subdivision surfaces of arbitrary topology, this is less the case. The lack of a clear understanding of the relationship between the limit surface and the cage has historically lead to many applications avoiding tessellation. Its worth mentioning that subdivision can be used to generate a tessellation even when the limit surface is not available for direct evaluation. The recursive nature of subdivision does give rise to formulae that allow a point on the limit surface to be computed that corresponds to each point of the cage. This process is often referred to as snapping or pushing the points of the cage onto the limit surface. Subdivided 1x and snapped to limit surface Subdivided 2x and snapped to limit surface Since the end result is a connected set of points on the limit surface, this forms a tessellation of the limit surface, and we consider it a separate process to subdivision though it does make use of it. The fact that such a tessellation might have been achieved using subdivision is indistinguishable from the final result -- the same tessellation might just as easily have been generated by evaluating limit patches of the cage uniformly 2x, 4x, 8x, etc. along each edge. Which to Use Subdivision is undeniably useful in creating finer cages to manipulate the surface, but tessellation is preferred for displaying the surface when the patches are available for direct evaluation. There was a time when global refinement was pursued in limited circles as a way of rapidly evaluating parametric surfaces along isoparametric lines, but patch evaluation, i.e. tessellation, generally prevails. Considerable confusion has arisen due the way the two techniques have been employed and presented when displaying the shape in end-user applications. One can argue that if an application displays a representation of the surface that is satisfactory for its purposes, then it is not necessary to burden the user with additional terminology and choices. But when two representations of the same surface differ considerably between two applications, the lack of any explanation or control leads to confusion. As long as applications make different choices on how to display the surface, we seek a balance between simplicity and control. Since subdivided points do not lie on the limit surface, it is important to make it clear to users when subdivision is being used instead of tessellation. This is particularly true in applications where the cage and the surface are displayed in the same style as there is no visual cue for users to make that distinction. Mesh Data and Topology The ability of subdivision surfaces to support arbitrary topology leads to the use of meshes to store both the topology of the cage and the data values associated with its control points, i.e. its vertices. The shape of a mesh, or the subdivision surface that results from it, is a combination of the topology of the mesh and the position data associated with its vertices. When dealing with meshes there are advantages to separating the topology from the data, and this is even more important when dealing with subdivision surfaces. The shape referred to above is not just the shape of the mesh the cage in this case but could be the shape of a refined cage or the limit surface. By observing the roles that both the data and topology play in operations such as subdivision and evaluation, significant advantages can be gained by managing data, topology and the associated computations accordingly. While the main purpose of subdivision surfaces is to use position data associated with the vertices to define a smooth, continuous limit surface, there are many cases where non-positional data is associated with a mesh. That data may often be interpolated smoothly like position, but often it is preferred to interpolate it linearly or even make it discontinuous along edges of the mesh. Texture coordinates and color are common examples here. Other than position, which is assigned to and associated with vertices, there are no constraints on how arbitrary data can or should be associated or interpolated. Texture coordinates, for example, can be assigned to create a completely smooth limit surface like the position, linearly interpolated across faces, or even made discontinuous between them. There are, however, consequences to consider -- both in terms of data management and performance -- which are described below as the terminology and techniques used to achieve each are defined. Separating Data from Topology While the topology of meshes used to store subdivision surfaces is arbitrarily complex and variable, the topology of the parametric patches that make up its limit surface are simple and fixed. Bicubic B-Spline and Bezier patches are both defined by a simple 4x4 grid of control points and a set of basis functions for each point that collectively form the resulting surface. For such a patch, the position at a given parametric location is the result of the combination of position data associated with its control points and the weights of the corresponding basis functions weights being the values of basis functions evaluated at a parametric location. The topology and the basis functions remain the same, so we can make use of the weights independent of the data. If the positions of the control points change, we can simply recombine the new position data with the weights that we just used and apply the same combination. The fixed topology of a parametric patch and two shapes resulting from two sets of positions. Similarly, for a piecewise surface, the position at a given parametric location is the result of the single patch containing that parametric location evaluated at the given position. The control points involved are the subset of control points associated with that particular patch. If the topology of the surface is fixed, so too is the topology of the collection of patches that comprise that surface. If the positions of those control points change, we can recombine the new position data with the same weights for the subset of points associated with the patch. More complex but fixed topology of a surface and two shapes resulting from two sets of positions. This holds for a piecewise surface of arbitrary topology. Regardless of how complex the topology, as long as it remains fixed i.e. relationships between vertices, edges and faces does not change or anything other settings affecting subdivision rules, the same techniques apply. This is just one example of the value of separating computations involving topology from those involving the data. Both subdivision and evaluation can be factored into steps involving topology computing the weights and combining the data separately. Three shapes resulting from three sets of positions for a mesh of fixed topology. When the topology is fixed, enormous savings are possible by pre-computing information associated with the topology and organizing the data associated with the control points in a way that can be efficiently combined with it. This is key to understanding some of the techniques used to process subdivision surfaces. For a mesh of arbitrary topology, the control points of the underlying surface are the vertices, and position data associated with them is most familiar. But there is nothing that requires that the control points of a patch have to represent position -- the same techniques apply regardless of the type of data involved. Vertex and Varying Data The most typical and fundamental operation is to evaluate a position on the surface, i.e. evaluate the underlying patches of the limit surface using the x,y,z positions at the vertices of the mesh. Given a parametric u,v location on one such patch, the data-independent evaluation method first computes the weights and then combines the x,y,z vertex positions resulting in an x,y,z position at that location. But the weights and their combination can be applied to any data at the vertices, e.g. color, texture coordinates or anything else. Data associated with the vertices that is interpolated this way, including position, is said to be vertex data or to have vertex interpolation. Specifying other data as vertex data will result in it being smoothly interpolated in exactly the same way using exactly the same weights as the position. So to capture a simple 2D projection of the surface for texture coordinates, 2D values matching the x,y of the positions would be used. If linear interpolation of data associated with vertices is desired instead, the data is said to be varying data or to have varying interpolation. Here the non-linear evaluation of the patches defining the smooth limit surface is ignored and weights for simple linear interpolation are used. This is a common choice for texture coordinates as evaluation of texture without the need of bicubic patches is computationally cheaper. The linear interpolation will not capture the smoothness required of a true projection between the vertices, but both vertex and varying interpolation have their uses. Projected texture smoothly interpolated from vertex data Projected texture linearly interpolated from varying data Since both vertex and varying data is associated with vertices a unique value assigned to each, the resulting surface will be continuous -- piecewise smooth in the case of vertex data and piecewise linear in the case of varying. Face-Varying Data and Topology In order to support discontinuities in data on the surface, unlike vertex and varying data, there must be multiple values associated with vertices, edges andor faces, in order for a discontinuity to exist. Discontinuities are made possible by assigning values to the corners of faces, similar to the way in which vertices are assigned to the corners of faces when defining the topology of the mesh. Recalling the assignment of vertices to faces Vertex indices are assigned to all corners of each face as part of mesh construction and are often referred to as the face-vertices of an individual face or the mesh. All face-vertices that share the same vertex index will be connected by that vertex and share the same vertex data associated with it. By assigning a different set of indices to the face-vertices -- indices not referring to the vertices but some set of data to be associated with the corners of each face -- corners that share the same vertex no longer need to share the same data value and the data can be made discontinuous between faces This method of associating data values with the face-vertices of the mesh is said to be assigning face-varying data for face-varying interpolation. An interpolated value will vary continuously within a face i.e. the patch of the limit surface associated with the face but not necessarily across the edges or vertices shared with adjacent faces. Disjoint face-varying UV regions applied to the limit surface The combination of associating data values not with the vertices the control points but the face corners, and the resulting data-dependent discontinuities that result, make this a considerably more complicated approach than vertex or varying. The added complexity of the data alone is reason to only use it when necessary, i.e. when discontinuities are desired and present. Part of the complexity of dealing with face-varying data and interpolation is the way in which the interpolation behavior can be defined. Where the data is continuous, the interpolation can be specified to be as smooth as the underlying limit surface of vertex data or simply linear as achieved with varying data. Where the data is discontinuous -- across interior edges and around vertices -- the discontinuities create boundaries for the data, and partition the underlying surface into disjoint regions. The interpolation along these boundaries can also be specified as smooth or linear in a number of ways many of which have a historical basis. A more complete description of the different linear interpolation options with face-varying data and interpolation is given later. These options make it possible to treat the data as either vertex or varying, but with the added presence of discontinuities. An essential point to remember with face-varying interpolation is that each set of data is free to have its own discontinuities -- this leads to each data set having both unique topology and size. The topology specified for a collection of face-varying data is referred to as a channel and is unique to face-varying interpolation. Unlike vertex and varying interpolation, which both associate a data value with a vertex, the number of values in a face-varying channel is not fixed by the number of vertices or faces. The number of indices assigned to the face-corners will be the same for all channels, but the number of unique values referred to by these indices may not. We can take advantage of the common mesh topology in areas where the data is continuous, but we lose some of those advantages around the discontinuities. This results in the higher complexity and cost of a face-varying channel compared to vertex or varying data. If the topology for a channel is fixed, though, similar techniques can be applied to factor computation related to the topology so that changes to the data can be processed efficiently. Schemes and Options While previous sections have described subdivision surfaces in more general terms, this section describes a number of common variations often referred to as extensions to the subdivision algorithms and the ways that they are represented in OpenSubdiv. The number and nature of the extensions here significantly complicate what are otherwise fairly simple subdivision algorithms. Historically applications have supported either a subset or have had varying implementations of the same feature. OpenSubdiv strives to provide a consistent and efficient implementation of this feature set. Given the varying presentations of some of these features elsewhere, the naming chosen by OpenSubdiv is emphasized here. Subdivision Schemes OpenSubdiv provides two well known subdivision surface types -- Catmull-Clark often referred to more tersely as Catmark and Loop subdivision. Catmull-Clark is more widely used and suited to quad-dominant meshes, while Loop is preferred for and requires purely triangulated meshes. The many examples from previous sections have illustrated the more popular Catmull-Clark scheme. For an example of Loop Boundary Interpolation Rules Boundary interpolation rules control how subdivision and the limit surface behave for faces adjacent to boundary edges and vertices. The following choices are available via the enumeration SdcOptionsVtxBoundaryInterpolation Mode Behavior VTX_BOUNDARY_NONE No boundary edge interpolation is applied by default boundary faces are tagged as holes so that the boundary vertices continue to support the adjacent interior faces, but no surface corresponding to the boundary faces is generated boundary faces can be selectively interpolated by sharpening all boundary edges incident the vertices of the face VTX_BOUNDARY_EDGE_ONLY A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary faces extends VTX_BOUNDARY_EDGE_AND_CORNER Similar to edge-only but the smooth curve resulting on the boundary is made to interpolate corner vertices vertices with exactly one incident face On a grid example In practice, it is rare to use no boundary interpolation at all -- this feature has its uses in allowing separate meshes to be seamlessly joined together by replicating the vertices along boundaries, but these uses are limited. Given the global nature of the setting, it is usually preferable to explicitly make the boundary faces holes in the areas where surfaces from separate meshes are joined, rather than sharpening edges to interpolate the desired boundaries everywhere else. The remaining edge only and edge and corner choices are then solely distinguished by whether or not the surface at corner vertices is smooth or sharp. Face-varying Interpolation Rules Face-varying interpolation rules control how face-varying data is interpolated both in the interior of face-varying regions smooth or linear and at the boundaries where it is discontinuous constrained to be linear or pinned in a number of ways. Where the topology is continuous and the interpolation chosen to be smooth, the behavior of face-varying interpolation will match that of the vertex interpolation. Choices for face-varying interpolation are most commonly available in the context of UVs for texture coordinates and a number of names for such choices have evolved in different applications over the years. The choices offered by OpenSubdiv cover a wide range of popular applications. The feature is named face-varying linear interpolation -- rather than boundary interpolation commonly used -- to emphasize that it can be applied to the entire surface not just boundaries and that the effects are to make the surface behave more linearly in various ways. The following choices are available for the SdcOptionsFVarLinearInterpolation enum -- the ordering here applying progressively more linear constraints Mode Behavior FVAR_LINEAR_NONE smooth everywhere the mesh is smooth FVAR_LINEAR_CORNERS_ONLY linearly interpolate sharpen or pin corners only FVAR_LINEAR_CORNERS_PLUS1 CORNERS_ONLY sharpening of junctions of 3 or more regions FVAR_LINEAR_CORNERS_PLUS2 CORNERS_PLUS1 sharpening of darts and concave corners FVAR_LINEAR_BOUNDARIES linear interpolation along all boundary edges and corners FVAR_LINEAR_ALL linear interpolation everywhere boundaries and interior These rules cannot make the interpolation of the face-varying data smoother than that of the vertices. The presence of sharp features of the mesh created by sharpness values, boundary interpolation rules, or the subdivision scheme itself e.g. Bilinear take precedence. All face-varying interpolation modes illustrated in UV space using a simple 4x4 grid of quads segmented into three UV regions their control point locations implied by interpolation in the FVAR_LINEAR_ALL case For those familiar, this shape and its assigned UV sets are available for inspection in the catmark_fvar_bound1 shape of OpenSubdivs example and regression shapes. Semi-Sharp Creases Just as some types of parametric surfaces support additional shaping controls to affect creasing along the boundaries between surface elements, OpenSubdiv provides additional sharpness values or weights associated with edges and vertices to achieve similar results over arbitrary topology. Setting sharpness values to a maximum value 10 in this case -- a number chosen for historical reasons effectively modifies the subdivision rules so that the boundaries between the piecewise smooth surfaces are infinitely sharp or discontinuous. But since real world surfaces never really have infinitely sharp edges, especially when viewed sufficiently close, it is often preferable to set the sharpness lower than this value, making the crease semi-sharp. A constant weight value assigned to a sequence of edges connected edges therefore enables the creation of features akin to fillets and blends without adding extra rows of vertices though that technique still has its merits Sharpness values range from 0-10, with a value of 0 or less having no effect on the surface and a value of 10 or more making the feature completely sharp. It should be noted that infinitely sharp creases are really tangent discontinuities in the surface, implying that the geometric normals are also discontinuous there. Therefore, displacing along the normal will likely tear apart the surface along the crease. If you really want to displace a surface at a crease, it may be better to make the crease semi-sharp. Other Options While the preceding options represent features available in a wide-variety of tools and modeling formats, a few others exist whose recognition and adoption is more limited. In some cases, they offer improvements to undesirable behavior of the subdivision algorithms, but their effects are less than ideal. Given both their limited effectiveness and lack of recognition, these options should be used with caution. Chaikin Rule The Chaikin Rule is a variation of the semi-sharp creasing method that attempts to improve the appearance of creases along a sequence of connected edges when the sharpness values differ. This choice modifies the subdivision of sharpness values using Chaikins curve subdivision algorithm to consider all sharpness values of edges around a common vertex when determining the sharpness of child edges. The creasing method can be set using the values defined in the enumeration SdcOptionsCreasingMethod Mode Behavior CREASE_UNIFORM Apply regular semi-sharp crease rules CREASE_CHAIKIN Apply Chaikin semi-sharp crease rules Example of contiguous semi-sharp creases interpolation Triangle Subdivision Rule The triangle subdivision rule is a rule added to the Catmull-Clark scheme that modifies the behavior at triangular faces to improve the undesirable surface artefacts that often result in such areas. Mode Behavior TRI_SUB_CATMARK Default Catmark scheme weights TRI_SUB_SMOOTH Smooth triangle weights Cylinder example This rule was empirically determined to make triangles subdivide more smoothly. However, this rule breaks the nice property that two separate meshes can be joined seamlessly by overlapping their boundaries i.e. when there are triangles at either boundary, it is impossible to join the meshes seamlessly Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Subdivision Surfaces Subdivision Surfaces 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Overview Piecewise Parametric Surfaces Parametric Patches Piecewise Surfaces Arbitrary Topology Regular versus Irregular Features Non-manifold Topology Subdivision versus Tessellation Subdivision Tessellation Which to Use Mesh Data and Topology Separating Data from Topology Vertex and Varying Data Face-Varying Data and Topology Schemes and Options Subdivision Schemes Boundary Interpolation Rules Face-varying Interpolation Rules Semi-Sharp Creases Other Options Chaikin Rule Triangle Subdivision Rule Overview Subdivision surfaces are a common modeling primitive that has gained popularity in animation and visual effects over the past decades. As the name suggests, subdivision surfaces are fundamentally surfaces . More specifically, subdivision surfaces are piecewise parametric surfaces defined over meshes of arbitrary topology -- both concepts that will be described in the sections that follow. Subdivision is both an operation that can be applied to a polygonal mesh to refine it, and a mathematical tool that defines the underlying smooth surface to which repeated subdivision of the mesh converges. Explicit subdivision is simple to apply some number of times to provide a smoother mesh, and that simplicity has historically lead to many tools representing the shape this way. In contrast, deriving the smooth surface that ultimately defines the shape -- its limit surface -- is considerably more complex but provides greater accuracy and flexibility. These differences have led to confusion in how some tools expose subdivision surfaces. The ultimate goal is to have all tools use subdivision surfaces as true surface primitives. The focus here is therefore less on subdivision and more on the nature of the surface that results from it. In addition to providing a consistent implementation of subdivision -- one that includes a number of widely used feature extensions -- a significant value of OpenSubdiv is that it makes the limit surface more accessible. Since its introduction, OpenSubdiv has received interest from users and developers with a wide variety of skills, interests and backgrounds. This document is intended to present subdivision surfaces from a perspective helpful in making use of OpenSubdiv. One purpose it serves is to provide a high level overview for those with less experience with the algorithms or mathematics of subdivision. The other is to provide an overview of the feature set available with OpenSubdiv, and to introduce those capabilities with the terminology used by OpenSubdiv as much of it is overloaded. Piecewise Parametric Surfaces Piecewise parametric surfaces are arguably the most widely used geometric representation in industrial design, entertainment and many other areas. Many of the objects we deal with everyday -- cars, mobile phones, laptops -- were all designed and visualized first as piecewise parametric surfaces before those designs were approved and pursued. Piecewise parametric surfaces are ultimately just collections of simpler modeling primitives referred to as patches. Patches constitute the pieces of the larger surface in much the same way as a face or polygon constitutes a piece of a polygonal mesh. Parametric Patches Patches are the building blocks of piecewise smooth surfaces, and many different kinds of patches have evolved to meet the needs of geometric modeling. Two of the more effective and common patches are illustrated below Single bicubic B-Spline patch Single bicubic Bezier patch Patches consist of a set of points or vertices that affect a rectangular piece of smooth surface triangular patches also exist. That rectangle is parameterized in its two directions, transforming a simple 2D rectangle into the 3D surface u,v 2D domain of a patch Mapping from u,v to x,y,z The points that control the shape of the surface are usually referred to as control points or control vertices, and the collection of the entire set defining a patch as the control mesh, the control hull, the control cage or simply the hull, the cage, etc. For the sake of brevity we will frequently use the term cage, which serves us more generally later. So a patch essentially consist of two entities its control points and the surface affected by them. The way the control points affect the surface is what makes the different types of patches unique. Even patches defined by the same number of points can have different behavior. Note that all 16 points of the B-Spline patch above are relatively far from the surface they define compared to the similar Bezier patch. The two patches in that example actually represent exactly the same piece of surface -- each with a set of control points having different effects on it. In mathematical terms, each control point has a basis function associated with it that affects the surface in a particular way when only that point is moved Bicubic B-Spline basis function Bicubic Bezier basis funciton It is these basis functions that often give rise to the names of the different patches. There are pros and cons to these different properties of the control points of patches, which become more apparent as we assemble patches into piecewise surfaces. Piecewise Surfaces Piecewise parametric surfaces are collections of patches. For rectangular patches, one of the simplest ways to construct a collection is to define a set of patches using a rectangular grid of control points Piecewise B-Spline surface Piecewise Bezier surface Note that we can overlap the points of adjacent B-spline patches. This overlapping means that moving one control point affects multiple patches -- but it also ensures that those patches always meet smoothly this was a design intention and not true for other patch types. Adjacent Bezier patches only share points at their boundaries and coordinating the points across those boundaries to keep the surface smooth is possible, but awkward. This makes B-splines a more favorable surface representation for interactive modeling, but Bezier patches serve many other useful purposes. A more complicated B-spline surface Part of a more complicated B-Spline surface Just as a patch consisted of a cage and a surface, the same is now true of the collection. The control cage is manipulated by a designer and the surface of each of the patches involved is displayed so they can assess its effect. Arbitrary Topology Piecewise surfaces discussed thus far have been restricted to collections of patches over regular grids of control points. There is a certain simplicity with rectangular parametric surfaces that is appealing, but a surface representation that supports arbitrary topology has many other advantages. Rectangular parametric surfaces gained widespread adoption despite their topological limitations, and their popularity continues today in some areas. Complex objects often need many such surfaces to represent them and a variety of techniques have evolved to assemble them effectively, including stitching multiple surfaces together or cutting holes into them trimming. These are complicated techniques, and while effective in some contexts e.g. industrial design they become cumbersome in others e.g. animation and visual effects. A single polygonal mesh can represent shapes with far more complexity than a single rectangular piecewise surface, but its faceted nature eventually becomes a problem. Subdivision surfaces combine the topological flexibility of polygonal meshes with the underlying smoothness of piecewise parametric surfaces. Just as rectangular piecewise parametric surfaces have a collection of control points its cage stored as a grid and an underlying surface, subdivision surfaces also have a collection of control points its cage stored as a mesh and an underlying surface often referred as its limit surface. Regular versus Irregular Features A mesh contains the vertices and faces that form the cage for the underlying surface, and the topology of that mesh can be arbitrarily complex. In areas where the faces and vertices of the mesh are connected to form rectangular grids, the limit surface becomes one of the rectangular piecewise parametric surfaces previously mentioned. These regions of the mesh are said to be regular they provide behavior familiar from the use of similar rectangular surfaces and their limit surface is relatively simple to deal with. All other areas are considered irregular they provide the desired topological flexibility and so are less familiar and less predictable in some cases and their limit surface can be much more complicated. Irregular features come in a number of forms. The most widely referred to is an extra-ordinary vertex, i.e. a vertex which, in the case of a quad subdivision scheme like Catmull-Clark, does not have four incident faces. Irregular vertex and incident faces Regular and irregular regions of the surface The presence of these irregular features makes the limit surface around them similarly irregular, i.e. it cannot be represented as simply as it can for regular regions. Its worth noting that irregular regions shrink in size and become more isolated as subdivision is applied. A face with a lot of extra-ordinary vertices around it makes for a very complicated surface, and isolating these features is a way to help deal with that complexity Two valence-5 vertices nearby Isolation subdivided once Isolation subdivided twice Its generally necessary to perform some kind of local subdivision in these areas to break these pieces of surface into smaller, more manageable pieces, and the term feature adaptive subdivision has become popular in recent years to describe this process. Whether this is done explicitly or implicitly, globally or locally, what matters most is that there is an underlying piece of limit surface for each face -- albeit a potentially complicated one at an irregular feature -- that can be evaluated in much the same way as rectangular piecewise surfaces. Patches of the regular regions Patches of the irregular region While supporting a smooth surface in these irregular areas is the main advantage of subdivision surfaces, both the complexity of the resulting surfaces and their quality are reasons to use them with care. When the topology is largely irregular, there is a higher cost associated with its surface, so minimizing irregularities is advantageous. And in some cases the surface quality, i.e. the perceived smoothness, of the irregular surfaces can lead to undesirable artefacts. An arbitrary polygonal mesh will often not make a good subdivision cage, regardless of how good that polygonal mesh appears. As with rectangular piecewise parametric surfaces, the cage should be shaped to affect the underlying surface it is intended to represent. See Modeling Tips for related recommendations. Non-manifold Topology Since the cage of a subdivision surface is stored in a mesh, and often manipulated in the same context as polygonal meshes, the topic of manifold versus non-manifold topology warrants some attention. There are many definitions or descriptions of what distinguishes a manifold mesh from one that is not. These range from concise but abstract mathematical definitions to sets of examples showing manifold and non-manifold meshes -- all have their value and an appropriate audience. The following is not a strict definition but serves well to illustrate most local topological configurations that cause a mesh to be non-manifold. Consider standing on the faces of a mesh and walking around each vertex in turn. Assuming a right-hand winding order of faces, stand on the side of the face in the positive normal direction. And when walking, step across each incident edge in a counter-clockwise direction to the next incident face. For an interior vertex start at the corner of any incident face walk around the vertex across each incident edge to the next unvisited face repeat if you arrive back where you started and any incident faces or edges were not visited, the mesh is non-manifold Similarly, for a boundary vertex start at the corner of the face containing the leading boundary edge walk around the vertex across each incident edge to the next unvisited face repeat if you arrive at another boundary edge and any incident faces or edges were not visited, the mesh is non-manifold If you can walk around all vertices this way and dont encounter any non-manifold features, the mesh is likely manifold. Obviously if a vertex has no faces, there is nothing to walk around and this test cant succeed, so it is again non-manifold. All of the faces around a vertex should also be in the same orientation, otherwise two adjacent faces have normals in opposite directions and the mesh will be considered non-manifold, so we should really include that constraint when stepping to the next face to be more strict. Consider walking around the indicated vertices of the following non-manifold meshes Edges with 2 incident faces Faces sharing a vertex but no edges As mentioned earlier, many tools do not support non-manifold meshes, and in some contexts, e.g. 3D printing, they should be strictly avoided. Sometimes a manifold mesh may be desired and enforced as an end result, but the mesh may temporarily become non-manifold due to a particular sequence of modeling operations. Rather than supporting or advocating the use of non-manifold meshes, OpenSubdiv strives to be robust in the presence of non-manifold features to simplify the usage of its clients -- sparing them the need for topological analysis to determine when OpenSubdiv can or cannot be used. Although subdivision rules are not as well standardized in areas where the mesh is not manifold, OpenSubdiv provides simple rules and a reasonable limit surface in most cases. Surface around edges with 2 incident faces Surface for faces sharing a vertex but no edges As with the case of regular versus irregular features, since every face has a corresponding piece of surface associated with it -- whether locally manifold or not -- the term arbitrary topology can be said to include non-manifold topology. Subdivision versus Tessellation The preceding sections illustrate subdivision surfaces as piecewise parametric surfaces of arbitrary topology. As piecewise parametric surfaces, they consist of a cage and the underlying surface defined by that cage. Two techniques used to display subdivision surfaces are subdivision and tessellation. Both have their legitimate uses, but there is an important distinction between them subdivision operates on a cage and produces a refined cage tessellation operates on a surface and produces a discretization of that surface The existence and relative simplicity of the subdivision algorithm makes it easy to apply repeatedly to approximate the shape of the surface, but with the result being a refined cage, that approximation is not always very accurate. When compared to a cage refined to a different level, or a tessellation that uses points evaluated directly on the limit surface, the discrepancies can be confusing. Subdivision Subdivision is the process that gives subdivision surfaces their name, but it is not unique to them. Being piecewise parametric surfaces, lets first look at subdivision in the context of the simpler parametric patches that comprise them. Subdivision is a special case of refinement , which is key to the success of some of the most widely used types of parametric patches and their aggregate surfaces. A surface can be refined when an algorithm exists such that more control points can be introduced while keeping the shape of the surface exactly the same . For interactive and design purposes, this allows a designer to introduce more resolution for finer control without introducing undesired side effects in the shape. For more analytical purposes, it allows the surface to be broken into pieces, often adaptively, while being faithful to the original shape. One reason why both B-spline and Bezier patches are so widely used is that both of them can be refined. Uniform subdivision -- the process of splitting each of the patches in one or both of its directions -- is a special case of refinement that both of these patch types support B-Spline surface and its cage Cage subdivided 1x Cage subdivided 2x In the cases illustrated above for B-Splines, the uniformly refined cages produce the same limit surface as the original granted in more pieces. So it is fair to say that both uniform B-splines and Bezier surfaces are subdivision surfaces. The limit surface remains the same with the many more control points roughly 4x with each iteration of subdivision, and those points are closer to but not on the surface. It may be tempting to use these new control points to represent the surface, but using the same number of points evaluated at corresponding uniformly spaced parametric locations on the surface is usually simpler and more effective. Note also that points of the cage typically do not have any normal vectors associated with them, though we can evaluate normals explicitly for arbitrary locations on the surface just as we do for position. So if displaying a cage as a shaded surface, normal vectors at each of the control points must be contrived. Both the positions and normals of the points on the finer cage are therefore both approximations. For more general subdivision surfaces, the same is true. Subdivision will refine a mesh of arbitrary topology, but the resulting points will not lie on the limit surface and any normal vectors contrived from and associated with these points will only be approximations to those of the limit surface. Tessellation There is little need to use subdivision to approximate a parametric surface when it can be computed directly, i.e. it can be tessellated. We can evaluate at arbitrary locations on the surface and connect the resulting points to form a tessellation -- a discretization of the limit surface -- that is far more flexible than the results achieved from uniform subdivision Uniform 3x3 tessellation of B-spline surface Curvature-adaptive tessellation of B-spline surface For a simple parametric surface, the direct evaluation of the limit surface is also simple, but for more complicated subdivision surfaces of arbitrary topology, this is less the case. The lack of a clear understanding of the relationship between the limit surface and the cage has historically lead to many applications avoiding tessellation. Its worth mentioning that subdivision can be used to generate a tessellation even when the limit surface is not available for direct evaluation. The recursive nature of subdivision does give rise to formulae that allow a point on the limit surface to be computed that corresponds to each point of the cage. This process is often referred to as snapping or pushing the points of the cage onto the limit surface. Subdivided 1x and snapped to limit surface Subdivided 2x and snapped to limit surface Since the end result is a connected set of points on the limit surface, this forms a tessellation of the limit surface, and we consider it a separate process to subdivision though it does make use of it. The fact that such a tessellation might have been achieved using subdivision is indistinguishable from the final result -- the same tessellation might just as easily have been generated by evaluating limit patches of the cage uniformly 2x, 4x, 8x, etc. along each edge. Which to Use Subdivision is undeniably useful in creating finer cages to manipulate the surface, but tessellation is preferred for displaying the surface when the patches are available for direct evaluation. There was a time when global refinement was pursued in limited circles as a way of rapidly evaluating parametric surfaces along isoparametric lines, but patch evaluation, i.e. tessellation, generally prevails. Considerable confusion has arisen due the way the two techniques have been employed and presented when displaying the shape in end-user applications. One can argue that if an application displays a representation of the surface that is satisfactory for its purposes, then it is not necessary to burden the user with additional terminology and choices. But when two representations of the same surface differ considerably between two applications, the lack of any explanation or control leads to confusion. As long as applications make different choices on how to display the surface, we seek a balance between simplicity and control. Since subdivided points do not lie on the limit surface, it is important to make it clear to users when subdivision is being used instead of tessellation. This is particularly true in applications where the cage and the surface are displayed in the same style as there is no visual cue for users to make that distinction. Mesh Data and Topology The ability of subdivision surfaces to support arbitrary topology leads to the use of meshes to store both the topology of the cage and the data values associated with its control points, i.e. its vertices. The shape of a mesh, or the subdivision surface that results from it, is a combination of the topology of the mesh and the position data associated with its vertices. When dealing with meshes there are advantages to separating the topology from the data, and this is even more important when dealing with subdivision surfaces. The shape referred to above is not just the shape of the mesh the cage in this case but could be the shape of a refined cage or the limit surface. By observing the roles that both the data and topology play in operations such as subdivision and evaluation, significant advantages can be gained by managing data, topology and the associated computations accordingly. While the main purpose of subdivision surfaces is to use position data associated with the vertices to define a smooth, continuous limit surface, there are many cases where non-positional data is associated with a mesh. That data may often be interpolated smoothly like position, but often it is preferred to interpolate it linearly or even make it discontinuous along edges of the mesh. Texture coordinates and color are common examples here. Other than position, which is assigned to and associated with vertices, there are no constraints on how arbitrary data can or should be associated or interpolated. Texture coordinates, for example, can be assigned to create a completely smooth limit surface like the position, linearly interpolated across faces, or even made discontinuous between them. There are, however, consequences to consider -- both in terms of data management and performance -- which are described below as the terminology and techniques used to achieve each are defined. Separating Data from Topology While the topology of meshes used to store subdivision surfaces is arbitrarily complex and variable, the topology of the parametric patches that make up its limit surface are simple and fixed. Bicubic B-Spline and Bezier patches are both defined by a simple 4x4 grid of control points and a set of basis functions for each point that collectively form the resulting surface. For such a patch, the position at a given parametric location is the result of the combination of position data associated with its control points and the weights of the corresponding basis functions weights being the values of basis functions evaluated at a parametric location. The topology and the basis functions remain the same, so we can make use of the weights independent of the data. If the positions of the control points change, we can simply recombine the new position data with the weights that we just used and apply the same combination. The fixed topology of a parametric patch and two shapes resulting from two sets of positions. Similarly, for a piecewise surface, the position at a given parametric location is the result of the single patch containing that parametric location evaluated at the given position. The control points involved are the subset of control points associated with that particular patch. If the topology of the surface is fixed, so too is the topology of the collection of patches that comprise that surface. If the positions of those control points change, we can recombine the new position data with the same weights for the subset of points associated with the patch. More complex but fixed topology of a surface and two shapes resulting from two sets of positions. This holds for a piecewise surface of arbitrary topology. Regardless of how complex the topology, as long as it remains fixed i.e. relationships between vertices, edges and faces does not change or anything other settings affecting subdivision rules, the same techniques apply. This is just one example of the value of separating computations involving topology from those involving the data. Both subdivision and evaluation can be factored into steps involving topology computing the weights and combining the data separately. Three shapes resulting from three sets of positions for a mesh of fixed topology. When the topology is fixed, enormous savings are possible by pre-computing information associated with the topology and organizing the data associated with the control points in a way that can be efficiently combined with it. This is key to understanding some of the techniques used to process subdivision surfaces. For a mesh of arbitrary topology, the control points of the underlying surface are the vertices, and position data associated with them is most familiar. But there is nothing that requires that the control points of a patch have to represent position -- the same techniques apply regardless of the type of data involved. Vertex and Varying Data The most typical and fundamental operation is to evaluate a position on the surface, i.e. evaluate the underlying patches of the limit surface using the x,y,z positions at the vertices of the mesh. Given a parametric u,v location on one such patch, the data-independent evaluation method first computes the weights and then combines the x,y,z vertex positions resulting in an x,y,z position at that location. But the weights and their combination can be applied to any data at the vertices, e.g. color, texture coordinates or anything else. Data associated with the vertices that is interpolated this way, including position, is said to be vertex data or to have vertex interpolation. Specifying other data as vertex data will result in it being smoothly interpolated in exactly the same way using exactly the same weights as the position. So to capture a simple 2D projection of the surface for texture coordinates, 2D values matching the x,y of the positions would be used. If linear interpolation of data associated with vertices is desired instead, the data is said to be varying data or to have varying interpolation. Here the non-linear evaluation of the patches defining the smooth limit surface is ignored and weights for simple linear interpolation are used. This is a common choice for texture coordinates as evaluation of texture without the need of bicubic patches is computationally cheaper. The linear interpolation will not capture the smoothness required of a true projection between the vertices, but both vertex and varying interpolation have their uses. Projected texture smoothly interpolated from vertex data Projected texture linearly interpolated from varying data Since both vertex and varying data is associated with vertices a unique value assigned to each, the resulting surface will be continuous -- piecewise smooth in the case of vertex data and piecewise linear in the case of varying. Face-Varying Data and Topology In order to support discontinuities in data on the surface, unlike vertex and varying data, there must be multiple values associated with vertices, edges andor faces, in order for a discontinuity to exist. Discontinuities are made possible by assigning values to the corners of faces, similar to the way in which vertices are assigned to the corners of faces when defining the topology of the mesh. Recalling the assignment of vertices to faces Vertex indices are assigned to all corners of each face as part of mesh construction and are often referred to as the face-vertices of an individual face or the mesh. All face-vertices that share the same vertex index will be connected by that vertex and share the same vertex data associated with it. By assigning a different set of indices to the face-vertices -- indices not referring to the vertices but some set of data to be associated with the corners of each face -- corners that share the same vertex no longer need to share the same data value and the data can be made discontinuous between faces This method of associating data values with the face-vertices of the mesh is said to be assigning face-varying data for face-varying interpolation. An interpolated value will vary continuously within a face i.e. the patch of the limit surface associated with the face but not necessarily across the edges or vertices shared with adjacent faces. Disjoint face-varying UV regions applied to the limit surface The combination of associating data values not with the vertices the control points but the face corners, and the resulting data-dependent discontinuities that result, make this a considerably more complicated approach than vertex or varying. The added complexity of the data alone is reason to only use it when necessary, i.e. when discontinuities are desired and present. Part of the complexity of dealing with face-varying data and interpolation is the way in which the interpolation behavior can be defined. Where the data is continuous, the interpolation can be specified to be as smooth as the underlying limit surface of vertex data or simply linear as achieved with varying data. Where the data is discontinuous -- across interior edges and around vertices -- the discontinuities create boundaries for the data, and partition the underlying surface into disjoint regions. The interpolation along these boundaries can also be specified as smooth or linear in a number of ways many of which have a historical basis. A more complete description of the different linear interpolation options with face-varying data and interpolation is given later. These options make it possible to treat the data as either vertex or varying, but with the added presence of discontinuities. An essential point to remember with face-varying interpolation is that each set of data is free to have its own discontinuities -- this leads to each data set having both unique topology and size. The topology specified for a collection of face-varying data is referred to as a channel and is unique to face-varying interpolation. Unlike vertex and varying interpolation, which both associate a data value with a vertex, the number of values in a face-varying channel is not fixed by the number of vertices or faces. The number of indices assigned to the face-corners will be the same for all channels, but the number of unique values referred to by these indices may not. We can take advantage of the common mesh topology in areas where the data is continuous, but we lose some of those advantages around the discontinuities. This results in the higher complexity and cost of a face-varying channel compared to vertex or varying data. If the topology for a channel is fixed, though, similar techniques can be applied to factor computation related to the topology so that changes to the data can be processed efficiently. Schemes and Options While previous sections have described subdivision surfaces in more general terms, this section describes a number of common variations often referred to as extensions to the subdivision algorithms and the ways that they are represented in OpenSubdiv. The number and nature of the extensions here significantly complicate what are otherwise fairly simple subdivision algorithms. Historically applications have supported either a subset or have had varying implementations of the same feature. OpenSubdiv strives to provide a consistent and efficient implementation of this feature set. Given the varying presentations of some of these features elsewhere, the naming chosen by OpenSubdiv is emphasized here. Subdivision Schemes OpenSubdiv provides two well known subdivision surface types -- Catmull-Clark often referred to more tersely as Catmark and Loop subdivision. Catmull-Clark is more widely used and suited to quad-dominant meshes, while Loop is preferred for and requires purely triangulated meshes. The many examples from previous sections have illustrated the more popular Catmull-Clark scheme. For an example of Loop Boundary Interpolation Rules Boundary interpolation rules control how subdivision and the limit surface behave for faces adjacent to boundary edges and vertices. The following choices are available via the enumeration SdcOptionsVtxBoundaryInterpolation Mode Behavior VTX_BOUNDARY_NONE No boundary edge interpolation is applied by default boundary faces are tagged as holes so that the boundary vertices continue to support the adjacent interior faces, but no surface corresponding to the boundary faces is generated boundary faces can be selectively interpolated by sharpening all boundary edges incident the vertices of the face VTX_BOUNDARY_EDGE_ONLY A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary faces extends VTX_BOUNDARY_EDGE_AND_CORNER Similar to edge-only but the smooth curve resulting on the boundary is made to interpolate corner vertices vertices with exactly one incident face On a grid example In practice, it is rare to use no boundary interpolation at all -- this feature has its uses in allowing separate meshes to be seamlessly joined together by replicating the vertices along boundaries, but these uses are limited. Given the global nature of the setting, it is usually preferable to explicitly make the boundary faces holes in the areas where surfaces from separate meshes are joined, rather than sharpening edges to interpolate the desired boundaries everywhere else. The remaining edge only and edge and corner choices are then solely distinguished by whether or not the surface at corner vertices is smooth or sharp. Face-varying Interpolation Rules Face-varying interpolation rules control how face-varying data is interpolated both in the interior of face-varying regions smooth or linear and at the boundaries where it is discontinuous constrained to be linear or pinned in a number of ways. Where the topology is continuous and the interpolation chosen to be smooth, the behavior of face-varying interpolation will match that of the vertex interpolation. Choices for face-varying interpolation are most commonly available in the context of UVs for texture coordinates and a number of names for such choices have evolved in different applications over the years. The choices offered by OpenSubdiv cover a wide range of popular applications. The feature is named face-varying linear interpolation -- rather than boundary interpolation commonly used -- to emphasize that it can be applied to the entire surface not just boundaries and that the effects are to make the surface behave more linearly in various ways. The following choices are available for the SdcOptionsFVarLinearInterpolation enum -- the ordering here applying progressively more linear constraints Mode Behavior FVAR_LINEAR_NONE smooth everywhere the mesh is smooth FVAR_LINEAR_CORNERS_ONLY linearly interpolate sharpen or pin corners only FVAR_LINEAR_CORNERS_PLUS1 CORNERS_ONLY sharpening of junctions of 3 or more regions FVAR_LINEAR_CORNERS_PLUS2 CORNERS_PLUS1 sharpening of darts and concave corners FVAR_LINEAR_BOUNDARIES linear interpolation along all boundary edges and corners FVAR_LINEAR_ALL linear interpolation everywhere boundaries and interior These rules cannot make the interpolation of the face-varying data smoother than that of the vertices. The presence of sharp features of the mesh created by sharpness values, boundary interpolation rules, or the subdivision scheme itself e.g. Bilinear take precedence. All face-varying interpolation modes illustrated in UV space using a simple 4x4 grid of quads segmented into three UV regions their control point locations implied by interpolation in the FVAR_LINEAR_ALL case For those familiar, this shape and its assigned UV sets are available for inspection in the catmark_fvar_bound1 shape of OpenSubdivs example and regression shapes. Semi-Sharp Creases Just as some types of parametric surfaces support additional shaping controls to affect creasing along the boundaries between surface elements, OpenSubdiv provides additional sharpness values or weights associated with edges and vertices to achieve similar results over arbitrary topology. Setting sharpness values to a maximum value 10 in this case -- a number chosen for historical reasons effectively modifies the subdivision rules so that the boundaries between the piecewise smooth surfaces are infinitely sharp or discontinuous. But since real world surfaces never really have infinitely sharp edges, especially when viewed sufficiently close, it is often preferable to set the sharpness lower than this value, making the crease semi-sharp. A constant weight value assigned to a sequence of edges connected edges therefore enables the creation of features akin to fillets and blends without adding extra rows of vertices though that technique still has its merits Sharpness values range from 0-10, with a value of 0 or less having no effect on the surface and a value of 10 or more making the feature completely sharp. It should be noted that infinitely sharp creases are really tangent discontinuities in the surface, implying that the geometric normals are also discontinuous there. Therefore, displacing along the normal will likely tear apart the surface along the crease. If you really want to displace a surface at a crease, it may be better to make the crease semi-sharp. Other Options While the preceding options represent features available in a wide-variety of tools and modeling formats, a few others exist whose recognition and adoption is more limited. In some cases, they offer improvements to undesirable behavior of the subdivision algorithms, but their effects are less than ideal. Given both their limited effectiveness and lack of recognition, these options should be used with caution. Chaikin Rule The Chaikin Rule is a variation of the semi-sharp creasing method that attempts to improve the appearance of creases along a sequence of connected edges when the sharpness values differ. This choice modifies the subdivision of sharpness values using Chaikins curve subdivision algorithm to consider all sharpness values of edges around a common vertex when determining the sharpness of child edges. The creasing method can be set using the values defined in the enumeration SdcOptionsCreasingMethod Mode Behavior CREASE_UNIFORM Apply regular semi-sharp crease rules CREASE_CHAIKIN Apply Chaikin semi-sharp crease rules Example of contiguous semi-sharp creases interpolation Triangle Subdivision Rule The triangle subdivision rule is a rule added to the Catmull-Clark scheme that modifies the behavior at triangular faces to improve the undesirable surface artefacts that often result in such areas. Mode Behavior TRI_SUB_CATMARK Default Catmark scheme weights TRI_SUB_SMOOTH Smooth triangle weights Cylinder example This rule was empirically determined to make triangles subdivide more smoothly. However, this rule breaks the nice property that two separate meshes can be joined seamlessly by overlapping their boundaries i.e. when there are triangles at either boundary, it is impossible to join the meshes seamlessly Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "subdivision_surfaces.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Sdc Overview", │ │ │ │ │ - "text": "Sdc Overview Sdc Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Subdivision Core Sdc Types, Traits and Options Creasing support Scheme-specific support The FACE, EDGE and VERTEX interfaces The MASK interface Subdivision Core Sdc Sdc is the lowest level layer in OpenSubdiv. Its intent is to separate the core subdivision details from any particular representation of a mesh it was previously bound to Hbr to facilitate the generation of consistent results with other mesh representations, both internal and external to OpenSubdiv. The functionality can be divided roughly into three sections types, traits and options for the supported subdivision schemes computations required to support semi-sharp creasing computations for mask weights of subdivided vertices for all schemes For most common usage, familiarity with only the first of these is necessary -- primarily the use of public types and constants for the choice of subdivision scheme and its associated options. The latter two provide the basis for a more comprehensive implementation of subdivision, which requires considerably more understanding and effort. Overall, the approach was to extract the functionality at the lowest level possible. In some cases, the implementation is not far from being simple global functions. The intent was to start at a low level and build any higher level functionality as needed. What exists now is functional for ongoing development and anticipated needs within OpenSubdiv for the near future. The intent of Sdc is to provide the building blocks for OpenSubdiv and its clients to efficiently process the specific set of supported subdivision schemes. It is not intended to be a general framework for defining customized subdivision schemes. Types, Traits and Options The most basic type is the enum SdcSchemeType that identifies the fixed set of subdivision schemes supported by OpenSubdiv Bilinear , Catmark and Loop . With this alone, we intend to avoid all dynamic casting issues related to the scheme by simply adding members to the associated subclasses for inspection. In addition to the type enum itself, a class defining a fixed set of traits associated with each scheme is provided. While these traits are available as static methods in the interface of a class supporting more functionality for each scheme to be described shortly, the SchemeTypeTraits provide queries of the traits for a variable of type SdcSchemeType -- enabling parameterization of code by the value of a trait without templates or virtual inheritance a simple internal table of traits is constructed and trivially indexed. The second contribution is the collection of all variations in one place that can be applied to the subdivision schemes, i.e. the boundary interpolation rules, creasing method, edge subdivision choices, etc. The fact that these are all declared in one place alone should help clients see the full set of variations that are possible. A simple Options struct a set of bitfields aggregates all of these variations into a single object the equivalent of an integer in this case that are passed around to other Sdc classes andor methods and are expected to be used at a higher level both within OpenSubdiv and externally. By aggregating the options and passing them around as a group, it allows us to extend the set easily in future without the need to rewire a lot of interfaces to accommodate the new choice. Clients can enable new choices at the highest level and be assured that they will propagate to the lowest level where they are relevant. Unlike other options structs used elsewhere to specify variations of a particular method, SdcOptions defines all options that affect the shape of the underlying limit surface of a subdivision mesh. Other operations at higher levels in the library may have options that approximate the shape and so create a slightly different appearance, but SdcOptions is a fundamental part of the definition of the true limit surface. Creasing support Since the computations involved in the support of semi-sharp creasing are independent of the subdivision scheme, the goal in Sdc was to encapsulate all related creasing functionality in a similarly independent manner. Computations involving sharpness values are also much less dependent on topology -- there are vertices and edges with sharpness values, but knowledge of faces or boundary edges is not required, -- so the complexity of topological neighborhoods required for more scheme-specific functionality is arguably not necessary here. Creasing computations have been provided as methods defined on a Crease class that is constructed with a set of Options. Its methods typically take sharpness values as inputs and compute a corresponding set of sharpness values as a result. For the Uniform creasing method previously known as Normal , the computations may be so trivial as to question whether such an interface is worth it, but for Chaikin or other schemes in the future that are non-trivial, the benefits should be clear. Functionality is divided between both uniform and non-uniform, so clients have some control over avoiding unnecessary overhead, e.g. non-uniform computations typically require neighboring sharpness values around a vertex, while uniform does not. Also included as part of the Crease class is the Rule enum -- this indicates if a vertex is Smooth, Crease, Dart or Corner referred to as the mask in Hbr and is a function of the sharpness values at and around a vertex. Knowing the Rule for a vertex can accelerate mask queries, and the Rule can often be inferred based on the origin of a vertex e.g. it originated from the middle of a face, was the child of a Smooth vertex, etc.. Methods are defined for the Crease class to subdivide edge and vertex sharpness values determine the Rule for a vertex based on incident sharpness values determine the transitional weight between two sets of sharpness values Being all low-level and working directly on sharpness values, it is a clients responsibility to coordinate the application of any hierarchical crease edits with their computations. Similarly, in keeping with this as a low-level interface, values are passed as primitive arrays. This follows the trend in OpenSubdiv of dealing with data of various kinds e.g. weights, component indices, now sharpness values, etc. in small contiguous sets of values. In most internal cases we can refer to a set of values or gather what will typically be a small number of values on the stack for temporary use. Scheme-specific support While the SchemeTypeTraits class provides traits for each subdivision scheme supported by OpenSubdiv i.e. Bilinear , Catmark and Loop , the Scheme class provides these more directly, Additionally, the Scheme class provides methods for computing the various sets of weights used to compute new vertices resulting from subdivision. The collection of weights used to compute a single vertex at a new subdivision level is typically referred to as a mask . The primary purpose of the Scheme class is to provide such masks in a manner both general and efficient. Each subdivision scheme has its own values for its masks, and each are provided as specializations of the template class SchemeSchemeType TYPE . The intent is to minimize the amount of code specific to each scheme. The computation of mask weights for subdivided vertices is the most significant contribution of Sdc. The use of semi-sharp creasing with each non-linear subdivision scheme complicates what are otherwise simple masks determined solely by the topology, and packaging that functionality to achieve both the generality and efficiency desired has been a challenge. Mask queries are defined in the Scheme class template, which has specializations for each of the supported subdivision schemes. Mask queries are defined in terms of interfaces for two template parameters the first defining the topological neighborhood of a vertex, and a second defining a container in which to gather the individual weights template typename FACE , typename MASK void ComputeFaceVertexMask FACE const faceNeighborhood , MASK faceVertexMask , ... const Each mask query is expected to call methods defined for the FACE , EDGE or VERTEX classes to obtain the information they require typically these methods are simple queries about the topology and associated sharpness values. Clients are free to use their own mesh representations to gather the requested information as quickly as possible, or to cache some subset as member variables for immediate inline retrieval. In general, the set of weights for a subdivided vertex is dependent on the following the topology around the parent component from which the vertex originates the type of subdivision Rule applicable to the parent component the type of subdivision Rule applicable to the new child vertex a transitional weight blending the effect between differing parent and child rules This seems fairly straight-forward, until we look at some of the dependencies involved the parent Rule requires the sharpness values at and around the parent component the child Rule requires the subdivided sharpness values at and around the new child vertex though it can sometimes be trivially inferred from the parent the transitional weight between differing rules requires all parent and child sharpness values Clearly the sharpness values are inspected multiple times and so it pays to have them available for retrieval. Computing them on an as-needed basis may be simple for uniform creasing, but a non-uniform creasing method requires traversing topological neighborhoods, and that in addition to the computation itself can be costly. The point here is that it is potentially unreasonable to expect to evaluate the mask weights completely independent of any other consideration. Expecting and encouraging the client to have subdivided sharpness values first, for use in more than one place, is therefore recommended. The complexity of the general case above is also unnecessary for most vertices. Any client using Sdc typically has more information about the nature of the vertex being subdivided and much of this can be avoided -- particularly for the smooth interior case that often dominates. More on that in the details of the Scheme classes. Given that most of the complexity has been moved into the template parameters for the mask queries, the Scheme class remains fairly simple. Like the Crease class, it is instantiated with a set of Options to avoid them cluttering the interface. It is currently little more than a few methods for the limit and refinement masks for each vertex type, plus the few fixed traits of the scheme as static methods. The mask queries have been written in a way that greatly simplifies the specializations required for each scheme. The generic implementation for both the edge-vertex and vertex-vertex masks take care of all of the creasing logic, requiring only a small set of specific masks to be assigned for each Scheme smooth and crease masks for an edge-vertex, and smooth, crease and corner masks for a vertex-vertex. Other than the Bilinear case, which will specialize the mask queries to trivialize them for linear interpolation, the specializations for each Scheme should only require defining this set of masks -- and with two of them common edge-vertex crease and vertex-vertex corner the Catmark scheme only needs to define three. The FACE, EDGE and VERTEX interfaces Mask queries require an interface to a topological neighborhood, currently labeled FACE , EDGE and VERTEX . This naming potentially implies more generality than intended, as such classes are only expected to provide the methods required of the mask queries to compute its associated weights. While all methods must be defined, some may rarely be invoked, and the client has considerable flexibility in the implementation of these they can defer some evaluations lazily until required, or be pro-active and cache information in member variables for immediate access. An approach discussed in the past has alluded to iterator classes that clients would write to traverse their meshes. The mask queries would then be parameterized in terms of a more general and generic mesh component that would make use of more general traversal iterators. The advantage here is the iterators are written once, then traversal is left to the query and only what is necessary is gathered. The disadvantages are that clients are forced to write these to do anything, getting them correct and efficient may not be trivial or possible in some cases, and that the same data e.g. subdivided sharpness may be gathered or computed multiple times for different purposes. The other extreme was to gather everything possible required at once, but that is objectionable. The approach taken here provides a reasonable compromise between the two. The mask queries ask for exactly what they want, and the provided classes are expected to deliver it as efficiently as possible. In some cases the client may already be storing it in a more accessible form and general topological iteration can be avoided. The information requested of these classes in the three mask queries is as follows For FACE the number of incident vertices For EDGE the number of incident faces the sharpness value of the parent edge the sharpness values of the two child edges the number of vertices per incident face For VERTEX the number of incident faces the number of incident edges the sharpness value of the parent vertex the sharpness values for each incident parent edge the sharpness value of the child vertex the sharpness values for each incident child edge The latter should not be surprising given the dependencies noted above. There are also a few more to consider for future use, e.g. whether the EDGE or VERTEX is manifold or not. In most cases, additional information can be provided to the mask queries i.e. pre-determined Rules, and most of the child sharpness values are not necessary. The most demanding situation is a fractional crease that decays to zero -- in which case all parent and child sharpness values in the neighborhood are required to determine the proper transitional weight. The MASK interface Methods dealing with the collections of weights defining a mask are typically parameterized by a MASK template parameter that contains the weights. The set of mask weights is currently divided into vertex-weights, edge-weights and face-weights -- consistent with previous usage in OpenSubdiv and providing some useful correlation between the full set of weights and topology. The vertex-weights refer to parent vertices incident the parent component from which a vertex originated, the edge-weights the vertices opposite incident edges of the parent, and the face-weights the center of incident parent faces. Note the latter is NOT in terms of vertices of the parent but potentially vertices in the child originating from faces of the parent. This has been done historically in OpenSubdiv but is finding less use -- particularly when it comes to providing greater support for the Loop scheme -- and is a point needing attention. So the mask queries require the following capabilities assign the number of vertex, edge andor face weights retrieve the number of vertex, edge andor face weights assign individual vertex, edge andor face weights by index retrieve individual vertex, edge andor face weights by index through a set of methods required of all MASK classes. Since the maximum number of weights is typically known based on the topology, usage within Vtr, Far or Hbr is expected to simply define buffers on the stack. Another option is to utilize pre-allocated tables, partitioned into the three sets of weights on construction of a MASK , and populated by the mask queries. A potentially useful side-effect of this is that the client can define their weights to be stored in either single or double-precision. With that possibility in mind, care was taken within the mask queries to make use of a declared type in the MASK interface MASKWeight for intermediate calculations. Having support for double-precision masks in Sdc does enable it at higher levels in OpenSubdiv if later desired, and that support is made almost trivial with MASK being generic. It is important to remember here that these masks are being defined consistent with existing usage within OpenSubdiv both Hbr and the subdivision tables generated by Far . As noted above, the face weights correspond to the centers of incident faces, i.e. vertices on the same level as the vertex for which the mask is being computed, and not relative to vertices in the parent level as with the other sets of weights. It is true that the weights can be translated into a set in terms solely of parent vertices, but in the general case i.e. Catmark subdivision with non-quads in the base mesh this requires additional topological association. In general we would need N-3 weights for the N-3 vertices between the two incident edges, where N is the number of vertices of each face typically 4 even at level 0. Perhaps such a translation method could be provided on the mask class, with an optional indication of the incident face topology for the irregular cases. The Loop scheme does not have face weights , for a vertex-vertex mask, but for an edge-vertex mask it does require weights associated with the faces incident the edge -- either the vertex opposite the edge for each triangle, or its center which has no other use for Loop. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Sdc Overview Sdc Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Subdivision Core Sdc Types, Traits and Options Creasing support Scheme-specific support The FACE, EDGE and VERTEX interfaces The MASK interface Subdivision Core Sdc Sdc is the lowest level layer in OpenSubdiv. Its intent is to separate the core subdivision details from any particular representation of a mesh it was previously bound to Hbr to facilitate the generation of consistent results with other mesh representations, both internal and external to OpenSubdiv. The functionality can be divided roughly into three sections types, traits and options for the supported subdivision schemes computations required to support semi-sharp creasing computations for mask weights of subdivided vertices for all schemes For most common usage, familiarity with only the first of these is necessary -- primarily the use of public types and constants for the choice of subdivision scheme and its associated options. The latter two provide the basis for a more comprehensive implementation of subdivision, which requires considerably more understanding and effort. Overall, the approach was to extract the functionality at the lowest level possible. In some cases, the implementation is not far from being simple global functions. The intent was to start at a low level and build any higher level functionality as needed. What exists now is functional for ongoing development and anticipated needs within OpenSubdiv for the near future. The intent of Sdc is to provide the building blocks for OpenSubdiv and its clients to efficiently process the specific set of supported subdivision schemes. It is not intended to be a general framework for defining customized subdivision schemes. Types, Traits and Options The most basic type is the enum SdcSchemeType that identifies the fixed set of subdivision schemes supported by OpenSubdiv Bilinear , Catmark and Loop . With this alone, we intend to avoid all dynamic casting issues related to the scheme by simply adding members to the associated subclasses for inspection. In addition to the type enum itself, a class defining a fixed set of traits associated with each scheme is provided. While these traits are available as static methods in the interface of a class supporting more functionality for each scheme to be described shortly, the SchemeTypeTraits provide queries of the traits for a variable of type SdcSchemeType -- enabling parameterization of code by the value of a trait without templates or virtual inheritance a simple internal table of traits is constructed and trivially indexed. The second contribution is the collection of all variations in one place that can be applied to the subdivision schemes, i.e. the boundary interpolation rules, creasing method, edge subdivision choices, etc. The fact that these are all declared in one place alone should help clients see the full set of variations that are possible. A simple Options struct a set of bitfields aggregates all of these variations into a single object the equivalent of an integer in this case that are passed around to other Sdc classes andor methods and are expected to be used at a higher level both within OpenSubdiv and externally. By aggregating the options and passing them around as a group, it allows us to extend the set easily in future without the need to rewire a lot of interfaces to accommodate the new choice. Clients can enable new choices at the highest level and be assured that they will propagate to the lowest level where they are relevant. Unlike other options structs used elsewhere to specify variations of a particular method, SdcOptions defines all options that affect the shape of the underlying limit surface of a subdivision mesh. Other operations at higher levels in the library may have options that approximate the shape and so create a slightly different appearance, but SdcOptions is a fundamental part of the definition of the true limit surface. Creasing support Since the computations involved in the support of semi-sharp creasing are independent of the subdivision scheme, the goal in Sdc was to encapsulate all related creasing functionality in a similarly independent manner. Computations involving sharpness values are also much less dependent on topology -- there are vertices and edges with sharpness values, but knowledge of faces or boundary edges is not required, -- so the complexity of topological neighborhoods required for more scheme-specific functionality is arguably not necessary here. Creasing computations have been provided as methods defined on a Crease class that is constructed with a set of Options. Its methods typically take sharpness values as inputs and compute a corresponding set of sharpness values as a result. For the Uniform creasing method previously known as Normal , the computations may be so trivial as to question whether such an interface is worth it, but for Chaikin or other schemes in the future that are non-trivial, the benefits should be clear. Functionality is divided between both uniform and non-uniform, so clients have some control over avoiding unnecessary overhead, e.g. non-uniform computations typically require neighboring sharpness values around a vertex, while uniform does not. Also included as part of the Crease class is the Rule enum -- this indicates if a vertex is Smooth, Crease, Dart or Corner referred to as the mask in Hbr and is a function of the sharpness values at and around a vertex. Knowing the Rule for a vertex can accelerate mask queries, and the Rule can often be inferred based on the origin of a vertex e.g. it originated from the middle of a face, was the child of a Smooth vertex, etc.. Methods are defined for the Crease class to subdivide edge and vertex sharpness values determine the Rule for a vertex based on incident sharpness values determine the transitional weight between two sets of sharpness values Being all low-level and working directly on sharpness values, it is a clients responsibility to coordinate the application of any hierarchical crease edits with their computations. Similarly, in keeping with this as a low-level interface, values are passed as primitive arrays. This follows the trend in OpenSubdiv of dealing with data of various kinds e.g. weights, component indices, now sharpness values, etc. in small contiguous sets of values. In most internal cases we can refer to a set of values or gather what will typically be a small number of values on the stack for temporary use. Scheme-specific support While the SchemeTypeTraits class provides traits for each subdivision scheme supported by OpenSubdiv i.e. Bilinear , Catmark and Loop , the Scheme class provides these more directly, Additionally, the Scheme class provides methods for computing the various sets of weights used to compute new vertices resulting from subdivision. The collection of weights used to compute a single vertex at a new subdivision level is typically referred to as a mask . The primary purpose of the Scheme class is to provide such masks in a manner both general and efficient. Each subdivision scheme has its own values for its masks, and each are provided as specializations of the template class SchemeSchemeType TYPE . The intent is to minimize the amount of code specific to each scheme. The computation of mask weights for subdivided vertices is the most significant contribution of Sdc. The use of semi-sharp creasing with each non-linear subdivision scheme complicates what are otherwise simple masks determined solely by the topology, and packaging that functionality to achieve both the generality and efficiency desired has been a challenge. Mask queries are defined in the Scheme class template, which has specializations for each of the supported subdivision schemes. Mask queries are defined in terms of interfaces for two template parameters the first defining the topological neighborhood of a vertex, and a second defining a container in which to gather the individual weights template typename FACE , typename MASK void ComputeFaceVertexMask FACE const faceNeighborhood , MASK faceVertexMask , ... const Each mask query is expected to call methods defined for the FACE , EDGE or VERTEX classes to obtain the information they require typically these methods are simple queries about the topology and associated sharpness values. Clients are free to use their own mesh representations to gather the requested information as quickly as possible, or to cache some subset as member variables for immediate inline retrieval. In general, the set of weights for a subdivided vertex is dependent on the following the topology around the parent component from which the vertex originates the type of subdivision Rule applicable to the parent component the type of subdivision Rule applicable to the new child vertex a transitional weight blending the effect between differing parent and child rules This seems fairly straight-forward, until we look at some of the dependencies involved the parent Rule requires the sharpness values at and around the parent component the child Rule requires the subdivided sharpness values at and around the new child vertex though it can sometimes be trivially inferred from the parent the transitional weight between differing rules requires all parent and child sharpness values Clearly the sharpness values are inspected multiple times and so it pays to have them available for retrieval. Computing them on an as-needed basis may be simple for uniform creasing, but a non-uniform creasing method requires traversing topological neighborhoods, and that in addition to the computation itself can be costly. The point here is that it is potentially unreasonable to expect to evaluate the mask weights completely independent of any other consideration. Expecting and encouraging the client to have subdivided sharpness values first, for use in more than one place, is therefore recommended. The complexity of the general case above is also unnecessary for most vertices. Any client using Sdc typically has more information about the nature of the vertex being subdivided and much of this can be avoided -- particularly for the smooth interior case that often dominates. More on that in the details of the Scheme classes. Given that most of the complexity has been moved into the template parameters for the mask queries, the Scheme class remains fairly simple. Like the Crease class, it is instantiated with a set of Options to avoid them cluttering the interface. It is currently little more than a few methods for the limit and refinement masks for each vertex type, plus the few fixed traits of the scheme as static methods. The mask queries have been written in a way that greatly simplifies the specializations required for each scheme. The generic implementation for both the edge-vertex and vertex-vertex masks take care of all of the creasing logic, requiring only a small set of specific masks to be assigned for each Scheme smooth and crease masks for an edge-vertex, and smooth, crease and corner masks for a vertex-vertex. Other than the Bilinear case, which will specialize the mask queries to trivialize them for linear interpolation, the specializations for each Scheme should only require defining this set of masks -- and with two of them common edge-vertex crease and vertex-vertex corner the Catmark scheme only needs to define three. The FACE, EDGE and VERTEX interfaces Mask queries require an interface to a topological neighborhood, currently labeled FACE , EDGE and VERTEX . This naming potentially implies more generality than intended, as such classes are only expected to provide the methods required of the mask queries to compute its associated weights. While all methods must be defined, some may rarely be invoked, and the client has considerable flexibility in the implementation of these they can defer some evaluations lazily until required, or be pro-active and cache information in member variables for immediate access. An approach discussed in the past has alluded to iterator classes that clients would write to traverse their meshes. The mask queries would then be parameterized in terms of a more general and generic mesh component that would make use of more general traversal iterators. The advantage here is the iterators are written once, then traversal is left to the query and only what is necessary is gathered. The disadvantages are that clients are forced to write these to do anything, getting them correct and efficient may not be trivial or possible in some cases, and that the same data e.g. subdivided sharpness may be gathered or computed multiple times for different purposes. The other extreme was to gather everything possible required at once, but that is objectionable. The approach taken here provides a reasonable compromise between the two. The mask queries ask for exactly what they want, and the provided classes are expected to deliver it as efficiently as possible. In some cases the client may already be storing it in a more accessible form and general topological iteration can be avoided. The information requested of these classes in the three mask queries is as follows For FACE the number of incident vertices For EDGE the number of incident faces the sharpness value of the parent edge the sharpness values of the two child edges the number of vertices per incident face For VERTEX the number of incident faces the number of incident edges the sharpness value of the parent vertex the sharpness values for each incident parent edge the sharpness value of the child vertex the sharpness values for each incident child edge The latter should not be surprising given the dependencies noted above. There are also a few more to consider for future use, e.g. whether the EDGE or VERTEX is manifold or not. In most cases, additional information can be provided to the mask queries i.e. pre-determined Rules, and most of the child sharpness values are not necessary. The most demanding situation is a fractional crease that decays to zero -- in which case all parent and child sharpness values in the neighborhood are required to determine the proper transitional weight. The MASK interface Methods dealing with the collections of weights defining a mask are typically parameterized by a MASK template parameter that contains the weights. The set of mask weights is currently divided into vertex-weights, edge-weights and face-weights -- consistent with previous usage in OpenSubdiv and providing some useful correlation between the full set of weights and topology. The vertex-weights refer to parent vertices incident the parent component from which a vertex originated, the edge-weights the vertices opposite incident edges of the parent, and the face-weights the center of incident parent faces. Note the latter is NOT in terms of vertices of the parent but potentially vertices in the child originating from faces of the parent. This has been done historically in OpenSubdiv but is finding less use -- particularly when it comes to providing greater support for the Loop scheme -- and is a point needing attention. So the mask queries require the following capabilities assign the number of vertex, edge andor face weights retrieve the number of vertex, edge andor face weights assign individual vertex, edge andor face weights by index retrieve individual vertex, edge andor face weights by index through a set of methods required of all MASK classes. Since the maximum number of weights is typically known based on the topology, usage within Vtr, Far or Hbr is expected to simply define buffers on the stack. Another option is to utilize pre-allocated tables, partitioned into the three sets of weights on construction of a MASK , and populated by the mask queries. A potentially useful side-effect of this is that the client can define their weights to be stored in either single or double-precision. With that possibility in mind, care was taken within the mask queries to make use of a declared type in the MASK interface MASKWeight for intermediate calculations. Having support for double-precision masks in Sdc does enable it at higher levels in OpenSubdiv if later desired, and that support is made almost trivial with MASK being generic. It is important to remember here that these masks are being defined consistent with existing usage within OpenSubdiv both Hbr and the subdivision tables generated by Far . As noted above, the face weights correspond to the centers of incident faces, i.e. vertices on the same level as the vertex for which the mask is being computed, and not relative to vertices in the parent level as with the other sets of weights. It is true that the weights can be translated into a set in terms solely of parent vertices, but in the general case i.e. Catmark subdivision with non-quads in the base mesh this requires additional topological association. In general we would need N-3 weights for the N-3 vertices between the two incident edges, where N is the number of vertices of each face typically 4 even at level 0. Perhaps such a translation method could be provided on the mask class, with an optional indication of the incident face topology for the irregular cases. The Loop scheme does not have face weights , for a vertex-vertex mask, but for an edge-vertex mask it does require weights associated with the faces incident the edge -- either the vertex opposite the edge for each triangle, or its center which has no other use for Loop. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "sdc_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Release Notes", │ │ │ │ │ - "text": "Release Notes Release Notes 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 2.6.0 Release 2.5.1 Release 2.5.0 Release 2.4.1 Release 2.4.0 Release 2.3.5 Release 2.3.4 Release 2.3.3 Release 2.3.2 Release 2.3.1 Release 2.3.0 Release 2.2.0 Release 2.1.0 Release 2.0.1 Release 2.0.0 Release 1.2.4 Release 1.2.3 Release 1.2.2 Release 1.2.1 Release 1.2.0 Release 1.1.0 Release 1.0.0 Release 2.6.0 New Features Add subdivision kernels for ARM NEON Add OsdUtilVertexSplit which creates a vertex-varying data table by duplicating vertices in a FarMesh Add basic functions to work with FV data via evaluator API Changes Added Catmark restricted vertex compute kernels that optimize for vertices with no semi-sharp creases Fix accessor omissions in osdmesh.h Add support for different subdivision schemes for OsdUtilMesh Bug Fixes Fix crashes when using rather low-end cards like Intel ones Fix a bug in the creation of an edge-vertex kernel batch Fix mismatch in declaration and usage of OsdCudaComputeRestrictedVertexA Fix a bug in the vertex order for restricted Catmark vertex-vertex kernel batches Fix a bug in FarCatmarkSubdivisionTablesFactory that prevented the CATMARK_QUAD_FACE_VERTEX kernel from being selected for subdivision level 2 or greater. Fix a bug in OsdUtilVertexSplit that occurs when getting the address of the end of a stdvector Fix error in createCLBuffer that occurs when the buffer size is zero Fix a bug in the CUDA computeRestrictedEdge kernel Fix duplicate variables with identical name Fix osdutil build errors Fix cmake diagnostic messsage Release 2.5.1 New Features Add CATMARK_QUAD_FACE_VERTEX and CATMARK_TRI_QUAD_FACE_VERTEX compute kernels optimization that takes advantage of all-quads or all-triange-and-quads meshes Bug Fixes Fix a compiler error in the GLSL Transform Feedback kernels on OS X Fix boundary interpolation in osdutil Fix bilinear stencil tangent computions Release 2.5.0 New Features Add ability to generate triangle patches for a uniformly subdivided mesh Add new example topologySharing Add interleaved buffer mode in glViewer Add GLSL compute kernel to glBatchViewer Add TBB compute kernel to glBatchViewer Add a PullDown widget to our HUD in examplescommon GUI updates cosmetic changes to GL example code Adding a programmable image shader to gl_hud Code cleanup for GLFrameBuffer in examplescommon Implement C-API accessor to evaluator topology osdutil Add command line option to CMakes options Add a CMake option to disable OpenCL Add a FindCLEW.cmake module in anticipation of using CLEW as a dependency Integrate CLEW into osd library and examples Changes Change interleaved buffer support in OsdCompute Removed OsdVertexDescriptor and replaced with OsdVertexBufferDescriptor Reorganize ComputeContext and ComputeController. Reorganize EvalStencilContext and EvalStencilController Moved transient states current vertex buffer etc to controller Reorganize EvalLimitContext and EvalLimitController Moved transient states current vertex buffer etc to controller Fix adaptive isolation of sharp corner vertices Fix incorrect FarMeshFactory logic for isolating multiple corner vertices in corner patches Change EvalLimit Gregory patch kernels to the large weights table to accomodate higher valences Fix calculation of screen space LOD tess factors for transition corner patches. Add a public constructor to OsdMesh Decrease compiler warning thresholds and fix outstanding warnings Make PTex support optional Add a NO_MAYA flag to CMakeLists to disable all Autodesk Maya dependencies in the build Document NO_MAYA command line option Bug Fixes Fix mistakenly deleted memory barrier in glsl OsdCompute kernel. Fix shape_utils genRIB function to use streams correctly. Temporary workaround for the synchronization bug of glsl compute kernel Fix Hud display for higher DPI MBP retina Fix Hud d3d11 Fix examples to use GL timer query to measure the GPU draw timing more precisely Fix glViewer stop updating during freeze. Fix file permissions on farPatchTablesFactory.h Fix some meory leaks in adaptive evaluator osdutil Fix OsdUtilAdaptiveEvaluator concurrency issue Fix OsdUtilRefiner incorrect Invalid size of patch array error reporting. Fix OsdUtilPatchPartitioner failure for triangle patches Fixes a bug that causes OsdUtilPatchPartitioner to fail to rebuild the face-varying data table correctly for triangle patches. Add missing third parameter to templated OsdDrawContext usage osdutilbatch.h Return success status from openSubdiv_finishEvaluatorDescr osdutil Remove debugging stdcout calls osdutil Build errors warnings Fix OSX Core Profile build GLFrameBuffer Fix ptexViewer build error on OSX Fix framebuffer shader compiling for OSX Reordering includes to address a compile error on OSXglew environment Fix compilation errors with CLEW enabled Fix icc build problems Fix compiler warnings in OsdClVertexBuffer Fix compilation error on windowsmsvc2013 Fix build warningserrors with VS2010 Pro Fix Windows build warning in FarPatchTablesFactory Fix doxygen generation errors Release 2.4.1 Changes Add correct OpenSubdiv namespace beginend blocks. Bug Fixes Compile osdutil with -fPIC for correct linking. Fix a bug of OsdUtilMeshBatch, the varying buffer isnt computed with CL kernels Fix FindGLFW.cmake to use the GLFW_LOCATION environment variable in Windows Fix Draw contexts do not fully initialize patch arrays Release 2.4.0 New Features Adding functionality to store uniform face-varying data across multiple levels of subdivision Add OsdUtilPatchPartitioner. It splits patcharray into subsets so that clients can draw partial surfaces for both adaptive and uniform. Changes Remove FarMesh dependency from OsdContext. Use DSA APIs for GL buffer update if available. Refactor Far API replace void- of all kernel applications with CONTEXT template parameter. It eliminates many static_casts from void- for both far and osd classes. move the big switch-cases of far default kernel launches out of Refine so that osd controllers can arbitrary mix default kernels and custom kernels. change FarKernelBatchkernelType from enum to int, clients can add custom kernel types. remove a back-pointer to farmesh from subdivision table. untemplate all subdivision table classes and template their compute methods instead. Those methods take a typed vertex storage. remove an unused argument FarMesh from the constructor of subdivision table factories. Refactor FarSubdivisionTables. Delete scheme specialized subdivision tables. The base class FarSubdivisionTables already has all tables, so we just need scheme enum to identify which scheme the subdivision tables belong to. This brings a lot of code cleanups around far factory classes. Move FarMultiMeshFactory to OsdUtil. Move table splicing functions of FarMultiMeshFactory into factories Change PxOsdUtil prefix to final OsdUtil prefix. Improve error reporting in osdutil refinement classes, and fix a build issue Bug Fixes Fix another multi mesh splicing bug of face varying data. Make CMake path variables more robust Fixing a crash on Marvericks wglew Update dxViewer example documentation Fix wrong logic in openSubdiv_setEvaluatorCoarsePositions Remove debug print from adaptive evaluators initialization Release 2.3.5 New Features Add the ability to read obj files to the dxViewer example Add screen-capture function to ptexViewer Update documention for Xcode builds Add documentation boundary interpolation rules and face-varying boundary interpolation rules Changes Refactoring FarPatchTables and FarPatchTablesFactory Move GL vertex buffer VBO buffer allocation out of allocate and into BindVBO Enable uvViewer on OS X now that Mavericks is released. Replacing un-necessary dynamic_cast with reinterpret_cast within FarDispatcher Minor code cleanup of FarMeshFactory Remove address space qualifiers from OpenCL kernel functions Fix OpenCL initialization to be slightly more robust Add OpenCL header include paths where necessary Add static specifiers for non-kernel CL funcs at program scope Add stddef.h to pythonosdosdshim.i Modify ptexViewer and uvViewer shaders to address some portability issues Bug Fixes Fix Gregory Boundary patch buffer overrun Fix black texels when the resolution of a ptex face is less than 4 Fix a splicing bug in FarMultiMeshFactory Fix a build error when using older versions of GLFW Fix build warnings optimized Fix FindTBB.cmake Fix FindMaya.cmake Fix glViewer support for GLSL compute Fix ptexViewer enable specular pass in both IBL and point lighting Fix Zlib include in ptexViewer Fix ptexViewer shader errors. Fix osdPolySmooth Maya plugin Fix UV merging in osdPolySmooth code example Add cleanup function to osdPolySmooth Maya plugin Fix Maya OsdPolySmooth node component output Fix GLSL array instantiation syntax for glStencilViewer Fix examples to run correctly on high DPI displays with GLFW 3 Release 2.3.4 New Features Adding CPUOMPTBB Context Controller pairs for CPU evaluation of smooth normals Added adaptiveEvaluator class inspired by Sergeys work in blender OsdUtil Changes Changed the HUD to ignore mouse clicks when not visible. Updates for blender development OsdUtil Add C compatible API to access the adaptiveEvaluator class from non-C OsdUtil Update license headers to apache OsdUtil CMake build improvement make osd a cmake object library remove compiling redundancies Improve stringification of shaders kernels in CMake build Bug Fixes Fixed iOS build Fixed VS2010 warningserrors. Fix OsdCpuEvalLimitKernel Fix maxvalence calculation in FarMeshFactory Fix FarStencilFactory control stencil caching Removing assert for high-valence vertices running off limit tangent pre-computed table. Fix degenerate stencil limit tangent code path. Fix unused variable build warnings gcc 4.8.2 - Fedora 19 Fix build warning from osdutiladaptiveEvaluator.cpp Release 2.3.3 Changes Modify Far remapping of singular vertices to point to their source vertex. Refactoring Ptex Mipmap and Analytic Displacement code Adding some documentation for Chaikin crease rule Misc. improvements to PxOsdUtilsMesh Adding recommended isolation output to OsdPolySmooth node Bug Fixes Adding an error check on version parsing of main CMakeLists Fix regex in FindMaya.cmake that breaks with recent versions of Maya Fix crashes induced by typeid Fixed VS2010 build warning Fix build break in hbr_regression Fix incorrect capitalization in GL ptexViewer shader.glsl Fix OSX build add stdlib.h include Release 2.3.2 New Features Adding control cage drawing to ptexViewer Adding Maya osdPolySmooth plugin into OpenSubdiv examples. Changes Removing some glGetError checks that are causing problems for Autodesk D3D11DrawRegistry returns the common shader config for all non-tess patcharrays. Updates to simple cpu osdutil classes Bug Fixes Fix Hbr Chaikin crease rule Fix Chaikin tag parsing Fix return value of allocate function for OsdCPUGLVertxBuffer Fixed GLSL shader portability. Fix FindGLFW.cmake for GLFW 3.03 on OSX Fixed compiler warnings. Fixed VS2010 build errors Fixed WIN32 build error when no DXSDK installed. Fix OSX build stdlib.h needs to be included in glPtexMipmapTexture.h Fix for crash in new meshrefiner code in OsdUtil Release 2.3.1 New Features Add DX11 version of ptex mipmap loader Add DX11 ptex viewer work in progress Add DX11 fractional partitioning, normal derivatives computation Add memory usage controls to Ptex loader Add face-varying boundary interpolation parsing to shape_utils Add simple HbrMesh and FarMesh wrapper classes to osdutil Changes Amend language of attribution file NOTICE.txt Optimize a bit of ptex mipmap lookup. Show ptex memory usage in GL and DX11 ptexViewers Improve ptex guttering Addding some video links to our collection of external resources Bug Fixes Fix edge-only face-varying interpolation Fix Far to handle disconnected vertices in an Hbr mesh Fixed ptex cache resource release sequence Fix build symbol conflict in Far Fix patch parambuffer generation in OsdD3D11DrawContext Fix a minor osdutil build warning seen with gcc 4.8.1 Fix VS2010 build errors Release 2.3.0 New Features Added Analytical displacement mapping Analytic Displacement Mapping using Hardware Tessellation Niessner and Loop TOG 2013 Added a new ptex mipmap loader Added face varying macros for loop subdivision Added the uvViewer example to see how face varying interpolation rule works Added a slider component and cleanup hud code. Changes Adding license attribution files, improved language of the code headers Install documentation into the Filesystem Hierarchy Standard location Set GLFW_OPENGL_FORWARD_COMPAT on Mac OS to make samples work on that platform Added surface normal mode mipmap to ptxViewer Bug Fixes Fix a bug of bad fvar splicing for loop surface. Fix incorrect bilinear limit tangents in FarStencilTablesFactory Fix boundary interpolation rules doc Added an error check on updating cuda buffer Fix face varying rendering on loop surface Fixed glBatchViewer build for GLFW 2.x Expand search paths for FindGLFW.cmake for Debian and other Linux architectures Fix CMake executable builds for ICC Fix bhr baseline regression, so reference files are real OBJs Fixed clKernelBundle.cpp to build on Android. Fix misc build warings Release 2.2.0 New Features Added subdivision stencil functionality Far OsdEval Bug Fixes Fix D3D11DrawContext to check for NULL pointers Fix cpuEvalLimitController crash bug Fixed search path suffixes for ICC libs Fixed invalid initialization of glslTransformFeedback kernel. Release 2.1.0 New Features Added TBB Compute back-end on Linux contribution from Sheng Fu Added support for ICC compiler still Beta Changes Added constructor to OsdMesh with a FarMesh as input Modify CMake to name and sym-link DSOs based on Linux ABI versioning spec Added command line input to DX11 viewer FarMultiMesh can splice uniform and adaptive meshes together. Bug Fixes Fix FarMultiMesh splicing Removed unnecessary cudaThreadSynchronize calls. Fix glViewer overlapping HUD menus Fix facevarying rendering in glBatchViewer Fix build of GLSL transform feedback kernels Fix Getting Started documentation Release 2.0.1 New Features New CLA files to reflect Apache 2.0 licensing Changes Move all public headers to includeopensubdiv... Adding Osd documentation based on Siggraph slides Bug Fixes Fix incorrect transition pattern 3 in GLSL HLSL shaders Fix CMake build to not link GPU-based libraries into libosdCPU Fix support for GLEW on OSX Fix GLFW Xrandr xf86vmode dependency paths for X11 based systems Fix HUD display overlaps in code examples Fix FindGLEW.cmake to be aware of multiarch on linux systems Fix some hard-coded include paths in CMake build Release 2.0.0 New Features New CMake build flags NO_LIB, NO_CUDA, NO_PYTHON Changes OpenSubdiv is now under Apache 2.0 license HbrHalfedge and HbrFVarData copy constructors are now private Documentation style matched to graphics.pixar.com new content Add an animation freeze button to ptexViewer Variable name changes for better readability across all example shader code Bug Fixes Fix incorrect patch generation for patches with 2 non-consecutive boundary edges Fix undefined gl_PrimitiveID shader build errors Fix for shader macro OSD_DISPLACEMENT_CALLBACK Fix out-of-bounds stdvector access in FarPatchTablesFactory Release 1.2.4 New Features Adding support for fractional tessellation of patches Adding a much needed API documention system based on Docutils RST markup Adding support for face-varying interpolation in GLSL APIs Adding varying data buffers to OsdMesh Adding accessors to the vertex buffers in OsdGlMesh Adding face-varying data to regression shapes Changes Cleanup of common bicubic patch shader code GLSL HLSL for portability ATI OSX drivers Bug Fixes Fix FarVertexEditTablesFactory to insert properly vertex edit batches fixes incorrect hierarchical hole in regression shape Fix FarPatchMap quadtree to not drop top-level non-quad faces Fix Gregory patches bug with incorrect max-valence Fix FarPatchTablesGetNumFaces and FarPatchTablesGetFaceVertices functions to return the correct values Fix face indexing GLSL code ptex works on non-quads again Fix face-varying data splicing in FarMultiMeshFactory Fix ptex face indexing in FarMultiMeshFactory Fix glew include to not break builds Fix Clang ICC build failures with FarPatchTables Fix build and example code to work with GFLW 3.0 Fix cmake to have ptex dynamically linked in OSX Release 1.2.3 New Features Adding Varying and Face-Varying data interpolation to EvalLimit Changes EvalLimit API refactor the EvalContext now has dedicated structs to track all the vertex, varying and face-varying data streams. Also renamed some buffers into tables to maintain code consistency EvalLimit optimization switch serial indexing to a quad-tree based search Bug Fixes Face-varying data bug fixes making sure the data is carried around appropriately Fixes for OpenCL use with the new batching APIs GLSL general shader code cleanup fixes for better portability GLSL Tranform Feedback initialization fix Critical fix for FarMultiMesh batching indexing was incorrect Fix osdutil CL implementation protect includes on systems with no OpenCL SDK installed Fix face-varying interpolation on adaptive patches FarPatchTables fix IsFeatureAdaptive to return the correct answer Fix Far factories to handle the absence of face-varying data correctly. Many GLSL shader code style fixes which should help with ATI OSX shader compiling Release 1.2.2 New Features Introducing the EvalLimit API the Eval module aims at providing support for computational tasks that are not related to drawing the surfaces. The EvalLimit sub-module provides an API that enables client code to evaluate primitive variables on the limit surface. OsdxxxComputeController minor optimization. Added early exit to Refine method to avoid unnecessary interop. Changes OsdGLDawContext minor API change. Protecting some member variables and adding const accessors OsdError minor API refactor, added Warning functions. Bug Fixes Fix Ptex bug prevent corner texel guttering code to from going into infinite loops Adding the ability for a FarMeshFactory to construct patchTables starting from firstLevel in uniform subdivision mode Consolidating the color coding of bicubic patch types through all our our code examples this is used mostly as a debugging tool Fixing some MSVC build warnings Update to the outdated README.md Release 1.2.1 New Features Added CUDA runtime error checking Release 1.2.0 Changes Major Far refactor around patchTables to introduce the draw batching API Renaming osd_util to osdutil Bug Fixes Fix GLSL transform feedback initialization bug in ptexViewer Minor bug typo fixes Release 1.1.0 New Features release initiated because of the switch to Git Flow Release 1.0.0 Oringal release Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Release Notes Release Notes 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 2.6.0 Release 2.5.1 Release 2.5.0 Release 2.4.1 Release 2.4.0 Release 2.3.5 Release 2.3.4 Release 2.3.3 Release 2.3.2 Release 2.3.1 Release 2.3.0 Release 2.2.0 Release 2.1.0 Release 2.0.1 Release 2.0.0 Release 1.2.4 Release 1.2.3 Release 1.2.2 Release 1.2.1 Release 1.2.0 Release 1.1.0 Release 1.0.0 Release 2.6.0 New Features Add subdivision kernels for ARM NEON Add OsdUtilVertexSplit which creates a vertex-varying data table by duplicating vertices in a FarMesh Add basic functions to work with FV data via evaluator API Changes Added Catmark restricted vertex compute kernels that optimize for vertices with no semi-sharp creases Fix accessor omissions in osdmesh.h Add support for different subdivision schemes for OsdUtilMesh Bug Fixes Fix crashes when using rather low-end cards like Intel ones Fix a bug in the creation of an edge-vertex kernel batch Fix mismatch in declaration and usage of OsdCudaComputeRestrictedVertexA Fix a bug in the vertex order for restricted Catmark vertex-vertex kernel batches Fix a bug in FarCatmarkSubdivisionTablesFactory that prevented the CATMARK_QUAD_FACE_VERTEX kernel from being selected for subdivision level 2 or greater. Fix a bug in OsdUtilVertexSplit that occurs when getting the address of the end of a stdvector Fix error in createCLBuffer that occurs when the buffer size is zero Fix a bug in the CUDA computeRestrictedEdge kernel Fix duplicate variables with identical name Fix osdutil build errors Fix cmake diagnostic messsage Release 2.5.1 New Features Add CATMARK_QUAD_FACE_VERTEX and CATMARK_TRI_QUAD_FACE_VERTEX compute kernels optimization that takes advantage of all-quads or all-triange-and-quads meshes Bug Fixes Fix a compiler error in the GLSL Transform Feedback kernels on OS X Fix boundary interpolation in osdutil Fix bilinear stencil tangent computions Release 2.5.0 New Features Add ability to generate triangle patches for a uniformly subdivided mesh Add new example topologySharing Add interleaved buffer mode in glViewer Add GLSL compute kernel to glBatchViewer Add TBB compute kernel to glBatchViewer Add a PullDown widget to our HUD in examplescommon GUI updates cosmetic changes to GL example code Adding a programmable image shader to gl_hud Code cleanup for GLFrameBuffer in examplescommon Implement C-API accessor to evaluator topology osdutil Add command line option to CMakes options Add a CMake option to disable OpenCL Add a FindCLEW.cmake module in anticipation of using CLEW as a dependency Integrate CLEW into osd library and examples Changes Change interleaved buffer support in OsdCompute Removed OsdVertexDescriptor and replaced with OsdVertexBufferDescriptor Reorganize ComputeContext and ComputeController. Reorganize EvalStencilContext and EvalStencilController Moved transient states current vertex buffer etc to controller Reorganize EvalLimitContext and EvalLimitController Moved transient states current vertex buffer etc to controller Fix adaptive isolation of sharp corner vertices Fix incorrect FarMeshFactory logic for isolating multiple corner vertices in corner patches Change EvalLimit Gregory patch kernels to the large weights table to accomodate higher valences Fix calculation of screen space LOD tess factors for transition corner patches. Add a public constructor to OsdMesh Decrease compiler warning thresholds and fix outstanding warnings Make PTex support optional Add a NO_MAYA flag to CMakeLists to disable all Autodesk Maya dependencies in the build Document NO_MAYA command line option Bug Fixes Fix mistakenly deleted memory barrier in glsl OsdCompute kernel. Fix shape_utils genRIB function to use streams correctly. Temporary workaround for the synchronization bug of glsl compute kernel Fix Hud display for higher DPI MBP retina Fix Hud d3d11 Fix examples to use GL timer query to measure the GPU draw timing more precisely Fix glViewer stop updating during freeze. Fix file permissions on farPatchTablesFactory.h Fix some meory leaks in adaptive evaluator osdutil Fix OsdUtilAdaptiveEvaluator concurrency issue Fix OsdUtilRefiner incorrect Invalid size of patch array error reporting. Fix OsdUtilPatchPartitioner failure for triangle patches Fixes a bug that causes OsdUtilPatchPartitioner to fail to rebuild the face-varying data table correctly for triangle patches. Add missing third parameter to templated OsdDrawContext usage osdutilbatch.h Return success status from openSubdiv_finishEvaluatorDescr osdutil Remove debugging stdcout calls osdutil Build errors warnings Fix OSX Core Profile build GLFrameBuffer Fix ptexViewer build error on OSX Fix framebuffer shader compiling for OSX Reordering includes to address a compile error on OSXglew environment Fix compilation errors with CLEW enabled Fix icc build problems Fix compiler warnings in OsdClVertexBuffer Fix compilation error on windowsmsvc2013 Fix build warningserrors with VS2010 Pro Fix Windows build warning in FarPatchTablesFactory Fix doxygen generation errors Release 2.4.1 Changes Add correct OpenSubdiv namespace beginend blocks. Bug Fixes Compile osdutil with -fPIC for correct linking. Fix a bug of OsdUtilMeshBatch, the varying buffer isnt computed with CL kernels Fix FindGLFW.cmake to use the GLFW_LOCATION environment variable in Windows Fix Draw contexts do not fully initialize patch arrays Release 2.4.0 New Features Adding functionality to store uniform face-varying data across multiple levels of subdivision Add OsdUtilPatchPartitioner. It splits patcharray into subsets so that clients can draw partial surfaces for both adaptive and uniform. Changes Remove FarMesh dependency from OsdContext. Use DSA APIs for GL buffer update if available. Refactor Far API replace void- of all kernel applications with CONTEXT template parameter. It eliminates many static_casts from void- for both far and osd classes. move the big switch-cases of far default kernel launches out of Refine so that osd controllers can arbitrary mix default kernels and custom kernels. change FarKernelBatchkernelType from enum to int, clients can add custom kernel types. remove a back-pointer to farmesh from subdivision table. untemplate all subdivision table classes and template their compute methods instead. Those methods take a typed vertex storage. remove an unused argument FarMesh from the constructor of subdivision table factories. Refactor FarSubdivisionTables. Delete scheme specialized subdivision tables. The base class FarSubdivisionTables already has all tables, so we just need scheme enum to identify which scheme the subdivision tables belong to. This brings a lot of code cleanups around far factory classes. Move FarMultiMeshFactory to OsdUtil. Move table splicing functions of FarMultiMeshFactory into factories Change PxOsdUtil prefix to final OsdUtil prefix. Improve error reporting in osdutil refinement classes, and fix a build issue Bug Fixes Fix another multi mesh splicing bug of face varying data. Make CMake path variables more robust Fixing a crash on Marvericks wglew Update dxViewer example documentation Fix wrong logic in openSubdiv_setEvaluatorCoarsePositions Remove debug print from adaptive evaluators initialization Release 2.3.5 New Features Add the ability to read obj files to the dxViewer example Add screen-capture function to ptexViewer Update documention for Xcode builds Add documentation boundary interpolation rules and face-varying boundary interpolation rules Changes Refactoring FarPatchTables and FarPatchTablesFactory Move GL vertex buffer VBO buffer allocation out of allocate and into BindVBO Enable uvViewer on OS X now that Mavericks is released. Replacing un-necessary dynamic_cast with reinterpret_cast within FarDispatcher Minor code cleanup of FarMeshFactory Remove address space qualifiers from OpenCL kernel functions Fix OpenCL initialization to be slightly more robust Add OpenCL header include paths where necessary Add static specifiers for non-kernel CL funcs at program scope Add stddef.h to pythonosdosdshim.i Modify ptexViewer and uvViewer shaders to address some portability issues Bug Fixes Fix Gregory Boundary patch buffer overrun Fix black texels when the resolution of a ptex face is less than 4 Fix a splicing bug in FarMultiMeshFactory Fix a build error when using older versions of GLFW Fix build warnings optimized Fix FindTBB.cmake Fix FindMaya.cmake Fix glViewer support for GLSL compute Fix ptexViewer enable specular pass in both IBL and point lighting Fix Zlib include in ptexViewer Fix ptexViewer shader errors. Fix osdPolySmooth Maya plugin Fix UV merging in osdPolySmooth code example Add cleanup function to osdPolySmooth Maya plugin Fix Maya OsdPolySmooth node component output Fix GLSL array instantiation syntax for glStencilViewer Fix examples to run correctly on high DPI displays with GLFW 3 Release 2.3.4 New Features Adding CPUOMPTBB Context Controller pairs for CPU evaluation of smooth normals Added adaptiveEvaluator class inspired by Sergeys work in blender OsdUtil Changes Changed the HUD to ignore mouse clicks when not visible. Updates for blender development OsdUtil Add C compatible API to access the adaptiveEvaluator class from non-C OsdUtil Update license headers to apache OsdUtil CMake build improvement make osd a cmake object library remove compiling redundancies Improve stringification of shaders kernels in CMake build Bug Fixes Fixed iOS build Fixed VS2010 warningserrors. Fix OsdCpuEvalLimitKernel Fix maxvalence calculation in FarMeshFactory Fix FarStencilFactory control stencil caching Removing assert for high-valence vertices running off limit tangent pre-computed table. Fix degenerate stencil limit tangent code path. Fix unused variable build warnings gcc 4.8.2 - Fedora 19 Fix build warning from osdutiladaptiveEvaluator.cpp Release 2.3.3 Changes Modify Far remapping of singular vertices to point to their source vertex. Refactoring Ptex Mipmap and Analytic Displacement code Adding some documentation for Chaikin crease rule Misc. improvements to PxOsdUtilsMesh Adding recommended isolation output to OsdPolySmooth node Bug Fixes Adding an error check on version parsing of main CMakeLists Fix regex in FindMaya.cmake that breaks with recent versions of Maya Fix crashes induced by typeid Fixed VS2010 build warning Fix build break in hbr_regression Fix incorrect capitalization in GL ptexViewer shader.glsl Fix OSX build add stdlib.h include Release 2.3.2 New Features Adding control cage drawing to ptexViewer Adding Maya osdPolySmooth plugin into OpenSubdiv examples. Changes Removing some glGetError checks that are causing problems for Autodesk D3D11DrawRegistry returns the common shader config for all non-tess patcharrays. Updates to simple cpu osdutil classes Bug Fixes Fix Hbr Chaikin crease rule Fix Chaikin tag parsing Fix return value of allocate function for OsdCPUGLVertxBuffer Fixed GLSL shader portability. Fix FindGLFW.cmake for GLFW 3.03 on OSX Fixed compiler warnings. Fixed VS2010 build errors Fixed WIN32 build error when no DXSDK installed. Fix OSX build stdlib.h needs to be included in glPtexMipmapTexture.h Fix for crash in new meshrefiner code in OsdUtil Release 2.3.1 New Features Add DX11 version of ptex mipmap loader Add DX11 ptex viewer work in progress Add DX11 fractional partitioning, normal derivatives computation Add memory usage controls to Ptex loader Add face-varying boundary interpolation parsing to shape_utils Add simple HbrMesh and FarMesh wrapper classes to osdutil Changes Amend language of attribution file NOTICE.txt Optimize a bit of ptex mipmap lookup. Show ptex memory usage in GL and DX11 ptexViewers Improve ptex guttering Addding some video links to our collection of external resources Bug Fixes Fix edge-only face-varying interpolation Fix Far to handle disconnected vertices in an Hbr mesh Fixed ptex cache resource release sequence Fix build symbol conflict in Far Fix patch parambuffer generation in OsdD3D11DrawContext Fix a minor osdutil build warning seen with gcc 4.8.1 Fix VS2010 build errors Release 2.3.0 New Features Added Analytical displacement mapping Analytic Displacement Mapping using Hardware Tessellation Niessner and Loop TOG 2013 Added a new ptex mipmap loader Added face varying macros for loop subdivision Added the uvViewer example to see how face varying interpolation rule works Added a slider component and cleanup hud code. Changes Adding license attribution files, improved language of the code headers Install documentation into the Filesystem Hierarchy Standard location Set GLFW_OPENGL_FORWARD_COMPAT on Mac OS to make samples work on that platform Added surface normal mode mipmap to ptxViewer Bug Fixes Fix a bug of bad fvar splicing for loop surface. Fix incorrect bilinear limit tangents in FarStencilTablesFactory Fix boundary interpolation rules doc Added an error check on updating cuda buffer Fix face varying rendering on loop surface Fixed glBatchViewer build for GLFW 2.x Expand search paths for FindGLFW.cmake for Debian and other Linux architectures Fix CMake executable builds for ICC Fix bhr baseline regression, so reference files are real OBJs Fixed clKernelBundle.cpp to build on Android. Fix misc build warings Release 2.2.0 New Features Added subdivision stencil functionality Far OsdEval Bug Fixes Fix D3D11DrawContext to check for NULL pointers Fix cpuEvalLimitController crash bug Fixed search path suffixes for ICC libs Fixed invalid initialization of glslTransformFeedback kernel. Release 2.1.0 New Features Added TBB Compute back-end on Linux contribution from Sheng Fu Added support for ICC compiler still Beta Changes Added constructor to OsdMesh with a FarMesh as input Modify CMake to name and sym-link DSOs based on Linux ABI versioning spec Added command line input to DX11 viewer FarMultiMesh can splice uniform and adaptive meshes together. Bug Fixes Fix FarMultiMesh splicing Removed unnecessary cudaThreadSynchronize calls. Fix glViewer overlapping HUD menus Fix facevarying rendering in glBatchViewer Fix build of GLSL transform feedback kernels Fix Getting Started documentation Release 2.0.1 New Features New CLA files to reflect Apache 2.0 licensing Changes Move all public headers to includeopensubdiv... Adding Osd documentation based on Siggraph slides Bug Fixes Fix incorrect transition pattern 3 in GLSL HLSL shaders Fix CMake build to not link GPU-based libraries into libosdCPU Fix support for GLEW on OSX Fix GLFW Xrandr xf86vmode dependency paths for X11 based systems Fix HUD display overlaps in code examples Fix FindGLEW.cmake to be aware of multiarch on linux systems Fix some hard-coded include paths in CMake build Release 2.0.0 New Features New CMake build flags NO_LIB, NO_CUDA, NO_PYTHON Changes OpenSubdiv is now under Apache 2.0 license HbrHalfedge and HbrFVarData copy constructors are now private Documentation style matched to graphics.pixar.com new content Add an animation freeze button to ptexViewer Variable name changes for better readability across all example shader code Bug Fixes Fix incorrect patch generation for patches with 2 non-consecutive boundary edges Fix undefined gl_PrimitiveID shader build errors Fix for shader macro OSD_DISPLACEMENT_CALLBACK Fix out-of-bounds stdvector access in FarPatchTablesFactory Release 1.2.4 New Features Adding support for fractional tessellation of patches Adding a much needed API documention system based on Docutils RST markup Adding support for face-varying interpolation in GLSL APIs Adding varying data buffers to OsdMesh Adding accessors to the vertex buffers in OsdGlMesh Adding face-varying data to regression shapes Changes Cleanup of common bicubic patch shader code GLSL HLSL for portability ATI OSX drivers Bug Fixes Fix FarVertexEditTablesFactory to insert properly vertex edit batches fixes incorrect hierarchical hole in regression shape Fix FarPatchMap quadtree to not drop top-level non-quad faces Fix Gregory patches bug with incorrect max-valence Fix FarPatchTablesGetNumFaces and FarPatchTablesGetFaceVertices functions to return the correct values Fix face indexing GLSL code ptex works on non-quads again Fix face-varying data splicing in FarMultiMeshFactory Fix ptex face indexing in FarMultiMeshFactory Fix glew include to not break builds Fix Clang ICC build failures with FarPatchTables Fix build and example code to work with GFLW 3.0 Fix cmake to have ptex dynamically linked in OSX Release 1.2.3 New Features Adding Varying and Face-Varying data interpolation to EvalLimit Changes EvalLimit API refactor the EvalContext now has dedicated structs to track all the vertex, varying and face-varying data streams. Also renamed some buffers into tables to maintain code consistency EvalLimit optimization switch serial indexing to a quad-tree based search Bug Fixes Face-varying data bug fixes making sure the data is carried around appropriately Fixes for OpenCL use with the new batching APIs GLSL general shader code cleanup fixes for better portability GLSL Tranform Feedback initialization fix Critical fix for FarMultiMesh batching indexing was incorrect Fix osdutil CL implementation protect includes on systems with no OpenCL SDK installed Fix face-varying interpolation on adaptive patches FarPatchTables fix IsFeatureAdaptive to return the correct answer Fix Far factories to handle the absence of face-varying data correctly. Many GLSL shader code style fixes which should help with ATI OSX shader compiling Release 1.2.2 New Features Introducing the EvalLimit API the Eval module aims at providing support for computational tasks that are not related to drawing the surfaces. The EvalLimit sub-module provides an API that enables client code to evaluate primitive variables on the limit surface. OsdxxxComputeController minor optimization. Added early exit to Refine method to avoid unnecessary interop. Changes OsdGLDawContext minor API change. Protecting some member variables and adding const accessors OsdError minor API refactor, added Warning functions. Bug Fixes Fix Ptex bug prevent corner texel guttering code to from going into infinite loops Adding the ability for a FarMeshFactory to construct patchTables starting from firstLevel in uniform subdivision mode Consolidating the color coding of bicubic patch types through all our our code examples this is used mostly as a debugging tool Fixing some MSVC build warnings Update to the outdated README.md Release 1.2.1 New Features Added CUDA runtime error checking Release 1.2.0 Changes Major Far refactor around patchTables to introduce the draw batching API Renaming osd_util to osdutil Bug Fixes Fix GLSL transform feedback initialization bug in ptexViewer Minor bug typo fixes Release 1.1.0 New Features release initiated because of the switch to Git Flow Release 1.0.0 Oringal release Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_notes_2x.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "3.0 - 3.5 Release Notes", │ │ │ │ │ - "text": "3.0 - 3.5 Release Notes 3.0 - 3.5 Release Notes 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 3.5 Release 3.5.0 - Sep 2022 Release 3.4 Release 3.4.4 - Feb 2021 Release 3.4.3 - Apr 2020 Release 3.4.0 - Jun 2019 Release 3.3 Release 3.3.3 - Jul 2018 Release 3.3.2 - Jun 2018 Release 3.3.1 - Feb 1018 Release 3.3.0 - Aug 2017 Release 3.2 Release 3.2.0 - Feb 2017 Release 3.1 Release 3.1.1 - Jan 2017 Release 3.1.0 - Oct 2016 Release 3.0 Release 3.0.5 - Mar 2016 Release 3.0.4 - Feb 2016 Release 3.0.3 - Oct 2015 Release 3.0.2 - Aug 2015 Release 3.0.1 - Aug 2015 Release 3.0.0 - Jun 2015 Release 3.0.0 RC2 Release 3.0.0 RC1 Previous 2.x Release Notes Release 3.5 Release 3.5.0 - Sep 2022 Release 3.5.0 is a significant release with new features, several configuration improvements, and a few other improvements and bug fixes. For more information on the following, see Release 3.5 Deprecation Announcements Hbr is deprecated and will be removed from subsequent releases New Features Simplified Surface Evaluation Bfr Tessellation Patterns Bfr Changes Suppression of GCC compiler warnings GitHub 1253, 1254, 1270 Additional methods for FarTopologyLevel GitHub 1227, 1255 Improved mixed partial derivative at Gregory patch corners GitHub 1252 Minor improvements to Far tutorials GitHub 1226, 1241 Added CMake config GitHub 1242 Updated CMake minimum version to 3.12 GitHub 1237, 1261 Updated documentation build scripts for Python 3 1265, 1266 Updated stringify build tool for improved cross compilation support GitHub 1267 Added NO_MACOS_FRAMEWORKS build option GitHub 1238 Updated Azure pipelines agents for Unbuntu and macOS GitHub 1247, 1256 Removed obsolete AppVeyor and Travis CI scripts GitHub 1259 Bug Fixes Cache active program for OsdGLComputeEvaluator GitHub 1244 Fixed member initialization warnings in OsdD3D11ComputeEvaluator GitHub 1239 Fixed GLSL shader source to remove storage qualifiers from struct members GitHub 1271 Fixed use of CMake variables for Apple builds GitHub 1235 Fixed build errors when using OpenGL without GLFW GitHub 1257 Fixed links to embedded videos GitHub 1231 Release 3.4 Release 3.4.4 - Feb 2021 Release 3.4.4 is a minor release including bug fixes and configuration improvements Changes The master branch on GitHub has been renamed release GitHub 1218 1219 The CMake configuration has been updated to allow use as a sub-project GitHub 1206 Removed obsolete references to hbr from examplesfarViewer GitHub 1217 Bug Fixes Fixed bug with sparse PatchTables and irregular face-varying seams GitHub 1203 Fixed loss of precision when using double precision stencil tables GitHub 1207 Fixed reset of FarTopologyRefinerGetMaxLevel after call to Unrefine GitHub 1208 Fixed linking with -ldl on unix systems GitHub 1196 Fixed naming and installation of macOS frameworks GitHub 1194 1201 Fixed GL version and extension processing and dynamic loading on macOS GitHub 1216 Fixed FindDocutils.cmake to be more robust GitHub 1213 1220 Fixed errors using build_scriptsbuild_osd.py with Python3 GitHub 1206 Release 3.4.3 - Apr 2020 Release 3.4.3 is a minor release including bug fixes and configuration improvements Changes GLEW is no longer required by default GitHub 1183 1184 Removed false Ptex link dependency from libosdCPU GitHub 1174 Removed false GLFW link dependency from DX11 and Metal examples GitHub 1178 Removed link dependency on unused TBB libraries GitHub 1064 Added option to disable building of dynamic shared libraries GitHub 1169 Added new tutorial for FarLimitStencilTable GitHub 1176 Updated use of EXT_direct_state_access to ARB_direct_state_access GitHub 1184 Fixed C strict aliasing warnings GitHub 1182 Fixed MSVC warnings in example code GitHub 1158 1172 Fixed compatibility with Visual Studio 2019 GitHub 1173 1189 Fixed CMake CMP0054 warnings GitHub 1180 Added prefix to OpenSubdiv CMake macros GitHub 1157 Moved utilities in examplescommon to regressioncommon GitHub 1167 Minor fixes to Far tutorials GitHub 1175 1177 Switched to Azure Pipelines for continuous integration testing instead of Travis-CI and AppVeyor GitHub 1168 1190 Bug Fixes Fixed selective boundary interpolation for case SdcOptionsVTX_BOUNDARY_NONE GitHub 1170 1171 Fixed static library linking to address missing symbols GitHub 1192 Additional fixes for dynamic and static linking GitHub 1193 Release 3.4.0 - Jun 2019 Release 3.4.0 is a significant release with several new features, bug fixes, and general code and configuration improvements. For more information on the following, please see Release 3.4 New Features Triangular Patches for Loop subdivision Improvements to Introductory Documentation Sparse Patch Tables and Adaptive Refinement Full Support for Double Precision in Far Changes Added new build script GitHub 1068 Added support for newer DirectX SDKs GitHub 1066 Patch arrays extended to support combined regular and irregular types GitHub 995 FarPatchTables and adaptive refinement supported for Bilinear scheme GitHub 1035 New FarPatchTableFactory method to determine adaptive refinement options GitHub 1047 New FarPatchTableFactory options to align primvar buffers of uniform tables GitHub 986 FarStencilTableUpdateValues overloaded to support separate base buffer GitHub 1011 FarLimitStencilTableFactory updated to create face-varying tables GitHub 1012 Regular patches on boundaries no longer require additional isolation GitHub 1025 Inclusion of OpenSubdiv header files in source code now consistent GitHub 767 Re-organization of and additions to Far tutorials GitHub 1083 examples now use common command-line conventions and parsing GitHub 1056 Bug Fixes Fixed FarPrimvarRefiner internal limitFVar prototype GitHub 979 Fixed FarStencilTable append when base StencilTable empty GitHub 982 Patches around non-manifold vertices now free of cracks GitHub 1013 Release 3.3 Release 3.3.3 - Jul 2018 Release 3.3.3 is bug-fix release addressing regressions from release 3.3.2 Bug Fixes Fixed a regression in PatchTable construction with varying patches GitHub 976 Fixed a regression in PatchTable construction for face-varying patches GitHub 972 Fixed a bug in the initialization of FarSourcePatch GitHub 971 Release 3.3.2 - Jun 2018 Release 3.3.2 is a minor release with potentially significant performance improvements to the patch pre-processing stages Changes Improved performance of PatchTable construction GitHub 966 The resulting improved accuracy will produce slight numerical differences in computations involving patches, e.g. StencilTable and PatchTable evaluation Bug Fixes FarPatchTableFactory now supports PatchTable construction with ENDCAP_BILINEAR_BASIS specified Release 3.3.1 - Feb 1018 Release 3.3.1 is a minor bug-fix release Bug Fixes Fixed GLSLHLSLMetal patch shader code to resolve degenerate normals GitHub 947 Fixed problems with face-varying patches in uniform PatchTables GitHub 946 Fixed integer overflow bugs for large meshes in PatchTable factories GitHub 957 Fixed computation of PatchParam for triangle refinement GitHub 962 Changes Added build options NO_GLFW and NO_GLFW_X11 Added additional shapes with infinitely sharp creases to the Metal and DX11 example viewers Disabled GL tests during CI runs on Linux Improved stability of examplesglImaging in CI runs by testing GL version Release 3.3.0 - Aug 2017 Release 3.3.0 is significant release adding an Osd implementation for Apples Metal API New Features Added an Osd implementation for Apples Metal API Added the mtlViewer example Changes Fixed several instances of local variable shadowing that could cause build warnings Updated continuous-integration build scripts and added testing on macOS Release 3.2 Release 3.2.0 - Feb 2017 Release 3.2.0 is a minor release containing API additions and bug fixes New Features Extended FarStencilTableFactory to support face-varying Extended Osd Evaluator classes to support evaluation of 1st and 2nd derivatives Added an option to disable generation of legacy sharp corner patches Changes Corrected numerous spelling errors in doxygen comments Updated glFVarViewer with improved error detection and command line parsing Added option to build using MSVC with static CRT Bug Fixes Fixed a double delete of GL program in OsdGLComputeEvaluator Release 3.1 Release 3.1.1 - Jan 2017 Release 3.1.1 is a minor bug-fix release. Bug Fixes Fixed a bug with non-manifold face-varying topology causing a crash during patch table creation Fixed GLEW compilation and linking with dynamic GLEW libraries on Windows Fixed GLFW linking with GLFW 3.2 on X11 platforms Release 3.1.0 - Oct 2016 Release 3.1.0 is a significant release with several new features, bug fixes, and general code and configuration improvements. For more information on the following, please see Release 3.1 New Features Bicubic Face-Varying Patches Varying and Face-Varying Evaluation Second Order Derivative Evaluation Separate Levels of Feature Isolation Sharp Patches for Infinitely Sharp Features Changes Enabled the use of CMakes folder feature Removed the use of iso646 alternative keywords and, or, not, etc. to improve portability Added numerical valued preprocessor directives OPENSUBDIV_VERSION_MAJOR, etc. to opensubdivversion.h Improved documentation for FarPatchParam and added Unnormalize to complement Normalize Added additional topology queries to FarTopologyLevel Updated glFVarViewer and glEvalLimit viewer to make use of bicubic face-varying patches Updated glViewer and dxViewer to add a toggle for InfSharpPatch Updated dxPtexViewer for improved feature parity with glPtexViewer Improved far_regression to exercise shapes independent of Hbr compatibility Added support for Appveyor continuous integration testing Removed cmakeFindIlmBase Removed mayaPolySmooth example Bug Fixes Fixed Ptex version parsing and compatibility issues Fixed compatibility issues with VS2015 Fixed bug interpolating face-varying data with Bilinear scheme Fixed bug with refinement using Chaikin creasing Fixed bugs with HUD sliders in the example viewers Release 3.0 Release 3.0.5 - Mar 2016 Release 3.0.5 is a minor stability release with performance and correctness bug fixes. Bug Fixes The previous release reduced transient memory use during PatchTable construction, but increased the amount of memory consumed by the resulting PatchTable itself, this regression has been fixed. The example Ptex texture sampling code has been fixed to prevent sampling beyond the texels for a face when multisample rasterization is enabled. Release 3.0.4 - Feb 2016 Release 3.0.4 is a minor stability release which includes important performance and bug fixes. New Features Added accessor methods to FarLimitStencilTable to retrieve limit stencil data including derivative weights Added support for OpenCL event control to OsdCLVertexBuffer and OsdCLEvaluator Changes Major reduction in memory use during FarPatchTable construction for topologies with large numbers of extraordinary features Improved performance for GL and D3D11 tessellation control hull shader execution when drawing BSpline patches with the single crease patch optimization enabled Bug Fixes Restored support for drawing with fractional tessellation Fixed far_tutorial_6 to refine primvar data only up to the number of levels produced by topological refinement Fixed build warnings and errors reported by Visual Studio 2015 Release 3.0.3 - Oct 2015 Release 3.0.3 is a minor stability release which includes important performance and bug fixes. New Features Smooth normal generation tutorial, far_tutorial_8 Changes Major performance improvement in PatchTable construction Improved patch approximations for non-manifold features Bug Fixes Fixed double delete in GLSL Compute controller Fixed buffer layout for GLSL Compute kernel Fixed GL buffer leak in OsdGLPatchTable Fixed out-of-bounds data access for TBB and OMP stencil evaluation Fixed WIN32_LEAN_AND_MEAN typo Fixed Loop-related shader issues glFVarViewer Release 3.0.2 - Aug 2015 Release 3.0.2 is a minor release for a specific fix. Bug Fixes Fixed drawing of single crease patches Release 3.0.1 - Aug 2015 Release 3.0.1 is a minor release focused on stability and correctness. Changes Added a references section to the documentation, please see References Removed references to AddVaryingWithWeight from examples and tutorials Added more regression test shapes Addressed general compiler warnings e.g. signed vs unsigned comparisons Addressed compiler warnings in the core libraries reported by GCCs -Wshadow Eased GCC version restriction, earlier requirement for version 4.8 or newer is no longer needed Replaced topology initialization assertions with errors Improved compatibility with ICC Improved descriptive content and formatting of Far error messages Improved build when configured to include no GPU specific code Bug Fixes Fixed handling of unconnected vertices to avoid out of bounds data access Fixed non-zero starting offsets for TbbEvalStencils and OmpEvalStencils Fixed FarStencilTableFactoryOptionsfactorizeIntermediateLevels Fixed FarPatchTablesFactoryOptionsgenerateAllLevels Fixed the behavior of VTX_BOUNDARY_NONE for meshes with bilinear scheme Fixed some template method specializations which produced duplicate definitions Disabled depth buffering when drawing the UI in the example viewers Disabled the fractional tessellation spacing option in example viewers since this mode is currently not supported Release 3.0.0 - Jun 2015 Release 3.0.0 is a major release with many significant improvements and changes. For more information on the following, please see Release 3.0 New Features Faster subdivision using less memory Support for non-manifold topology Face-Varying data specified topologically Elimination of fixed valence tables Single-crease patch for semi-sharp edges Additional irregular patch approximations Introduction of Stencil Tables Faster, simpler GPU kernels Unified adaptive shaders Updated coding style with namespaces More documentation and tutorials Bug Fixes Smooth Face-Varying interpolation around creases Release 3.0.0 RC2 New Features Documentation updates far_tutorial_3 updates for the multiple face-varying channels maya example plugin interpolates a UV channel and a vertex color channel Bug Fixes Fixed a LimitStencilTableFactory bug, which returns an invalid table PatchParam encoding changed to support refinement levels up to 10 Added Xinerama link dependency Fixed MSVC 32bit build problem Fixed minor cmake issues Fixed glViewerfarViewer stability bugs Release 3.0.0 RC1 Changes FarTopologyRefiner was split into several classes to clarify and focus the API. Interpolation of Vertex and Varying primvars in a single pass is no longer supported. The Osd layer was largely refactored. Previous 2.x Release Notes Previous releases Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "3.0 - 3.5 Release Notes 3.0 - 3.5 Release Notes 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 3.5 Release 3.5.0 - Sep 2022 Release 3.4 Release 3.4.4 - Feb 2021 Release 3.4.3 - Apr 2020 Release 3.4.0 - Jun 2019 Release 3.3 Release 3.3.3 - Jul 2018 Release 3.3.2 - Jun 2018 Release 3.3.1 - Feb 1018 Release 3.3.0 - Aug 2017 Release 3.2 Release 3.2.0 - Feb 2017 Release 3.1 Release 3.1.1 - Jan 2017 Release 3.1.0 - Oct 2016 Release 3.0 Release 3.0.5 - Mar 2016 Release 3.0.4 - Feb 2016 Release 3.0.3 - Oct 2015 Release 3.0.2 - Aug 2015 Release 3.0.1 - Aug 2015 Release 3.0.0 - Jun 2015 Release 3.0.0 RC2 Release 3.0.0 RC1 Previous 2.x Release Notes Release 3.5 Release 3.5.0 - Sep 2022 Release 3.5.0 is a significant release with new features, several configuration improvements, and a few other improvements and bug fixes. For more information on the following, see Release 3.5 Deprecation Announcements Hbr is deprecated and will be removed from subsequent releases New Features Simplified Surface Evaluation Bfr Tessellation Patterns Bfr Changes Suppression of GCC compiler warnings GitHub 1253, 1254, 1270 Additional methods for FarTopologyLevel GitHub 1227, 1255 Improved mixed partial derivative at Gregory patch corners GitHub 1252 Minor improvements to Far tutorials GitHub 1226, 1241 Added CMake config GitHub 1242 Updated CMake minimum version to 3.12 GitHub 1237, 1261 Updated documentation build scripts for Python 3 1265, 1266 Updated stringify build tool for improved cross compilation support GitHub 1267 Added NO_MACOS_FRAMEWORKS build option GitHub 1238 Updated Azure pipelines agents for Unbuntu and macOS GitHub 1247, 1256 Removed obsolete AppVeyor and Travis CI scripts GitHub 1259 Bug Fixes Cache active program for OsdGLComputeEvaluator GitHub 1244 Fixed member initialization warnings in OsdD3D11ComputeEvaluator GitHub 1239 Fixed GLSL shader source to remove storage qualifiers from struct members GitHub 1271 Fixed use of CMake variables for Apple builds GitHub 1235 Fixed build errors when using OpenGL without GLFW GitHub 1257 Fixed links to embedded videos GitHub 1231 Release 3.4 Release 3.4.4 - Feb 2021 Release 3.4.4 is a minor release including bug fixes and configuration improvements Changes The master branch on GitHub has been renamed release GitHub 1218 1219 The CMake configuration has been updated to allow use as a sub-project GitHub 1206 Removed obsolete references to hbr from examplesfarViewer GitHub 1217 Bug Fixes Fixed bug with sparse PatchTables and irregular face-varying seams GitHub 1203 Fixed loss of precision when using double precision stencil tables GitHub 1207 Fixed reset of FarTopologyRefinerGetMaxLevel after call to Unrefine GitHub 1208 Fixed linking with -ldl on unix systems GitHub 1196 Fixed naming and installation of macOS frameworks GitHub 1194 1201 Fixed GL version and extension processing and dynamic loading on macOS GitHub 1216 Fixed FindDocutils.cmake to be more robust GitHub 1213 1220 Fixed errors using build_scriptsbuild_osd.py with Python3 GitHub 1206 Release 3.4.3 - Apr 2020 Release 3.4.3 is a minor release including bug fixes and configuration improvements Changes GLEW is no longer required by default GitHub 1183 1184 Removed false Ptex link dependency from libosdCPU GitHub 1174 Removed false GLFW link dependency from DX11 and Metal examples GitHub 1178 Removed link dependency on unused TBB libraries GitHub 1064 Added option to disable building of dynamic shared libraries GitHub 1169 Added new tutorial for FarLimitStencilTable GitHub 1176 Updated use of EXT_direct_state_access to ARB_direct_state_access GitHub 1184 Fixed C strict aliasing warnings GitHub 1182 Fixed MSVC warnings in example code GitHub 1158 1172 Fixed compatibility with Visual Studio 2019 GitHub 1173 1189 Fixed CMake CMP0054 warnings GitHub 1180 Added prefix to OpenSubdiv CMake macros GitHub 1157 Moved utilities in examplescommon to regressioncommon GitHub 1167 Minor fixes to Far tutorials GitHub 1175 1177 Switched to Azure Pipelines for continuous integration testing instead of Travis-CI and AppVeyor GitHub 1168 1190 Bug Fixes Fixed selective boundary interpolation for case SdcOptionsVTX_BOUNDARY_NONE GitHub 1170 1171 Fixed static library linking to address missing symbols GitHub 1192 Additional fixes for dynamic and static linking GitHub 1193 Release 3.4.0 - Jun 2019 Release 3.4.0 is a significant release with several new features, bug fixes, and general code and configuration improvements. For more information on the following, please see Release 3.4 New Features Triangular Patches for Loop subdivision Improvements to Introductory Documentation Sparse Patch Tables and Adaptive Refinement Full Support for Double Precision in Far Changes Added new build script GitHub 1068 Added support for newer DirectX SDKs GitHub 1066 Patch arrays extended to support combined regular and irregular types GitHub 995 FarPatchTables and adaptive refinement supported for Bilinear scheme GitHub 1035 New FarPatchTableFactory method to determine adaptive refinement options GitHub 1047 New FarPatchTableFactory options to align primvar buffers of uniform tables GitHub 986 FarStencilTableUpdateValues overloaded to support separate base buffer GitHub 1011 FarLimitStencilTableFactory updated to create face-varying tables GitHub 1012 Regular patches on boundaries no longer require additional isolation GitHub 1025 Inclusion of OpenSubdiv header files in source code now consistent GitHub 767 Re-organization of and additions to Far tutorials GitHub 1083 examples now use common command-line conventions and parsing GitHub 1056 Bug Fixes Fixed FarPrimvarRefiner internal limitFVar prototype GitHub 979 Fixed FarStencilTable append when base StencilTable empty GitHub 982 Patches around non-manifold vertices now free of cracks GitHub 1013 Release 3.3 Release 3.3.3 - Jul 2018 Release 3.3.3 is bug-fix release addressing regressions from release 3.3.2 Bug Fixes Fixed a regression in PatchTable construction with varying patches GitHub 976 Fixed a regression in PatchTable construction for face-varying patches GitHub 972 Fixed a bug in the initialization of FarSourcePatch GitHub 971 Release 3.3.2 - Jun 2018 Release 3.3.2 is a minor release with potentially significant performance improvements to the patch pre-processing stages Changes Improved performance of PatchTable construction GitHub 966 The resulting improved accuracy will produce slight numerical differences in computations involving patches, e.g. StencilTable and PatchTable evaluation Bug Fixes FarPatchTableFactory now supports PatchTable construction with ENDCAP_BILINEAR_BASIS specified Release 3.3.1 - Feb 1018 Release 3.3.1 is a minor bug-fix release Bug Fixes Fixed GLSLHLSLMetal patch shader code to resolve degenerate normals GitHub 947 Fixed problems with face-varying patches in uniform PatchTables GitHub 946 Fixed integer overflow bugs for large meshes in PatchTable factories GitHub 957 Fixed computation of PatchParam for triangle refinement GitHub 962 Changes Added build options NO_GLFW and NO_GLFW_X11 Added additional shapes with infinitely sharp creases to the Metal and DX11 example viewers Disabled GL tests during CI runs on Linux Improved stability of examplesglImaging in CI runs by testing GL version Release 3.3.0 - Aug 2017 Release 3.3.0 is significant release adding an Osd implementation for Apples Metal API New Features Added an Osd implementation for Apples Metal API Added the mtlViewer example Changes Fixed several instances of local variable shadowing that could cause build warnings Updated continuous-integration build scripts and added testing on macOS Release 3.2 Release 3.2.0 - Feb 2017 Release 3.2.0 is a minor release containing API additions and bug fixes New Features Extended FarStencilTableFactory to support face-varying Extended Osd Evaluator classes to support evaluation of 1st and 2nd derivatives Added an option to disable generation of legacy sharp corner patches Changes Corrected numerous spelling errors in doxygen comments Updated glFVarViewer with improved error detection and command line parsing Added option to build using MSVC with static CRT Bug Fixes Fixed a double delete of GL program in OsdGLComputeEvaluator Release 3.1 Release 3.1.1 - Jan 2017 Release 3.1.1 is a minor bug-fix release. Bug Fixes Fixed a bug with non-manifold face-varying topology causing a crash during patch table creation Fixed GLEW compilation and linking with dynamic GLEW libraries on Windows Fixed GLFW linking with GLFW 3.2 on X11 platforms Release 3.1.0 - Oct 2016 Release 3.1.0 is a significant release with several new features, bug fixes, and general code and configuration improvements. For more information on the following, please see Release 3.1 New Features Bicubic Face-Varying Patches Varying and Face-Varying Evaluation Second Order Derivative Evaluation Separate Levels of Feature Isolation Sharp Patches for Infinitely Sharp Features Changes Enabled the use of CMakes folder feature Removed the use of iso646 alternative keywords and, or, not, etc. to improve portability Added numerical valued preprocessor directives OPENSUBDIV_VERSION_MAJOR, etc. to opensubdivversion.h Improved documentation for FarPatchParam and added Unnormalize to complement Normalize Added additional topology queries to FarTopologyLevel Updated glFVarViewer and glEvalLimit viewer to make use of bicubic face-varying patches Updated glViewer and dxViewer to add a toggle for InfSharpPatch Updated dxPtexViewer for improved feature parity with glPtexViewer Improved far_regression to exercise shapes independent of Hbr compatibility Added support for Appveyor continuous integration testing Removed cmakeFindIlmBase Removed mayaPolySmooth example Bug Fixes Fixed Ptex version parsing and compatibility issues Fixed compatibility issues with VS2015 Fixed bug interpolating face-varying data with Bilinear scheme Fixed bug with refinement using Chaikin creasing Fixed bugs with HUD sliders in the example viewers Release 3.0 Release 3.0.5 - Mar 2016 Release 3.0.5 is a minor stability release with performance and correctness bug fixes. Bug Fixes The previous release reduced transient memory use during PatchTable construction, but increased the amount of memory consumed by the resulting PatchTable itself, this regression has been fixed. The example Ptex texture sampling code has been fixed to prevent sampling beyond the texels for a face when multisample rasterization is enabled. Release 3.0.4 - Feb 2016 Release 3.0.4 is a minor stability release which includes important performance and bug fixes. New Features Added accessor methods to FarLimitStencilTable to retrieve limit stencil data including derivative weights Added support for OpenCL event control to OsdCLVertexBuffer and OsdCLEvaluator Changes Major reduction in memory use during FarPatchTable construction for topologies with large numbers of extraordinary features Improved performance for GL and D3D11 tessellation control hull shader execution when drawing BSpline patches with the single crease patch optimization enabled Bug Fixes Restored support for drawing with fractional tessellation Fixed far_tutorial_6 to refine primvar data only up to the number of levels produced by topological refinement Fixed build warnings and errors reported by Visual Studio 2015 Release 3.0.3 - Oct 2015 Release 3.0.3 is a minor stability release which includes important performance and bug fixes. New Features Smooth normal generation tutorial, far_tutorial_8 Changes Major performance improvement in PatchTable construction Improved patch approximations for non-manifold features Bug Fixes Fixed double delete in GLSL Compute controller Fixed buffer layout for GLSL Compute kernel Fixed GL buffer leak in OsdGLPatchTable Fixed out-of-bounds data access for TBB and OMP stencil evaluation Fixed WIN32_LEAN_AND_MEAN typo Fixed Loop-related shader issues glFVarViewer Release 3.0.2 - Aug 2015 Release 3.0.2 is a minor release for a specific fix. Bug Fixes Fixed drawing of single crease patches Release 3.0.1 - Aug 2015 Release 3.0.1 is a minor release focused on stability and correctness. Changes Added a references section to the documentation, please see References Removed references to AddVaryingWithWeight from examples and tutorials Added more regression test shapes Addressed general compiler warnings e.g. signed vs unsigned comparisons Addressed compiler warnings in the core libraries reported by GCCs -Wshadow Eased GCC version restriction, earlier requirement for version 4.8 or newer is no longer needed Replaced topology initialization assertions with errors Improved compatibility with ICC Improved descriptive content and formatting of Far error messages Improved build when configured to include no GPU specific code Bug Fixes Fixed handling of unconnected vertices to avoid out of bounds data access Fixed non-zero starting offsets for TbbEvalStencils and OmpEvalStencils Fixed FarStencilTableFactoryOptionsfactorizeIntermediateLevels Fixed FarPatchTablesFactoryOptionsgenerateAllLevels Fixed the behavior of VTX_BOUNDARY_NONE for meshes with bilinear scheme Fixed some template method specializations which produced duplicate definitions Disabled depth buffering when drawing the UI in the example viewers Disabled the fractional tessellation spacing option in example viewers since this mode is currently not supported Release 3.0.0 - Jun 2015 Release 3.0.0 is a major release with many significant improvements and changes. For more information on the following, please see Release 3.0 New Features Faster subdivision using less memory Support for non-manifold topology Face-Varying data specified topologically Elimination of fixed valence tables Single-crease patch for semi-sharp edges Additional irregular patch approximations Introduction of Stencil Tables Faster, simpler GPU kernels Unified adaptive shaders Updated coding style with namespaces More documentation and tutorials Bug Fixes Smooth Face-Varying interpolation around creases Release 3.0.0 RC2 New Features Documentation updates far_tutorial_3 updates for the multiple face-varying channels maya example plugin interpolates a UV channel and a vertex color channel Bug Fixes Fixed a LimitStencilTableFactory bug, which returns an invalid table PatchParam encoding changed to support refinement levels up to 10 Added Xinerama link dependency Fixed MSVC 32bit build problem Fixed minor cmake issues Fixed glViewerfarViewer stability bugs Release 3.0.0 RC1 Changes FarTopologyRefiner was split into several classes to clarify and focus the API. Interpolation of Vertex and Varying primvars in a single pass is no longer supported. The Osd layer was largely refactored. Previous 2.x Release Notes Previous releases Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_notes.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Overview of Release 3.5", │ │ │ │ │ - "text": "Overview of Release 3.5 Overview of Release 3.5 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Simplified Surface Evaluation Tessellation Patterns API Additions New classes in namespace Bfr Additions to FarTopologyLevel Additions to nested Options classes in Far Other Changes Deprecation Announcements Improvements Bug Fixes New Features Simplified Surface Evaluation The new Bfr interface provides an alternative to Far and Osd for evaluating the limit surface -- treating a subdivision mesh as a piecewise parameteric surface primitive . The Bfr interface is named for Base Face Representation as all concepts and classes relate to the individual faces of the original unrefined mesh, i.e. its base faces. Each base face has a piece of limit surface associated with it BfrSurface that is parameterized BfrParameterization and so can be evaluated and tessellated The limit surface for each face can be identified and evaluated independently of any other faces without any global pre-processing of a connected mesh. The resulting evaluation interface is much simpler, more flexible and more scalable than those assembled with the table-based class in Far -- providing a preferable alternative for many CPU-based use cases though not all. See the Bfr Overview documentation for more details. Tessellation Patterns In addition to evaluation, the Bfr interface includes a Tessellation class that provides tessellation patterns for all faces of a base mesh. A Tessellation does not encapsulate the entire tessellation process but simply provides topological patterns to assemble such a process. All faces of a mesh have a Parameterization which can be used to define a Tessellation with the specification of one or more tessellation rates. A single tessellation rate defines simple uniform tessellations while tessellation rates for each edge provide more complex non-uniform patterns A small set of options is also available to define the resulting patterns e.g. the preservation of quad faces with quad-based subdivision schemes above left and center and to generate its output in a more favorable form. Tessellation patterns do not support the full flexibility of typical hardware tessellation e.g. no fractional tessellation but do provide some useful alternatives to hardware tessellation e.g. the quad preservation previously noted, and more uniform triangles for triangular patches above right . The Tessellation class is also completely independent of evaluation in Bfr , and so can be used with any other evaluation interface. See the Tessellation subsection of the Bfr Overview for more details. API Additions See associated Doxygen for full details. New classes in namespace Bfr class Parameterization class Surface class SurfaceFactory class SurfaceFactoryCache class SurfaceFactoryMeshAdapter class RefinerSurfaceFactory class Tessellation Additions to FarTopologyLevel TopologyLevelIsVertexCorner TopologyLevelIsVertexRegular TopologyLevelIsVertexInfSharp TopologyLevelIsVertexSemiSharp TopologyLevelIsEdgeInfSharp TopologyLevelIsEdgeSemiSharp Additions to nested Options classes in Far PatchTableFactoryOptionsSetMaxIsolationLevel TopologyRefinerUniformOptionsSetRefinementLevel TopologyRefinerAdaptiveOptionsSetMaxIsolationLevel TopologyRefinerAdaptiveOptionsSetMaxSecondaryLevel Other Changes Deprecation Announcements Hbr is deprecated and will be removed from subsequent releases Improvements Suppression of GCC compiler warnings GitHub 1253, 1254, 1270 Additional methods for FarTopologyLevel GitHub 1227, 1255 Improved mixed partial derivative at Gregory patch corners GitHub 1252 Minor improvements to Far tutorials GitHub 1226, 1241 Added CMake config GitHub 1242 Updated CMake minimum version to 3.12 GitHub 1237, 1261 Updated documentation build scripts for Python 3 1265, 1266 Updated stringify build tool for improved cross compilation support GitHub 1267 Added NO_MACOS_FRAMEWORKS build option GitHub 1238 Updated Azure pipelines agents for Unbuntu and macOS GitHub 1247, 1256 Removed obsolete AppVeyor and Travis CI scripts GitHub 1259 Bug Fixes Cache active program for OsdGLComputeEvaluator GitHub 1244 Fixed member initialization warnings in OsdD3D11ComputeEvaluator GitHub 1239 Fixed GLSL shader source to remove storage qualifiers from struct members GitHub 1271 Fixed use of CMake variables for Apple builds GitHub 1235 Fixed build errors when using OpenGL without GLFW GitHub 1257 Fixed links to embedded videos GitHub 1231 Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.5 Overview of Release 3.5 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Simplified Surface Evaluation Tessellation Patterns API Additions New classes in namespace Bfr Additions to FarTopologyLevel Additions to nested Options classes in Far Other Changes Deprecation Announcements Improvements Bug Fixes New Features Simplified Surface Evaluation The new Bfr interface provides an alternative to Far and Osd for evaluating the limit surface -- treating a subdivision mesh as a piecewise parameteric surface primitive . The Bfr interface is named for Base Face Representation as all concepts and classes relate to the individual faces of the original unrefined mesh, i.e. its base faces. Each base face has a piece of limit surface associated with it BfrSurface that is parameterized BfrParameterization and so can be evaluated and tessellated The limit surface for each face can be identified and evaluated independently of any other faces without any global pre-processing of a connected mesh. The resulting evaluation interface is much simpler, more flexible and more scalable than those assembled with the table-based class in Far -- providing a preferable alternative for many CPU-based use cases though not all. See the Bfr Overview documentation for more details. Tessellation Patterns In addition to evaluation, the Bfr interface includes a Tessellation class that provides tessellation patterns for all faces of a base mesh. A Tessellation does not encapsulate the entire tessellation process but simply provides topological patterns to assemble such a process. All faces of a mesh have a Parameterization which can be used to define a Tessellation with the specification of one or more tessellation rates. A single tessellation rate defines simple uniform tessellations while tessellation rates for each edge provide more complex non-uniform patterns A small set of options is also available to define the resulting patterns e.g. the preservation of quad faces with quad-based subdivision schemes above left and center and to generate its output in a more favorable form. Tessellation patterns do not support the full flexibility of typical hardware tessellation e.g. no fractional tessellation but do provide some useful alternatives to hardware tessellation e.g. the quad preservation previously noted, and more uniform triangles for triangular patches above right . The Tessellation class is also completely independent of evaluation in Bfr , and so can be used with any other evaluation interface. See the Tessellation subsection of the Bfr Overview for more details. API Additions See associated Doxygen for full details. New classes in namespace Bfr class Parameterization class Surface class SurfaceFactory class SurfaceFactoryCache class SurfaceFactoryMeshAdapter class RefinerSurfaceFactory class Tessellation Additions to FarTopologyLevel TopologyLevelIsVertexCorner TopologyLevelIsVertexRegular TopologyLevelIsVertexInfSharp TopologyLevelIsVertexSemiSharp TopologyLevelIsEdgeInfSharp TopologyLevelIsEdgeSemiSharp Additions to nested Options classes in Far PatchTableFactoryOptionsSetMaxIsolationLevel TopologyRefinerUniformOptionsSetRefinementLevel TopologyRefinerAdaptiveOptionsSetMaxIsolationLevel TopologyRefinerAdaptiveOptionsSetMaxSecondaryLevel Other Changes Deprecation Announcements Hbr is deprecated and will be removed from subsequent releases Improvements Suppression of GCC compiler warnings GitHub 1253, 1254, 1270 Additional methods for FarTopologyLevel GitHub 1227, 1255 Improved mixed partial derivative at Gregory patch corners GitHub 1252 Minor improvements to Far tutorials GitHub 1226, 1241 Added CMake config GitHub 1242 Updated CMake minimum version to 3.12 GitHub 1237, 1261 Updated documentation build scripts for Python 3 1265, 1266 Updated stringify build tool for improved cross compilation support GitHub 1267 Added NO_MACOS_FRAMEWORKS build option GitHub 1238 Updated Azure pipelines agents for Unbuntu and macOS GitHub 1247, 1256 Removed obsolete AppVeyor and Travis CI scripts GitHub 1259 Bug Fixes Cache active program for OsdGLComputeEvaluator GitHub 1244 Fixed member initialization warnings in OsdD3D11ComputeEvaluator GitHub 1239 Fixed GLSL shader source to remove storage qualifiers from struct members GitHub 1271 Fixed use of CMake variables for Apple builds GitHub 1235 Fixed build errors when using OpenGL without GLFW GitHub 1257 Fixed links to embedded videos GitHub 1231 Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_35.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Overview of Release 3.4", │ │ │ │ │ - "text": "Overview of Release 3.4 Overview of Release 3.4 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Triangular Patches for Loop Subdivision Major Improvements to Introductory Documentation Sparse Patch Tables Support for Double Precision in Far API Additions Far extensions for triangular patches Construction and refinement of topology Construction and interface of FarPatchTable Construction and use of Far stencil tables Far class templates for double precision Far member functions converted to templates for double precision OsdMeshBits OsdPatchArray Osd extensions for patch evaluation common to all shaders Osd extensions for patch tessellation common to all shaders Other Changes Improvements Bug Fixes New Features Triangular Patches for Loop Subdivision Support for the drawing and evaluation of Loop subdivision meshes with triangular patches was added. This includes the full set of Far and Osd interfaces for both evaluation and drawing. The feature set supported for Loop subdivision now matches that of Catmark, including creases, face-varying patches, non-manifold topology, etc. The long standing requirement that Loop meshes be purely triangular remains, as Loop subdivision is not defined for non-triangular faces. And as is the case with the use of the Catmark scheme, application of Loop subdivision to dense, poorly modeled meshes may lead to unexpectedly poor performance andor surface quality. The patch representation used for Loop subdivision is intended to exactly match the underlying limit surface where regular, and so uses quartic triangular Box-splines. This is in contrast to approaches that use simpler patches to approximate the Loop limit surface everywhere. As with Catmark, Gregory patches are used to approximate irregular areas. Though other choices are available that compromise surface quality in favor of improved performance, they may be less effective with Loop than they are with Catmark. Major Improvements to Introductory Documentation A significant rewrite of the Subdivision Surfaces page is included in this release. The new documentation emphasizes the piecewise parametric surface nature of subdivision surfaces and the implications of supporting arbitary topology . As a true surface primitive, the distinction between the control points and the limit surface and the corresponding operations of subdivision and tessellation that are applied to them is made clear. Sparse Patch Tables Interfaces in Far for the construction of PatchTables and the required adaptive refinement have been extended to apply to an arbitrary subset of faces. This allows patches for either large meshes or meshes that may otherwise benefit from some kind of partioning e.g. areas of static and dynamic topology to be managed in an arbitrary number of groups. In the extreme, a PatchTable forming the tree of patches for a single base face can be constructed. Client data buffers for the base mesh do not need to be partitioned and base mesh topology can be shared by multiple instances of FarTopologyRefiner used to create corresponding instances of FarPatchTables. See the new Far tutorial 5.2 for a simple example. Support for Double Precision in Far Classes and interfaces in Far have been adapted to allow support for double precision via templates parameterized for float or double. Class templates for major classes such as FarStencilTable have been introduced and the original classes preserved for compatibility. Other classes such as FarPatchTable have had methods overloaded or replaced with template functions to support both single and double precision. Internally, all use of floating point constants and math library functions has been adapted to maximize accuracy appropriate to the precision of the template instance. Interfaces in Osd have not been extended. The extensions in Far provide the basis for extensions in Osd, but demand is limited. For those benefiting from such Osd extensions, contributions are welcomed. See the revised Far tutorial 5.1 that constructs a FarPatchTable for a simple example. API Additions See associated Doxygen for full details. Far extensions for triangular patches enum PatchDescriptorTypeGREGORY_TRIANGLE PatchParamNormalizeTriangle PatchParamUnnormalizeTriangle PatchParamIsTriangleRotated Construction and refinement of topology overloaded TopologyRefinerFactoryCreate extensions to TopologyRefinerRefineAdaptive Construction and interface of FarPatchTable overloaded PatchTableFactoryCreate PatchTableFactoryGetRefineAdaptiveOptions member PatchTableFactoryOptionsincludeBaseLevelIndices member PatchTableFactoryOptionsincludeFVarBaseLevelIndices member PatchTableFactoryOptionsgenerateVaryingTables member PatchTableFactoryOptionsgenerateVaryingLocalPoints member PatchTableFactoryOptionssetPatchPrecisionDouble member PatchTableFactoryOptionssetFVarPatchPrecisionDouble PatchTableGetFVarPatchDescriptorRegular PatchTableGetFVarPatchDescriptorIrregular PatchTableGetFVarValueStride Construction and use of Far stencil tables overloaded StencilTableUpdateValues enum LimitStencilTableFactoryMode member LimitStencilTableFactoryOptionsinterpolationMode member LimitStencilTableFactoryOptionsfvarChannel Far class templates for double precision class StencilReal class StencilTableReal class StencilTableFactoryReal class LimitStencilReal class LimitStencilTableReal class LimitStencilTableFactoryReal class PrimvarRefinerReal Far member functions converted to templates for double precision PatchParamNormalize PatchParamUnnormalize PatchTableEvaluateBasis PatchTableEvaluateBasisVarying PatchTableEvaluateBasisFaceVarying PatchTableGetLocalPointStencilTable PatchTableGetLocalPointVaryingStencilTable PatchTableGetLocalPointFaceVaryingStencilTable PatchMapFindPatch OsdMeshBits enumeration MeshEndCapBilinearBasis OsdPatchArray GetDescriptorRegular GetDescriptorIrregular GetPatchTyperRegular GetPatchTyperIrregular GetStride Osd extensions for patch evaluation common to all shaders struct OsdPatchArray and OsdPatchArrayInit struct OsdPatchCoord and OsdPatchCoordInit struct OsdPatchParam and OsdPatchParamInit OsdPatchParamGetFaceId OsdPatchParamGetU OsdPatchParamGetV OsdPatchParamGetTransition OsdPatchParamGetBoundary OsdPatchParamGetNonQuadRoot OsdPatchParamGetDepth OsdPatchParamGetParamFraction OsdPatchParamIsRegular OsdPatchParamIsTriangleRotated OsdPatchParamNormalize OsdPatchParamUnnormalize OsdPatchParamNormalizeTriangle OsdPatchParamUnnormalizeTriangle OsdEvaluatePatchBasisNormalized OsdEvaluatePatchBasis Osd extensions for patch tessellation common to all shaders OsdInterpolatePatchCoordTriangle OsdComputePerPatchVertexBoxSplineTriangle OsdEvalPatchBezierTriangle OsdEvalPatchGregoryTriangle OsdGetTessLevelsUniformTriangle OsdEvalPatchBezierTessLevels OsdEvalPatchBezierTriangleTessLevels OsdGetTessParameterizationTriangle Other Changes Improvements Added new build script GitHub 1068 Added support for newer DirectX SDKs GitHub 1066 Patch arrays extended to support combined regular and irregular types GitHub 995 FarPatchTables and adaptive refinement supported for Bilinear scheme GitHub 1035 New FarPatchTableFactory method to determine adaptive refinement options GitHub 1047 New FarPatchTableFactory options to align primvar buffers of uniform tables GitHub 986 FarStencilTableUpdateValues overloaded to support separate base buffer GitHub 1011 FarLimitStencilTableFactory updated to create face-varying tables GitHub 1012 Regular patches on boundaries no longer require additional isolation GitHub 1025 Inclusion of OpenSubdiv header files in source code now consistent GitHub 767 Re-organization of and additions to Far tutorials GitHub 1083 Examples now use common command-line conventions and parsing GitHub 1056 Bug Fixes Fixed FarPrimvarRefiner internal limitFVar prototype GitHub 979 Fixed FarStencilTable append when base StencilTable empty GitHub 982 Patches around non-manifold vertices now free of cracks GitHub 1013 Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.4 Overview of Release 3.4 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Triangular Patches for Loop Subdivision Major Improvements to Introductory Documentation Sparse Patch Tables Support for Double Precision in Far API Additions Far extensions for triangular patches Construction and refinement of topology Construction and interface of FarPatchTable Construction and use of Far stencil tables Far class templates for double precision Far member functions converted to templates for double precision OsdMeshBits OsdPatchArray Osd extensions for patch evaluation common to all shaders Osd extensions for patch tessellation common to all shaders Other Changes Improvements Bug Fixes New Features Triangular Patches for Loop Subdivision Support for the drawing and evaluation of Loop subdivision meshes with triangular patches was added. This includes the full set of Far and Osd interfaces for both evaluation and drawing. The feature set supported for Loop subdivision now matches that of Catmark, including creases, face-varying patches, non-manifold topology, etc. The long standing requirement that Loop meshes be purely triangular remains, as Loop subdivision is not defined for non-triangular faces. And as is the case with the use of the Catmark scheme, application of Loop subdivision to dense, poorly modeled meshes may lead to unexpectedly poor performance andor surface quality. The patch representation used for Loop subdivision is intended to exactly match the underlying limit surface where regular, and so uses quartic triangular Box-splines. This is in contrast to approaches that use simpler patches to approximate the Loop limit surface everywhere. As with Catmark, Gregory patches are used to approximate irregular areas. Though other choices are available that compromise surface quality in favor of improved performance, they may be less effective with Loop than they are with Catmark. Major Improvements to Introductory Documentation A significant rewrite of the Subdivision Surfaces page is included in this release. The new documentation emphasizes the piecewise parametric surface nature of subdivision surfaces and the implications of supporting arbitary topology . As a true surface primitive, the distinction between the control points and the limit surface and the corresponding operations of subdivision and tessellation that are applied to them is made clear. Sparse Patch Tables Interfaces in Far for the construction of PatchTables and the required adaptive refinement have been extended to apply to an arbitrary subset of faces. This allows patches for either large meshes or meshes that may otherwise benefit from some kind of partioning e.g. areas of static and dynamic topology to be managed in an arbitrary number of groups. In the extreme, a PatchTable forming the tree of patches for a single base face can be constructed. Client data buffers for the base mesh do not need to be partitioned and base mesh topology can be shared by multiple instances of FarTopologyRefiner used to create corresponding instances of FarPatchTables. See the new Far tutorial 5.2 for a simple example. Support for Double Precision in Far Classes and interfaces in Far have been adapted to allow support for double precision via templates parameterized for float or double. Class templates for major classes such as FarStencilTable have been introduced and the original classes preserved for compatibility. Other classes such as FarPatchTable have had methods overloaded or replaced with template functions to support both single and double precision. Internally, all use of floating point constants and math library functions has been adapted to maximize accuracy appropriate to the precision of the template instance. Interfaces in Osd have not been extended. The extensions in Far provide the basis for extensions in Osd, but demand is limited. For those benefiting from such Osd extensions, contributions are welcomed. See the revised Far tutorial 5.1 that constructs a FarPatchTable for a simple example. API Additions See associated Doxygen for full details. Far extensions for triangular patches enum PatchDescriptorTypeGREGORY_TRIANGLE PatchParamNormalizeTriangle PatchParamUnnormalizeTriangle PatchParamIsTriangleRotated Construction and refinement of topology overloaded TopologyRefinerFactoryCreate extensions to TopologyRefinerRefineAdaptive Construction and interface of FarPatchTable overloaded PatchTableFactoryCreate PatchTableFactoryGetRefineAdaptiveOptions member PatchTableFactoryOptionsincludeBaseLevelIndices member PatchTableFactoryOptionsincludeFVarBaseLevelIndices member PatchTableFactoryOptionsgenerateVaryingTables member PatchTableFactoryOptionsgenerateVaryingLocalPoints member PatchTableFactoryOptionssetPatchPrecisionDouble member PatchTableFactoryOptionssetFVarPatchPrecisionDouble PatchTableGetFVarPatchDescriptorRegular PatchTableGetFVarPatchDescriptorIrregular PatchTableGetFVarValueStride Construction and use of Far stencil tables overloaded StencilTableUpdateValues enum LimitStencilTableFactoryMode member LimitStencilTableFactoryOptionsinterpolationMode member LimitStencilTableFactoryOptionsfvarChannel Far class templates for double precision class StencilReal class StencilTableReal class StencilTableFactoryReal class LimitStencilReal class LimitStencilTableReal class LimitStencilTableFactoryReal class PrimvarRefinerReal Far member functions converted to templates for double precision PatchParamNormalize PatchParamUnnormalize PatchTableEvaluateBasis PatchTableEvaluateBasisVarying PatchTableEvaluateBasisFaceVarying PatchTableGetLocalPointStencilTable PatchTableGetLocalPointVaryingStencilTable PatchTableGetLocalPointFaceVaryingStencilTable PatchMapFindPatch OsdMeshBits enumeration MeshEndCapBilinearBasis OsdPatchArray GetDescriptorRegular GetDescriptorIrregular GetPatchTyperRegular GetPatchTyperIrregular GetStride Osd extensions for patch evaluation common to all shaders struct OsdPatchArray and OsdPatchArrayInit struct OsdPatchCoord and OsdPatchCoordInit struct OsdPatchParam and OsdPatchParamInit OsdPatchParamGetFaceId OsdPatchParamGetU OsdPatchParamGetV OsdPatchParamGetTransition OsdPatchParamGetBoundary OsdPatchParamGetNonQuadRoot OsdPatchParamGetDepth OsdPatchParamGetParamFraction OsdPatchParamIsRegular OsdPatchParamIsTriangleRotated OsdPatchParamNormalize OsdPatchParamUnnormalize OsdPatchParamNormalizeTriangle OsdPatchParamUnnormalizeTriangle OsdEvaluatePatchBasisNormalized OsdEvaluatePatchBasis Osd extensions for patch tessellation common to all shaders OsdInterpolatePatchCoordTriangle OsdComputePerPatchVertexBoxSplineTriangle OsdEvalPatchBezierTriangle OsdEvalPatchGregoryTriangle OsdGetTessLevelsUniformTriangle OsdEvalPatchBezierTessLevels OsdEvalPatchBezierTriangleTessLevels OsdGetTessParameterizationTriangle Other Changes Improvements Added new build script GitHub 1068 Added support for newer DirectX SDKs GitHub 1066 Patch arrays extended to support combined regular and irregular types GitHub 995 FarPatchTables and adaptive refinement supported for Bilinear scheme GitHub 1035 New FarPatchTableFactory method to determine adaptive refinement options GitHub 1047 New FarPatchTableFactory options to align primvar buffers of uniform tables GitHub 986 FarStencilTableUpdateValues overloaded to support separate base buffer GitHub 1011 FarLimitStencilTableFactory updated to create face-varying tables GitHub 1012 Regular patches on boundaries no longer require additional isolation GitHub 1025 Inclusion of OpenSubdiv header files in source code now consistent GitHub 767 Re-organization of and additions to Far tutorials GitHub 1083 Examples now use common command-line conventions and parsing GitHub 1056 Bug Fixes Fixed FarPrimvarRefiner internal limitFVar prototype GitHub 979 Fixed FarStencilTable append when base StencilTable empty GitHub 982 Patches around non-manifold vertices now free of cracks GitHub 1013 Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_34.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Overview of Release 3.3", │ │ │ │ │ - "text": "Overview of Release 3.3 Overview of Release 3.3 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Metal Compute and Tessellation API Additions OsdMTLContext OsdMTLComputeEvaluator OsdMTLStencilTable OsdMTLMeshInterface OsdMTLPatchTable OsdMTLLegacyGregoryPatchTable OsdPatchShaderSource OsdCPUMTLVertexBuffer Other Changes Improvements New Features Metal Compute and Tessellation Added support for drawing and evaluation using Apples Metal API for high performance and low-overhead GPU access. This includes the full set of Osd interfaces needed to draw using Metal graphics rendering including tessellation shaders and evaluate stencils and patch tables using Metal compute processing. Also includes an example mtlViewer that can be built to run on either macOS or iOS. Metal Graphics Rendering with Tessellation Metal Patch Evaluation using Compute Processing API Additions See associated Doxygen for full details. OsdMTLContext device and commandQueue member data OsdMTLComputeEvaluator Create EvalStencils EvalPatches EvalPatchesVarying EvalPatchesFaceVarying Compile Synchronize OsdMTLStencilTable Create GetSizesBuffer GetIndicesBuffer GetDuWeightsBuffer GetDvWeightsBuffer GetDuuWeightsBuffer GetDuvWeightsBuffer GetDvvWeightsBuffer GetNumStencils OsdMTLMeshInterface GetNumVertices GetMaxValence UpdateVertexBuffer UpdateVaryingBuffer Refine Synchronize GetPatchTable GetFarPatchTable BindVertexBuffer BindVaryingBuffer OsdMTLPatchTable Create GetPatchArrays GetPatchIndexBuffer GetPatchParamBuffer GetVaryingPatchArrays GetVaryingPatchIndexBuffer GetNumFVarChannels GetFVarPatchArrays GetFVarPatchIndexBuffer GetFVarPatchParamBuffer OsdMTLLegacyGregoryPatchTable UpdateVertexBuffer GetVertexBuffer GetVertexValenceBuffer GetQuadOffsetsBuffer OsdPatchShaderSource GetCommonShaderSource GetPatchBasisShaderSource GetVertexShaderSource GetHullShaderSource GetDomainShaderSource OsdCPUMTLVertexBuffer Create UpdateData GetNumElements GetNumVertices BindCpuBuffer BindMTLBuffer BindVBO Other Changes Improvements Fixed several instances of local variable shadowing that could cause build warnings Updated continuous-integration build scripts and added testing on macOS Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.3 Overview of Release 3.3 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Metal Compute and Tessellation API Additions OsdMTLContext OsdMTLComputeEvaluator OsdMTLStencilTable OsdMTLMeshInterface OsdMTLPatchTable OsdMTLLegacyGregoryPatchTable OsdPatchShaderSource OsdCPUMTLVertexBuffer Other Changes Improvements New Features Metal Compute and Tessellation Added support for drawing and evaluation using Apples Metal API for high performance and low-overhead GPU access. This includes the full set of Osd interfaces needed to draw using Metal graphics rendering including tessellation shaders and evaluate stencils and patch tables using Metal compute processing. Also includes an example mtlViewer that can be built to run on either macOS or iOS. Metal Graphics Rendering with Tessellation Metal Patch Evaluation using Compute Processing API Additions See associated Doxygen for full details. OsdMTLContext device and commandQueue member data OsdMTLComputeEvaluator Create EvalStencils EvalPatches EvalPatchesVarying EvalPatchesFaceVarying Compile Synchronize OsdMTLStencilTable Create GetSizesBuffer GetIndicesBuffer GetDuWeightsBuffer GetDvWeightsBuffer GetDuuWeightsBuffer GetDuvWeightsBuffer GetDvvWeightsBuffer GetNumStencils OsdMTLMeshInterface GetNumVertices GetMaxValence UpdateVertexBuffer UpdateVaryingBuffer Refine Synchronize GetPatchTable GetFarPatchTable BindVertexBuffer BindVaryingBuffer OsdMTLPatchTable Create GetPatchArrays GetPatchIndexBuffer GetPatchParamBuffer GetVaryingPatchArrays GetVaryingPatchIndexBuffer GetNumFVarChannels GetFVarPatchArrays GetFVarPatchIndexBuffer GetFVarPatchParamBuffer OsdMTLLegacyGregoryPatchTable UpdateVertexBuffer GetVertexBuffer GetVertexValenceBuffer GetQuadOffsetsBuffer OsdPatchShaderSource GetCommonShaderSource GetPatchBasisShaderSource GetVertexShaderSource GetHullShaderSource GetDomainShaderSource OsdCPUMTLVertexBuffer Create UpdateData GetNumElements GetNumVertices BindCpuBuffer BindMTLBuffer BindVBO Other Changes Improvements Fixed several instances of local variable shadowing that could cause build warnings Updated continuous-integration build scripts and added testing on macOS Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_33.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Overview of Release 3.2", │ │ │ │ │ - "text": "Overview of Release 3.2 Overview of Release 3.2 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Face-Varying Stencil Evaluation 1st and 2nd Derivative Evaluation Smooth Corner Patch API Additions OsdCpuEvaluator, GLComputeEvaluator, etc OsdMesh OsdMeshBits FarPatchTableFactoryOptions FarStencilTableFactory FarStencilTableFactoryOptions Other Changes Improvements Bug Fixes New Features Face-Varying Stencil Evaluation Face-Varying primvar values may now be refined using stencil tables. The stencil table for a face-varying channel is created by specifying the desired fvarChannel and setting the FarStencilTableFactoryOption interpolationMode to INTERPOLATE_FACE_VARYING when creating the stencil table. 1st and 2nd Derivative Evaluation The Osd Evaluator API has been extended to support 1st derivative and 2nd partial derivative evaluation for stencils and patches. 1st Derivative Surface Normal 2nd Derivative Surface Curvature On the left is an example of computing a surface normal at each point using the evaluated 1st derivatives, while on the right is an example of computing surface curvature at each point using the evaluated 2nd partial derivatives. Smooth Corner Patch An option has been added to disable the legacy behavior of generating a sharp-corner patch at a smooth corner. Corners which are actually sharp will continue to generate sharp-corner patches. The differences between the two methods is most apparent at low-levels of feature isolation. This feature is controlled by the generateLegacySharpCornerPatches option added to FarPatchTableFactoryOptions. Sharp Corner Patch legacy behavior Smooth Corner Patch On the left is the legacy behavior of generating sharp corner patches at smooth corners. The image on the right shows the correct smooth corner patches generated when this legacy behavior is disabled. API Additions See associated Doxygen for full details. OsdCpuEvaluator, GLComputeEvaluator, etc Create EvalStencils EvalPatches EvalPatchesVarying EvalPatchesFaceVarying OsdMesh Create OsdMeshBits member MeshUseSmoothCornerPatch FarPatchTableFactoryOptions member generateLegacySharpCornerPatches FarStencilTableFactory enumeration ModeINTERPOLATE_FACE_VARYING AppendLocalPointStencilTableFaceVarying FarStencilTableFactoryOptions member fvarChannel Other Changes Improvements Corrected numerous spelling errors in doxygen comments Updated glFVarViewer with improved error detection and command line parsing Added option to build using MSVC with static CRT Bug Fixes Fixed a double delete of GL program in OsdGLComputeEvaluator Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.2 Overview of Release 3.2 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Face-Varying Stencil Evaluation 1st and 2nd Derivative Evaluation Smooth Corner Patch API Additions OsdCpuEvaluator, GLComputeEvaluator, etc OsdMesh OsdMeshBits FarPatchTableFactoryOptions FarStencilTableFactory FarStencilTableFactoryOptions Other Changes Improvements Bug Fixes New Features Face-Varying Stencil Evaluation Face-Varying primvar values may now be refined using stencil tables. The stencil table for a face-varying channel is created by specifying the desired fvarChannel and setting the FarStencilTableFactoryOption interpolationMode to INTERPOLATE_FACE_VARYING when creating the stencil table. 1st and 2nd Derivative Evaluation The Osd Evaluator API has been extended to support 1st derivative and 2nd partial derivative evaluation for stencils and patches. 1st Derivative Surface Normal 2nd Derivative Surface Curvature On the left is an example of computing a surface normal at each point using the evaluated 1st derivatives, while on the right is an example of computing surface curvature at each point using the evaluated 2nd partial derivatives. Smooth Corner Patch An option has been added to disable the legacy behavior of generating a sharp-corner patch at a smooth corner. Corners which are actually sharp will continue to generate sharp-corner patches. The differences between the two methods is most apparent at low-levels of feature isolation. This feature is controlled by the generateLegacySharpCornerPatches option added to FarPatchTableFactoryOptions. Sharp Corner Patch legacy behavior Smooth Corner Patch On the left is the legacy behavior of generating sharp corner patches at smooth corners. The image on the right shows the correct smooth corner patches generated when this legacy behavior is disabled. API Additions See associated Doxygen for full details. OsdCpuEvaluator, GLComputeEvaluator, etc Create EvalStencils EvalPatches EvalPatchesVarying EvalPatchesFaceVarying OsdMesh Create OsdMeshBits member MeshUseSmoothCornerPatch FarPatchTableFactoryOptions member generateLegacySharpCornerPatches FarStencilTableFactory enumeration ModeINTERPOLATE_FACE_VARYING AppendLocalPointStencilTableFaceVarying FarStencilTableFactoryOptions member fvarChannel Other Changes Improvements Corrected numerous spelling errors in doxygen comments Updated glFVarViewer with improved error detection and command line parsing Added option to build using MSVC with static CRT Bug Fixes Fixed a double delete of GL program in OsdGLComputeEvaluator Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_32.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Overview of Release 3.1", │ │ │ │ │ - "text": "Overview of Release 3.1 Overview of Release 3.1 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Bicubic Face-Varying Patches Varying and Face-Varying Evaluation Second Order Derivative Evaluation Separate Levels of Feature Isolation Sharp Patches for Infinitely Sharp Features API Additions OsdCpuEvaluator, GLComputeEvaluator, etc OsdCpuPatchTable, GLPatchTable, etc OsdMeshBits OsdPatchParam OsdGLSLPatchShaderSource, HLSLPatchShaderSource FarLimitStencil FarLimitStencilTable FarLimitStencilTableFactoryOptions FarPatchParam FarPatchTable FarPatchTableFactoryOptions FarTopologyLevel FarTopologyRefinerAdaptiveOptions Other Changes Improvements Bug Fixes New Features Bicubic Face-Varying Patches The motivation for this feature is to improve drawing and evaluation of face-varying primvar values for all face-varying interpolation options . A common use of non-linear face-varying data is to capture a UV projection on the surface. The following example shows a simple shape with the face-varying interpolation option assigned to a non-linear choice to achieve the desired projection in this case FVAR_LINEAR_NONE Linear Face-Varying Patches Bicubic Face-Varying Patches The result on the left shows the old linearly interpolated patches, which ignores any non-linear settings. The result on the right shows the new use of bicubic face-varying patches to accurately interpolate the desired projection. Generation of a full face-varying patch representation can be enabled using a new option in FarPatchTableFactoryOptions. Additionally, topological refinement can be improved to consider fvar channel topology using a new option in FarTopologyRefinerAdaptiveOptions. See the API additions below and their associated Doxygen text for more details. Evaluation of patch basis weights for all patch types as been added to the GPU shader source provided by OsdGLSLPatchShaderSource, and OsdHLSLPatchShaderSource. Use of non-linear face-varying patches increases the storage size of the patch table and may also require additional data access and computation while drawing. Varying and Face-Varying Evaluation This feature extends existing evaluation methods to support evaluation of varying and face-varying primvar data at arbitrary limit surface locations. Varying Primvar Evaluation Face-Varying Primvar Evaluation The image on the left shows evaluation of varying primvar values and the image on the right shows evaluation of face-varying primvar values. The EvaluateBasis API of FarPatchTable has been extended as well as the OSD Evaluator API. Second Order Derivative Evaluation This feature extends the FarLimitStencilTable and FarPatchTable interfaces to support evaluation of 2nd order partial derivatives. The generation of derivative values for FarLimitStencilTable is controlled by new options that can be specified when creating the stencil table. Additionally, the implementation exposes a more accurate method to compute derivatives for Gregory basis patches. This can be enabled using the CMake configuration and compile time definition OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES. Separate Levels of Feature Isolation The primary motivation for this feature is to reduce the number of patches generated by adaptive refinement when they can be adequately represented at a lower level. A single level of isolation must be as high as the greatest semi-sharp feature to properly resolve the shape of that feature. That high isolation level generates many unnecessary patches for smooth extra-ordinary vertices. In the following example, a single semi-sharp vertex is refined to level 5 Single Isolation Level 5 Primary Level 5, Secondary Level 2 Single isolation to level 5 on the left results in 312 patches. The right shows the semi-sharp feature isolated to 5, but with the new secondary level set to 2, the number of patches is reduced to 123. The second specified level of adaptive refinement is used to halt isolation for features that typically do not require the specified maximum. These include interior and boundary extra-ordinary vertices and those infinitely sharp patches that correspond to boundary extra-ordinary patches. The secondary level is available as a new option in FarTopologyRefinerAdaptiveOptions. Sharp Patches for Infinitely Sharp Features The motivation for sharp patches is to accurately represent the limit surface of infinitely sharp features, which otherwise can only be approximated by very high levels of adaptive refinement, resulting in many unnecessary patches. The true limit surface for regular faces along an infinitely sharp crease is a regular B-Spline patch -- the same as regular faces along a boundary. Similarly, the limit surface for faces around an extra-ordinary vertex on an infinitely sharp crease is the same as that of faces around an extra-ordinary vertex on a boundary. So these patches are identified and isolated to the same degree -- the regular patches as soon as possible, and the irregular patches to the depth specified. Consider the following regressionshapecatmark_cube_creases2 Level 5 without Sharp Patches Level 5 with Sharp Patches Level 2 with Sharp Patches Without use of sharp patches on the left, isolating to level 5 generates 1764 patches and does still not capture the sharp edges. With sharp patches in the center, isolating to the same degree level 5 reduces the number of patches to 96 and captures the sharp edges. The sharp features can be captured at a lower degree with comparable accuracy as illustrated on the right where isolation to level 2 further reduces the number of patches to 42. The use of infinitely sharp patches can be enabled both at a high level as an new option to OsdMesh, or more directly when adaptively refining or construction the patch tables in FarTopologyRefinerAdaptiveOptions and FarPatchTableFactoryOptions. Given the improved accuracy and reduced patches by the use of simple regular patches, we would prefer that this be the default behavior, but it was made an explicit option in order to avoid disrupting existing usage. In a future major release this feature will hopefully be the norm. API Additions See associated Doxygen for full details. OsdCpuEvaluator, GLComputeEvaluator, etc EvalPatchesVarying EvalPatchesFaceVarying OsdCpuPatchTable, GLPatchTable, etc GetFVarPatchArrayBuffer GetFVarPatchIndexBuffer GetFVarPatchIndexSize GetFVarPatchParamBuffer GetFVarPatchParamSize GetNumFVarChannels GetVaryingPatchArrayBuffer GetVaryingPatchIndexBuffer GetVaryingPatchIndexSize OsdMeshBits member MeshFVarAdaptive member MeshUseInfSharpPatch OsdPatchParam IsRegular Unnormalize extensions to Set OsdGLSLPatchShaderSource, HLSLPatchShaderSource GetPatchBasisShaderSource FarLimitStencil GetDuuWeights GetDuvWeights GetDvvWeights extensions to LimitStencil FarLimitStencilTable GetDuuWeights GetDuvWeights GetDvvWeights Update2ndDerivs extensions to LimitStencilTable FarLimitStencilTableFactoryOptions member generate1stDerivatives member generate1stDerivatives extensions to LimitTableStencilFactoryCreate FarPatchParam IsRegular Unnormalize extensions to Set FarPatchTable ComputeLocalPointValuesFaceVarying ComputeLocalPointValuesVarying GetFVarPatchDescriptor GetFVarPatchParam GetNumLocalPointsFaceVarying GetNumLocalPointsVarying GetPatchArrayVaryingVertices GetPatchArrayFVarPatchParam GetPatchArrayFVarValues GetPatchFVarPatchParam GetPatchVaryingVertices GetVaryingPatchDescriptor GetVaryingVertices EvaluateBasisFaceVarying EvaluateBasisVarying extensions to EvaluateBasis FarPatchTableFactoryOptions member useInfSharpPatch member genenerateFVarLegacyLinearPatches FarTopologyLevel DoesEdgeFVarTopologyMatch DoesFaceFVarTopologyMatch DoesVertexFVarTopologyMatch IsEdgeBoundary IsEdgeNonManifold IsVertexBoundary IsVertexNonManifold FarTopologyRefinerAdaptiveOptions member secondaryLevel member useInfSharpPatch member considerFVarChannels Other Changes Improvements Enabled the use of CMakes folder feature Removed the use of iso646 alternative keywords and, or, not, etc. to improve portability Added numerical valued preprocessor directives OPENSUBDIV_VERSION_MAJOR, etc. to opensubdivversion.h Improved documentation for FarPatchParam and added Unnormalize to complement Normalize Added additional topology queries to FarTopologyLevel Updated glFVarViewer and glEvalLimit viewer to make use of bicubic face-varying patches Updated glViewer and dxViewer to add a toggle for InfSharpPatch Updated dxPtexViewer for improved feature parity with glPtexViewer Improved far_regression to exercise shapes independent of Hbr compatibility Added support for Appveyor continuous integration testing Removed cmakeFindIlmBase Removed mayaPolySmooth example Bug Fixes Fixed Ptex version parsing and compatibility issues Fixed compatibility issues with VS2015 Fixed bug interpolating face-varying data with Bilinear scheme Fixed bug with refinement using Chaikin creasing Fixed bugs with HUD sliders in the example viewers Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.1 Overview of Release 3.1 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE New Features Bicubic Face-Varying Patches Varying and Face-Varying Evaluation Second Order Derivative Evaluation Separate Levels of Feature Isolation Sharp Patches for Infinitely Sharp Features API Additions OsdCpuEvaluator, GLComputeEvaluator, etc OsdCpuPatchTable, GLPatchTable, etc OsdMeshBits OsdPatchParam OsdGLSLPatchShaderSource, HLSLPatchShaderSource FarLimitStencil FarLimitStencilTable FarLimitStencilTableFactoryOptions FarPatchParam FarPatchTable FarPatchTableFactoryOptions FarTopologyLevel FarTopologyRefinerAdaptiveOptions Other Changes Improvements Bug Fixes New Features Bicubic Face-Varying Patches The motivation for this feature is to improve drawing and evaluation of face-varying primvar values for all face-varying interpolation options . A common use of non-linear face-varying data is to capture a UV projection on the surface. The following example shows a simple shape with the face-varying interpolation option assigned to a non-linear choice to achieve the desired projection in this case FVAR_LINEAR_NONE Linear Face-Varying Patches Bicubic Face-Varying Patches The result on the left shows the old linearly interpolated patches, which ignores any non-linear settings. The result on the right shows the new use of bicubic face-varying patches to accurately interpolate the desired projection. Generation of a full face-varying patch representation can be enabled using a new option in FarPatchTableFactoryOptions. Additionally, topological refinement can be improved to consider fvar channel topology using a new option in FarTopologyRefinerAdaptiveOptions. See the API additions below and their associated Doxygen text for more details. Evaluation of patch basis weights for all patch types as been added to the GPU shader source provided by OsdGLSLPatchShaderSource, and OsdHLSLPatchShaderSource. Use of non-linear face-varying patches increases the storage size of the patch table and may also require additional data access and computation while drawing. Varying and Face-Varying Evaluation This feature extends existing evaluation methods to support evaluation of varying and face-varying primvar data at arbitrary limit surface locations. Varying Primvar Evaluation Face-Varying Primvar Evaluation The image on the left shows evaluation of varying primvar values and the image on the right shows evaluation of face-varying primvar values. The EvaluateBasis API of FarPatchTable has been extended as well as the OSD Evaluator API. Second Order Derivative Evaluation This feature extends the FarLimitStencilTable and FarPatchTable interfaces to support evaluation of 2nd order partial derivatives. The generation of derivative values for FarLimitStencilTable is controlled by new options that can be specified when creating the stencil table. Additionally, the implementation exposes a more accurate method to compute derivatives for Gregory basis patches. This can be enabled using the CMake configuration and compile time definition OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES. Separate Levels of Feature Isolation The primary motivation for this feature is to reduce the number of patches generated by adaptive refinement when they can be adequately represented at a lower level. A single level of isolation must be as high as the greatest semi-sharp feature to properly resolve the shape of that feature. That high isolation level generates many unnecessary patches for smooth extra-ordinary vertices. In the following example, a single semi-sharp vertex is refined to level 5 Single Isolation Level 5 Primary Level 5, Secondary Level 2 Single isolation to level 5 on the left results in 312 patches. The right shows the semi-sharp feature isolated to 5, but with the new secondary level set to 2, the number of patches is reduced to 123. The second specified level of adaptive refinement is used to halt isolation for features that typically do not require the specified maximum. These include interior and boundary extra-ordinary vertices and those infinitely sharp patches that correspond to boundary extra-ordinary patches. The secondary level is available as a new option in FarTopologyRefinerAdaptiveOptions. Sharp Patches for Infinitely Sharp Features The motivation for sharp patches is to accurately represent the limit surface of infinitely sharp features, which otherwise can only be approximated by very high levels of adaptive refinement, resulting in many unnecessary patches. The true limit surface for regular faces along an infinitely sharp crease is a regular B-Spline patch -- the same as regular faces along a boundary. Similarly, the limit surface for faces around an extra-ordinary vertex on an infinitely sharp crease is the same as that of faces around an extra-ordinary vertex on a boundary. So these patches are identified and isolated to the same degree -- the regular patches as soon as possible, and the irregular patches to the depth specified. Consider the following regressionshapecatmark_cube_creases2 Level 5 without Sharp Patches Level 5 with Sharp Patches Level 2 with Sharp Patches Without use of sharp patches on the left, isolating to level 5 generates 1764 patches and does still not capture the sharp edges. With sharp patches in the center, isolating to the same degree level 5 reduces the number of patches to 96 and captures the sharp edges. The sharp features can be captured at a lower degree with comparable accuracy as illustrated on the right where isolation to level 2 further reduces the number of patches to 42. The use of infinitely sharp patches can be enabled both at a high level as an new option to OsdMesh, or more directly when adaptively refining or construction the patch tables in FarTopologyRefinerAdaptiveOptions and FarPatchTableFactoryOptions. Given the improved accuracy and reduced patches by the use of simple regular patches, we would prefer that this be the default behavior, but it was made an explicit option in order to avoid disrupting existing usage. In a future major release this feature will hopefully be the norm. API Additions See associated Doxygen for full details. OsdCpuEvaluator, GLComputeEvaluator, etc EvalPatchesVarying EvalPatchesFaceVarying OsdCpuPatchTable, GLPatchTable, etc GetFVarPatchArrayBuffer GetFVarPatchIndexBuffer GetFVarPatchIndexSize GetFVarPatchParamBuffer GetFVarPatchParamSize GetNumFVarChannels GetVaryingPatchArrayBuffer GetVaryingPatchIndexBuffer GetVaryingPatchIndexSize OsdMeshBits member MeshFVarAdaptive member MeshUseInfSharpPatch OsdPatchParam IsRegular Unnormalize extensions to Set OsdGLSLPatchShaderSource, HLSLPatchShaderSource GetPatchBasisShaderSource FarLimitStencil GetDuuWeights GetDuvWeights GetDvvWeights extensions to LimitStencil FarLimitStencilTable GetDuuWeights GetDuvWeights GetDvvWeights Update2ndDerivs extensions to LimitStencilTable FarLimitStencilTableFactoryOptions member generate1stDerivatives member generate1stDerivatives extensions to LimitTableStencilFactoryCreate FarPatchParam IsRegular Unnormalize extensions to Set FarPatchTable ComputeLocalPointValuesFaceVarying ComputeLocalPointValuesVarying GetFVarPatchDescriptor GetFVarPatchParam GetNumLocalPointsFaceVarying GetNumLocalPointsVarying GetPatchArrayVaryingVertices GetPatchArrayFVarPatchParam GetPatchArrayFVarValues GetPatchFVarPatchParam GetPatchVaryingVertices GetVaryingPatchDescriptor GetVaryingVertices EvaluateBasisFaceVarying EvaluateBasisVarying extensions to EvaluateBasis FarPatchTableFactoryOptions member useInfSharpPatch member genenerateFVarLegacyLinearPatches FarTopologyLevel DoesEdgeFVarTopologyMatch DoesFaceFVarTopologyMatch DoesVertexFVarTopologyMatch IsEdgeBoundary IsEdgeNonManifold IsVertexBoundary IsVertexNonManifold FarTopologyRefinerAdaptiveOptions member secondaryLevel member useInfSharpPatch member considerFVarChannels Other Changes Improvements Enabled the use of CMakes folder feature Removed the use of iso646 alternative keywords and, or, not, etc. to improve portability Added numerical valued preprocessor directives OPENSUBDIV_VERSION_MAJOR, etc. to opensubdivversion.h Improved documentation for FarPatchParam and added Unnormalize to complement Normalize Added additional topology queries to FarTopologyLevel Updated glFVarViewer and glEvalLimit viewer to make use of bicubic face-varying patches Updated glViewer and dxViewer to add a toggle for InfSharpPatch Updated dxPtexViewer for improved feature parity with glPtexViewer Improved far_regression to exercise shapes independent of Hbr compatibility Added support for Appveyor continuous integration testing Removed cmakeFindIlmBase Removed mayaPolySmooth example Bug Fixes Fixed Ptex version parsing and compatibility issues Fixed compatibility issues with VS2015 Fixed bug interpolating face-varying data with Bilinear scheme Fixed bug with refinement using Chaikin creasing Fixed bugs with HUD sliders in the example viewers Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_31.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "Porting Guide 2.x to 3.0", │ │ │ │ │ - "text": "Porting Guide 2.x to 3.0 Porting Guide 2.x to 3.0 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Porting Guide 2.x to 3.0 Source Code Organization Hbr Layer Translation Subdivision Schemes and Options in Sdc Specifying Face Varying Topology and Options Far Layer Translation Ordering of Refined Vertices Osd Layer Translation Controller Objects ComputeContext, DrawContext EvalLimitContext OsdMesh OsdKernelBatch OsdVertex Feature Adaptive Shader Changes End Cap Strategies Changes to Subdivision Build Support for Combining 2.x and 3.0 Porting Guide 2.x to 3.0 This document is a high-level description of how to port exiting OpenSubdiv 2.x code to use OpenSubdiv 3.0. NOTE If your questions are not answered here, please contact us on the OpenSubdiv forum and we will be happy to help Source Code Organization Given the scale of functional changes that were being made to the public interface, we took the opportunity in 3.0 to update the coding style and organization -- most notably making use of namespaces for each library. Subdirectory Namespace Relevance hbr NA Historical, no longer used sdc Sdc New, low-level, public options, constants, etc. vtr Vtr New, internal use, topology representation far Far Revised, similar functionality with new API osd Osd Revised, similar functionality with new API Hbr Layer Translation Client mesh topology is now translated into an instance of FarTopologyRefiner instead of HbrMesh. OpenSubdiv 2.x OpenSubdiv 3.0 HbrMeshVTX_TYPE FarTopologyRefiner The FarTopologyRefiner is now the core representation of topology from which all other major classes in Far and Osd are constructed. It was designed to support efficient refinement uniform or sparse of a base mesh of arbitrary topology no manifold restrictions. Once constructed it can be directly refined to meet some need, or passed to other contexts that will refine it to meet their needs. In contrast to directly assembling an HbrMesh, the TopologyRefiner, like other classes in Far, requires a Factory class for its construction. One of the early goals of these factories was to allow a client to convert their existing boundary representation -- with its full topological traversal abilities -- directly into the TopologyRefiners representation. While this is now possible, this also represents the most complex construction process and is only recommended for usage where this conversion process is critical. Details on how to construct a TopologyRefiner can be found in the Far overview documentation. Additionally, documentation for FarTopologyRefinerFactoryMESH outlines the requirements, and Far tutorial 3.1 tutorialsfartutorial_3_1 provides an example of a factory for directly converting HbrMeshes to TopologyRefiners. Its worth a reminder here that FarTopologyRefiner contains only topological information which does include sharpness, since that is considered relating to subdivision topology and not the positions or other data associated with a mesh. While HbrMeshT required some definition of a vertex type T and dimensions of face-varying data, TopologyRefiner is more clearly separated from the data. So the construction of the TopologyRefiner does not involve data specification at all. Subdivision Schemes and Options in Sdc The creation of a new TopologyRefiner requires specification of a subdivision scheme and a set of options that are applicable to all schemes. With HbrMesh, the scheme was specified by declaring a static instance of a specific subclass of a subdivision object, and the options were specified with a number of methods on the different classes. Such general information about the schemes has now been encapsulated in the Sdc layer for use throughout OpenSubdiv. The subdivision scheme is now a simple enumerated type SdcSchemeType and the entire set of options that can be applied to a scheme is encapsulated in a single simple struct of flags and enumerated types SdcOptions. OpenSubdiv 2.x OpenSubdiv 3.0 HbrMeshTSetInterpolateBoundaryMethod SdcOptionsSetVtxBoundaryInterpolation HbrMeshTSetFVarInterpolateBoundaryMethod SdcOptionsSetFVarLinearInterpolation HbrSubdivisionTSetCreaseSubdivisionMethod SdcOptionsSetCreasingMethod Specifying Face Varying Topology and Options Both the way in which face varying data is associated with a mesh and the options used to control its interpolation have changed. The documentation on Compatibility with OpenSubdiv 2.x details the equivalence of interpolation options between Hbr and the new SdcOptionsFVarLinearInterpolation enum, while the section on Face Varying Interpolation illustrates their effects. Face varying data is now specified by index rather than by value, or as often stated, it is specified topologically. Just as vertices for faces are specified by indices into a potential buffer of positions, face varying values are specified by indices into a potential buffer of values. Both vertices and face varying values frequently referred to as FVarValues in the API are assigned and associated with the corners of all faces. In many cases this will simplify representation as many common geometry container formats such as Obj or Alembic specify texture coordinates the same way. For other cases, where a value per face-corner is provided with no indication of which values incident each vertex should be considered shared, it will be necessary to determine shared indices for values at each vertex if any non-linear interpolation is desired. Far Layer Translation While TopologyRefiner was introduced into Far as the new intermediate topology representation, several other changes were made to classes in Far to provide more modular building blocks for use by the Osd layer or directly. OpenSubdiv 2.x OpenSubdiv 3.0 FarMeshU NA, no longer needed FarSubdivisionTables FarStencilTable FarPatchTables FarPatchTable Ordering of Refined Vertices The FarMesh was previously responsible for refining an HbrMesh -- generating new vertices and faces in successive levels of refinement in the FarSubdivisionTables. Vertices were grouped and reordered from the native ordering of HbrMesh so that vertices requiring similar processing were consecutive. Such grouping alleviated most of the idiosyncrasies of HbrMeshs native ordering but not all. FarToplogyRefiner is inherently a collection of refinement levels, and within each refined level so excluding the base level, all components are still grouped for the same reasons. There are two issues here though the ordering of these groups has changed though an option exists to preserve it the ordering of components within these groups is not guaranteed to have been preserved Vertices in a refined level are grouped according to the type of component in the parent level from which they originated, i.e. some vertices originate from the center of a face face-vertices, some from an edge edge-vertices and some from a vertex vertex-vertices. Note that there is a conflict in terminology here -- face-vertices and edge-vertices most often refer to vertices incident a face or edge -- but for the sake of this discussion, we use them to refer to the component from which a child vertex originates. The following table shows the ordering of these groups in 2.x and the two choices available in 3.0. The option is the orderVerticesFromFacesFirst flag that can be set in the Option structs passed to the uniform and adaptive refinement methods of TopologyRefiner Version and option Vertex group ordering 2.x face-vertices, edge-vertices, vertex-vertices 3.0 default vertex-vertices, face-vertices, edge-vertices 3.0 orderVerticesFromFacesFirst true face-vertices, edge-vertices, vertex-vertices The decision to change the default ordering was based on common feedback the rationale was to allow a trivial mapping from vertices in the cage to their descendants at all refinement levels. While the grouping is fundamental to the refinement process, the ordering of the groups is internally flexible, and the full set of possible orderings can be made publicly available in future if there is demand for such flexibility. The ordering of vertices within these groups was never clearly defined given the way that HbrMesh applied its refinement. For example, for the face-vertices in a level, it was never clear which face-vertices would be first as it depended on the order in which HbrMesh traversed the parent faces and generated them. Given one face, HbrMesh would often visit neighboring faces first before moving to the next intended face. The ordering with FarTopologyRefiner is much clearer and predictable. Using the face-vertices as an example, the order of the face-vertices in level N1 is identical to the order of the parent faces in level N from which they originated. So if we have face-vertices Vi , Vj and Vk at some level, originating from faces Fi , Fj and Fk in the previous level, they will be ordered in increasing order of i , j and k . For uniform refinement the ordering of face vertices Vi will therefore exactly match the ordering of the parent faces Fi . For adaptive or otherwise sparse refinement, the subset of Vi will be ordered similarly, just with components missing from those not refined. The same is true of all vertices, i.e. edge-vertices and vertex-vertices, and also for other components in refined levels, i.e. the child faces and edges. For child faces and edges, more than one will originate from the same parent face or edge. In addition to the overall ordering based on the parent faces or edges, another ordering is imposed on multiple children originating from the same face or edge. They will be ordered based on the corner or end-vertex with which they are associated. In the case of refined faces, another way to view the ordering is to consider the way that faces are originally defined -- by specifying the set of vertices for the corners of each face, often aggregated into a single large array. The ordering of the set of refined faces for each level will correspond directly to such an array of vertices per face in the previous level. Osd Layer Translation Two big changes in the 3.0 API have allowed the Osd layer to be significantly simpler, the first is the move to stencil tables from subdivision tables and the second is shader simplification. With this refactoring, the focus has been to use more meaningful names and to make the data contained within an object more apparent. Controller Objects The API-specific ComputeController has been replaced with the Evaluator . It reflects the fact that stencil compute batches are significantly simpler than subdivision table compute batches. The name Evaluator was chosen with the hope that is more meaningful than the generic ComputeController moniker the Evaluator evaluates stencil and patch tables. In the 2.x code base, subdiv level buffers were always required to be allocated contiguously, however in 3.0 with the shift to stencil tables, this strict allocation scheme is no longer required. As a result, the EvalStencils and EvalPatches methods now accept both a source and a destination descriptor. OpenSubdiv 2.x OpenSubdiv 3.0 ComputeControllerRefine Osd...EvaluatorEvalStencils ComputeControllerSynchronize Osd...EvaluatorSynchronize EvalStencilsControllerUpdateValues Osd...EvaluatorEvalStencils EvalStencilsControllerUpdateDerivs Osd...EvaluatorEvalStencils EvalLimitControllerEvalLimitSample Osd...EvaluatorEvalPatches Also note that OsdVertexDescriptor has been renamed, however its data members and semantic purpose remains the same OpenSubdiv 2.x OpenSubdiv 3.0 OsdVertexBufferDescriptor OsdBufferDescriptor ComputeContext, DrawContext ComputeContext and DrawContext have been replaced with API-specific StencilTable and PatchTable objects, for example OsdGLStencilTableSSBO. OpenSubdiv 2.x OpenSubdiv 3.0 ComputeContext Osd...StencilTable e.g. GLStencilTableTBO EvalStencilsContext Osd...StencilTable DrawContext Osd...PatchTable e.g. GLPatchTable EvalLimitContext The data stored in EvalLimitContext has been merged into the Evaluator class as well. EvalCoords have been moved into their own type, OsdPatchCoords. The primary change here is that the PTex face ID is no longer part of the data structure, rather the client can use a FarPatchMap to convert from PTex face ID to a FarPatchTablePatchHandle. OpenSubdiv 2.x OpenSubdiv 3.0 EvalLimitContext PatchTable EvalLimitContextEvalCoords OsdPatchCoords types.h OsdMesh While not strictly required, OsdMesh is still supported in 3.0 as convenience API for allocating buffers. OsdMesh serves as a simple way to allocate all required data, in the location required by the API for example, GPU buffers for OpenGL. OsdKernelBatch No translation, it is no longer part of the API. OsdVertex No translation, it is no longer part of the API. Feature Adaptive Shader Changes In 3.0, the feature adaptive screen-space tessellation shaders have been dramatically simplified, and the client-facing API has changed dramatically as well. The primary shift is to reduce the total number of shader combinations, and as a result, some of the complexity management mechanisms are no longer necessary. In the discussion below, some key changes are highlighted, but deep integrations may require additional discussion please feel free to send follow up questions to the OpenSubdiv google group. The number of feature adaptive shaders has been reduced from N to exactly 1 or 2, depending on how end-caps are handled. Osd layer no longer compiles shaders, rather it returns shader source for the client to compile. This source is obtained via OsdGLSLHLSLPatchShaderSource. The API exposed in shaders to access patch-based data has been consolidated and formalized, see osdglslPatchCommon.glsl and osdhlslPatchCommon.hlsl for details. Patches are no longer rotated and transition patches have been eliminated, simplifying PatchDescriptor to a 4 bits. Additionally, FarPatchTablesDescriptor has been moved into its own class in the Far namespace. The following table outlines the API translation between 2.x and 3.0 OpenSubdiv 2.x OpenSubdiv 3.0 OsdDrawContextPatchDescriptor NA, no longer needed. OsdDrawContextPatchArray OSdPatchArray types.h FarPatchTablesPatchDescriptor FarPatchDescriptor patchDescriptor.h FarPatchTablesPatchArray made private. End Cap Strategies By default, OpenSubdiv uses Gregory patches to approximate the patches around extraordinary vertices at the maximum isolation level, this process is referred to as end-capping. If ENDCAP_BSPLINE_BASIS is specified to PatchTableFactoryOptions, BSpline patches are used, which gives less accuracy, but it makes possible to render an entire mesh in a single draw call. Both patches require additional control points that are not part of the mesh, we refer to these as local points. In 3.0, the local points of those patches are computed by applying a stencil table to refined vertices to construct a new stencil table for the local points. Since this new stencil table is topologically compatible with the primary stencil table for refinement, it is convenient and efficient to splice those stencil tables together. This splicing can be done in the following way FarStencilTable const refineStencils FarStencilTableFactoryCreatetopologyRefiner FarPatchTable cosnt patchTable FarPatchTableFactoryCreatetopologyRefiner FarStencilTable const localPointStencils patchTable-GetLocalPointStencilTable FarStencilTable const splicedStencils FarStencilTableFactoryAppendLocalPointStencilTablestopologyRefiner, refineStencils, localPointStencils NOTE Once the spliced stencil table is created, the refined stencils can be released, but the local point stencils are owned by patchTable, it should not be released. OpenSubdiv 3.0 also supports 2.x style Gregory patches, if ENDCAP_LEGACY_GREGORY is specified to PatchTableFactoryOptions. In this case, such an extra stencil splicing isnt needed, however clients must still bind additional buffers VertexValence buffer and QuadOffsets buffer. See OsdGLLegacyGregoryPatchTable for additional details. Changes to Subdivision The refactoring of OpenSubdiv 3.0 data representations presented a unique opportunity to revisit some corners of the subdivision specification and remove or update some legacy features -- none of which was taken lightly. More details are provided in Subdivision Compatibility , while the following offers a quick overview All face-varying interpolation options have been combined into a single enum. Vertex interpolation options have been renamed or removed The naming of the standard creasing method has changed from Normal to Uniform . Unused legacy modes of the smoothtriangle option have been removed. The averaging of Chaikin creasing with infinitely sharp edges has changed. Support for Hierarchical Edits has been removed. Build Support for Combining 2.x and 3.0 Running OpenSubdiv 2.0 and 3.0 in a single process is supported, however some special care must be taken to avoid namespace collisions, both in terms of run-time symbols avoid using OpenSubdivOsd, for example and in terms of build-time search paths. To support both OpenSubdiv 2.0 and 3.0 in your build environment, you can prefix the header install directory of OpenSubdiv 3.0. Do this using the build flag CMAKE_INCDIR_BASE when configuring cmake i.e. -DCMAKE_INCDIR_BASEincludeopensubdiv3 and then including files from opensubdiv3... in client code. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "porting.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "Overview of Release 3.0", │ │ │ │ │ - "text": "Overview of Release 3.0 Overview of Release 3.0 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 3.0 Subdivision Core Sdc Topology and Refinement Limit Properties and Patches Faster Evaluation and Display Updated Source-Code Style Documentation and Tutorials Additional Resources Porting Guide Subdivision Compatibility Release 3.0 OpenSubdiv 3.0 represents a landmark release, with profound changes to the core algorithms, simplified APIs, and streamlined GPU execution. Providing faster, more efficient, and more flexible subdivision code remains our principal goal. To achieve this, OpenSubdiv 3.0 introduces many improvements that constitute a fairly radical departure from previous versions. This document highlights some of the major changes that have gone in to the 3.0 release. Subdivision Core Sdc In consideration of past, present and future topological representations, all low-level details fundamental to subdivision and the specific subdivision schemes have been factored into a new low-level layer called Sdc SubDivision Core. This layer encapsulates the full set of applicable options, the formulae required to support semi-sharp creasing, the formulae for the refinement masks of each subdivision scheme, etc. As initially conceived, its goal was often expressed as separating the math from the mesh. Sdc provides the low-level nuts and bolts to provide a subdivision implementation consistent with OpenSubdiv. It is used by OpenSubdivs libraries and may also be useful in providing an existing clients implementation with the details necessary to make that implementation consistent with OpenSubdiv. Topology and Refinement OpenSubdiv 3.0 introduces a new intermediate internal topological representation named Vtr Vectorized Topology Representation. Compared to the Hbr library used in previous versions, Vtr is much more efficient for the kinds of topological analysis required by Far and is more flexible. While Hbr is no longer used by OpenSubdiv, it will remain in the source distribution for legacy and regression purposes. Faster Subdivision A major focus of the 3.0 release is performance, and the improvement to the initial refinement of a mesh required for topological analysis is close to an order magnitude often much more for uniform, but less for adaptive. Supporting for Non-manifold Topology With topology conversion no longer constrained by Hbr, OpenSubdiv is no longer restricted to meshes of manifold topology. With one exception non-triangles with Loop subdivision, any set of faces and vertices that can be represented in common container formats such as Obj or Alembic can be represented and subdivided. With future efforts to bring the functionality for the Loop scheme up to par with Catmark, that last remaining topological restriction will be removed. Simpler Conversion of Topology Several entry-points are now available for client topology, rather than the single incremental assembly of an HbrMesh that previously existed. The new topological relationships can be populated using either a high-level interface where simplicity has been emphasized, or a more complex lower-level interface for enhanced efficiency. Face Varying Topology Previously, face-varying data was assigned by value to the vertex for each face, and whether or not the set of values around a vertex was continuous was determined by comparing these values later. In some cases this could result in two values that were not meant to be shared being welded together. Face-varying data is now specified topologically just as the vertex topology is defined from a set of vertices and integer references indices to these vertices for the corner of each face, face-varying topology is defined from a set of values and integer references indices to these values for the corner of each face. So if values are to be considered distinct around a vertex, they are given distinct indices and no comparison of any data is ever performed. Note that the number of vertices and values will typically differ, but since indices are assigned to the corners of all faces for both, the total number of indices assigned to all faces will be the same. This ensures that OpenSubdivs face-varying topology matches what is often specified in common geometry container formats like Obj, Alembic and USD. Multiple channels of face-varying data can be defined and each is topologically independent of the others. Limit Properties and Patches A fundamental goal of OpenSubdiv is to provide an accurate and reliable representation of the limit surface. Improvements have been made both to the properties positions and tangents at discrete points in the subdivision hierarchy, as well as to the representations of patches used for the continuous limit surface between them. Removed Fixed Valence Tables Limit properties of extra-ordinary vertices are computed for arbitrary valence and new patch types no longer rely on small table sizes. All tables that restricted the valence of a vertex to some relatively small table size have now been removed. The only restriction on valence that exists is within the new topology representation, which restricts it to the size of an unsigned 16-bit integer 65,535. This limit could also be removed, by recompiling with a certain size changed from 16- to 32-bits, but doing so would increase the memory cost for all common cases. We feel the 16-bit limit is a reasonable compromise. Single Crease Patch OpenSubdiv 3.0 newly implements efficient evaluation of semi-smooth creases using single crease patches. With this optimization, high-order edge sharpness tags can be handled very efficiently for both computation time and memory consumption. Niessner et al., Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces. Eurographics Short Papers. 2012. httpresearch.microsoft.comen-usumpeoplecloopEG2012.pdf New Irregular Patch Approximations While legacy Gregory patch support is still available, we have introduced several new options for representing irregular patches Legacy Gregory, fast Gregory Basis stencils, and BSpline patches. Gregory basis stencils provide the same high quality approximation of Legacy Gregory patches, but execute considerably faster with a simpler GPU representation. While BSpline patches are not as close an approximation as Gregory patches, they enable an entire adaptively refined mesh to be drawn with screen space tessellation via a single global shader configuration Gregory Basis patches require one additional global shader configuration. The new implementations of the GregoryBasis and BSpline approximations relax the previous max valence limit. Legacy Gregory patch still has a limitation of max valence typically 24, depending on the hardware capability of GL_MAX_VARYING_VECTORS. Users are still encouraged to use models with vertices of low valence for both improved model quality and performance. Faster Evaluation and Display OpenSubdiv 3.0 also introduces new data structures and algorithms that greatly enhance performance for the common case of repeated evaluation both on the CPU and GPU. Introducing Stencil Tables OpenSubdiv 3.0 replaces the serialized subdivision tables with factorized stencil tables. The SubdivisionTables class of earlier releases contained a large number of data inter-dependencies, which incurred penalties from fences or force additional kernel launches. Most of these dependencies have now been factorized away in the pre-computation stage, yielding stencil tables FarStencilTable instead. Stencils remove all data dependencies and simplify all the computations into a single trivial kernel. This simplification results in a faster pre-computation stage, faster execution on GPU, with less driver overhead. The new stencil tables Compute back-end is supported on all the same platforms as previous releases except GCD. Faster, Simpler GPU Kernels On the GPU side, the replacement of subdivision tables with stencils greatly reduces bottlenecks in compute, yielding as much as a 4x interpolation speed-up. At the same time, stencils reduce the complexity of interpolation to a single kernel launch per primitive, a critical improvement for mobile platforms. As a result of these changes, compute batching is now trivial, which in turn enabled API simplifications in the Osd layer. Unified Adaptive Shaders Adaptive tessellation shader configurations have been greatly simplified. The number of shader configurations has been reduced from a combinatorial per-patch explosion down to a constant two global configurations. This massive improvement over the 2.x code base results in significantly faster load times and a reduced per-frame cost for adaptive drawing. Similar to compute kernel simplification, this shader simplification has resulted in additional simplifications in the Osd layer. Updated Source-Code Style OpenSubdiv 3.0 replaces naming prefixes with C namespaces for all API layers, bringing the source style more in line with contemporary specifications mostly inspired from the Google C Style Guide . The large-scale changes introduced in this release generally break compatibility with existing client-code. However, this gives us the opportunity to effect some much needed updates to our code-style guidelines and general conventions, throughout the entire OpenSubdiv code-base. We are hoping to drastically improve the quality, consistency and readability of the source code. Documentation and Tutorials The documentation has been reorganized and fleshed out. This release introduces a number of new tutorials . The tutorials provide an easier entry point for learning the API than do the programs provided in examples. The examples provide more fleshed out solutions and are a good next step after the tutorials are mastered. Additional Resources Porting Guide Please see the Porting Guide for help on how to port existing code written for OpenSubdiv 2.x to the new 3.0 release. Subdivision Compatibility The 3.0 release has made some minor changes to the subdivision specification and rules. See Subdivision Compatibility for a complete list. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Overview of Release 3.0 Overview of Release 3.0 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Release 3.0 Subdivision Core Sdc Topology and Refinement Limit Properties and Patches Faster Evaluation and Display Updated Source-Code Style Documentation and Tutorials Additional Resources Porting Guide Subdivision Compatibility Release 3.0 OpenSubdiv 3.0 represents a landmark release, with profound changes to the core algorithms, simplified APIs, and streamlined GPU execution. Providing faster, more efficient, and more flexible subdivision code remains our principal goal. To achieve this, OpenSubdiv 3.0 introduces many improvements that constitute a fairly radical departure from previous versions. This document highlights some of the major changes that have gone in to the 3.0 release. Subdivision Core Sdc In consideration of past, present and future topological representations, all low-level details fundamental to subdivision and the specific subdivision schemes have been factored into a new low-level layer called Sdc SubDivision Core. This layer encapsulates the full set of applicable options, the formulae required to support semi-sharp creasing, the formulae for the refinement masks of each subdivision scheme, etc. As initially conceived, its goal was often expressed as separating the math from the mesh. Sdc provides the low-level nuts and bolts to provide a subdivision implementation consistent with OpenSubdiv. It is used by OpenSubdivs libraries and may also be useful in providing an existing clients implementation with the details necessary to make that implementation consistent with OpenSubdiv. Topology and Refinement OpenSubdiv 3.0 introduces a new intermediate internal topological representation named Vtr Vectorized Topology Representation. Compared to the Hbr library used in previous versions, Vtr is much more efficient for the kinds of topological analysis required by Far and is more flexible. While Hbr is no longer used by OpenSubdiv, it will remain in the source distribution for legacy and regression purposes. Faster Subdivision A major focus of the 3.0 release is performance, and the improvement to the initial refinement of a mesh required for topological analysis is close to an order magnitude often much more for uniform, but less for adaptive. Supporting for Non-manifold Topology With topology conversion no longer constrained by Hbr, OpenSubdiv is no longer restricted to meshes of manifold topology. With one exception non-triangles with Loop subdivision, any set of faces and vertices that can be represented in common container formats such as Obj or Alembic can be represented and subdivided. With future efforts to bring the functionality for the Loop scheme up to par with Catmark, that last remaining topological restriction will be removed. Simpler Conversion of Topology Several entry-points are now available for client topology, rather than the single incremental assembly of an HbrMesh that previously existed. The new topological relationships can be populated using either a high-level interface where simplicity has been emphasized, or a more complex lower-level interface for enhanced efficiency. Face Varying Topology Previously, face-varying data was assigned by value to the vertex for each face, and whether or not the set of values around a vertex was continuous was determined by comparing these values later. In some cases this could result in two values that were not meant to be shared being welded together. Face-varying data is now specified topologically just as the vertex topology is defined from a set of vertices and integer references indices to these vertices for the corner of each face, face-varying topology is defined from a set of values and integer references indices to these values for the corner of each face. So if values are to be considered distinct around a vertex, they are given distinct indices and no comparison of any data is ever performed. Note that the number of vertices and values will typically differ, but since indices are assigned to the corners of all faces for both, the total number of indices assigned to all faces will be the same. This ensures that OpenSubdivs face-varying topology matches what is often specified in common geometry container formats like Obj, Alembic and USD. Multiple channels of face-varying data can be defined and each is topologically independent of the others. Limit Properties and Patches A fundamental goal of OpenSubdiv is to provide an accurate and reliable representation of the limit surface. Improvements have been made both to the properties positions and tangents at discrete points in the subdivision hierarchy, as well as to the representations of patches used for the continuous limit surface between them. Removed Fixed Valence Tables Limit properties of extra-ordinary vertices are computed for arbitrary valence and new patch types no longer rely on small table sizes. All tables that restricted the valence of a vertex to some relatively small table size have now been removed. The only restriction on valence that exists is within the new topology representation, which restricts it to the size of an unsigned 16-bit integer 65,535. This limit could also be removed, by recompiling with a certain size changed from 16- to 32-bits, but doing so would increase the memory cost for all common cases. We feel the 16-bit limit is a reasonable compromise. Single Crease Patch OpenSubdiv 3.0 newly implements efficient evaluation of semi-smooth creases using single crease patches. With this optimization, high-order edge sharpness tags can be handled very efficiently for both computation time and memory consumption. Niessner et al., Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces. Eurographics Short Papers. 2012. httpresearch.microsoft.comen-usumpeoplecloopEG2012.pdf New Irregular Patch Approximations While legacy Gregory patch support is still available, we have introduced several new options for representing irregular patches Legacy Gregory, fast Gregory Basis stencils, and BSpline patches. Gregory basis stencils provide the same high quality approximation of Legacy Gregory patches, but execute considerably faster with a simpler GPU representation. While BSpline patches are not as close an approximation as Gregory patches, they enable an entire adaptively refined mesh to be drawn with screen space tessellation via a single global shader configuration Gregory Basis patches require one additional global shader configuration. The new implementations of the GregoryBasis and BSpline approximations relax the previous max valence limit. Legacy Gregory patch still has a limitation of max valence typically 24, depending on the hardware capability of GL_MAX_VARYING_VECTORS. Users are still encouraged to use models with vertices of low valence for both improved model quality and performance. Faster Evaluation and Display OpenSubdiv 3.0 also introduces new data structures and algorithms that greatly enhance performance for the common case of repeated evaluation both on the CPU and GPU. Introducing Stencil Tables OpenSubdiv 3.0 replaces the serialized subdivision tables with factorized stencil tables. The SubdivisionTables class of earlier releases contained a large number of data inter-dependencies, which incurred penalties from fences or force additional kernel launches. Most of these dependencies have now been factorized away in the pre-computation stage, yielding stencil tables FarStencilTable instead. Stencils remove all data dependencies and simplify all the computations into a single trivial kernel. This simplification results in a faster pre-computation stage, faster execution on GPU, with less driver overhead. The new stencil tables Compute back-end is supported on all the same platforms as previous releases except GCD. Faster, Simpler GPU Kernels On the GPU side, the replacement of subdivision tables with stencils greatly reduces bottlenecks in compute, yielding as much as a 4x interpolation speed-up. At the same time, stencils reduce the complexity of interpolation to a single kernel launch per primitive, a critical improvement for mobile platforms. As a result of these changes, compute batching is now trivial, which in turn enabled API simplifications in the Osd layer. Unified Adaptive Shaders Adaptive tessellation shader configurations have been greatly simplified. The number of shader configurations has been reduced from a combinatorial per-patch explosion down to a constant two global configurations. This massive improvement over the 2.x code base results in significantly faster load times and a reduced per-frame cost for adaptive drawing. Similar to compute kernel simplification, this shader simplification has resulted in additional simplifications in the Osd layer. Updated Source-Code Style OpenSubdiv 3.0 replaces naming prefixes with C namespaces for all API layers, bringing the source style more in line with contemporary specifications mostly inspired from the Google C Style Guide . The large-scale changes introduced in this release generally break compatibility with existing client-code. However, this gives us the opportunity to effect some much needed updates to our code-style guidelines and general conventions, throughout the entire OpenSubdiv code-base. We are hoping to drastically improve the quality, consistency and readability of the source code. Documentation and Tutorials The documentation has been reorganized and fleshed out. This release introduces a number of new tutorials . The tutorials provide an easier entry point for learning the API than do the programs provided in examples. The examples provide more fleshed out solutions and are a good next step after the tutorials are mastered. Additional Resources Porting Guide Please see the Porting Guide for help on how to port existing code written for OpenSubdiv 2.x to the new 3.0 release. Subdivision Compatibility The 3.0 release has made some minor changes to the subdivision specification and rules. See Subdivision Compatibility for a complete list. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "release_30.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "References", │ │ │ │ │ - "text": "References References 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE References References Analytic Displacement Mapping using Hardware Tessellation Matthias Niessner, Charles Loop ACM Transactions on Graphics, Vol. 32 No. 3 Article 26 June 2013 httpresearch.microsoft.comen-usumpeoplecloopTOG2013.pdf httpdoi.org10.11452487228.2487234 Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, Mark Meyer, and Tony DeRose ACM Transactions on Graphics, Vol. 31 No. 1 Article 6 January 2012 httpresearch.microsoft.comen-usumpeopleclooptog2012.pdf httpdoi.org10.11452077341.2077347 Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, and Guenter Greiner. Eurographics Proceedings, Cagliari, 2012 httpresearch.microsoft.comen-usumpeoplecloopEG2012.pdf httpdoi.org10.2312confEG2012short041-044 Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation Charles Loop, Scott Schaefer, Tianyun Ni, Ignacio Castano SIGGRAPH Asia Conference Proceedings 2009 httpwww.dgp.toronto.edupeoplestamrealityResearchpdfsig98.pdf httpdoi.org10.11451661412.1618497 GPU Smoothing of Quad Meshes T. L. Ni, Y. Yeo, A. Myles, V. Goel and J. Peters Proc. IEEE SMI 2008 httpwww.cise.ufl.eduresearchSurfLabpaperssmi08.pdf httpdoi.org10.1109SMI.2008.4547938 Fast Parallel Construction of Smooth Surfaces from Meshes with TriQuadPent Facets A. Myles and T. Ni and J. Peters Eurographics Symposium on Geometry Processing 2008 httpswww.cise.ufl.eduresearchSurfLabpapers08poly.pdf httpdoi.org10.1111j.1467-8659.2008.01276.x Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches Charles Loop, Scott Schaefer ACM Transactions on Graphics, Vol. 27 No. 1 Article 8 March 2008 httpresearch.microsoft.comen-usumpeoplecloopacctog.pdf httpdoi.org10.11451330511.1330519 Rapid Evaluation of Catmull-Clark Subdivision Surfaces Jeffrey Bolz and Peter Schroder Web3D Proceedings 2002 httpwww.multires.caltech.edupubsfastsubd.pdf httpdoi.org10.1145504502.504505 Piecewise Smooth Subdivision Surfaces with Normal Control Henning Biermann, Adi Levin and Denis Zorin SIGGRAPH 2000 Conference Proceedings httpmrl.nyu.edudzorinpapersbiermann2000pss.pdf httpdoi.org10.1145344779.344841 Subdivision for Modeling and Animation Denis Zorin, Peter Schroder Course Notes of SIGGRAPH 1999 httpwww.multires.caltech.edupubssig99notes.pdf Exact Evaluation of Catmull-Clark Subdivision Surfaces at Arbitrary Parameter Values Jos Stam SIGGRAPH 98 Conference Proceedings, Annual Conference Series, July 1998 httpwww.dgp.toronto.edupeoplestamrealityResearchpdfsig98.pdf httpdoi.org10.1145280814.280945 Subdivision Surfaces in Character Animation Tony DeRose, Michael Kass, Tien Truong Proceedings of SIGGRAPH 1998 httpgraphics.pixar.comlibraryGeripaper.pdf httpdoi.org10.1145280814.280826 Efficient, Fair Interpolation Using Catmull-Clark Surfaces Mark Halstead, Michael Kass, Tony DeRose SIGGRAPH 93 Conference Proceedings httpgraphics.pixar.comlibraryFairSubdivisionpaper.pdf httpdoi.org10.1145166117.166121 Recursively generated B-spline surfaces on arbitrary topological meshes Catmull, E. Clark, J. Computer-Aided Design 10 6 1978 httpdoi.org10.10160010-448528782990110-0 Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "References References 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE References References Analytic Displacement Mapping using Hardware Tessellation Matthias Niessner, Charles Loop ACM Transactions on Graphics, Vol. 32 No. 3 Article 26 June 2013 httpresearch.microsoft.comen-usumpeoplecloopTOG2013.pdf httpdoi.org10.11452487228.2487234 Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, Mark Meyer, and Tony DeRose ACM Transactions on Graphics, Vol. 31 No. 1 Article 6 January 2012 httpresearch.microsoft.comen-usumpeopleclooptog2012.pdf httpdoi.org10.11452077341.2077347 Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, and Guenter Greiner. Eurographics Proceedings, Cagliari, 2012 httpresearch.microsoft.comen-usumpeoplecloopEG2012.pdf httpdoi.org10.2312confEG2012short041-044 Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation Charles Loop, Scott Schaefer, Tianyun Ni, Ignacio Castano SIGGRAPH Asia Conference Proceedings 2009 httpwww.dgp.toronto.edupeoplestamrealityResearchpdfsig98.pdf httpdoi.org10.11451661412.1618497 GPU Smoothing of Quad Meshes T. L. Ni, Y. Yeo, A. Myles, V. Goel and J. Peters Proc. IEEE SMI 2008 httpwww.cise.ufl.eduresearchSurfLabpaperssmi08.pdf httpdoi.org10.1109SMI.2008.4547938 Fast Parallel Construction of Smooth Surfaces from Meshes with TriQuadPent Facets A. Myles and T. Ni and J. Peters Eurographics Symposium on Geometry Processing 2008 httpswww.cise.ufl.eduresearchSurfLabpapers08poly.pdf httpdoi.org10.1111j.1467-8659.2008.01276.x Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches Charles Loop, Scott Schaefer ACM Transactions on Graphics, Vol. 27 No. 1 Article 8 March 2008 httpresearch.microsoft.comen-usumpeoplecloopacctog.pdf httpdoi.org10.11451330511.1330519 Rapid Evaluation of Catmull-Clark Subdivision Surfaces Jeffrey Bolz and Peter Schroder Web3D Proceedings 2002 httpwww.multires.caltech.edupubsfastsubd.pdf httpdoi.org10.1145504502.504505 Piecewise Smooth Subdivision Surfaces with Normal Control Henning Biermann, Adi Levin and Denis Zorin SIGGRAPH 2000 Conference Proceedings httpmrl.nyu.edudzorinpapersbiermann2000pss.pdf httpdoi.org10.1145344779.344841 Subdivision for Modeling and Animation Denis Zorin, Peter Schroder Course Notes of SIGGRAPH 1999 httpwww.multires.caltech.edupubssig99notes.pdf Exact Evaluation of Catmull-Clark Subdivision Surfaces at Arbitrary Parameter Values Jos Stam SIGGRAPH 98 Conference Proceedings, Annual Conference Series, July 1998 httpwww.dgp.toronto.edupeoplestamrealityResearchpdfsig98.pdf httpdoi.org10.1145280814.280945 Subdivision Surfaces in Character Animation Tony DeRose, Michael Kass, Tien Truong Proceedings of SIGGRAPH 1998 httpgraphics.pixar.comlibraryGeripaper.pdf httpdoi.org10.1145280814.280826 Efficient, Fair Interpolation Using Catmull-Clark Surfaces Mark Halstead, Michael Kass, Tony DeRose SIGGRAPH 93 Conference Proceedings httpgraphics.pixar.comlibraryFairSubdivisionpaper.pdf httpdoi.org10.1145166117.166121 Recursively generated B-spline surfaces on arbitrary topological meshes Catmull, E. Clark, J. Computer-Aided Design 10 6 1978 httpdoi.org10.10160010-448528782990110-0 Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "references.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "OSD Overview", │ │ │ │ │ - "text": "OSD Overview OSD Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE OpenSubdiv Osd Refinement Limit Stencil Evaluation Limit Evaluation with PatchTable OpenGLDX11Metal Drawing with Hardware Tessellation InterleavedBatched Buffer Configuration Cross-Platform Implementation OpenSubdiv Osd Osd contains device dependent code that makes Far structures available on various backends such as TBB, CUDA, OpenCL, GLSL, etc. The main roles of Osd are Refinement Compute stencil-based uniformadaptive subdivision on CPUGPU backends Limit Stencil Evaluation Compute limit surfaces by limit stencils on CPUGPU backends Limit Evaluation with PatchTable Compute limit surfaces by patch evaluation on CPUGPU backends OpenGLDX11Metal Drawing with hardware tessellation Provide GLSLHLSLMetal tessellation functions for patch table InterleavedBatched buffer configuration Provide consistent buffer descriptor to deal with arbitrary buffer layout. Cross-Platform Implementation Provide convenient classes to interop between compute and draw APIs These are independently used by clients. For example, a client can use only the limit stencil evaluation, or a client can refine subdivision surfaces and draw them with the PatchTable and Osd tessellation shaders. All device specific evaluation kernels are implemented in the Evaluator classes. Since Evaluators dont own vertex buffers, clients should provide their own buffers as a source and destination. There are some interop classes defined in Osd for convenience. OpenSubdiv utilizes a series of regression tests to compare and enforce identical results across different computational devices. Refinement Osd supports both uniform and feature adaptive subdivision. Once clients create a FarStencilTable for the topology, they can convert it into device-specific stencil tables if necessary. The following table shows which evaluator classes and stencil table interfaces can be used together. Note that while Osd provides these stencil table classes which can be easily constructed from FarStencilTable, clients arent required to use these table classes. Clients may have their own entities as a stencil tables as long as EvaluatorEvalStencils can access the necessary interfaces. Backend Evaluator class compatible stencil table CPU CPU single-threaded CpuEvaluator FarStencilTable TBB CPU multi-threaded TbbEvaluator FarStencilTable OpenMP CPU multi-threaded OmpEvaluator FarStencilTable CUDA GPU CudaEvaluator CudaStencilTable OpenCL CPUGPU CLEvaluator CLStencilTable GL ComputeShader GPU GLComputeEvaluator GLStencilTableSSBO GL Transform Feedback GPU GLXFBEvaluator GLStencilTableTBO DX11 ComputeShader GPU D3D11ComputeEvaluator D3D11StencilTable Metal GPU MTLComputeEvaluator MTLStencilTable Limit Stencil Evaluation Limit stencil evaluation is quite similar to refinement in Osd . At first clients create FarLimitStencilTable for the locations to evaluate the limit surfaces, then convert it into an evaluator compatible stencil table and call EvaluatorEvalStencils. Limit Evaluation with PatchTable Another way to evaluate the limit surfaces is to use the PatchTable. Once all control vertices and local points are resolved by the stencil evaluation, Osd can evaluate the limit surfaces through the PatchTable. Backend Evaluator class compatible patch table CPU CPU single-threaded CpuEvaluator CpuPatchTable TBB CPU multi-threaded TbbEvaluator CpuPatchTable OpenMP CPU multi-threaded OmpEvaluator CpuPatchTable CUDA GPU CudaEvaluator CudaPatchTable OpenCL CPUGPU CLEvaluator CLPatchTable GL ComputeShader GPU GLComputeEvaluator GLPatchTable GL Transform Feedback GPU GLXFBEvaluator GLPatchTable DX11 ComputeShader GPU D3D11ComputeEvaluator not yet supported D3D11PatchTable Metal ComputeShader GPU MTLComputeEvaluator MTLPatchTable Release Notes 3.x Osd evaluation backends EvaluatorEvalPatches do not support evaluation of single-crease or Legacy Gregory patch types. OpenGLDX11Metal Drawing with Hardware Tessellation One of the most interesting use cases of the Osd layer is realtime drawing of subdivision surfaces using hardware tessellation. This is somewhat similar to limit evaluation with PatchTable described above. Drawing differs from limit evaluation in that Osd provides shader snippets for patch evaluation and clients will inject them into their own shader source. See shader interface for a more detailed discussion of the shader interface. InterleavedBatched Buffer Configuration All Osd layer APIs assume that each primitive variables to be computed points, colors, uvs ... are contiguous arrays of 32bit floating point values. The Osd API refers to such an array as a buffer. A buffer can exist on CPU memory or GPU memory. Osd Evaluators typically take one source buffer and one destination buffer, or three destination buffers if derivatives are being computed. Osd Evaluators also take BufferDescriptors, that are used to specify the layout of the source and destination buffers. A BufferDescriptor is a struct of 3 integers which specify an offset, length and stride. For example Vertex 0 Vertex 1 ... X Y Z X Y Z ... The layout of this buffer can be described as Osd BufferDescriptor desc offset 0 , length 3 , stride 3 BufferDescriptor can be used for an interleaved buffer too. Vertex 0 Vertex 1 ... X Y Z R G B A X Y Z R G B A ... Osd BufferDescriptor xyzDesc 0 , 3 , 7 Osd BufferDescriptor rgbaDesc 3 , 4 , 7 Although the source and destination buffers dont need to be the same buffer for EvalStencils, adaptive patch tables are constructed to first index the coarse vertices and the refined vertices immediately afterward. In this case, the BufferDescriptor for the destination should include the offset as the number of coarse vertices to be skipped. Coarse vertices n Src Refined vertices Dst Vertex 0 Vertex 1 ... Vertex n Vertex n1 X Y Z X Y Z ... X Y Z X Y Z ... Osd BufferDescriptor srcDesc 0 , 3 , 3 Osd BufferDescriptor dstDesc n 3 , 3 , 3 Also note that the source descriptor doesnt have to start with offset 0. This is useful when a client has a big buffer with multiple objects batched together. Cross-Platform Implementation One of the key goals of OpenSubdiv is to achieve as much cross-platform flexibility as possible and leverage all optimized hardware paths where available. This can be very challenging as there is a very large variety of plaftorms and APIs available, with very distinct capabilities. In Osd , Evaluators dont care about interops between those APIs. All Evaluators have two kinds of APIs for both EvalStencils and EvalPatches. Explicit signatures which directly take device-specific buffer representation e.g., pointer for CpuEvaluator, GLuint buffer for GLComputeEvaluator, etc. Generic signatures which take arbitrary buffer classes. The buffer class is required to have a certain method to return the device-specific buffer representation. The later interface is useful if the client supports multiple backends at the same time. The methods that need to be implemented for the Evaluators are Evaluator class object method CpuEvaluator TbbEvaluator OmpEvaluator pointer to cpu memory BindCpuBuffer CudaEvaluator pointer to cuda memory BindCudaBuffer CLEvaluator cl_mem BindCLBuffer GLComputeEvaluator GLXFBEvaluator GL buffer object BindVBO D3D11ComputeEvaluator D3D11 UAV BindD3D11UAV MTLComputeEvaluator MTLBuffer BindMTLBuffer The buffers can use these methods as a trigger of interop. Osd provides a default implementation of interop buffer for most of the backend combinations. For example, if the client wants to use CUDA as a computation backend and use OpenGL as the drawing API, OsdCudaGLVertexBuffer fits the case since it implements BindCudaBuffer and BindVBO. Again, clients can implement their own buffer class and pass it to the Evaluators. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "Porting Guide 2.x to 3.0", │ │ │ │ │ + "text": "Porting Guide 2.x to 3.0 Porting Guide 2.x to 3.0 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Porting Guide 2.x to 3.0 Source Code Organization Hbr Layer Translation Subdivision Schemes and Options in Sdc Specifying Face Varying Topology and Options Far Layer Translation Ordering of Refined Vertices Osd Layer Translation Controller Objects ComputeContext, DrawContext EvalLimitContext OsdMesh OsdKernelBatch OsdVertex Feature Adaptive Shader Changes End Cap Strategies Changes to Subdivision Build Support for Combining 2.x and 3.0 Porting Guide 2.x to 3.0 This document is a high-level description of how to port exiting OpenSubdiv 2.x code to use OpenSubdiv 3.0. NOTE If your questions are not answered here, please contact us on the OpenSubdiv forum and we will be happy to help Source Code Organization Given the scale of functional changes that were being made to the public interface, we took the opportunity in 3.0 to update the coding style and organization -- most notably making use of namespaces for each library. Subdirectory Namespace Relevance hbr NA Historical, no longer used sdc Sdc New, low-level, public options, constants, etc. vtr Vtr New, internal use, topology representation far Far Revised, similar functionality with new API osd Osd Revised, similar functionality with new API Hbr Layer Translation Client mesh topology is now translated into an instance of FarTopologyRefiner instead of HbrMesh. OpenSubdiv 2.x OpenSubdiv 3.0 HbrMeshVTX_TYPE FarTopologyRefiner The FarTopologyRefiner is now the core representation of topology from which all other major classes in Far and Osd are constructed. It was designed to support efficient refinement uniform or sparse of a base mesh of arbitrary topology no manifold restrictions. Once constructed it can be directly refined to meet some need, or passed to other contexts that will refine it to meet their needs. In contrast to directly assembling an HbrMesh, the TopologyRefiner, like other classes in Far, requires a Factory class for its construction. One of the early goals of these factories was to allow a client to convert their existing boundary representation -- with its full topological traversal abilities -- directly into the TopologyRefiners representation. While this is now possible, this also represents the most complex construction process and is only recommended for usage where this conversion process is critical. Details on how to construct a TopologyRefiner can be found in the Far overview documentation. Additionally, documentation for FarTopologyRefinerFactoryMESH outlines the requirements, and Far tutorial 3.1 tutorialsfartutorial_3_1 provides an example of a factory for directly converting HbrMeshes to TopologyRefiners. Its worth a reminder here that FarTopologyRefiner contains only topological information which does include sharpness, since that is considered relating to subdivision topology and not the positions or other data associated with a mesh. While HbrMeshT required some definition of a vertex type T and dimensions of face-varying data, TopologyRefiner is more clearly separated from the data. So the construction of the TopologyRefiner does not involve data specification at all. Subdivision Schemes and Options in Sdc The creation of a new TopologyRefiner requires specification of a subdivision scheme and a set of options that are applicable to all schemes. With HbrMesh, the scheme was specified by declaring a static instance of a specific subclass of a subdivision object, and the options were specified with a number of methods on the different classes. Such general information about the schemes has now been encapsulated in the Sdc layer for use throughout OpenSubdiv. The subdivision scheme is now a simple enumerated type SdcSchemeType and the entire set of options that can be applied to a scheme is encapsulated in a single simple struct of flags and enumerated types SdcOptions. OpenSubdiv 2.x OpenSubdiv 3.0 HbrMeshTSetInterpolateBoundaryMethod SdcOptionsSetVtxBoundaryInterpolation HbrMeshTSetFVarInterpolateBoundaryMethod SdcOptionsSetFVarLinearInterpolation HbrSubdivisionTSetCreaseSubdivisionMethod SdcOptionsSetCreasingMethod Specifying Face Varying Topology and Options Both the way in which face varying data is associated with a mesh and the options used to control its interpolation have changed. The documentation on Compatibility with OpenSubdiv 2.x details the equivalence of interpolation options between Hbr and the new SdcOptionsFVarLinearInterpolation enum, while the section on Face Varying Interpolation illustrates their effects. Face varying data is now specified by index rather than by value, or as often stated, it is specified topologically. Just as vertices for faces are specified by indices into a potential buffer of positions, face varying values are specified by indices into a potential buffer of values. Both vertices and face varying values frequently referred to as FVarValues in the API are assigned and associated with the corners of all faces. In many cases this will simplify representation as many common geometry container formats such as Obj or Alembic specify texture coordinates the same way. For other cases, where a value per face-corner is provided with no indication of which values incident each vertex should be considered shared, it will be necessary to determine shared indices for values at each vertex if any non-linear interpolation is desired. Far Layer Translation While TopologyRefiner was introduced into Far as the new intermediate topology representation, several other changes were made to classes in Far to provide more modular building blocks for use by the Osd layer or directly. OpenSubdiv 2.x OpenSubdiv 3.0 FarMeshU NA, no longer needed FarSubdivisionTables FarStencilTable FarPatchTables FarPatchTable Ordering of Refined Vertices The FarMesh was previously responsible for refining an HbrMesh -- generating new vertices and faces in successive levels of refinement in the FarSubdivisionTables. Vertices were grouped and reordered from the native ordering of HbrMesh so that vertices requiring similar processing were consecutive. Such grouping alleviated most of the idiosyncrasies of HbrMeshs native ordering but not all. FarToplogyRefiner is inherently a collection of refinement levels, and within each refined level so excluding the base level, all components are still grouped for the same reasons. There are two issues here though the ordering of these groups has changed though an option exists to preserve it the ordering of components within these groups is not guaranteed to have been preserved Vertices in a refined level are grouped according to the type of component in the parent level from which they originated, i.e. some vertices originate from the center of a face face-vertices, some from an edge edge-vertices and some from a vertex vertex-vertices. Note that there is a conflict in terminology here -- face-vertices and edge-vertices most often refer to vertices incident a face or edge -- but for the sake of this discussion, we use them to refer to the component from which a child vertex originates. The following table shows the ordering of these groups in 2.x and the two choices available in 3.0. The option is the orderVerticesFromFacesFirst flag that can be set in the Option structs passed to the uniform and adaptive refinement methods of TopologyRefiner Version and option Vertex group ordering 2.x face-vertices, edge-vertices, vertex-vertices 3.0 default vertex-vertices, face-vertices, edge-vertices 3.0 orderVerticesFromFacesFirst true face-vertices, edge-vertices, vertex-vertices The decision to change the default ordering was based on common feedback the rationale was to allow a trivial mapping from vertices in the cage to their descendants at all refinement levels. While the grouping is fundamental to the refinement process, the ordering of the groups is internally flexible, and the full set of possible orderings can be made publicly available in future if there is demand for such flexibility. The ordering of vertices within these groups was never clearly defined given the way that HbrMesh applied its refinement. For example, for the face-vertices in a level, it was never clear which face-vertices would be first as it depended on the order in which HbrMesh traversed the parent faces and generated them. Given one face, HbrMesh would often visit neighboring faces first before moving to the next intended face. The ordering with FarTopologyRefiner is much clearer and predictable. Using the face-vertices as an example, the order of the face-vertices in level N1 is identical to the order of the parent faces in level N from which they originated. So if we have face-vertices Vi , Vj and Vk at some level, originating from faces Fi , Fj and Fk in the previous level, they will be ordered in increasing order of i , j and k . For uniform refinement the ordering of face vertices Vi will therefore exactly match the ordering of the parent faces Fi . For adaptive or otherwise sparse refinement, the subset of Vi will be ordered similarly, just with components missing from those not refined. The same is true of all vertices, i.e. edge-vertices and vertex-vertices, and also for other components in refined levels, i.e. the child faces and edges. For child faces and edges, more than one will originate from the same parent face or edge. In addition to the overall ordering based on the parent faces or edges, another ordering is imposed on multiple children originating from the same face or edge. They will be ordered based on the corner or end-vertex with which they are associated. In the case of refined faces, another way to view the ordering is to consider the way that faces are originally defined -- by specifying the set of vertices for the corners of each face, often aggregated into a single large array. The ordering of the set of refined faces for each level will correspond directly to such an array of vertices per face in the previous level. Osd Layer Translation Two big changes in the 3.0 API have allowed the Osd layer to be significantly simpler, the first is the move to stencil tables from subdivision tables and the second is shader simplification. With this refactoring, the focus has been to use more meaningful names and to make the data contained within an object more apparent. Controller Objects The API-specific ComputeController has been replaced with the Evaluator . It reflects the fact that stencil compute batches are significantly simpler than subdivision table compute batches. The name Evaluator was chosen with the hope that is more meaningful than the generic ComputeController moniker the Evaluator evaluates stencil and patch tables. In the 2.x code base, subdiv level buffers were always required to be allocated contiguously, however in 3.0 with the shift to stencil tables, this strict allocation scheme is no longer required. As a result, the EvalStencils and EvalPatches methods now accept both a source and a destination descriptor. OpenSubdiv 2.x OpenSubdiv 3.0 ComputeControllerRefine Osd...EvaluatorEvalStencils ComputeControllerSynchronize Osd...EvaluatorSynchronize EvalStencilsControllerUpdateValues Osd...EvaluatorEvalStencils EvalStencilsControllerUpdateDerivs Osd...EvaluatorEvalStencils EvalLimitControllerEvalLimitSample Osd...EvaluatorEvalPatches Also note that OsdVertexDescriptor has been renamed, however its data members and semantic purpose remains the same OpenSubdiv 2.x OpenSubdiv 3.0 OsdVertexBufferDescriptor OsdBufferDescriptor ComputeContext, DrawContext ComputeContext and DrawContext have been replaced with API-specific StencilTable and PatchTable objects, for example OsdGLStencilTableSSBO. OpenSubdiv 2.x OpenSubdiv 3.0 ComputeContext Osd...StencilTable e.g. GLStencilTableTBO EvalStencilsContext Osd...StencilTable DrawContext Osd...PatchTable e.g. GLPatchTable EvalLimitContext The data stored in EvalLimitContext has been merged into the Evaluator class as well. EvalCoords have been moved into their own type, OsdPatchCoords. The primary change here is that the PTex face ID is no longer part of the data structure, rather the client can use a FarPatchMap to convert from PTex face ID to a FarPatchTablePatchHandle. OpenSubdiv 2.x OpenSubdiv 3.0 EvalLimitContext PatchTable EvalLimitContextEvalCoords OsdPatchCoords types.h OsdMesh While not strictly required, OsdMesh is still supported in 3.0 as convenience API for allocating buffers. OsdMesh serves as a simple way to allocate all required data, in the location required by the API for example, GPU buffers for OpenGL. OsdKernelBatch No translation, it is no longer part of the API. OsdVertex No translation, it is no longer part of the API. Feature Adaptive Shader Changes In 3.0, the feature adaptive screen-space tessellation shaders have been dramatically simplified, and the client-facing API has changed dramatically as well. The primary shift is to reduce the total number of shader combinations, and as a result, some of the complexity management mechanisms are no longer necessary. In the discussion below, some key changes are highlighted, but deep integrations may require additional discussion please feel free to send follow up questions to the OpenSubdiv google group. The number of feature adaptive shaders has been reduced from N to exactly 1 or 2, depending on how end-caps are handled. Osd layer no longer compiles shaders, rather it returns shader source for the client to compile. This source is obtained via OsdGLSLHLSLPatchShaderSource. The API exposed in shaders to access patch-based data has been consolidated and formalized, see osdglslPatchCommon.glsl and osdhlslPatchCommon.hlsl for details. Patches are no longer rotated and transition patches have been eliminated, simplifying PatchDescriptor to a 4 bits. Additionally, FarPatchTablesDescriptor has been moved into its own class in the Far namespace. The following table outlines the API translation between 2.x and 3.0 OpenSubdiv 2.x OpenSubdiv 3.0 OsdDrawContextPatchDescriptor NA, no longer needed. OsdDrawContextPatchArray OSdPatchArray types.h FarPatchTablesPatchDescriptor FarPatchDescriptor patchDescriptor.h FarPatchTablesPatchArray made private. End Cap Strategies By default, OpenSubdiv uses Gregory patches to approximate the patches around extraordinary vertices at the maximum isolation level, this process is referred to as end-capping. If ENDCAP_BSPLINE_BASIS is specified to PatchTableFactoryOptions, BSpline patches are used, which gives less accuracy, but it makes possible to render an entire mesh in a single draw call. Both patches require additional control points that are not part of the mesh, we refer to these as local points. In 3.0, the local points of those patches are computed by applying a stencil table to refined vertices to construct a new stencil table for the local points. Since this new stencil table is topologically compatible with the primary stencil table for refinement, it is convenient and efficient to splice those stencil tables together. This splicing can be done in the following way FarStencilTable const refineStencils FarStencilTableFactoryCreatetopologyRefiner FarPatchTable cosnt patchTable FarPatchTableFactoryCreatetopologyRefiner FarStencilTable const localPointStencils patchTable-GetLocalPointStencilTable FarStencilTable const splicedStencils FarStencilTableFactoryAppendLocalPointStencilTablestopologyRefiner, refineStencils, localPointStencils NOTE Once the spliced stencil table is created, the refined stencils can be released, but the local point stencils are owned by patchTable, it should not be released. OpenSubdiv 3.0 also supports 2.x style Gregory patches, if ENDCAP_LEGACY_GREGORY is specified to PatchTableFactoryOptions. In this case, such an extra stencil splicing isnt needed, however clients must still bind additional buffers VertexValence buffer and QuadOffsets buffer. See OsdGLLegacyGregoryPatchTable for additional details. Changes to Subdivision The refactoring of OpenSubdiv 3.0 data representations presented a unique opportunity to revisit some corners of the subdivision specification and remove or update some legacy features -- none of which was taken lightly. More details are provided in Subdivision Compatibility , while the following offers a quick overview All face-varying interpolation options have been combined into a single enum. Vertex interpolation options have been renamed or removed The naming of the standard creasing method has changed from Normal to Uniform . Unused legacy modes of the smoothtriangle option have been removed. The averaging of Chaikin creasing with infinitely sharp edges has changed. Support for Hierarchical Edits has been removed. Build Support for Combining 2.x and 3.0 Running OpenSubdiv 2.0 and 3.0 in a single process is supported, however some special care must be taken to avoid namespace collisions, both in terms of run-time symbols avoid using OpenSubdivOsd, for example and in terms of build-time search paths. To support both OpenSubdiv 2.0 and 3.0 in your build environment, you can prefix the header install directory of OpenSubdiv 3.0. Do this using the build flag CMAKE_INCDIR_BASE when configuring cmake i.e. -DCMAKE_INCDIR_BASEincludeopensubdiv3 and then including files from opensubdiv3... in client code. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "osd_overview.html" │ │ │ │ │ + "loc": "porting.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "OSD Tessellation shader Interface", │ │ │ │ │ - "text": "OSD Tessellation shader Interface OSD Tessellation shader Interface 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Basic Tessellation Control Shader Example for B-Spline patches Tessellation Evaluation Shader Example for B-Spline patches Basis Conversion B-spline Patch Gregory Basis Patch Box-spline Triangle Patch Gregory Triangle Patch Legacy Gregory Patch 2.x compatibility Tessellation levels Tessellation levels at each tessellated vertex Tessellation levels computed at each patch Uniform Screenspace Basic Starting with 3.0, Osd tessellation shaders can be used as a set of functions from client shader code. In order to tessellate Osd patches, client shader code should perform the following steps regular B-spline patch case In a tessellation control shader fetch a PatchParam for the current patch call OsdComputePerPatchVertexBSpline to compute OsdPerPatchVertexBezier. compute tessellation level. To prevent cracks on transition patches, two vec4 parameters tessOuterHi, tessOuterLo will be needed in addition to built-in gl_TessLevelInnerOuters. In a tessellation evaluation shader call OsdGetTessParameterization to remap gl_TessCoord to a patch parameter at which to evaluate. call OsdEvalPatchBezierOsdEvalPatchGregory to evaluate the current patch. The following is a minimal example of GLSL code explaining how client shader code uses OpenSubdiv shader functions to tessellate patches of a patch table. Tessellation Control Shader Example for B-Spline patches layout vertices 16 out in vec3 position patch out vec4 tessOuterLo , tessOuterHi out OsdPerPatchVertexBezier v void main Get a patch param from texture buffer. ivec3 patchParam OsdGetPatchParam gl_PrimitiveID Compute per-patch vertices. OsdComputePerPatchVertexBSpline patchParam , gl_InvocationID , position , v Compute tessellation factors. if gl_InvocationID 0 vec4 tessLevelOuter vec4 0 vec2 tessLevelInner vec2 0 OsdGetTessLevelsUniform patchParam , tessLevelOuter , tessLevelInner , tessOuterLo , tessOuterHi gl_TessLevelOuter 0 tessLevelOuter 0 gl_TessLevelOuter 1 tessLevelOuter 1 gl_TessLevelOuter 2 tessLevelOuter 2 gl_TessLevelOuter 3 tessLevelOuter 3 gl_TessLevelInner 0 tessLevelInner 0 gl_TessLevelInner 1 tessLevelInner 1 Tessellation Evaluation Shader Example for B-Spline patches layout quads in patch in vec4 tessOuterLo , tessOuterHi in OsdPerPatchVertexBezier v uniform mat4 mvpMatrix void main Compute tesscoord. vec2 UV OsdGetTessParameterization gl_TessCoord . xy , tessOuterLo , tessOuterHi vec3 P vec3 0 , dPu vec3 0 , dPv vec3 0 vec3 N vec3 0 , dNu vec3 0 , dNv vec3 0 ivec3 patchParam inpt 0 . v . patchParam Evaluate patch at the tess coord UV OsdEvalPatchBezier patchParam , UV , v , P , dPu , dPv , N , dNu , dNv Apply model-view-projection matrix. gl_Position mvpMatrix vec4 P , 1 Basis Conversion B-spline Patch The following diagram shows how the Osd shaders process b-spline patches. While regular patches are expressed as b-spline patches in FarPatchTable, the Osd shader converts them into Bezier basis patches for simplicity and efficiency. This conversion is performed in the tessellation control stage. The boundary edge evaluation and single crease matrix evaluation are also resolved during this conversion. OsdComputePerPatchVertexBSpline can be used for this process. The resulting Bezier control vertices are stored in OsdPerPatchVertexBezier struct. void OsdComputePerPatchVertexBSpline ivec3 patchParam , int ID , vec3 cv 16 , out OsdPerPatchVertexBezier result The tessellation evaluation shader takes an array of OsdPerPatchVertexBezier struct, and then evaluates the patch using the OsdEvalPatchBezier function. void OsdEvalPatchBezier ivec3 patchParam , vec2 UV , OsdPerPatchVertexBezier cv 16 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Gregory Basis Patch In a similar way, Gregory basis patches are processed as follows OsdComputePerPatchVertexGregoryBasis can be used for the Gregory patches although no basis conversion involved for the Gregory patches and the resulting vertices are stored in a OsdPerPatchVertexGreogryBasis struct. void OsdComputePerPatchVertexGregoryBasis ivec3 patchParam , int ID , vec3 cv , out OsdPerPatchVertexGregoryBasis result The tessellation evaluation shader takes an array of OsdPerPatchVertexGregoryBasis struct, and then evaluates the patch using the OsdEvalPatchGregory function. void OsdEvalPatchGregory ivec3 patchParam , vec2 UV , vec3 cv 20 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Box-spline Triangle Patch While regular triangle patches are expressed as triangular box-spline patches in FarPatchTable, the Osd shader converts them into triangular Bezier patches for consistency. This conversion is performed in the tessellation control stage. The boundary edge evaluation is resolved during this conversion. OsdComputePerPatchVertexBoxSplineTriangle can be used for this process. The resulting Bezier control vertices are stored in OsdPerPatchVertexBezier struct. void OsdComputePerPatchVertexBoxSplineTriangle ivec3 patchParam , int ID , vec3 cv 12 , out OsdPerPatchVertexBezier result The tessellation evaluation shader takes an array of OsdPerPatchVertexBezier struct, and then evaluates the patch using the OsdEvalPatchBezierTriangle function. void OsdEvalPatchBezierTriangle ivec3 patchParam , vec2 UV , OsdPerPatchVertexBezier cv 15 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Gregory Triangle Patch OsdComputePerPatchVertexGregoryBasis can be used for the quartic triangular Gregory patches although no basis conversion involved for the Gregory triangle patches and the resulting vertices are stored in a OsdPerPatchVertexGreogryBasis struct. void OsdComputePerPatchVertexGregoryBasis ivec3 patchParam , int ID , vec3 cv , out OsdPerPatchVertexGregoryBasis result The tessellation evaluation shader takes an array of OsdPerPatchVertexGregoryBasis struct, and then evaluates the patch using the OsdEvalPatchGregoryTriangle function. void OsdEvalPatchGregoryTriangle ivec3 patchParam , vec2 UV , vec3 cv 18 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Legacy Gregory Patch 2.x compatibility OpenSubdiv 3.0 also supports 2.x style Gregory patch evaluation see far_overview. In order to evaluate a legacy Gregory patch, client needs to bind extra buffers and to perform extra steps in the vertex shader as shown in the following diagram Tessellation levels Osd provides both uniform and screen-space adaptive tessellation level computation. Because of the nature of feature adaptive subdivision , we need to pay extra attention for a patchs outer tessellation level for the screen-space adaptive case so that cracks dont appear. An edge of the patch marked as a transition edge is split into two segments Hi and Lo. The Osd shaders uses these two segments to ensure the same tessellation along the edge between different levels of subdivision. In the following example, suppose the left hand side patch has determined the tessellation level of its right edge to be 5. gl_TessLevelOuter is set to 5 for the edge, and at the same time we also pass 2 and 3 to the tessellation evaluation shader as separate levels for the two segments of the edge split at the middle. Tessellation levels at each tessellated vertex The tessellation evaluation shader takes gl_TessCoord and those two values, and remaps gl_TessCoord using OsdGetTessParameterization or OsdGetTessLevelParameterizationTriangle to ensure the parameters are consistent across adjacent patches. vec2 OsdGetTessParameterization vec2 uv , vec4 tessOuterLo , vec4 tessOuterHi vec2 OsdGetTessParameterizationTriangle vec3 uvw , vec4 tessOuterLo , vec4 tessOuterHi Tessellation levels computed at each patch These tessellation levels can be computed the corresponding method in the tesselation control shader. Note that these functions potentially requires all bezier control points, you need to call barrier to ensure the conversion is done for all invocations. See osdglslPatchBSpline.glsl for more details. Uniform void OsdGetTessLevelsUniform ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi void OsdGetTessLevelsUniformTriangle ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi Screenspace void OsdEvalPatchBezierTessLevels OsdPerPatchVertexBezier cpBezier 16 , ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi void OsdEvalPatchBezierTriangleTessLevels vec3 cv 15 , ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "OSD Tessellation shader Interface OSD Tessellation shader Interface 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Basic Tessellation Control Shader Example for B-Spline patches Tessellation Evaluation Shader Example for B-Spline patches Basis Conversion B-spline Patch Gregory Basis Patch Box-spline Triangle Patch Gregory Triangle Patch Legacy Gregory Patch 2.x compatibility Tessellation levels Tessellation levels at each tessellated vertex Tessellation levels computed at each patch Uniform Screenspace Basic Starting with 3.0, Osd tessellation shaders can be used as a set of functions from client shader code. In order to tessellate Osd patches, client shader code should perform the following steps regular B-spline patch case In a tessellation control shader fetch a PatchParam for the current patch call OsdComputePerPatchVertexBSpline to compute OsdPerPatchVertexBezier. compute tessellation level. To prevent cracks on transition patches, two vec4 parameters tessOuterHi, tessOuterLo will be needed in addition to built-in gl_TessLevelInnerOuters. In a tessellation evaluation shader call OsdGetTessParameterization to remap gl_TessCoord to a patch parameter at which to evaluate. call OsdEvalPatchBezierOsdEvalPatchGregory to evaluate the current patch. The following is a minimal example of GLSL code explaining how client shader code uses OpenSubdiv shader functions to tessellate patches of a patch table. Tessellation Control Shader Example for B-Spline patches layout vertices 16 out in vec3 position patch out vec4 tessOuterLo , tessOuterHi out OsdPerPatchVertexBezier v void main Get a patch param from texture buffer. ivec3 patchParam OsdGetPatchParam gl_PrimitiveID Compute per-patch vertices. OsdComputePerPatchVertexBSpline patchParam , gl_InvocationID , position , v Compute tessellation factors. if gl_InvocationID 0 vec4 tessLevelOuter vec4 0 vec2 tessLevelInner vec2 0 OsdGetTessLevelsUniform patchParam , tessLevelOuter , tessLevelInner , tessOuterLo , tessOuterHi gl_TessLevelOuter 0 tessLevelOuter 0 gl_TessLevelOuter 1 tessLevelOuter 1 gl_TessLevelOuter 2 tessLevelOuter 2 gl_TessLevelOuter 3 tessLevelOuter 3 gl_TessLevelInner 0 tessLevelInner 0 gl_TessLevelInner 1 tessLevelInner 1 Tessellation Evaluation Shader Example for B-Spline patches layout quads in patch in vec4 tessOuterLo , tessOuterHi in OsdPerPatchVertexBezier v uniform mat4 mvpMatrix void main Compute tesscoord. vec2 UV OsdGetTessParameterization gl_TessCoord . xy , tessOuterLo , tessOuterHi vec3 P vec3 0 , dPu vec3 0 , dPv vec3 0 vec3 N vec3 0 , dNu vec3 0 , dNv vec3 0 ivec3 patchParam inpt 0 . v . patchParam Evaluate patch at the tess coord UV OsdEvalPatchBezier patchParam , UV , v , P , dPu , dPv , N , dNu , dNv Apply model-view-projection matrix. gl_Position mvpMatrix vec4 P , 1 Basis Conversion B-spline Patch The following diagram shows how the Osd shaders process b-spline patches. While regular patches are expressed as b-spline patches in FarPatchTable, the Osd shader converts them into Bezier basis patches for simplicity and efficiency. This conversion is performed in the tessellation control stage. The boundary edge evaluation and single crease matrix evaluation are also resolved during this conversion. OsdComputePerPatchVertexBSpline can be used for this process. The resulting Bezier control vertices are stored in OsdPerPatchVertexBezier struct. void OsdComputePerPatchVertexBSpline ivec3 patchParam , int ID , vec3 cv 16 , out OsdPerPatchVertexBezier result The tessellation evaluation shader takes an array of OsdPerPatchVertexBezier struct, and then evaluates the patch using the OsdEvalPatchBezier function. void OsdEvalPatchBezier ivec3 patchParam , vec2 UV , OsdPerPatchVertexBezier cv 16 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Gregory Basis Patch In a similar way, Gregory basis patches are processed as follows OsdComputePerPatchVertexGregoryBasis can be used for the Gregory patches although no basis conversion involved for the Gregory patches and the resulting vertices are stored in a OsdPerPatchVertexGreogryBasis struct. void OsdComputePerPatchVertexGregoryBasis ivec3 patchParam , int ID , vec3 cv , out OsdPerPatchVertexGregoryBasis result The tessellation evaluation shader takes an array of OsdPerPatchVertexGregoryBasis struct, and then evaluates the patch using the OsdEvalPatchGregory function. void OsdEvalPatchGregory ivec3 patchParam , vec2 UV , vec3 cv 20 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Box-spline Triangle Patch While regular triangle patches are expressed as triangular box-spline patches in FarPatchTable, the Osd shader converts them into triangular Bezier patches for consistency. This conversion is performed in the tessellation control stage. The boundary edge evaluation is resolved during this conversion. OsdComputePerPatchVertexBoxSplineTriangle can be used for this process. The resulting Bezier control vertices are stored in OsdPerPatchVertexBezier struct. void OsdComputePerPatchVertexBoxSplineTriangle ivec3 patchParam , int ID , vec3 cv 12 , out OsdPerPatchVertexBezier result The tessellation evaluation shader takes an array of OsdPerPatchVertexBezier struct, and then evaluates the patch using the OsdEvalPatchBezierTriangle function. void OsdEvalPatchBezierTriangle ivec3 patchParam , vec2 UV , OsdPerPatchVertexBezier cv 15 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Gregory Triangle Patch OsdComputePerPatchVertexGregoryBasis can be used for the quartic triangular Gregory patches although no basis conversion involved for the Gregory triangle patches and the resulting vertices are stored in a OsdPerPatchVertexGreogryBasis struct. void OsdComputePerPatchVertexGregoryBasis ivec3 patchParam , int ID , vec3 cv , out OsdPerPatchVertexGregoryBasis result The tessellation evaluation shader takes an array of OsdPerPatchVertexGregoryBasis struct, and then evaluates the patch using the OsdEvalPatchGregoryTriangle function. void OsdEvalPatchGregoryTriangle ivec3 patchParam , vec2 UV , vec3 cv 18 , out vec3 P , out vec3 dPu , out vec3 dPv , out vec3 N , out vec3 dNu , out vec3 dNv Legacy Gregory Patch 2.x compatibility OpenSubdiv 3.0 also supports 2.x style Gregory patch evaluation see far_overview. In order to evaluate a legacy Gregory patch, client needs to bind extra buffers and to perform extra steps in the vertex shader as shown in the following diagram Tessellation levels Osd provides both uniform and screen-space adaptive tessellation level computation. Because of the nature of feature adaptive subdivision , we need to pay extra attention for a patchs outer tessellation level for the screen-space adaptive case so that cracks dont appear. An edge of the patch marked as a transition edge is split into two segments Hi and Lo. The Osd shaders uses these two segments to ensure the same tessellation along the edge between different levels of subdivision. In the following example, suppose the left hand side patch has determined the tessellation level of its right edge to be 5. gl_TessLevelOuter is set to 5 for the edge, and at the same time we also pass 2 and 3 to the tessellation evaluation shader as separate levels for the two segments of the edge split at the middle. Tessellation levels at each tessellated vertex The tessellation evaluation shader takes gl_TessCoord and those two values, and remaps gl_TessCoord using OsdGetTessParameterization or OsdGetTessLevelParameterizationTriangle to ensure the parameters are consistent across adjacent patches. vec2 OsdGetTessParameterization vec2 uv , vec4 tessOuterLo , vec4 tessOuterHi vec2 OsdGetTessParameterizationTriangle vec3 uvw , vec4 tessOuterLo , vec4 tessOuterHi Tessellation levels computed at each patch These tessellation levels can be computed the corresponding method in the tesselation control shader. Note that these functions potentially requires all bezier control points, you need to call barrier to ensure the conversion is done for all invocations. See osdglslPatchBSpline.glsl for more details. Uniform void OsdGetTessLevelsUniform ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi void OsdGetTessLevelsUniformTriangle ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi Screenspace void OsdEvalPatchBezierTessLevels OsdPerPatchVertexBezier cpBezier 16 , ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi void OsdEvalPatchBezierTriangleTessLevels vec3 cv 15 , ivec3 patchParam , out vec4 tessLevelOuter , out vec2 tessLevelInner , out vec4 tessOuterLo , out vec4 tessOuterHi Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "osd_shader_interface.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "mtlPtexViewer", │ │ │ │ │ - "text": "mtlPtexViewer mtlPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION KEYBOARD CONTROLS SEE ALSO SYNOPSIS open mtlPtexViewer.app --args -yup -u -a -l isolation level ptex color file ptex displacement file DESCRIPTION mtlPtexViewer is a stand-alone application demonstrating shading with color and displacement ptex maps. Multiple controls are available to experiment with the algorithms. KEYBOARD CONTROLS q quit f fit frame - increase decrease tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "OSD Overview", │ │ │ │ │ + "text": "OSD Overview OSD Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE OpenSubdiv Osd Refinement Limit Stencil Evaluation Limit Evaluation with PatchTable OpenGLDX11Metal Drawing with Hardware Tessellation InterleavedBatched Buffer Configuration Cross-Platform Implementation OpenSubdiv Osd Osd contains device dependent code that makes Far structures available on various backends such as TBB, CUDA, OpenCL, GLSL, etc. The main roles of Osd are Refinement Compute stencil-based uniformadaptive subdivision on CPUGPU backends Limit Stencil Evaluation Compute limit surfaces by limit stencils on CPUGPU backends Limit Evaluation with PatchTable Compute limit surfaces by patch evaluation on CPUGPU backends OpenGLDX11Metal Drawing with hardware tessellation Provide GLSLHLSLMetal tessellation functions for patch table InterleavedBatched buffer configuration Provide consistent buffer descriptor to deal with arbitrary buffer layout. Cross-Platform Implementation Provide convenient classes to interop between compute and draw APIs These are independently used by clients. For example, a client can use only the limit stencil evaluation, or a client can refine subdivision surfaces and draw them with the PatchTable and Osd tessellation shaders. All device specific evaluation kernels are implemented in the Evaluator classes. Since Evaluators dont own vertex buffers, clients should provide their own buffers as a source and destination. There are some interop classes defined in Osd for convenience. OpenSubdiv utilizes a series of regression tests to compare and enforce identical results across different computational devices. Refinement Osd supports both uniform and feature adaptive subdivision. Once clients create a FarStencilTable for the topology, they can convert it into device-specific stencil tables if necessary. The following table shows which evaluator classes and stencil table interfaces can be used together. Note that while Osd provides these stencil table classes which can be easily constructed from FarStencilTable, clients arent required to use these table classes. Clients may have their own entities as a stencil tables as long as EvaluatorEvalStencils can access the necessary interfaces. Backend Evaluator class compatible stencil table CPU CPU single-threaded CpuEvaluator FarStencilTable TBB CPU multi-threaded TbbEvaluator FarStencilTable OpenMP CPU multi-threaded OmpEvaluator FarStencilTable CUDA GPU CudaEvaluator CudaStencilTable OpenCL CPUGPU CLEvaluator CLStencilTable GL ComputeShader GPU GLComputeEvaluator GLStencilTableSSBO GL Transform Feedback GPU GLXFBEvaluator GLStencilTableTBO DX11 ComputeShader GPU D3D11ComputeEvaluator D3D11StencilTable Metal GPU MTLComputeEvaluator MTLStencilTable Limit Stencil Evaluation Limit stencil evaluation is quite similar to refinement in Osd . At first clients create FarLimitStencilTable for the locations to evaluate the limit surfaces, then convert it into an evaluator compatible stencil table and call EvaluatorEvalStencils. Limit Evaluation with PatchTable Another way to evaluate the limit surfaces is to use the PatchTable. Once all control vertices and local points are resolved by the stencil evaluation, Osd can evaluate the limit surfaces through the PatchTable. Backend Evaluator class compatible patch table CPU CPU single-threaded CpuEvaluator CpuPatchTable TBB CPU multi-threaded TbbEvaluator CpuPatchTable OpenMP CPU multi-threaded OmpEvaluator CpuPatchTable CUDA GPU CudaEvaluator CudaPatchTable OpenCL CPUGPU CLEvaluator CLPatchTable GL ComputeShader GPU GLComputeEvaluator GLPatchTable GL Transform Feedback GPU GLXFBEvaluator GLPatchTable DX11 ComputeShader GPU D3D11ComputeEvaluator not yet supported D3D11PatchTable Metal ComputeShader GPU MTLComputeEvaluator MTLPatchTable Release Notes 3.x Osd evaluation backends EvaluatorEvalPatches do not support evaluation of single-crease or Legacy Gregory patch types. OpenGLDX11Metal Drawing with Hardware Tessellation One of the most interesting use cases of the Osd layer is realtime drawing of subdivision surfaces using hardware tessellation. This is somewhat similar to limit evaluation with PatchTable described above. Drawing differs from limit evaluation in that Osd provides shader snippets for patch evaluation and clients will inject them into their own shader source. See shader interface for a more detailed discussion of the shader interface. InterleavedBatched Buffer Configuration All Osd layer APIs assume that each primitive variables to be computed points, colors, uvs ... are contiguous arrays of 32bit floating point values. The Osd API refers to such an array as a buffer. A buffer can exist on CPU memory or GPU memory. Osd Evaluators typically take one source buffer and one destination buffer, or three destination buffers if derivatives are being computed. Osd Evaluators also take BufferDescriptors, that are used to specify the layout of the source and destination buffers. A BufferDescriptor is a struct of 3 integers which specify an offset, length and stride. For example Vertex 0 Vertex 1 ... X Y Z X Y Z ... The layout of this buffer can be described as Osd BufferDescriptor desc offset 0 , length 3 , stride 3 BufferDescriptor can be used for an interleaved buffer too. Vertex 0 Vertex 1 ... X Y Z R G B A X Y Z R G B A ... Osd BufferDescriptor xyzDesc 0 , 3 , 7 Osd BufferDescriptor rgbaDesc 3 , 4 , 7 Although the source and destination buffers dont need to be the same buffer for EvalStencils, adaptive patch tables are constructed to first index the coarse vertices and the refined vertices immediately afterward. In this case, the BufferDescriptor for the destination should include the offset as the number of coarse vertices to be skipped. Coarse vertices n Src Refined vertices Dst Vertex 0 Vertex 1 ... Vertex n Vertex n1 X Y Z X Y Z ... X Y Z X Y Z ... Osd BufferDescriptor srcDesc 0 , 3 , 3 Osd BufferDescriptor dstDesc n 3 , 3 , 3 Also note that the source descriptor doesnt have to start with offset 0. This is useful when a client has a big buffer with multiple objects batched together. Cross-Platform Implementation One of the key goals of OpenSubdiv is to achieve as much cross-platform flexibility as possible and leverage all optimized hardware paths where available. This can be very challenging as there is a very large variety of plaftorms and APIs available, with very distinct capabilities. In Osd , Evaluators dont care about interops between those APIs. All Evaluators have two kinds of APIs for both EvalStencils and EvalPatches. Explicit signatures which directly take device-specific buffer representation e.g., pointer for CpuEvaluator, GLuint buffer for GLComputeEvaluator, etc. Generic signatures which take arbitrary buffer classes. The buffer class is required to have a certain method to return the device-specific buffer representation. The later interface is useful if the client supports multiple backends at the same time. The methods that need to be implemented for the Evaluators are Evaluator class object method CpuEvaluator TbbEvaluator OmpEvaluator pointer to cpu memory BindCpuBuffer CudaEvaluator pointer to cuda memory BindCudaBuffer CLEvaluator cl_mem BindCLBuffer GLComputeEvaluator GLXFBEvaluator GL buffer object BindVBO D3D11ComputeEvaluator D3D11 UAV BindD3D11UAV MTLComputeEvaluator MTLBuffer BindMTLBuffer The buffers can use these methods as a trigger of interop. Osd provides a default implementation of interop buffer for most of the backend combinations. For example, if the client wants to use CUDA as a computation backend and use OpenGL as the drawing API, OsdCudaGLVertexBuffer fits the case since it implements BindCudaBuffer and BindVBO. Again, clients can implement their own buffer class and pass it to the Evaluators. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "mtlptexviewer.html" │ │ │ │ │ + "loc": "osd_overview.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "Modeling Tips", │ │ │ │ │ - "text": "Modeling Tips Modeling Tips 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Topology Use Fewer Spans Avoid High Valence vertices Edge-Loop Transitions Practical Topology Primer Triangles and N-Gons Semi-Sharp Creases Use crease sets Additional Resources The following sections describe common techniques specific to modeling with subdivision surfaces. Note The following information contains techniques specific to the Catmull-Clark subdivision scheme. Some elements need to be adjusted for Loop surfaces. Topology Well-constructed subdivision meshes have several important properties They consist primarily of regular faces quads for Catmull-Clark, tris for Loop They contain few extraordinary vertices They efficiently describe the intended shape They are topologically manifold Use Fewer Spans While polygon models need to use a large number of spans to approximate smooth curved surfaces, subdivision models require significantly fewer control points. In most situations, 6 spans are enough to create accurate circular shapes, and 4 is often enough to approximate background objects. Avoid High Valence vertices A high valence vertex is a vertex connected to more than 4 adjacent edges. High valence vertices cause several problems when subdivided The Catmull-Clark scheme can produce wavy surfaces when a revolution vertex is surrounded by triangles see here High valence vertices incur fairly large performance hits Currently, OpenSubdiv has a hard constraint imposed by GPU shaders on the maximum valence of a vertex 27 on current hardware Instead, here are some topological strategies to cap revolution shapes Note that all these cylinders use only quad faces, and all the vertices in the caps have a valence of 4 except the bottom left example Edge-Loop Transitions It is often necessary to vary the density of control vertices over the surface mesh areas around the fingers of a hand require more CVs than the comparatively simpler region around the palm. It is important to handle the topology around these transitions efficiently. One strategy is to use extraordinary vertices, such as this example, using a valence 5 vertex to expand 3 edge loops into 5. Practical Topology Primer Some real-world examples showing how to produce detailed shapes with sparse topology, few extraordinary vertices, and no high-valence revolution poles. Triangles and N-Gons Used sparsely, non-quads can be very useful to gather 3 or more diverging edge-loops. These are often encountered in highly deforming areas with curvature saddle-points ex arm-torso connection. The strategic placement of a pentagon in one of these critical spots ensures that the surface remains smooth, while allowing for complex topology to flow around. Semi-Sharp Creases Semi-sharp creases can be a very powerful tool for hard-surface modeling. Both edges and vertices can be tagged with a sharpness value. Crease sharpness values range from 0 smooth to 10 infinitely sharp It is generally cheaper to use creases whenever possible, instead of adding extra edgesedge-loops. However... Creases introduce extra computation costs that are proportional to the sharpness value. So... Sharpness values above 5 should rarely be needed. The following sections introduce some techniques to best leverage them. Use crease sets Complex hard-surface models giant robots, vehicles, buildings... are likely to tag large number of edges it is extremely useful to organize these edgesedge loops into logical sets with descriptive names. Edges or vertices in a crease set group all share the same sharpness value. If you are modeling with Maya, the CreaseSetEditor implements this type of workflow. Additionally, for debugging purposes, it is often very helpful if the name of a set contains the sharpness value ex topDeck_2. Besides authoring convenience, one of the benefits of having many edge-loops share identical sharpness values is that it enables very powerful performance optimizations within the feature adaptive algorithm faster renders less memory. Additional Resources An excellent short tutorial from the Guerrilla CG Project that illustrates many of the common pitfalls of subdivision modeling, and the strategies to overcome them Ivo Kos, Modelling Technical Director at Pixar Animation Studios, shows some of the modeling techniques he uses when modeling props and architecture sets for feature films. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "mtlPtexViewer", │ │ │ │ │ + "text": "mtlPtexViewer mtlPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION KEYBOARD CONTROLS SEE ALSO SYNOPSIS open mtlPtexViewer.app --args -yup -u -a -l isolation level ptex color file ptex displacement file DESCRIPTION mtlPtexViewer is a stand-alone application demonstrating shading with color and displacement ptex maps. Multiple controls are available to experiment with the algorithms. KEYBOARD CONTROLS q quit f fit frame - increase decrease tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "mod_notes.html" │ │ │ │ │ + "loc": "mtlptexviewer.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "mtlViewer", │ │ │ │ │ - "text": "mtlViewer mtlViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION KEYBOARD CONTROLS SEE ALSO SYNOPSIS open mtlViewer.app --args -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION mtlViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. mtlViewer running on macOS mtlViewer running on iOS KEYBOARD CONTROLS q quit f fit frame - increase decrease tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "mtlViewer mtlViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION KEYBOARD CONTROLS SEE ALSO SYNOPSIS open mtlViewer.app --args -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION mtlViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. mtlViewer running on macOS mtlViewer running on iOS KEYBOARD CONTROLS q quit f fit frame - increase decrease tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "mtlviewer.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "Introduction", │ │ │ │ │ - "text": "Introduction Introduction 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Introduction Why Fast Subdivision Research Heritage Licensing Contributing External Resources Introduction OpenSubdiv is a set of open source libraries that implement high performance subdivision surface subdiv evaluation on massively parallel CPU and GPU architectures. This code path is optimized for drawing deforming surfaces with static topology at interactive framerates. OpenSubdiv is an API ready to be integrated into 3rd party digital content creation tools. It is not an application, nor a tool that can be used directly to create digital assets. Why Fast Subdivision Subdivision surfaces are commonly used for final rendering of character shapes for a smooth and controllable limit surfaces. However, subdivision surfaces in interactive apps are typically drawn as their polygonal control hulls because of performance. The polygonal control hull is an approximation that is offset from the true limit surface. Looking at an approximation in the interactive app makes it difficult to see exact contact, like fingers touching a potion bottle or hands touching a cheek. It also makes it difficult to see poke-throughs in cloth simulation if the skin and cloth are both approximations. This problem is particularly bad when one character is much larger than another and unequal subdiv face sizes cause approximation errors to be magnified. Maya and Pixars proprietary Presto animation system can take 100ms to subdivide a character of 30,000 polygons to the second level of subdivision 500,000 polygons. Being able to perform the same operation in less than 3ms allows the user to interact with the smooth, accurate limit surface at all times. Research The new GPU technology behind OpenSubdiv is the result of a joint research effort between Pixar and Microsoft. Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, Mark Meyer, and Tony DeRose ACM Transactions on Graphics, Vol. 31 No. 1 Article 6 January 2012 httpgraphics.pixar.comlibraryGPUSubdivRenderingApaper.pdf Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, and Guenter Greiner. Eurographics Proceedings, Cagliari, 2012 httpsniessnerlab.orgpapers20121semismoothniessner2012efficient.pdf Analytic Displacement Mapping using Hardware Tessellation Matthias Niessner, Charles Loop ACM Transactions on Graphics, Vol. 32 No. 3 Article 26 June 2013 httpsniessnerlab.orgpapers20133analyticniessner2013analytic.pdf Heritage This is the fifth-generation subdiv library in use by Pixars proprietary animation system in a lineage that started with code written by Tony DeRose and Tien Truong for Geris Game in 1996. Each generation has been a from-scratch rewrite that has built upon our experience using subdivision surfaces to make animated films. This code is live, so Pixars changes to OpenSubdiv for current and future films will be released as open source at the same time they are rolled out to Pixar animation production. Subdivision for Modeling and Animation Denis Zorin, Peter Schroder Course Notes of SIGGRAPH 1999 httpwww.multires.caltech.edupubssig99notes.pdf Subdivision Surfaces in Character Animation Tony DeRose, Michael Kass, Tien Truong Proceedings of SIGGRAPH 1998 httpgraphics.pixar.comlibraryGeripaper.pdf Recursively generated B-spline surfaces on arbitrary topological meshes Catmull, E. Clark, J. Computer-Aided Design 10 6 1978 Licensing OpenSubdiv is covered by the Apache License, and is free to use for commercial or non-commercial use. This is the same code that Pixar uses internally for animated film production. Our intent is to encourage a geometry standard for subdivision surfaces, by providing consistent i.e. yielding the same limit surface, high performance implementations on a variety of platforms. Why Apache We were looking for a commercial-friendly license that would convey our patents to the end users. This quickly narrowed the field to Microsoft Public License or Apache. Initially we chose MSPL because it handled trademarks better. But at the request of several companies we gave Apache another look, and decided to go with Apache with a very slight modification that simply says you cannot use any contributors trademarks. In other words, you can use OpenSubdiv to make a product, but you cannot use a Luxo Lamp or other character, etc. when marketing your product. License Header Contributing For details on how to contribute to OpenSubdiv, see the page on Contributing External Resources Pixar Research Pixar RD Portal Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "title": "Modeling Tips", │ │ │ │ │ + "text": "Modeling Tips Modeling Tips 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Topology Use Fewer Spans Avoid High Valence vertices Edge-Loop Transitions Practical Topology Primer Triangles and N-Gons Semi-Sharp Creases Use crease sets Additional Resources The following sections describe common techniques specific to modeling with subdivision surfaces. Note The following information contains techniques specific to the Catmull-Clark subdivision scheme. Some elements need to be adjusted for Loop surfaces. Topology Well-constructed subdivision meshes have several important properties They consist primarily of regular faces quads for Catmull-Clark, tris for Loop They contain few extraordinary vertices They efficiently describe the intended shape They are topologically manifold Use Fewer Spans While polygon models need to use a large number of spans to approximate smooth curved surfaces, subdivision models require significantly fewer control points. In most situations, 6 spans are enough to create accurate circular shapes, and 4 is often enough to approximate background objects. Avoid High Valence vertices A high valence vertex is a vertex connected to more than 4 adjacent edges. High valence vertices cause several problems when subdivided The Catmull-Clark scheme can produce wavy surfaces when a revolution vertex is surrounded by triangles see here High valence vertices incur fairly large performance hits Currently, OpenSubdiv has a hard constraint imposed by GPU shaders on the maximum valence of a vertex 27 on current hardware Instead, here are some topological strategies to cap revolution shapes Note that all these cylinders use only quad faces, and all the vertices in the caps have a valence of 4 except the bottom left example Edge-Loop Transitions It is often necessary to vary the density of control vertices over the surface mesh areas around the fingers of a hand require more CVs than the comparatively simpler region around the palm. It is important to handle the topology around these transitions efficiently. One strategy is to use extraordinary vertices, such as this example, using a valence 5 vertex to expand 3 edge loops into 5. Practical Topology Primer Some real-world examples showing how to produce detailed shapes with sparse topology, few extraordinary vertices, and no high-valence revolution poles. Triangles and N-Gons Used sparsely, non-quads can be very useful to gather 3 or more diverging edge-loops. These are often encountered in highly deforming areas with curvature saddle-points ex arm-torso connection. The strategic placement of a pentagon in one of these critical spots ensures that the surface remains smooth, while allowing for complex topology to flow around. Semi-Sharp Creases Semi-sharp creases can be a very powerful tool for hard-surface modeling. Both edges and vertices can be tagged with a sharpness value. Crease sharpness values range from 0 smooth to 10 infinitely sharp It is generally cheaper to use creases whenever possible, instead of adding extra edgesedge-loops. However... Creases introduce extra computation costs that are proportional to the sharpness value. So... Sharpness values above 5 should rarely be needed. The following sections introduce some techniques to best leverage them. Use crease sets Complex hard-surface models giant robots, vehicles, buildings... are likely to tag large number of edges it is extremely useful to organize these edgesedge loops into logical sets with descriptive names. Edges or vertices in a crease set group all share the same sharpness value. If you are modeling with Maya, the CreaseSetEditor implements this type of workflow. Additionally, for debugging purposes, it is often very helpful if the name of a set contains the sharpness value ex topDeck_2. Besides authoring convenience, one of the benefits of having many edge-loops share identical sharpness values is that it enables very powerful performance optimizations within the feature adaptive algorithm faster renders less memory. Additional Resources An excellent short tutorial from the Guerrilla CG Project that illustrates many of the common pitfalls of subdivision modeling, and the strategies to overcome them Ivo Kos, Modelling Technical Director at Pixar Animation Studios, shows some of the modeling techniques he uses when modeling props and architecture sets for feature films. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ - "loc": "intro.html" │ │ │ │ │ + "loc": "mod_notes.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "License", │ │ │ │ │ - "text": "License License 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Open Source License OpenSubdiv is covered by a modified Apache 2.0 license included below, and is free to use for commercial or non-commercial use. All Pixar patents in the area of subdivision surface algorithms have also been released for public use. We welcome any involvement in the development or extension of this code in fact, we would love it. Please contact us if you are interested. For information on Apache licenses, see httpwww.apache.orglicenses The following license text describes the open source policy adopted by Pixar and is included in every source file. Copyright 2013 Pixar Licensed under the Apache License, Version 2.0 the Apache License with the following modification you may not use this file except in compliance with the Apache License and the following modification to it Section 6. Trademarks. is deleted and replaced with 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required to comply with Section 4c of the License and to reproduce the content of the NOTICE file. You may obtain a copy of the Apache License at httpwww.apache.orglicensesLICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Apache License with the above modification is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "License License 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Open Source License OpenSubdiv is covered by a modified Apache 2.0 license included below, and is free to use for commercial or non-commercial use. All Pixar patents in the area of subdivision surface algorithms have also been released for public use. We welcome any involvement in the development or extension of this code in fact, we would love it. Please contact us if you are interested. For information on Apache licenses, see httpwww.apache.orglicenses The following license text describes the open source policy adopted by Pixar and is included in every source file. Copyright 2013 Pixar Licensed under the Apache License, Version 2.0 the Apache License with the following modification you may not use this file except in compliance with the Apache License and the following modification to it Section 6. Trademarks. is deleted and replaced with 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required to comply with Section 4c of the License and to reproduce the content of the NOTICE file. You may obtain a copy of the Apache License at httpwww.apache.orglicensesLICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Apache License with the above modification is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "license.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "Introduction", │ │ │ │ │ + "text": "Introduction Introduction 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Introduction Why Fast Subdivision Research Heritage Licensing Contributing External Resources Introduction OpenSubdiv is a set of open source libraries that implement high performance subdivision surface subdiv evaluation on massively parallel CPU and GPU architectures. This code path is optimized for drawing deforming surfaces with static topology at interactive framerates. OpenSubdiv is an API ready to be integrated into 3rd party digital content creation tools. It is not an application, nor a tool that can be used directly to create digital assets. Why Fast Subdivision Subdivision surfaces are commonly used for final rendering of character shapes for a smooth and controllable limit surfaces. However, subdivision surfaces in interactive apps are typically drawn as their polygonal control hulls because of performance. The polygonal control hull is an approximation that is offset from the true limit surface. Looking at an approximation in the interactive app makes it difficult to see exact contact, like fingers touching a potion bottle or hands touching a cheek. It also makes it difficult to see poke-throughs in cloth simulation if the skin and cloth are both approximations. This problem is particularly bad when one character is much larger than another and unequal subdiv face sizes cause approximation errors to be magnified. Maya and Pixars proprietary Presto animation system can take 100ms to subdivide a character of 30,000 polygons to the second level of subdivision 500,000 polygons. Being able to perform the same operation in less than 3ms allows the user to interact with the smooth, accurate limit surface at all times. Research The new GPU technology behind OpenSubdiv is the result of a joint research effort between Pixar and Microsoft. Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, Mark Meyer, and Tony DeRose ACM Transactions on Graphics, Vol. 31 No. 1 Article 6 January 2012 httpgraphics.pixar.comlibraryGPUSubdivRenderingApaper.pdf Efficient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces Matthias Niessner, Charles Loop, and Guenter Greiner. Eurographics Proceedings, Cagliari, 2012 httpsniessnerlab.orgpapers20121semismoothniessner2012efficient.pdf Analytic Displacement Mapping using Hardware Tessellation Matthias Niessner, Charles Loop ACM Transactions on Graphics, Vol. 32 No. 3 Article 26 June 2013 httpsniessnerlab.orgpapers20133analyticniessner2013analytic.pdf Heritage This is the fifth-generation subdiv library in use by Pixars proprietary animation system in a lineage that started with code written by Tony DeRose and Tien Truong for Geris Game in 1996. Each generation has been a from-scratch rewrite that has built upon our experience using subdivision surfaces to make animated films. This code is live, so Pixars changes to OpenSubdiv for current and future films will be released as open source at the same time they are rolled out to Pixar animation production. Subdivision for Modeling and Animation Denis Zorin, Peter Schroder Course Notes of SIGGRAPH 1999 httpwww.multires.caltech.edupubssig99notes.pdf Subdivision Surfaces in Character Animation Tony DeRose, Michael Kass, Tien Truong Proceedings of SIGGRAPH 1998 httpgraphics.pixar.comlibraryGeripaper.pdf Recursively generated B-spline surfaces on arbitrary topological meshes Catmull, E. Clark, J. Computer-Aided Design 10 6 1978 Licensing OpenSubdiv is covered by the Apache License, and is free to use for commercial or non-commercial use. This is the same code that Pixar uses internally for animated film production. Our intent is to encourage a geometry standard for subdivision surfaces, by providing consistent i.e. yielding the same limit surface, high performance implementations on a variety of platforms. Why Apache We were looking for a commercial-friendly license that would convey our patents to the end users. This quickly narrowed the field to Microsoft Public License or Apache. Initially we chose MSPL because it handled trademarks better. But at the request of several companies we gave Apache another look, and decided to go with Apache with a very slight modification that simply says you cannot use any contributors trademarks. In other words, you can use OpenSubdiv to make a product, but you cannot use a Luxo Lamp or other character, etc. when marketing your product. License Header Contributing For details on how to contribute to OpenSubdiv, see the page on Contributing External Resources Pixar Research Pixar RD Portal Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "intro.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "HBR Overview", │ │ │ │ │ - "text": "HBR Overview HBR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Hierarchical Boundary Representation Hbr Half-edge Data Structure Half-edge cycles and Manifold Topology Templated Vertex Class Boundary Interpolation Rules Hierarchical Boundary Representation Hbr Hbr is an interconnected topological data representation. The high level of vertex connectivity information makes this representation well suited for creation and editing purposes. It is however inefficient for interactive refinement operations Separate objects are allocated for each vertex and edge with pointers to neighboring vertices and edges. Hbr is also the lowest-level subdivision library in Pixars Photorealistic RenderMan . Note As of OpenSubdiv 3.0, all Hbr dependencies have been removed from the core APIs Sdc , Vtr , Far , Osd . The legacy source code of Hbr is provided purely for regression and legacy purposes. If your code is currently depending on Hbr functionality, we recommend migrating to the newer APIs as we cannot guarantee that this code will be maintained in future releases. For more information see the 3.0 release notes Half-edge Data Structure The current implementation is based on a half-edge data structure. Half-edge cycles and Manifold Topology Because half-edges only carry a reference to their opposite half-edge, a given edge can only access a single neighboring edge cycle. This is a fundamental limitation of the half-edge data structure, in that it cannot represent non-manifold geometry, in particular fan-type topologies. A different approach to topology will probably be necessary in order to accommodate non-manifold geometry. Templated Vertex Class The vertex class has been abstracted into a set of templated function accesses. Providing Hbr with a template vertex class that does not implement these functions allows client-code to use Hbr as a pure topological analysis tool without having to pay any costs for data interpolation. It also allows client-code to remain in complete control of the layout of the vertex data interleaved or non-interleaved. Boundary Interpolation Rules Hbr recognizes 4 rule-sets of boundary interpolation Interpolation Rule-Sets k_InterpolateBoundaryNone k_InterpolateBoundaryEdgeOnly k_InterpolateBoundaryEdgeAndCorner k_InterpolateBoundaryAlwaysSharp This enum is shared for both vertex and face-varying interpolation, with the following distinctions vertex boundaries the BoundaryNone rule skips all boundary vertices results are undefined the AlwaysSharp rule does not apply face-varying boundaries the BoundaryNone rule selects bilinear face-varying interpolation Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "HBR Overview HBR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Hierarchical Boundary Representation Hbr Half-edge Data Structure Half-edge cycles and Manifold Topology Templated Vertex Class Boundary Interpolation Rules Hierarchical Boundary Representation Hbr Hbr is an interconnected topological data representation. The high level of vertex connectivity information makes this representation well suited for creation and editing purposes. It is however inefficient for interactive refinement operations Separate objects are allocated for each vertex and edge with pointers to neighboring vertices and edges. Hbr is also the lowest-level subdivision library in Pixars Photorealistic RenderMan . Note As of OpenSubdiv 3.0, all Hbr dependencies have been removed from the core APIs Sdc , Vtr , Far , Osd . The legacy source code of Hbr is provided purely for regression and legacy purposes. If your code is currently depending on Hbr functionality, we recommend migrating to the newer APIs as we cannot guarantee that this code will be maintained in future releases. For more information see the 3.0 release notes Half-edge Data Structure The current implementation is based on a half-edge data structure. Half-edge cycles and Manifold Topology Because half-edges only carry a reference to their opposite half-edge, a given edge can only access a single neighboring edge cycle. This is a fundamental limitation of the half-edge data structure, in that it cannot represent non-manifold geometry, in particular fan-type topologies. A different approach to topology will probably be necessary in order to accommodate non-manifold geometry. Templated Vertex Class The vertex class has been abstracted into a set of templated function accesses. Providing Hbr with a template vertex class that does not implement these functions allows client-code to use Hbr as a pure topological analysis tool without having to pay any costs for data interpolation. It also allows client-code to remain in complete control of the layout of the vertex data interleaved or non-interleaved. Boundary Interpolation Rules Hbr recognizes 4 rule-sets of boundary interpolation Interpolation Rule-Sets k_InterpolateBoundaryNone k_InterpolateBoundaryEdgeOnly k_InterpolateBoundaryEdgeAndCorner k_InterpolateBoundaryAlwaysSharp This enum is shared for both vertex and face-varying interpolation, with the following distinctions vertex boundaries the BoundaryNone rule skips all boundary vertices results are undefined the AlwaysSharp rule does not apply face-varying boundaries the BoundaryNone rule selects bilinear face-varying interpolation Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "hbr_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Hierarchical Edits", │ │ │ │ │ - "text": "Hierarchical Edits Hierarchical Edits 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Hierarchical Edits Hierarchical Edits Paths Vertex Edits Edge Edits Face Edits Hierarchical Edits To understand the hierarchical aspect of subdivision, we realize that subdivision itself leads to a natural hierarchy after the first level of subdivision, each face in a subdivision mesh subdivides to four quads in the Catmull-Clark scheme, or four triangles in the Loop scheme. This creates a parent and child relationship between the original face and the resulting four subdivided faces, which in turn leads to a hierarchy of subdivision as each child in turn subdivides. A hierarchical edit is an edit made to any one of the faces, edges, or vertices that arise anywhere during subdivision. Normally these subdivision components inherit values from their parents based on a set of subdivision rules that depend on the subdivision scheme. A hierarchical edit overrides these values. This allows for a compact specification of localized detail on a subdivision surface, without having to express information about the rest of the subdivision surface at the same level of detail. Release Notes 3.0.0 Hierarchical Edits have been marked as extended specification and support for hierarchical features has been removed from the 3.0 release. This decision allows for great simplifications of many areas of the subdivision algorithms. If we can identify legitimate use-cases for hierarchical tags, we will consider re-implementing them in future releases, as time and resources allow. Hierarchical Edits Paths In order to perform a hierarchical edit, we need to be able to name the subdivision component we are interested in, no matter where it may occur in the subdivision hierarchy. This leads us to a hierarchical path specification for faces, since once we have a face we can navigate to an incident edge or vertex by association. We note that in a subdivision mesh, a face always has incident vertices, which are labelled in relation to the face with an integer index starting at zero and in consecutive order according to the usual winding rules for subdivision surfaces. Faces also have incident edges, and these are labelled according to the origin vertex of the edge. In this diagram, the indices of the vertices of the base face are marked in red so on the left we have an extraordinary Catmull-Clark face with five vertices labeled 0-4 and on the right we have a regular Catmull-Clark face with four vertices labelled 0-3 . The indices of the child faces are blue note that in both the extraordinary and regular cases, the child faces are indexed the same way, i.e. the sub-face labeled n has one incident vertex that is the result of the subdivision of the parent vertex also labeled n in the parent face. Specifically, we note that the sub-face 1 in both the regular and extraordinary face is nearest to the vertex labelled 1 in the parent. The indices of the vertices of the child faces are labeled green , and this is where the difference lies between the extraordinary and regular case in the extraordinary case, vertex to vertex subdivision always results in a vertex labeled 0 , while in the regular case, vertex to vertex subdivision assigns the same index to the child vertex. Again, specifically, we note that the parent vertex indexed 1 in the extraordinary case has a child vertex 0 , while in the regular case the parent vertex indexed 1 actually has a child vertex that is indexed 1 . Note that this indexing scheme was chosen to maintain the property that the vertex labeled 0 always has the lowest uv parametric value on the face. By appending a vertex index to a face index, we can create a vertex path specification. For example, 655 2 3 0 specifies the 1st. vertex of the 3 rd. child face of the 2 nd. child face of the of the 655 th. face of the subdivision mesh. Vertex Edits Vertex hierarchical edits can modify the value or the sharpness of primitive variables for vertices and sub-vertices anywhere in the subdivision hierarchy. The edits are performed using either an add or a set operator. set indicates the primitive variable value or sharpness is to be set directly to the values specified. add adds a value to the normal result computed via standard subdivision rules. In other words, this operation allows value offsets to be applied to the mesh at any level of the hierarchy. Edge Edits Edge hierarchical edits can only modify the sharpness of primitive variables for edges and sub-edges anywhere in the subdivision hierarchy. Face Edits Face hierarchical edits can modify several properties of faces and sub-faces anywhere in the subdivision hierarchy. Modifiable properties include The set or add operators modify the value of primitive variables associated with faces. The hole operation introduces holes missing faces into the subdivision mesh at any level in the subdivision hierarchy. The faces will be deleted, and none of their children will appear you cannot unhole a face if any ancestor is a hole. This operation takes no float or string arguments. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Hierarchical Edits Hierarchical Edits 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Hierarchical Edits Hierarchical Edits Paths Vertex Edits Edge Edits Face Edits Hierarchical Edits To understand the hierarchical aspect of subdivision, we realize that subdivision itself leads to a natural hierarchy after the first level of subdivision, each face in a subdivision mesh subdivides to four quads in the Catmull-Clark scheme, or four triangles in the Loop scheme. This creates a parent and child relationship between the original face and the resulting four subdivided faces, which in turn leads to a hierarchy of subdivision as each child in turn subdivides. A hierarchical edit is an edit made to any one of the faces, edges, or vertices that arise anywhere during subdivision. Normally these subdivision components inherit values from their parents based on a set of subdivision rules that depend on the subdivision scheme. A hierarchical edit overrides these values. This allows for a compact specification of localized detail on a subdivision surface, without having to express information about the rest of the subdivision surface at the same level of detail. Release Notes 3.0.0 Hierarchical Edits have been marked as extended specification and support for hierarchical features has been removed from the 3.0 release. This decision allows for great simplifications of many areas of the subdivision algorithms. If we can identify legitimate use-cases for hierarchical tags, we will consider re-implementing them in future releases, as time and resources allow. Hierarchical Edits Paths In order to perform a hierarchical edit, we need to be able to name the subdivision component we are interested in, no matter where it may occur in the subdivision hierarchy. This leads us to a hierarchical path specification for faces, since once we have a face we can navigate to an incident edge or vertex by association. We note that in a subdivision mesh, a face always has incident vertices, which are labelled in relation to the face with an integer index starting at zero and in consecutive order according to the usual winding rules for subdivision surfaces. Faces also have incident edges, and these are labelled according to the origin vertex of the edge. In this diagram, the indices of the vertices of the base face are marked in red so on the left we have an extraordinary Catmull-Clark face with five vertices labeled 0-4 and on the right we have a regular Catmull-Clark face with four vertices labelled 0-3 . The indices of the child faces are blue note that in both the extraordinary and regular cases, the child faces are indexed the same way, i.e. the sub-face labeled n has one incident vertex that is the result of the subdivision of the parent vertex also labeled n in the parent face. Specifically, we note that the sub-face 1 in both the regular and extraordinary face is nearest to the vertex labelled 1 in the parent. The indices of the vertices of the child faces are labeled green , and this is where the difference lies between the extraordinary and regular case in the extraordinary case, vertex to vertex subdivision always results in a vertex labeled 0 , while in the regular case, vertex to vertex subdivision assigns the same index to the child vertex. Again, specifically, we note that the parent vertex indexed 1 in the extraordinary case has a child vertex 0 , while in the regular case the parent vertex indexed 1 actually has a child vertex that is indexed 1 . Note that this indexing scheme was chosen to maintain the property that the vertex labeled 0 always has the lowest uv parametric value on the face. By appending a vertex index to a face index, we can create a vertex path specification. For example, 655 2 3 0 specifies the 1st. vertex of the 3 rd. child face of the 2 nd. child face of the of the 655 th. face of the subdivision mesh. Vertex Edits Vertex hierarchical edits can modify the value or the sharpness of primitive variables for vertices and sub-vertices anywhere in the subdivision hierarchy. The edits are performed using either an add or a set operator. set indicates the primitive variable value or sharpness is to be set directly to the values specified. add adds a value to the normal result computed via standard subdivision rules. In other words, this operation allows value offsets to be applied to the mesh at any level of the hierarchy. Edge Edits Edge hierarchical edits can only modify the sharpness of primitive variables for edges and sub-edges anywhere in the subdivision hierarchy. Face Edits Face hierarchical edits can modify several properties of faces and sub-faces anywhere in the subdivision hierarchy. Modifiable properties include The set or add operators modify the value of primitive variables associated with faces. The hole operation introduces holes missing faces into the subdivision mesh at any level in the subdivision hierarchy. The faces will be deleted, and none of their children will appear you cannot unhole a face if any ancestor is a hole. This operation takes no float or string arguments. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "hedits.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "glStencilViewer", │ │ │ │ │ - "text": "glStencilViewer glStencilViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glStencilViewer -f -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION glStencilViewer is a stand-alone application that showcases the application of pre-computed stencil tables to a collection of geometric test shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "glstencilviewer.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "glViewer", │ │ │ │ │ - "text": "glViewer glViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glViewer -f -yup -u -a -l refinement level -c animation loops objfiles -anim -catmark -loop -bilinear DESCRIPTION glViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glViewer glViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glViewer -f -yup -u -a -l refinement level -c animation loops objfiles -anim -catmark -loop -bilinear DESCRIPTION glViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glviewer.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "glStencilViewer", │ │ │ │ │ + "text": "glStencilViewer glStencilViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glStencilViewer -f -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION glStencilViewer is a stand-alone application that showcases the application of pre-computed stencil tables to a collection of geometric test shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "glstencilviewer.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "glShareTopology", │ │ │ │ │ - "text": "glShareTopology glShareTopology 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glShareTopology -u -a -l refinement level DESCRIPTION glShareTopology is a stand-alone application that showcases the implementation of topology instancing across Compute contexts. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glShareTopology glShareTopology 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glShareTopology -u -a -l refinement level DESCRIPTION glShareTopology is a stand-alone application that showcases the implementation of topology instancing across Compute contexts. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glsharetopology.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "glPtexViewer", │ │ │ │ │ - "text": "glPtexViewer glPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS glPtexViewer -f -yup -u -a -l isolation level -c animation loops -e environment map -d HDR diffuse map -s HDR specular map --disp displacement scale --bump bump scale ptex color file ptex displacement file ptex occlusion file ptex specular file objfiles DESCRIPTION glPtexViewer is a stand-alone application that showcases advanced HDR shading with color, displacement, occlusion and specular ptex maps. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. -e environment map A low dynamic range spherical environment map used as a background. Ideally, a color-normalized version of the HDR light probe. -d HDR diffuse map An HDR file containing a diffuse environment map typically they are low resolution blurry hemispherical convolutions of the environment light probe. -s environment map An HDR file containing a specular environment map. --disp displacement scale A scalar multiplier for the shader displacement values. --bump displacement scale A scalar multiplier for the shader bump values. ptex color file A ptex file containing RGB channels read as material albedo color. ptex displacement file A single-channel ptex file preferably float precision containing the displacement values. ptex occlusion file A single-channel ptex file preferably 8 bits precision containing a pre-computed ambient occlusion signal. ptex specular file A single-channel ptex file preferably 8 bits precision applied to modulate the specular reflectance of the material KEYBOARD CONTROLS q quit esc hide GUI x save screenshot f fit frame - increase decrease tessellation rate r reload and re - compile the shader files e draw normals SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glPtexViewer glPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS glPtexViewer -f -yup -u -a -l isolation level -c animation loops -e environment map -d HDR diffuse map -s HDR specular map --disp displacement scale --bump bump scale ptex color file ptex displacement file ptex occlusion file ptex specular file objfiles DESCRIPTION glPtexViewer is a stand-alone application that showcases advanced HDR shading with color, displacement, occlusion and specular ptex maps. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. -e environment map A low dynamic range spherical environment map used as a background. Ideally, a color-normalized version of the HDR light probe. -d HDR diffuse map An HDR file containing a diffuse environment map typically they are low resolution blurry hemispherical convolutions of the environment light probe. -s environment map An HDR file containing a specular environment map. --disp displacement scale A scalar multiplier for the shader displacement values. --bump displacement scale A scalar multiplier for the shader bump values. ptex color file A ptex file containing RGB channels read as material albedo color. ptex displacement file A single-channel ptex file preferably float precision containing the displacement values. ptex occlusion file A single-channel ptex file preferably 8 bits precision containing a pre-computed ambient occlusion signal. ptex specular file A single-channel ptex file preferably 8 bits precision applied to modulate the specular reflectance of the material KEYBOARD CONTROLS q quit esc hide GUI x save screenshot f fit frame - increase decrease tessellation rate r reload and re - compile the shader files e draw normals SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glptexviewer.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "glPaintTest", │ │ │ │ │ - "text": "glPaintTest glPaintTest 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS glPaintTest -f -yup -l adaptive refinement level objfiles -catmark -loop DESCRIPTION glPaintTest is a small stand-alone application showing the potential of using GPU limit tessellation for painting and sculpting applications. OPTIONS See the description of the common comand line options for the subset of common options supported here. KEYBOARD CONTROLS c use texture as color d use texture as displacement SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glPaintTest glPaintTest 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS glPaintTest -f -yup -l adaptive refinement level objfiles -catmark -loop DESCRIPTION glPaintTest is a small stand-alone application showing the potential of using GPU limit tessellation for painting and sculpting applications. OPTIONS See the description of the common comand line options for the subset of common options supported here. KEYBOARD CONTROLS c use texture as color d use texture as displacement SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glpainttest.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "glFVarViewer", │ │ │ │ │ - "text": "glFVarViewer glFVarViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glFVarViewer -f -u -a -l refinement level -c animation loops objfiles -catmark -loop -bilinear DESCRIPTION glFVarViewer is a stand-alone application that allows the inspection of face-varying data interpolation. The window displays 2 views left side regular 3D view of the model, with a procedural u,v texture right side a 2D view of the face-varying u,v pair The HUD allows interactive manipulation of the various face-varying boundary interpolation rules and tags. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glFVarViewer glFVarViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glFVarViewer -f -u -a -l refinement level -c animation loops objfiles -catmark -loop -bilinear DESCRIPTION glFVarViewer is a stand-alone application that allows the inspection of face-varying data interpolation. The window displays 2 views left side regular 3D view of the model, with a procedural u,v texture right side a 2D view of the face-varying u,v pair The HUD allows interactive manipulation of the various face-varying boundary interpolation rules and tags. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glfvarviewer.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "glEvalLimit", │ │ │ │ │ - "text": "glEvalLimit glEvalLimit 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glEvalLimit -f -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION glEvalLimit is a stand-alone application that showcases the limit surface Eval module. On the given shape, random samples are generated in local s,t space. Vertex, varying and face-varying data is then computed on the surface limit and displayed as colors. In order to emphasize the dynamic nature of the EvalLimit API, where the locations can be arbitrarily updated before each evaluation, the glEvalLimit example treats each sample as a ST particle. ST Particles are a simplified parametric-space particle dynamics simulation each particle is assigned a location on the subdivision surface limit that is composed of a unique ptex face index, with a local s,t parametric pair. The system also generates an array of parametric velocities ds, dt for each particle. An Update function then applies the velocities to the locations and moves the points along the parametric space. Face boundaries are managed using a ptex adjacency table obtained from the FarTopologyRefiner. Every time a particle moves outside of the 0.0f, 1.0f parametric range, a warp function moves it to the neighboring face, or bounces it, if the edge happens to be a boundary. Note currently the adjacency code does not handle diagonal crossings, nor crossings between quad and non-quad faces. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "glEvalLimit glEvalLimit 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS glEvalLimit -f -yup -u -a -l refinement level objfiles -catmark -loop -bilinear DESCRIPTION glEvalLimit is a stand-alone application that showcases the limit surface Eval module. On the given shape, random samples are generated in local s,t space. Vertex, varying and face-varying data is then computed on the surface limit and displayed as colors. In order to emphasize the dynamic nature of the EvalLimit API, where the locations can be arbitrarily updated before each evaluation, the glEvalLimit example treats each sample as a ST particle. ST Particles are a simplified parametric-space particle dynamics simulation each particle is assigned a location on the subdivision surface limit that is composed of a unique ptex face index, with a local s,t parametric pair. The system also generates an array of parametric velocities ds, dt for each particle. An Update function then applies the velocities to the locations and moves the points along the parametric space. Face boundaries are managed using a ptex adjacency table obtained from the FarTopologyRefiner. Every time a particle moves outside of the 0.0f, 1.0f parametric range, a warp function moves it to the neighboring face, or bounces it, if the edge happens to be a boundary. Note currently the adjacency code does not handle diagonal crossings, nor crossings between quad and non-quad faces. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "glevallimit.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Getting Started", │ │ │ │ │ - "text": "Getting Started Getting Started 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Downloading the code Branches Git Flow Checking out branches API Versions Making Changes Code Overview Downloading the code The code is hosted on a Github public repository. Download and setup information for Git tools can be found here . You can access the OpenSubdiv Git repository at httpsgithub.comPixarAnimationStudiosOpenSubdiv From there, there are several ways of downloading the OpenSubdiv source code. Zip archive downloaded from here Using a GUI client you can find a list here Please refer to the documentation of your preferred application. From the GitShell, Cygwin or the CLI assuming that you have the Git tools installed, you can clone the OpenSubdiv repository directly with the following command git clone https github.comPixarAnimationStudiosOpenSubdiv.git These methods only pull static archives, which is are not under the version control system and therefore cannot pull updates or push changes back. If you intend on contributing features or fixes to the main trunk of the code, you will need to create a free Github account and clone a fork of the OpenSubdiv repository. Submissions to the main code trunk can be sent using Gits pull-request mechanisms. Please note that we are using the git flow tools so all changes should be made to our dev branch. Before we can accept submissions however, we will need a signed Contributors License Agreement . Branches Git Flow Since version 1.1.0, OpenSubdiv has adopted the Git Flow branching model . Our active development branch is named dev all new features and bug fixes should be submitted to this branch. The changes submitted to the dev branch are periodically patched to the release branch as new versions are released. Checking out branches The Git Flow tools are not a requisite for working with the OpenSubdiv code base, but new work should always be performed in the dev branch, or dedicated feature-branches. By default, a cloned repository will be pointing to the release branch. You can switch to the dev branch using the following command git checkout dev You can check that the branch has now been switched simply with git branch Which should return dev release API Versions OpenSubdiv maintains an internal API versioning system. The version number can be read from the file .opensubdivversion.h . Following the Git-Flow pattern, our releases are indexed using Gits tagging system. List of the existing tags git tag -- list Checking out version 1.2.0 git checkout v1_2_0 Making Changes Direct push access to the OpenSubdiv repository is currently limited to a small internal development team. External code should be submitted by sending Git pull-requests from forks of our dev branch. Code Overview The OpenSubdiv code base contains the following main areas Directory Contents .opensubdiv The main subdivision APIs Sdc, Vtr, Far and Osd. .examples A small collection of standalone applications that illustrate how to deploy the various features and optimizations of the OpenSubdiv APIs. The GL-based examples rely on the cross-platform GLFW API for interactive window management, while the DirectX ones are OS-native. .tutorials Tutorials showing how to manipulate the APIs of OpenSubdiv. .documentation The reStructuredText source files along with python scripts that generate the HTML documentation site. .regression Standalone regression tests and baseline data to help maintain the integrity of our APIs. If GPU SDKs are detected, some tests will attempt to run computations on those GPUs. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Getting Started Getting Started 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Downloading the code Branches Git Flow Checking out branches API Versions Making Changes Code Overview Downloading the code The code is hosted on a Github public repository. Download and setup information for Git tools can be found here . You can access the OpenSubdiv Git repository at httpsgithub.comPixarAnimationStudiosOpenSubdiv From there, there are several ways of downloading the OpenSubdiv source code. Zip archive downloaded from here Using a GUI client you can find a list here Please refer to the documentation of your preferred application. From the GitShell, Cygwin or the CLI assuming that you have the Git tools installed, you can clone the OpenSubdiv repository directly with the following command git clone https github.comPixarAnimationStudiosOpenSubdiv.git These methods only pull static archives, which is are not under the version control system and therefore cannot pull updates or push changes back. If you intend on contributing features or fixes to the main trunk of the code, you will need to create a free Github account and clone a fork of the OpenSubdiv repository. Submissions to the main code trunk can be sent using Gits pull-request mechanisms. Please note that we are using the git flow tools so all changes should be made to our dev branch. Before we can accept submissions however, we will need a signed Contributors License Agreement . Branches Git Flow Since version 1.1.0, OpenSubdiv has adopted the Git Flow branching model . Our active development branch is named dev all new features and bug fixes should be submitted to this branch. The changes submitted to the dev branch are periodically patched to the release branch as new versions are released. Checking out branches The Git Flow tools are not a requisite for working with the OpenSubdiv code base, but new work should always be performed in the dev branch, or dedicated feature-branches. By default, a cloned repository will be pointing to the release branch. You can switch to the dev branch using the following command git checkout dev You can check that the branch has now been switched simply with git branch Which should return dev release API Versions OpenSubdiv maintains an internal API versioning system. The version number can be read from the file .opensubdivversion.h . Following the Git-Flow pattern, our releases are indexed using Gits tagging system. List of the existing tags git tag -- list Checking out version 1.2.0 git checkout v1_2_0 Making Changes Direct push access to the OpenSubdiv repository is currently limited to a small internal development team. External code should be submitted by sending Git pull-requests from forks of our dev branch. Code Overview The OpenSubdiv code base contains the following main areas Directory Contents .opensubdiv The main subdivision APIs Sdc, Vtr, Far and Osd. .examples A small collection of standalone applications that illustrate how to deploy the various features and optimizations of the OpenSubdiv APIs. The GL-based examples rely on the cross-platform GLFW API for interactive window management, while the DirectX ones are OS-native. .tutorials Tutorials showing how to manipulate the APIs of OpenSubdiv. .documentation The reStructuredText source files along with python scripts that generate the HTML documentation site. .regression Standalone regression tests and baseline data to help maintain the integrity of our APIs. If GPU SDKs are detected, some tests will attempt to run computations on those GPUs. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "getting_started.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "FAR Overview", │ │ │ │ │ - "text": "FAR Overview FAR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Feature Adaptive Representation Far Topology Refinement Primvar Refinement FarTopologyRefiner FarTopologyRefinerFactory FarPrimvarRefiner FarPatchTable Patch Arrays Patch Types Patch Parameterization Single-Crease Patches Local Points Legacy Gregory Patches FarStencilTable Advantages Principles Cascading Stencils Limit Stencils Sample Location On Extraordinary Faces Code example Feature Adaptive Representation Far Far is the primary API layer for processing client-supplied mesh data into subdivided surfaces. The Far interface may be used directly and also may be used to prepare mesh data for further processing by Osd . The two main aspects of the subdivision process are Topology Refinement and Primvar Refinement . Topology Refinement Topology refinement is the process of splitting the mesh topology according to the specified subdivison rules to generate new topological vertices, edges, and faces. This process is purely topological and does not depend on the speciific values of any primvar data point positions, etc. Topology refinement can be either uniform or adaptive, where extraordinary features are automatically isolated see feature adaptive subdivision . The Far topology classes present a public interface for the refinement functionality provided in Vtr , The main classes in Far related to topology refinement are TopologyRefiner A class encapsulating mesh refinement. TopologyLevel A class representing one level of refinement within a TopologyRefiner. TopologyRefinerFactoryMESH A factory class template specialized in terms of the applications mesh representation used to construct TopologyRefiner instances. Primvar Refinement Primvar refinement is the process of computing values for primvar data points, colors, normals, texture coordinates, etc by applying weights determined by the specified subdivision rules. There are many advantages gained by distinguishing between topology refinement and primvar interpolation including the ability to apply a single static topological refinement to multiple primvar instances or to different animated primvar time samples. Far supports methods to refine primvar data at the locations of topological vertices and at arbitrary locations on the subdivision limit surface. The main classes in Far related to primvar refinement are PrimvarRefiner A class implementing refinement of primvar data at the locations of topological vertices. PatchTable A representation of the refined surface topology that can be used for efficient evaluation of primvar data at arbitrary locations. StencilTable A representation of refinement weights suitable for efficient parallel processing of primvar refinement. LimitStencilTable A representation of refinement weights suitable for efficient parallel processing of primvar refinement at arbitrary limit surface locations. FarTopologyRefiner TopologyRefiner is the building block for many other useful classes in Far . It performs refinement of an arbitrary mesh and provides access to the refined mesh topology. It can be used for primvar refinement directly using PrimvarRefiner or indirectly by being used to create a stencil table , or a patch table , etc. TopologyRefiner provides the public refinement methods RefineUniform and RefineAdapative which perform refinement operations using Vtr. TopologyRefiner provides access to the refined topology via TopologyLevel instances. FarTopologyRefinerFactory Consistent with other classes in Far, instances of TopologyRefiner are created by a factory class -- in this case FarTopologyRefinerFactory. Here we outline several approaches for converting mesh topology into the required FarTopologyRefiner. Additional documentation is provided with the FarTopologyRefinerFactoryMESH class template used by all, and each has a concrete example provided in one of the tutorials or in the Far code itself. There are three ways to create TopologyRefiners use the existing TopologyRefinerFactoryTopologyDescriptor with a populated instance of TopologyDescriptor specialize TopologyRefinerFactoryclass MESH for more efficient conversion, using only face-vertex information fully specialize TopologyRefinerFactorclass MESH for most control over conversion Use the FarTopologyDescriptor FarTopologyDescriptor is a simple struct that can be initialized to refer to raw mesh topology information -- primarily a face-vertex list -- and then passed to a provided factory class to create a TopologyRefiner from each. Topologically, the minimal requirement consists of the number of vertices and faces of the mesh an array containing the number of vertices per face an array containing the vertices assigned to each face These last two define one of the six topological relations that are needed internally by Vtr, but this one relation is sufficient to construct the rest. Additional members are available to assign sharpness values per edge andor vertex, hole tags to faces, or to define multiple sets channels of face-varying data. Almost all of the Far tutorials i.e. tutorialsfartutorial_ illustrate use of the TopologyDescriptor and its factory for creating TopologyRefiners, i.e. TopologyRefinerFactoryTopologyDescriptor. For situations when users have raw mesh data and have not yet constructed a boundary representation of their own, it is hoped that this will suffice. Options have even been provided to indicate that raw topology information has been defined in a left-hand winding order and the factory will handle the conversion to right-hand counter-clockwise winding on-the-fly to avoid unnecessary data duplication. Custom Factory for Face Vertices If the nature of the TopologyDescriptors data expectations is not helpful, and so conversion to large temporary arrays would be necessary to properly make use of it, it may be worth writing a custom factory. Specialization of TopologyRefinerFactoryclass MESH should be done with care as the goal here is to maximize the performance of the conversion and so minimize overhead due to runtime validation. The template provides the high-level construction of the required topology vectors of the underlying Vtr. There are two ways to write such a factory provide only the face-vertex information for topology and let the factory infer all edges and other relationships, or provide the complete edge list and all other topological relationships directly. The latter is considerably more involved and described in a following section. The definition of TopologyRefinerFactoryTopologyDescriptor provides a clear and complete example of constructing a TopologyRefiner with minimal topology information, i.e. the face-vertex list. The class template TopologyRefinerFactoryMESH documents the needs here and the TopologyDescriptor instantiation and specialization should illustrate that. Custom Factory for Direct Conversion Fully specializing a factory for direct conversion is needed only for those requiring ultimate control and is not generally recommended. It is recommended that one of the previous two methods initially be used to convert your mesh topology into a TopologyRefiner. If the conversion performance is critical, or significant enough to warrant improvement, then it is worth writing a factory for full topological conversion. Writing a custom factory requires the specificationspecialization of two methods with the following purpose specify the sizes of topological data so that vectors can be pre-allocated assign the topological data to the newly allocated vectors As noted above, the assumption here is that the clients boundary-rep knows best how to retrieve the data that we require most efficiently. After the factory class gathers sizing information and allocates appropriate memory, the factory provides the client with locations of the appropriate tables to be populated using the same Array classes and interface used to access the tables. The client is expected to load a complete topological description along with additional optional data, i.e. the six topological relations required by Vtr, oriented when manifold sharpness values for edges andor vertices optional additional tags related to the components, e.g. holes optional values-per-face for face-varying channels optional This approach requires dealing directly with edges, unlike the other two. In order to convert edges into a TopologyRefiners representation, the edges need to be expressed as a collection of known size N -- each of which is referred to directly by indices 0,N-1. This can be awkward for representations such as half-edge or quad-edge that do not treat the instance of an edge uniquely. Particular care is also necessary when representing non-manifold features. The previous two approaches will construct non-manifold features as required from the face-vertex list -- dealing with degenerate edges and other non-manifold features as encountered. When directly translating full topology it is necessary to tag non-manifold features, and also to ensure that certain edge relationships are satisfied in their presence. More details are available with the assembly methods of the factory class template. While there is plenty of opportunity for user error here, that is no different from any other conversion process. Given that Far controls the construction process through the Factory class, we do have ample opportunity to insert runtime validation, and to vary that level of validation at any time on an instance of the Factory. The factory does provide run-time validation on the topology constructed that can be used for debugging purposes. A common base class has been created for the factory class, i.e. template class MESH class TopologyRefinerFactory public TopologyRefinerFactoryBase both to provide common code independent of MESH and also potentially to protect core code from unwanted specialization. FarPrimvarRefiner PrimvarRefiner supports refinement of arbitrary primvar data at the locations of topological vertices. A PrimvarRefiner accesses topology data directly from a TopologyRefiner. Different methods are provided to support three different classes of primvar interpolation. These methods may be used to refine primvar data to a specified refinement level. Interpolate... Interpolate using vertex weights InterpolateVarying... Interpolate using linear weights InterpolateFaceVarying... Interpolate using face-varying weights Additional methods allow primvar data to be interpolated to the final limit surface including the calculation of first derivative tangents. Limitdst Interpolate to the limit surface using vertex weights Limitdst, dstTan1, dstTan2 Interpolate including first derivatives to the limit surface using vertex weights LimitFaceVarying... Interpolate to the limit surface using face-varying weights PrimarRefiner provides a straightforward interface for refining primvar data, but depending on the application use case, it can be more efficient to create and use a StencilTable , or PatchTable , to refine primvar data. FarPatchTable PatchTable is the collection of patches derived from the refined faces of a particular mesh topology. This collection is created using FarPatchTableFactory from an instance of FarTopologyRefiner after refinement has been applied. Patch Arrays The PatchTable is organized into patch arrays. All patches in each array have the same type except for face-varying patch arrays which may have a mix of regular and irregular patch types. The PatchDescriptor provides the fundamental description of a patch, including the number of control points per patch as well as the basis for patch evaluation. Each patch in the array is associated with a PatchParam which specifies additional information about the individual patch. Patch Types The following are the different patch types that can be represented in the PatchTable Patch Type CVs Description NON_PATCH na Undefined patch type POINTS 1 Points useful for cage drawing LINES 2 Lines useful for cage drawing QUADS 4 Bi-linear quadrilaterals TRIANGLES 3 Linear triangles LOOP 12 Quartic triangular Box-spline patches REGULAR 16 Bi-cubic B-spline patches GREGORY 4 Legacy Gregory patches GREGORY_BOUNDARY 4 Legacy Gregory Boundary patches GREGORY_BASIS 20 Bi-cubic quadrilateral Gregory patches GREGORY_TRIANGLE 18 Quartic triangular Gregory patches The type of a patch dictates the number of control vertices expected in the table as well as the method used to evaluate values. Patch Parameterization Here we describe the encoding of the patch parameterization for quadrilateral patches. The encoding for triangular patches is similar, please see the API documentation of FarPatchParam for details. Each patch represents a specific portion of the parametric space of the coarse topological face identified by the PatchParam FaceId. As topological refinement progresses through successive levels, each resulting patch corresponds to a smaller and smaller subdomain of the face. The PatchParam UV origin describes the mapping from the uv domain of the patch to the uv subdomain of the topological face. We encode this uv origin using log2 integer values for compactness and efficiency. It is important to note that this uv parameterization is the intrinsic parameterization within a given patch or coarse face and is distinct from any client specified face-varying channel data. Patches which result from irregular coarse faces non-quad faces in the Catmark scheme are offset by the one additional level needed to quadrangulate the irregular face. It is the indices of these offset faces that are stored in the PatchParam and used in other classes such as the FarPatchMap. These offset indices can be identified from the coarse face using the FarPtexIndices class when needed. A patch along an interpolated boundary edge is supported by an incomplete sets of control vertices. For consistency, patches in the PatchTable always have a full set of control vertex indices and the PatchParam Boundary bitmask identifies which control vertices are incomplete the incomplete control vertex indices are assigned values which duplicate the first valid index. Each bit in the boundary bitmask corresponds to one edge of the patch starting from the edge from the first vertex and continuing around the patch. With feature adaptive refinement, regular B-spline basis patches along interpolated boundaries will fall into one of the eight cases four boundary and four corner illustrated below Transition edges occur during feature adaptive refinement where a patch at one level of refinement is adjacent to pairs of patches at the next level of refinement. These T-junctions do not pose a problem when evaluating primvar data on patches, but they must be taken into consideration when tessellating patches e.g. while drawing in order to avoid cracks. The PatchParam Transition bitmask identifies the transition edges of a patch. Each bit in the bitmask corresponds to one edge of the patch just like the encoding of boundary edges. After refining an arbitrary mesh, any of the 16 possible transition edge configurations might occur. The method of handling transition edges is delegated to patch drawing code. Single-Crease Patches Using single-crease patches allows a mesh with creases to be represented with many fewer patches than would be needed otherwise. A single-crease patch is a variation of a regular BSpline patch with one additional crease sharpness parameter. Release Notes 3.x Evaluation of single-crease patches is currently only implemented for OSD patch drawing, but we expect to implement support in all of the evaluation code paths for future releases. Local Points The control vertices represented by a PatchTable are primarily refined points, i.e. points which result from applying the subdivision scheme uniformly or adaptively to the points of the coarse mesh. However, the final patches generated from irregular faces, e.g. patches incident on an extraordinary vertex might have a representation which requires additional local points. Legacy Gregory Patches Using Gregory patches to approximate the surface at the final patches generated from irregular faces is an alternative representation which does not require any additional local points to be computed. Instead, when Legacy Gregory patches are used, the PatchTable must also have an alternative representation of the mesh topology encoded as a vertex valence table and a quad offsets table. FarStencilTable The base container for stencil data is the StencilTable class. As with most other Far entities, it has an associated StencilTableFactory that requires a TopologyRefiner Advantages Stencils are used to factorize the interpolation calculations that subdivision schema apply to vertices of smooth surfaces. If the topology being subdivided remains constant, factorizing the subdivision weights into stencils during a pre-compute pass yields substantial amortizations at run-time when re-posing the control cage. Factorizing the subdivision weights also allows to express each subdivided vertex as a weighted sum of vertices from the control cage. This step effectively removes any data inter-dependency between subdivided vertices the computations of subdivision interpolation can be applied to each vertex in parallel without any barriers or constraint. The Osd classes leverage these properties by exploiting CPU and GPU parallelism. Principles Iterative subdivision algorithms converge towards the limit surface by successively refining the vertices of the coarse control cage. Each successive iteration interpolates the new vertices by applying polynomial weights to a basis of supporting vertices . The interpolation calculations for any given vertex can be broken down into sequences of multiply-add operations applied to the supporting vertices. Stencil table encodes a factorization of these weighted sums each stencils is created by combining the list of control vertices from the 1-ring. With iterative subdivision, each refinement step is dependent upon the previous subdivision step being completed, and a substantial number of steps may be required in order approximate the limit each subdivision step incurs an O4 n growing amount of computations. Instead, once the weights of the contributing coarse control vertices for a given refined vertex have been factorized, it is possible to apply the stencil and directly obtain the interpolated vertex data without having to process the data for the intermediate refinement levels. Cascading Stencils Client-code can control the amount of factorization of the stencils the tables can be generated with contributions all the way from a basis of coarse vertices, or reduced only to contributions from vertices from the previous level of refinement. The latter mode allows client-code to access and insert modifications to the vertex data at set refinement levels -- creating what are often referred to as hierarchical edits . Once the edits have been applied by the client-code, another set of stencils can be used to smooth the vertex data to a higher level of refinement. See implementation details, see the Far cascading stencil tutorial Limit Stencils Stencil tables can be trivially extended from discrete subdivided vertices to arbitrary locations on the limit surface. Aside from extraordinary points, every location on the limit surface can be expressed as a closed-form weighted average of a set of coarse control vertices from the 1-ring surrounding the face. The weight accumulation process is similar the control cage is adaptively subdivided around extraordinary locations. A stencil is then generated for each limit location simply by factorizing the bi-cubic Bspline patch weights over those of the contributing basis of control-vertices. The use of bi-cubic patches also allows the accumulation of analytical derivatives, so limit stencils carry a set of weights for tangent vectors. Once the stencil table has been generated, limit stencils are the most direct and efficient method of evaluation of specific locations on the limit of a subdivision surface, starting from the coarse vertices of the control cage. Also just as discrete stencils, limit stencils that are factorized from coarse control vertices do not have inter-dependencies and can be evaluated in parallel. For implementation details, see the glStencilViewer code example. Sample Location On Extraordinary Faces Each stencil is associated with a singular parametric location on the coarse mesh. The parametric location is defined as face location and local 0.0 - 1.0 u,v triplet In the case of face that are not quads, a parametric sub-face quadrant needs to be identified. This can be done either explicitly or implicitly by using the unique ptex face indices for instance. Code example When the control vertices controlPoints move in space, the limit locations can be very efficiently recomputed simply by applying the blending weights to the series of coarse control vertices class StencilType public void Clear memset x , 0 , sizeof StencilType void AddWithWeight StencilType const cv , float weight x cv . x weight y cv . y weight z cv . z weight float x , y , z std vector StencilType controlPoints , points , utan , vtan Update points by applying stencils controlStencils . UpdateValues StencilType controlPoints 0 , points 0 Update tangents by applying derivative stencils controlStencils . UpdateDerivs StencilType controlPoints 0 , utan 0 , vtan 0 Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "FAR Overview FAR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Feature Adaptive Representation Far Topology Refinement Primvar Refinement FarTopologyRefiner FarTopologyRefinerFactory FarPrimvarRefiner FarPatchTable Patch Arrays Patch Types Patch Parameterization Single-Crease Patches Local Points Legacy Gregory Patches FarStencilTable Advantages Principles Cascading Stencils Limit Stencils Sample Location On Extraordinary Faces Code example Feature Adaptive Representation Far Far is the primary API layer for processing client-supplied mesh data into subdivided surfaces. The Far interface may be used directly and also may be used to prepare mesh data for further processing by Osd . The two main aspects of the subdivision process are Topology Refinement and Primvar Refinement . Topology Refinement Topology refinement is the process of splitting the mesh topology according to the specified subdivison rules to generate new topological vertices, edges, and faces. This process is purely topological and does not depend on the speciific values of any primvar data point positions, etc. Topology refinement can be either uniform or adaptive, where extraordinary features are automatically isolated see feature adaptive subdivision . The Far topology classes present a public interface for the refinement functionality provided in Vtr , The main classes in Far related to topology refinement are TopologyRefiner A class encapsulating mesh refinement. TopologyLevel A class representing one level of refinement within a TopologyRefiner. TopologyRefinerFactoryMESH A factory class template specialized in terms of the applications mesh representation used to construct TopologyRefiner instances. Primvar Refinement Primvar refinement is the process of computing values for primvar data points, colors, normals, texture coordinates, etc by applying weights determined by the specified subdivision rules. There are many advantages gained by distinguishing between topology refinement and primvar interpolation including the ability to apply a single static topological refinement to multiple primvar instances or to different animated primvar time samples. Far supports methods to refine primvar data at the locations of topological vertices and at arbitrary locations on the subdivision limit surface. The main classes in Far related to primvar refinement are PrimvarRefiner A class implementing refinement of primvar data at the locations of topological vertices. PatchTable A representation of the refined surface topology that can be used for efficient evaluation of primvar data at arbitrary locations. StencilTable A representation of refinement weights suitable for efficient parallel processing of primvar refinement. LimitStencilTable A representation of refinement weights suitable for efficient parallel processing of primvar refinement at arbitrary limit surface locations. FarTopologyRefiner TopologyRefiner is the building block for many other useful classes in Far . It performs refinement of an arbitrary mesh and provides access to the refined mesh topology. It can be used for primvar refinement directly using PrimvarRefiner or indirectly by being used to create a stencil table , or a patch table , etc. TopologyRefiner provides the public refinement methods RefineUniform and RefineAdapative which perform refinement operations using Vtr. TopologyRefiner provides access to the refined topology via TopologyLevel instances. FarTopologyRefinerFactory Consistent with other classes in Far, instances of TopologyRefiner are created by a factory class -- in this case FarTopologyRefinerFactory. Here we outline several approaches for converting mesh topology into the required FarTopologyRefiner. Additional documentation is provided with the FarTopologyRefinerFactoryMESH class template used by all, and each has a concrete example provided in one of the tutorials or in the Far code itself. There are three ways to create TopologyRefiners use the existing TopologyRefinerFactoryTopologyDescriptor with a populated instance of TopologyDescriptor specialize TopologyRefinerFactoryclass MESH for more efficient conversion, using only face-vertex information fully specialize TopologyRefinerFactorclass MESH for most control over conversion Use the FarTopologyDescriptor FarTopologyDescriptor is a simple struct that can be initialized to refer to raw mesh topology information -- primarily a face-vertex list -- and then passed to a provided factory class to create a TopologyRefiner from each. Topologically, the minimal requirement consists of the number of vertices and faces of the mesh an array containing the number of vertices per face an array containing the vertices assigned to each face These last two define one of the six topological relations that are needed internally by Vtr, but this one relation is sufficient to construct the rest. Additional members are available to assign sharpness values per edge andor vertex, hole tags to faces, or to define multiple sets channels of face-varying data. Almost all of the Far tutorials i.e. tutorialsfartutorial_ illustrate use of the TopologyDescriptor and its factory for creating TopologyRefiners, i.e. TopologyRefinerFactoryTopologyDescriptor. For situations when users have raw mesh data and have not yet constructed a boundary representation of their own, it is hoped that this will suffice. Options have even been provided to indicate that raw topology information has been defined in a left-hand winding order and the factory will handle the conversion to right-hand counter-clockwise winding on-the-fly to avoid unnecessary data duplication. Custom Factory for Face Vertices If the nature of the TopologyDescriptors data expectations is not helpful, and so conversion to large temporary arrays would be necessary to properly make use of it, it may be worth writing a custom factory. Specialization of TopologyRefinerFactoryclass MESH should be done with care as the goal here is to maximize the performance of the conversion and so minimize overhead due to runtime validation. The template provides the high-level construction of the required topology vectors of the underlying Vtr. There are two ways to write such a factory provide only the face-vertex information for topology and let the factory infer all edges and other relationships, or provide the complete edge list and all other topological relationships directly. The latter is considerably more involved and described in a following section. The definition of TopologyRefinerFactoryTopologyDescriptor provides a clear and complete example of constructing a TopologyRefiner with minimal topology information, i.e. the face-vertex list. The class template TopologyRefinerFactoryMESH documents the needs here and the TopologyDescriptor instantiation and specialization should illustrate that. Custom Factory for Direct Conversion Fully specializing a factory for direct conversion is needed only for those requiring ultimate control and is not generally recommended. It is recommended that one of the previous two methods initially be used to convert your mesh topology into a TopologyRefiner. If the conversion performance is critical, or significant enough to warrant improvement, then it is worth writing a factory for full topological conversion. Writing a custom factory requires the specificationspecialization of two methods with the following purpose specify the sizes of topological data so that vectors can be pre-allocated assign the topological data to the newly allocated vectors As noted above, the assumption here is that the clients boundary-rep knows best how to retrieve the data that we require most efficiently. After the factory class gathers sizing information and allocates appropriate memory, the factory provides the client with locations of the appropriate tables to be populated using the same Array classes and interface used to access the tables. The client is expected to load a complete topological description along with additional optional data, i.e. the six topological relations required by Vtr, oriented when manifold sharpness values for edges andor vertices optional additional tags related to the components, e.g. holes optional values-per-face for face-varying channels optional This approach requires dealing directly with edges, unlike the other two. In order to convert edges into a TopologyRefiners representation, the edges need to be expressed as a collection of known size N -- each of which is referred to directly by indices 0,N-1. This can be awkward for representations such as half-edge or quad-edge that do not treat the instance of an edge uniquely. Particular care is also necessary when representing non-manifold features. The previous two approaches will construct non-manifold features as required from the face-vertex list -- dealing with degenerate edges and other non-manifold features as encountered. When directly translating full topology it is necessary to tag non-manifold features, and also to ensure that certain edge relationships are satisfied in their presence. More details are available with the assembly methods of the factory class template. While there is plenty of opportunity for user error here, that is no different from any other conversion process. Given that Far controls the construction process through the Factory class, we do have ample opportunity to insert runtime validation, and to vary that level of validation at any time on an instance of the Factory. The factory does provide run-time validation on the topology constructed that can be used for debugging purposes. A common base class has been created for the factory class, i.e. template class MESH class TopologyRefinerFactory public TopologyRefinerFactoryBase both to provide common code independent of MESH and also potentially to protect core code from unwanted specialization. FarPrimvarRefiner PrimvarRefiner supports refinement of arbitrary primvar data at the locations of topological vertices. A PrimvarRefiner accesses topology data directly from a TopologyRefiner. Different methods are provided to support three different classes of primvar interpolation. These methods may be used to refine primvar data to a specified refinement level. Interpolate... Interpolate using vertex weights InterpolateVarying... Interpolate using linear weights InterpolateFaceVarying... Interpolate using face-varying weights Additional methods allow primvar data to be interpolated to the final limit surface including the calculation of first derivative tangents. Limitdst Interpolate to the limit surface using vertex weights Limitdst, dstTan1, dstTan2 Interpolate including first derivatives to the limit surface using vertex weights LimitFaceVarying... Interpolate to the limit surface using face-varying weights PrimarRefiner provides a straightforward interface for refining primvar data, but depending on the application use case, it can be more efficient to create and use a StencilTable , or PatchTable , to refine primvar data. FarPatchTable PatchTable is the collection of patches derived from the refined faces of a particular mesh topology. This collection is created using FarPatchTableFactory from an instance of FarTopologyRefiner after refinement has been applied. Patch Arrays The PatchTable is organized into patch arrays. All patches in each array have the same type except for face-varying patch arrays which may have a mix of regular and irregular patch types. The PatchDescriptor provides the fundamental description of a patch, including the number of control points per patch as well as the basis for patch evaluation. Each patch in the array is associated with a PatchParam which specifies additional information about the individual patch. Patch Types The following are the different patch types that can be represented in the PatchTable Patch Type CVs Description NON_PATCH na Undefined patch type POINTS 1 Points useful for cage drawing LINES 2 Lines useful for cage drawing QUADS 4 Bi-linear quadrilaterals TRIANGLES 3 Linear triangles LOOP 12 Quartic triangular Box-spline patches REGULAR 16 Bi-cubic B-spline patches GREGORY 4 Legacy Gregory patches GREGORY_BOUNDARY 4 Legacy Gregory Boundary patches GREGORY_BASIS 20 Bi-cubic quadrilateral Gregory patches GREGORY_TRIANGLE 18 Quartic triangular Gregory patches The type of a patch dictates the number of control vertices expected in the table as well as the method used to evaluate values. Patch Parameterization Here we describe the encoding of the patch parameterization for quadrilateral patches. The encoding for triangular patches is similar, please see the API documentation of FarPatchParam for details. Each patch represents a specific portion of the parametric space of the coarse topological face identified by the PatchParam FaceId. As topological refinement progresses through successive levels, each resulting patch corresponds to a smaller and smaller subdomain of the face. The PatchParam UV origin describes the mapping from the uv domain of the patch to the uv subdomain of the topological face. We encode this uv origin using log2 integer values for compactness and efficiency. It is important to note that this uv parameterization is the intrinsic parameterization within a given patch or coarse face and is distinct from any client specified face-varying channel data. Patches which result from irregular coarse faces non-quad faces in the Catmark scheme are offset by the one additional level needed to quadrangulate the irregular face. It is the indices of these offset faces that are stored in the PatchParam and used in other classes such as the FarPatchMap. These offset indices can be identified from the coarse face using the FarPtexIndices class when needed. A patch along an interpolated boundary edge is supported by an incomplete sets of control vertices. For consistency, patches in the PatchTable always have a full set of control vertex indices and the PatchParam Boundary bitmask identifies which control vertices are incomplete the incomplete control vertex indices are assigned values which duplicate the first valid index. Each bit in the boundary bitmask corresponds to one edge of the patch starting from the edge from the first vertex and continuing around the patch. With feature adaptive refinement, regular B-spline basis patches along interpolated boundaries will fall into one of the eight cases four boundary and four corner illustrated below Transition edges occur during feature adaptive refinement where a patch at one level of refinement is adjacent to pairs of patches at the next level of refinement. These T-junctions do not pose a problem when evaluating primvar data on patches, but they must be taken into consideration when tessellating patches e.g. while drawing in order to avoid cracks. The PatchParam Transition bitmask identifies the transition edges of a patch. Each bit in the bitmask corresponds to one edge of the patch just like the encoding of boundary edges. After refining an arbitrary mesh, any of the 16 possible transition edge configurations might occur. The method of handling transition edges is delegated to patch drawing code. Single-Crease Patches Using single-crease patches allows a mesh with creases to be represented with many fewer patches than would be needed otherwise. A single-crease patch is a variation of a regular BSpline patch with one additional crease sharpness parameter. Release Notes 3.x Evaluation of single-crease patches is currently only implemented for OSD patch drawing, but we expect to implement support in all of the evaluation code paths for future releases. Local Points The control vertices represented by a PatchTable are primarily refined points, i.e. points which result from applying the subdivision scheme uniformly or adaptively to the points of the coarse mesh. However, the final patches generated from irregular faces, e.g. patches incident on an extraordinary vertex might have a representation which requires additional local points. Legacy Gregory Patches Using Gregory patches to approximate the surface at the final patches generated from irregular faces is an alternative representation which does not require any additional local points to be computed. Instead, when Legacy Gregory patches are used, the PatchTable must also have an alternative representation of the mesh topology encoded as a vertex valence table and a quad offsets table. FarStencilTable The base container for stencil data is the StencilTable class. As with most other Far entities, it has an associated StencilTableFactory that requires a TopologyRefiner Advantages Stencils are used to factorize the interpolation calculations that subdivision schema apply to vertices of smooth surfaces. If the topology being subdivided remains constant, factorizing the subdivision weights into stencils during a pre-compute pass yields substantial amortizations at run-time when re-posing the control cage. Factorizing the subdivision weights also allows to express each subdivided vertex as a weighted sum of vertices from the control cage. This step effectively removes any data inter-dependency between subdivided vertices the computations of subdivision interpolation can be applied to each vertex in parallel without any barriers or constraint. The Osd classes leverage these properties by exploiting CPU and GPU parallelism. Principles Iterative subdivision algorithms converge towards the limit surface by successively refining the vertices of the coarse control cage. Each successive iteration interpolates the new vertices by applying polynomial weights to a basis of supporting vertices . The interpolation calculations for any given vertex can be broken down into sequences of multiply-add operations applied to the supporting vertices. Stencil table encodes a factorization of these weighted sums each stencils is created by combining the list of control vertices from the 1-ring. With iterative subdivision, each refinement step is dependent upon the previous subdivision step being completed, and a substantial number of steps may be required in order approximate the limit each subdivision step incurs an O4 n growing amount of computations. Instead, once the weights of the contributing coarse control vertices for a given refined vertex have been factorized, it is possible to apply the stencil and directly obtain the interpolated vertex data without having to process the data for the intermediate refinement levels. Cascading Stencils Client-code can control the amount of factorization of the stencils the tables can be generated with contributions all the way from a basis of coarse vertices, or reduced only to contributions from vertices from the previous level of refinement. The latter mode allows client-code to access and insert modifications to the vertex data at set refinement levels -- creating what are often referred to as hierarchical edits . Once the edits have been applied by the client-code, another set of stencils can be used to smooth the vertex data to a higher level of refinement. See implementation details, see the Far cascading stencil tutorial Limit Stencils Stencil tables can be trivially extended from discrete subdivided vertices to arbitrary locations on the limit surface. Aside from extraordinary points, every location on the limit surface can be expressed as a closed-form weighted average of a set of coarse control vertices from the 1-ring surrounding the face. The weight accumulation process is similar the control cage is adaptively subdivided around extraordinary locations. A stencil is then generated for each limit location simply by factorizing the bi-cubic Bspline patch weights over those of the contributing basis of control-vertices. The use of bi-cubic patches also allows the accumulation of analytical derivatives, so limit stencils carry a set of weights for tangent vectors. Once the stencil table has been generated, limit stencils are the most direct and efficient method of evaluation of specific locations on the limit of a subdivision surface, starting from the coarse vertices of the control cage. Also just as discrete stencils, limit stencils that are factorized from coarse control vertices do not have inter-dependencies and can be evaluated in parallel. For implementation details, see the glStencilViewer code example. Sample Location On Extraordinary Faces Each stencil is associated with a singular parametric location on the coarse mesh. The parametric location is defined as face location and local 0.0 - 1.0 u,v triplet In the case of face that are not quads, a parametric sub-face quadrant needs to be identified. This can be done either explicitly or implicitly by using the unique ptex face indices for instance. Code example When the control vertices controlPoints move in space, the limit locations can be very efficiently recomputed simply by applying the blending weights to the series of coarse control vertices class StencilType public void Clear memset x , 0 , sizeof StencilType void AddWithWeight StencilType const cv , float weight x cv . x weight y cv . y weight z cv . z weight float x , y , z std vector StencilType controlPoints , points , utan , vtan Update points by applying stencils controlStencils . UpdateValues StencilType controlPoints 0 , points 0 Update tangents by applying derivative stencils controlStencils . UpdateDerivs StencilType controlPoints 0 , utan 0 , vtan 0 Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "far_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "dxPtexViewer", │ │ │ │ │ - "text": "dxPtexViewer dxPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS dxPtexViewer -f -yup -u -a -l isolation level -c animation loops -e environment map -d HDR diffuse map -s HDR specular map --disp displacement scale ptex color file ptex displacement file ptex occlusion file ptex specular file objfiles DESCRIPTION dxPtexViewer is a stand-alone application that showcases advanced HDR shading with color, displacement, occlusion and specular ptex maps. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. -y Swap Z-up geometry to Y-UP. -e environment map A low dynamic range spherical environment map used as a background. Ideally, a color-normalized version of the HDR light probe. -d HDR diffuse map An HDR file containing a diffuse environment map typically they are low resolution blurry hemispherical convolutions of the environment light probe. -s environment map An HDR file containing a specular environment map. --disp displacement scale A scalar multiplier for the shader displacement values. ptex color file A ptex file containing RGB channels read as material albedo color. ptex displacement file A single-channel ptex file preferrably float precision containing the displacement values. ptex occlusion file A single-channel ptex file preferrably 8 bits precision containing a pre-computed ambient occlusion signal. ptex specular file A single-channel ptex file preferrably 8 bits precision applied to modulate the specular reflectance of the material objfiles A sequence of obj files used as an animation loop the topology has to match the data contained in all the ptex files KEYBOARD CONTROLS q quit esc hide GUI f fit frame - increase decrese tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "dxPtexViewer dxPtexViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS KEYBOARD CONTROLS SEE ALSO SYNOPSIS dxPtexViewer -f -yup -u -a -l isolation level -c animation loops -e environment map -d HDR diffuse map -s HDR specular map --disp displacement scale ptex color file ptex displacement file ptex occlusion file ptex specular file objfiles DESCRIPTION dxPtexViewer is a stand-alone application that showcases advanced HDR shading with color, displacement, occlusion and specular ptex maps. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. -y Swap Z-up geometry to Y-UP. -e environment map A low dynamic range spherical environment map used as a background. Ideally, a color-normalized version of the HDR light probe. -d HDR diffuse map An HDR file containing a diffuse environment map typically they are low resolution blurry hemispherical convolutions of the environment light probe. -s environment map An HDR file containing a specular environment map. --disp displacement scale A scalar multiplier for the shader displacement values. ptex color file A ptex file containing RGB channels read as material albedo color. ptex displacement file A single-channel ptex file preferrably float precision containing the displacement values. ptex occlusion file A single-channel ptex file preferrably 8 bits precision containing a pre-computed ambient occlusion signal. ptex specular file A single-channel ptex file preferrably 8 bits precision applied to modulate the specular reflectance of the material objfiles A sequence of obj files used as an animation loop the topology has to match the data contained in all the ptex files KEYBOARD CONTROLS q quit esc hide GUI f fit frame - increase decrese tessellation rate SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "dxptexviewer.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "dxViewer", │ │ │ │ │ - "text": "dxViewer dxViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS dxViewer -f -yup -u -a -l refinement level -c animation loops objfiles -catmark -loop -bilinear DESCRIPTION dxViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "dxViewer dxViewer 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE SYNOPSIS DESCRIPTION OPTIONS SEE ALSO SYNOPSIS dxViewer -f -yup -u -a -l refinement level -c animation loops objfiles -catmark -loop -bilinear DESCRIPTION dxViewer is a stand-alone application that showcases the application of uniform and feature adaptive subdivision schemes to a collection of geometric shapes. Multiple controls are available to experiment with the algorithms. OPTIONS See the description of the common comand line options for the subset of common options supported here. SEE ALSO Other examples glViewer , glFVarViewer , glEvalLimit , glStencilViewer , glPtexViewer , glPaintTest , glShareTopology , dxViewer , dxPtexViewer , Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "dxviewer.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Downloads", │ │ │ │ │ - "text": "Downloads Downloads 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Coupe Car Coupe Car Note we can use javascripts buttons to trigger download see button-download or we can just paste regular ReST hyperlinks to the files here. Direct links probably more reliable though. Coupe car maya Download Coupe car obj Download EULA OpenSubdiv is covered by a modified Apache 2.0 license included below, and is free to use for commercial or non-commercial use. All Pixar patents in the area of subdivision surface algorithms have also been released for public use. We welcome any involvement in the development or extension of this code in fact, we would love it. Please contact us if you are interested. Copyright 2013 Pixar Licensed under the Apache License, Version 2.0 the Apache License with the following modification you may not use this file except in compliance with the Apache License and the following modification to it Section 6. Trademarks. is deleted and replaced with 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required to comply with Section 4c of the License and to reproduce the content of the NOTICE file. You may obtain a copy of the Apache License at httpwww.apache.orglicensesLICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Apache License with the above modification is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License. Accept Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Downloads Downloads 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Coupe Car Coupe Car Note we can use javascripts buttons to trigger download see button-download or we can just paste regular ReST hyperlinks to the files here. Direct links probably more reliable though. Coupe car maya Download Coupe car obj Download EULA OpenSubdiv is covered by a modified Apache 2.0 license included below, and is free to use for commercial or non-commercial use. All Pixar patents in the area of subdivision surface algorithms have also been released for public use. We welcome any involvement in the development or extension of this code in fact, we would love it. Please contact us if you are interested. Copyright 2013 Pixar Licensed under the Apache License, Version 2.0 the Apache License with the following modification you may not use this file except in compliance with the Apache License and the following modification to it Section 6. Trademarks. is deleted and replaced with 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required to comply with Section 4c of the License and to reproduce the content of the NOTICE file. You may obtain a copy of the Apache License at httpwww.apache.orglicensesLICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Apache License with the above modification is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for the specific language governing permissions and limitations under the Apache License. Accept Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "downloads.html" │ │ │ │ │ }, { │ │ │ │ │ - "title": "Contributing to OpenSubdiv", │ │ │ │ │ - "text": "Contributing to OpenSubdiv Contributing to OpenSubdiv 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Contributor License Agreement Understand Git Recommended Git Workflow Sending a Pull Request Contributor License Agreement In order for us to accept code submissions merge git pull-requests, contributors need to sign the Contributor License Agreement CLA. There are two CLAs, one for individuals and one for corporations. As for the end-user license, both are based on Apache. They are found in the code repository individual form , corporate form . Please email the signed CLA to opensubdiv-clapixar.com . Understand Git First, you should familiarize yourself with the Git data model and commands. For small changes you may not need to understand Git deeply, but for larger changes or working with the codebase over a long period of time, it becomes critical to understand more of whats going on under the hood. There are many free resources on the internet, one which weve found useful is the following e-book httpsgithub.compluralsightgit-internals-pdfreleases Recommended Git Workflow Once you have a local development tree cloned and working, you can start making changes. You will need to integrate changes from the source tree as you work the following outlines the workflow used by core OpenSubdiv engineers at Pixar and DreamWorks Fork the repository into your own local copy. This can be done via the GitHub website using the fork button. Clone your fork locally git clone your_fork_url OpenSubdiv.your_name e.g. git clone httpsgithub.comyourusernameOpenSubdiv.git OpenSubdiv.yourusername Setup two remotes, origin and upstream . Origin will be setup as a result of cloning your remote repository, but upstream must be setup manually git remote add upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git Verify your remotes are setup correctly git remote -v Which should look something like origin httpsgithub.comyourusernameOpenSubdiv.git fetch origin httpsgithub.comyourusernameOpenSubdiv.git push upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git fetch upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git push Finally, fetch the upstream content this is required for the next step git fetch upstream Setup a new branch for each change. Working with branches in Git is its greatest pleasure, we strongly suggest setting up a new branch for each change which you plan to pull-request. All work is done in the dev branch, so be sure to keep your change in sync with this upstream branch. To begin, start your new branch from the dev branch git checkout -b dev-feature upstreamdev As you are working on your feature, new changes will be merged into the upstream repository, to sync these changes down and preserve your local edits, you can continually rebase your local work git pull --rebase upstream dev Notice the --rebase option here. It updates the current branch to the upstreamdev branch and rebases all edits so they are at the head of your local feature branch. Alternatively, you can rebase all your work at once when your feature is complete. Sending a Pull Request First, rebase and squash your changes appropriately to produce a clean set of changes at the head of your tree. We require changes to be grouped locally to ensure that rolling back changes can be done easily. If youve followed the steps above, your pending change should already be queued up as required. If you have not, you may need to rebase and squash changes at this point. Once the change is clean, push your changes to origin and go to the GitHub website to submit your pull request. Be sure to submit your request against the dev branch. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ - "tags": "", │ │ │ │ │ - "loc": "contributing.html" │ │ │ │ │ - }, { │ │ │ │ │ "title": "Subdivision Compatibility", │ │ │ │ │ - "text": "Subdivision Compatibility Subdivision Compatibility 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Subdivision Compatibility Compatibility with OpenSubdiv 2.x Compatibility with RenderMan Incompatibilities Other Differences Subdivision Compatibility This document highlights areas of compatibility with other software that makes use of subdivision surfaces, including previous versions of OpenSubdiv. The compatibility here refers to the choice of subdivision rules that define the shape of the resulting surfaces. Different subdivision rules will lead to different shapes. Choices affecting shape include the types of subdivision schemes supported e.g. Catmull-Clark, Loop, etc. the basic rules applied for these schemes any extended rules to affect sharpness or creasing rules applied separately to face-varying data Ensuring all of these rules are consistent provides the basis for consistent shapes, but further approximations to the limit surface create the potential for subtle deviations. Even within OpenSubdiv, multiple approximations are possible and vary. For now we focus on the compatibility of subdivision rules and deal with the limit approximations only when noteworthy. Compatibility with OpenSubdiv 2.x The refactoring of OpenSubdiv 3.0 data representations presented a unique opportunity to revisit some corners of the subdivision specification and remove or update some legacy features. Face-varying Interpolation Options Face-varying interpolation options have been consolidated into a single enum with one additional choice new to 3.0. No functionality from 2.x has been removed -- just re-expressed in a simpler and more comprehensible form. Face-varying interpolation was previously defined by a boundary interpolation enum with four modes and an additional boolean propagate corners option, which was little understood, i.e. void HbrMeshSetFVarInterpolateBoundarMethodInterpolateBoundaryMethod const void HbrMeshSetFVarPropagateCornersbool const The latter was only used in conjunction with one of the four modes edge and corner, so it was effectively a unique fifth choice. Closer inspection of all of these modes also revealed some unexpected and undesirable behavior in some common cases -- to an extent that could not simply be changed -- and so an additional mode was added to avoid such behavior. All choices are now provided through a single linear interpolation enum, described and illustrated in more detail in the overview of Face-Varying Interpolation . The use of boundary in the name of the enum was intentionally removed as the choice also affects interior interpolation. The new use of linear is now intended to reflect the fact that interpolation is constrained to be linear where specified by the choice applied. All five of Hbrs original modes of face-varying interpolation are supported with minor modifications where Hbr was found to be incorrect in the presence of semi-sharp creasing. An additional mode corners only has also been added to avoid some of the undesired side-effects of some existing modes illustrated below. The new values for the SdcOptionsFVarLinearInterpolation enum and its equivalents for HbrMeshs InterpolateBoundaryMethod and PropagateCorners flag are as follows ordered such that the set of linear constraints applied is always increasing -- from completely smooth to completely linear Sdc FVarLinearInterpolation Hbr FVarInterpolateBoundaryMethod Hbr FVarPropogateCorners FVAR_LINEAR_NONE k_InterpolateBoundaryEdgeOnly NA ignored FVAR_LINEAR_CORNERS_ONLY NA NA FVAR_LINEAR_CORNERS_PLUS1 k_InterpolateBoundaryEdgeAndCorner false FVAR_LINEAR_CORNERS_PLUS2 k_InterpolateBoundaryEdgeAndCorner true FVAR_LINEAR_BOUNDARIES k_InterpolateBoundaryAlwaysSharp NA ignored FVAR_LINEAR_ALL k_InterpolateBoundaryNone NA ignored Aside from the two corners plus modes that preserve Hbr behavior, all other modes are designed so that the interpolation of a disjoint face-varying region is not affected by changes to other regions that may share the same vertex. So the behavior of a disjoint region should be well understood and predictable when looking at it in isolation e.g. with corners only one would expect to see linear constraints applied where there are topological corners or infinitely sharp creasing applied within the region, and nowhere else. This is not true of the plus modes, and they are named to reflect the fact that more is taken into account where disjoint regions meet. The following example illustrates some undesired effects of the plus modes, which in part motivated the addition of the new corners only mode. The example uses the catmark_fvar_bound0 and catmark_fvar_bound1 shapes from the suite of regression shapes. Both shapes are a simple regular 4x4 grid of quads with face-varying UV data partitioned into multiple disjoint regions. The bound0 shape has two disjoint UV regions -- an upper and lower region -- while the bound1 shape further splits the lower region in two. This first figure illustrates the effect of the original plus1 mode which is also the same for plus2 Note that the effect of splitting the lower UV region in two has the undesired side effect of sharpening the boundary of the upper region. This is the result of the plus1 mode making collective decisions about the sharpness of all face-varying boundaries at the vertex rather than decisions local to each region. In both the plus1 and plus2 cases, all face-varying boundaries sharing a vertex will be sharpened if there are more than two regions meeting at that vertex. The second figure illustrates the effect of the new corners only mode As expected, the splitting of the lower region does not impact the upper region. In this case the decision to sharpen a face-varying boundary is made based on the local topology of each region. Vertex Interpolation Options Since the various options are now presented through a new API Sdc rather than Hbr, based on the history of some of these options and input from interested parties, the following changes have been implemented The naming of the standard creasing method has been changed from Normal to Uniform . Values for SdcOptionsCreasingMethod are now CREASE_UNIFORM standard integer subtraction per level default CREASE_CHAIKIN Chaikin non-uniform averaging around vertices Legacy modes of the smoothtriangle rule have been removed as they were never actually enabled in the code. Values for SdcOptionsTriangleSubdivision are now TRI_SUB_CATMARK Catmull-Clark weights default TRI_SUB_SMOOTH smooth triangle weights These should have little impact since one is a simple change in terminology as part of a new API while the other was removal of an option that was never used. Change to Chaikin creasing method In the process of re-implementing the Chaikin creasing method, observations lead to a conscious choice to change the behavior of Chaikin creasing in the presence of infinitely sharp edges most noticeable at boundaries. Previously, the inclusion of infinite sharpness values in the Chaikin methods computation of edge sharpness around a vertex would prevent a semi-sharp edge from decaying to zero. Infinitely sharp edges are now excluded from the Chaikin non-uniform averaging yielding a much more predictable and desirable result. For example, where the sharpness assignment is actually uniform at such a vertex, the result will now behave the same as the Uniform method. Since this feature has received little use only recently activated in RenderMan, now seemed the best time to make the change before more widespread adoption. Hierarchical Edits While extremely powerful, Hierarchical Edits come with additional maintenance and implementation complexity. Support for them in popular interchange formats and major DCC applications has either been dropped or was never implemented. As a result, the need for Hierarchical Edits is too limited to justify the cost and support for them, and they have therefore been removed from the 3.0 release of OpenSubdiv. Dropping support for Hierarchical Edits allows for significant simplifications of many areas of the subdivision algorithms. While the 3.0 release does not offer direct support for Hierarchical Edits, the architectural changes and direction of 3.0 still facilitate the application of the most common value edits for those wishing to use them -- though not always in the same optimized context. Of course, support for Hierarchical Edits in the future will be considered based on demand and resources. Non-Manifold Topology OpenSubdiv 2.x and earlier was limited to dealing with meshes whose topology was manifold -- a limitation imposed by the use of Hbr. With 3.0 no longer using Hbr, the manifold restriction has also been removed. OpenSubdiv 3.0, therefore, supports a superset of the meshes supported by 2.x and earlier versions with one known exception noted below. Non-manifold meshes that are acceptable to 3.0 however will likely not work with 2.x or earlier. The one known case that 3.0 will not represent the same as 2.x is ironically a case that is non-manifold, and for which Hbr did make special accommodation. That case occurs at a non-manifold vertex where two or more faces meet at a common vertex, but do not share a common edge, and when the boundary interpolation mode is set for smooth corners i.e. edge only, as illustrated below The cage is on the left and is refined to level 2 on the right. On the immediate right, boundary interpolation is set to sharp corners and the results appear the same for 2.x and 3.0. The center and far right illustrate the affects of setting boundary interpolation to smooth corners with 2.x and 3.0 respectively. Note that the 2.x result allows the refined mesh and so the limit surface to split into two while the 3.0 result keeps it connected. When Hbr encounters such vertices, regardless of the boundary mode it splits the vertex -- creating a separate instance of it for each face. So when building an HbrMesh, after finalizing the mesh, it will result in having more vertices than were originally defined termed split vertices. OpenSubdiv 2.x and earlier successfully hid the presence of these extra vertices from users. This case behaves in such a way that violates certain properties of the surface that 3.0 has attempted to emphasize. One of these relates to the nature of the limit surface and becomes more significant in the context of face varying if the cage is connected then so too is its limit surface, or similarly, if the cage consists of N connected regions then the limit surface similarly consists of N connected regions. Another undesirable property here is that the vertex V at which these faces meet must have more than one child vertex V . This makes it difficult to hide split vertices -- OpenSubdiv 2.x tables had an extra level of indirection that made it possible to do this relatively easily, but 3.0 has dispensed with such indirection where possible to streamline performance. Compatibility with RenderMan Since RenderMan and OpenSubdiv versions prior to 3.0 share a common library Hbr, most differences between RenderMan and OpenSubdiv 3.0 are covered in the preceding section of compatibility with OpenSubdiv 2.x. In addition to some features between RenderMan and OpenSubdiv that are not compatible, there are also other differences that may be present due to differences in the implementations of similar features. For most use cases, OpenSubdiv 3.0 is largely compatible with RenderMan. There are however some cases where some differences can be expected. These are highlighted below for completeness. Incompatibilities OpenSubdiv and RenderMan will be incompatible when certain features are used that are not common to both. They are fully described in the 2.x compatibility section and are listed briefly here. OpenSubdiv 3.0 Features Not Supported by RenderMan Non-manifold meshes Choice of the corners only face varying interpolation option RenderMan Features Not Supported by OpenSubdiv 3.0 Hierarchical Edits Other Differences Some differences can occur due to the differing implementations of the feature sets. Additionally, OpenSubdiv 3.0s implementation fixes some issues discovered in Hbr. Smooth Face-Varying Interpolation with Creasing There have been two discrepancies noted in the way that face-varying data is interpolated smoothly in the presence of creases. Smooth face-varying interpolation is expected to match vertex interpolation in the interior and only differ along the boundaries or discontinuities where the face-varying topology is intentionally made to differ from the vertex topology. A simple and effective way to identify discrepancies is to use the X and Y coordinates of vertex positions as the U and V of texture coordinates. If these U and V coordinates are assigned to a face-varying channel, smooth interpolation of U and V is expected to exactly match interpolation of X and Y, regardless of the presence of any sharpness and creasing. Two discrepancies can be seen with Hbr when superimposing the XY vertex interpolation with the projected UV face-varying interpolation. The first discrepancy occurs with interpolation around dart vertices This example shows a simple regular XY grid on the left with an interior sharp edge creating a dart vertex in the center. With no asymmetry in the vertices, the sharpness has no asymmetric affect and the XY vertex interpolation on the immediate right shows the regular grid expected from refinement. On the far right is the UV interpolation from Hbr, which exhibits distortion around the center dart vertex. The second discrepancy occurs with interpolation involving any fractional sharpness values. Hbr effectively ignores any fractional sharpness value in its face-varying interpolation. So edges of vertices with sharpness of say 2.5, will be treated as though their sharpness is 2.0 when face-varying values are interpolated. Similarly, any non-zero sharpness value less than 1.0 is treated as zero by truncation and so is essentially ignored. This example shows an asymmetric 2x2 grid of quads on the left with the center vertex progressively sharpened from 0.5 to 1.0. The three cases of the vertex smooth and sharpened are superimposed on the immediate right to display the three distinct interpolation results. On the far right the interpolation from Hbr displays the same three cases, but only two are visibly distinct -- the sharpness of 0.5 being treated the same as if it were 0.0. Both of these cases are corrected in OpenSubdiv 3.0. Smooth face-varying interpolation in the presence of creasing should match the expected behavior of the vertex interpolation, except where the face-varying topology is explicitly made to differ. The Chaikin Creasing Method At least two discrepancies are know to exist between the implementations of Hbr in RenderMan and OpenSubdiv 3.0 Use of Chaikin creasing with boundaries or infinitely sharp edges Subtle shape differences due to Hbrs use of predictive sharpness Fortunately, this feature was only recently added to Hbr and RenderMan and is little used, so it is expected these differences will have little impact. The first discrepancy is mentioned briefly in the previous section on compatibility between OpenSubdiv 2.x and 3.0. A conscious decision was made to change the averaging of sharpness values involving infinitely sharp edges in order to make results more predictable and favorable. The effects can be seen comparing the regression shape catmark_chaikin2. The second is more subtle and results from an oversight within Hbrs implementation that is not easily corrected. When determining what subdivision rule to apply from one level to the next, the sharpness values at the next level must be known in order to determine whether or not a transition between differing rules is required. If the rule at the next level differs from the previous, a combination of the two is applied. Such a change results from the sharpness values of one or more edges or the vertex itself decaying to zero. Rather than compute the sharpness values at the next level accurately, Hbr predicts it by simply subtracting 1.0 from it, as is done with the uniform creasing method, and it bases decisions on that predicted result. This does not work for Chaikin though. A sharpness value less than 1.0 may not decay to 0 if it is averaged with neighboring sharpness values greater than 1.0, so this sharpness prediction can result in the wrong rule being chosen for the next level. A typical case would have the subdivision rules for Chaikin creasing transition from Corner to Crease at one level, then from Crease to Smooth at the next. Hbrs predictive creasing might mistakenly detect the transition as Corner to Smooth at one level, then after properly computing the sharpness values for the next level later, from Crease to Smooth for the next. One of the regression shapes catmark_chakin1 was disabled from the regression suite because of this effect. The differences in shape that trigger its regression failure were investigated and determined to be the result of this issue. From observations thus far these differences are subtle but can be noticeable. Numerical Precision Since its inception, OpenSubdiv has sought to produce results that were numerically consistent to RenderMan. A regression suite to ensure a certain level of accuracy was provided to detect any substantial deviation. At some point in the development of OpenSubdiv, the point was made that numerical accuracy of Hbr could be improved by changing the order of operations and combining the vertex with the lowest coefficient first in one of the subdivision rules. This was applied more thoroughly in the independent implementation of 3.0 there seemed no reason not to. In most cases the relative magnitudes of the coefficients of subdivision and limit masks is clear so no overhead was necessary to detect them. At a certain point though, this greater accuracy came in conflict with the regression suite. It turned out that high-valence vertices could not be computed to within the desired tolerances set within the suite. The summation of many small coefficients for the adjacent vertices first, before the addition of the much larger coefficient for the primary vertex, allowed for the accumulation of precision that was being truncated by adding the much larger coefficient first in the Hbr implementation. With extremely high valence vertices, a difference in magnitude between the most and least significant coefficients of several orders of magnitude is likely, and that has a significant impact on the single-precision floating point computations. The improved accuracy of OpenSubdiv 3.0 can reach a magnitude that will not go undetected. Whether or not this can lead to visual artifacts is unclear. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Subdivision Compatibility Subdivision Compatibility 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Subdivision Compatibility Compatibility with OpenSubdiv 2.x Compatibility with RenderMan Incompatibilities Other Differences Subdivision Compatibility This document highlights areas of compatibility with other software that makes use of subdivision surfaces, including previous versions of OpenSubdiv. The compatibility here refers to the choice of subdivision rules that define the shape of the resulting surfaces. Different subdivision rules will lead to different shapes. Choices affecting shape include the types of subdivision schemes supported e.g. Catmull-Clark, Loop, etc. the basic rules applied for these schemes any extended rules to affect sharpness or creasing rules applied separately to face-varying data Ensuring all of these rules are consistent provides the basis for consistent shapes, but further approximations to the limit surface create the potential for subtle deviations. Even within OpenSubdiv, multiple approximations are possible and vary. For now we focus on the compatibility of subdivision rules and deal with the limit approximations only when noteworthy. Compatibility with OpenSubdiv 2.x The refactoring of OpenSubdiv 3.0 data representations presented a unique opportunity to revisit some corners of the subdivision specification and remove or update some legacy features. Face-varying Interpolation Options Face-varying interpolation options have been consolidated into a single enum with one additional choice new to 3.0. No functionality from 2.x has been removed -- just re-expressed in a simpler and more comprehensible form. Face-varying interpolation was previously defined by a boundary interpolation enum with four modes and an additional boolean propagate corners option, which was little understood, i.e. void HbrMeshSetFVarInterpolateBoundarMethodInterpolateBoundaryMethod const void HbrMeshSetFVarPropagateCornersbool const The latter was only used in conjunction with one of the four modes edge and corner, so it was effectively a unique fifth choice. Closer inspection of all of these modes also revealed some unexpected and undesirable behavior in some common cases -- to an extent that could not simply be changed -- and so an additional mode was added to avoid such behavior. All choices are now provided through a single linear interpolation enum, described and illustrated in more detail in the overview of Face-Varying Interpolation . The use of boundary in the name of the enum was intentionally removed as the choice also affects interior interpolation. The new use of linear is now intended to reflect the fact that interpolation is constrained to be linear where specified by the choice applied. All five of Hbrs original modes of face-varying interpolation are supported with minor modifications where Hbr was found to be incorrect in the presence of semi-sharp creasing. An additional mode corners only has also been added to avoid some of the undesired side-effects of some existing modes illustrated below. The new values for the SdcOptionsFVarLinearInterpolation enum and its equivalents for HbrMeshs InterpolateBoundaryMethod and PropagateCorners flag are as follows ordered such that the set of linear constraints applied is always increasing -- from completely smooth to completely linear Sdc FVarLinearInterpolation Hbr FVarInterpolateBoundaryMethod Hbr FVarPropogateCorners FVAR_LINEAR_NONE k_InterpolateBoundaryEdgeOnly NA ignored FVAR_LINEAR_CORNERS_ONLY NA NA FVAR_LINEAR_CORNERS_PLUS1 k_InterpolateBoundaryEdgeAndCorner false FVAR_LINEAR_CORNERS_PLUS2 k_InterpolateBoundaryEdgeAndCorner true FVAR_LINEAR_BOUNDARIES k_InterpolateBoundaryAlwaysSharp NA ignored FVAR_LINEAR_ALL k_InterpolateBoundaryNone NA ignored Aside from the two corners plus modes that preserve Hbr behavior, all other modes are designed so that the interpolation of a disjoint face-varying region is not affected by changes to other regions that may share the same vertex. So the behavior of a disjoint region should be well understood and predictable when looking at it in isolation e.g. with corners only one would expect to see linear constraints applied where there are topological corners or infinitely sharp creasing applied within the region, and nowhere else. This is not true of the plus modes, and they are named to reflect the fact that more is taken into account where disjoint regions meet. The following example illustrates some undesired effects of the plus modes, which in part motivated the addition of the new corners only mode. The example uses the catmark_fvar_bound0 and catmark_fvar_bound1 shapes from the suite of regression shapes. Both shapes are a simple regular 4x4 grid of quads with face-varying UV data partitioned into multiple disjoint regions. The bound0 shape has two disjoint UV regions -- an upper and lower region -- while the bound1 shape further splits the lower region in two. This first figure illustrates the effect of the original plus1 mode which is also the same for plus2 Note that the effect of splitting the lower UV region in two has the undesired side effect of sharpening the boundary of the upper region. This is the result of the plus1 mode making collective decisions about the sharpness of all face-varying boundaries at the vertex rather than decisions local to each region. In both the plus1 and plus2 cases, all face-varying boundaries sharing a vertex will be sharpened if there are more than two regions meeting at that vertex. The second figure illustrates the effect of the new corners only mode As expected, the splitting of the lower region does not impact the upper region. In this case the decision to sharpen a face-varying boundary is made based on the local topology of each region. Vertex Interpolation Options Since the various options are now presented through a new API Sdc rather than Hbr, based on the history of some of these options and input from interested parties, the following changes have been implemented The naming of the standard creasing method has been changed from Normal to Uniform . Values for SdcOptionsCreasingMethod are now CREASE_UNIFORM standard integer subtraction per level default CREASE_CHAIKIN Chaikin non-uniform averaging around vertices Legacy modes of the smoothtriangle rule have been removed as they were never actually enabled in the code. Values for SdcOptionsTriangleSubdivision are now TRI_SUB_CATMARK Catmull-Clark weights default TRI_SUB_SMOOTH smooth triangle weights These should have little impact since one is a simple change in terminology as part of a new API while the other was removal of an option that was never used. Change to Chaikin creasing method In the process of re-implementing the Chaikin creasing method, observations lead to a conscious choice to change the behavior of Chaikin creasing in the presence of infinitely sharp edges most noticeable at boundaries. Previously, the inclusion of infinite sharpness values in the Chaikin methods computation of edge sharpness around a vertex would prevent a semi-sharp edge from decaying to zero. Infinitely sharp edges are now excluded from the Chaikin non-uniform averaging yielding a much more predictable and desirable result. For example, where the sharpness assignment is actually uniform at such a vertex, the result will now behave the same as the Uniform method. Since this feature has received little use only recently activated in RenderMan, now seemed the best time to make the change before more widespread adoption. Hierarchical Edits While extremely powerful, Hierarchical Edits come with additional maintenance and implementation complexity. Support for them in popular interchange formats and major DCC applications has either been dropped or was never implemented. As a result, the need for Hierarchical Edits is too limited to justify the cost and support for them, and they have therefore been removed from the 3.0 release of OpenSubdiv. Dropping support for Hierarchical Edits allows for significant simplifications of many areas of the subdivision algorithms. While the 3.0 release does not offer direct support for Hierarchical Edits, the architectural changes and direction of 3.0 still facilitate the application of the most common value edits for those wishing to use them -- though not always in the same optimized context. Of course, support for Hierarchical Edits in the future will be considered based on demand and resources. Non-Manifold Topology OpenSubdiv 2.x and earlier was limited to dealing with meshes whose topology was manifold -- a limitation imposed by the use of Hbr. With 3.0 no longer using Hbr, the manifold restriction has also been removed. OpenSubdiv 3.0, therefore, supports a superset of the meshes supported by 2.x and earlier versions with one known exception noted below. Non-manifold meshes that are acceptable to 3.0 however will likely not work with 2.x or earlier. The one known case that 3.0 will not represent the same as 2.x is ironically a case that is non-manifold, and for which Hbr did make special accommodation. That case occurs at a non-manifold vertex where two or more faces meet at a common vertex, but do not share a common edge, and when the boundary interpolation mode is set for smooth corners i.e. edge only, as illustrated below The cage is on the left and is refined to level 2 on the right. On the immediate right, boundary interpolation is set to sharp corners and the results appear the same for 2.x and 3.0. The center and far right illustrate the affects of setting boundary interpolation to smooth corners with 2.x and 3.0 respectively. Note that the 2.x result allows the refined mesh and so the limit surface to split into two while the 3.0 result keeps it connected. When Hbr encounters such vertices, regardless of the boundary mode it splits the vertex -- creating a separate instance of it for each face. So when building an HbrMesh, after finalizing the mesh, it will result in having more vertices than were originally defined termed split vertices. OpenSubdiv 2.x and earlier successfully hid the presence of these extra vertices from users. This case behaves in such a way that violates certain properties of the surface that 3.0 has attempted to emphasize. One of these relates to the nature of the limit surface and becomes more significant in the context of face varying if the cage is connected then so too is its limit surface, or similarly, if the cage consists of N connected regions then the limit surface similarly consists of N connected regions. Another undesirable property here is that the vertex V at which these faces meet must have more than one child vertex V . This makes it difficult to hide split vertices -- OpenSubdiv 2.x tables had an extra level of indirection that made it possible to do this relatively easily, but 3.0 has dispensed with such indirection where possible to streamline performance. Compatibility with RenderMan Since RenderMan and OpenSubdiv versions prior to 3.0 share a common library Hbr, most differences between RenderMan and OpenSubdiv 3.0 are covered in the preceding section of compatibility with OpenSubdiv 2.x. In addition to some features between RenderMan and OpenSubdiv that are not compatible, there are also other differences that may be present due to differences in the implementations of similar features. For most use cases, OpenSubdiv 3.0 is largely compatible with RenderMan. There are however some cases where some differences can be expected. These are highlighted below for completeness. Incompatibilities OpenSubdiv and RenderMan will be incompatible when certain features are used that are not common to both. They are fully described in the 2.x compatibility section and are listed briefly here. OpenSubdiv 3.0 Features Not Supported by RenderMan Non-manifold meshes Choice of the corners only face varying interpolation option RenderMan Features Not Supported by OpenSubdiv 3.0 Hierarchical Edits Other Differences Some differences can occur due to the differing implementations of the feature sets. Additionally, OpenSubdiv 3.0s implementation fixes some issues discovered in Hbr. Smooth Face-Varying Interpolation with Creasing There have been two discrepancies noted in the way that face-varying data is interpolated smoothly in the presence of creases. Smooth face-varying interpolation is expected to match vertex interpolation in the interior and only differ along the boundaries or discontinuities where the face-varying topology is intentionally made to differ from the vertex topology. A simple and effective way to identify discrepancies is to use the X and Y coordinates of vertex positions as the U and V of texture coordinates. If these U and V coordinates are assigned to a face-varying channel, smooth interpolation of U and V is expected to exactly match interpolation of X and Y, regardless of the presence of any sharpness and creasing. Two discrepancies can be seen with Hbr when superimposing the XY vertex interpolation with the projected UV face-varying interpolation. The first discrepancy occurs with interpolation around dart vertices This example shows a simple regular XY grid on the left with an interior sharp edge creating a dart vertex in the center. With no asymmetry in the vertices, the sharpness has no asymmetric affect and the XY vertex interpolation on the immediate right shows the regular grid expected from refinement. On the far right is the UV interpolation from Hbr, which exhibits distortion around the center dart vertex. The second discrepancy occurs with interpolation involving any fractional sharpness values. Hbr effectively ignores any fractional sharpness value in its face-varying interpolation. So edges of vertices with sharpness of say 2.5, will be treated as though their sharpness is 2.0 when face-varying values are interpolated. Similarly, any non-zero sharpness value less than 1.0 is treated as zero by truncation and so is essentially ignored. This example shows an asymmetric 2x2 grid of quads on the left with the center vertex progressively sharpened from 0.5 to 1.0. The three cases of the vertex smooth and sharpened are superimposed on the immediate right to display the three distinct interpolation results. On the far right the interpolation from Hbr displays the same three cases, but only two are visibly distinct -- the sharpness of 0.5 being treated the same as if it were 0.0. Both of these cases are corrected in OpenSubdiv 3.0. Smooth face-varying interpolation in the presence of creasing should match the expected behavior of the vertex interpolation, except where the face-varying topology is explicitly made to differ. The Chaikin Creasing Method At least two discrepancies are know to exist between the implementations of Hbr in RenderMan and OpenSubdiv 3.0 Use of Chaikin creasing with boundaries or infinitely sharp edges Subtle shape differences due to Hbrs use of predictive sharpness Fortunately, this feature was only recently added to Hbr and RenderMan and is little used, so it is expected these differences will have little impact. The first discrepancy is mentioned briefly in the previous section on compatibility between OpenSubdiv 2.x and 3.0. A conscious decision was made to change the averaging of sharpness values involving infinitely sharp edges in order to make results more predictable and favorable. The effects can be seen comparing the regression shape catmark_chaikin2. The second is more subtle and results from an oversight within Hbrs implementation that is not easily corrected. When determining what subdivision rule to apply from one level to the next, the sharpness values at the next level must be known in order to determine whether or not a transition between differing rules is required. If the rule at the next level differs from the previous, a combination of the two is applied. Such a change results from the sharpness values of one or more edges or the vertex itself decaying to zero. Rather than compute the sharpness values at the next level accurately, Hbr predicts it by simply subtracting 1.0 from it, as is done with the uniform creasing method, and it bases decisions on that predicted result. This does not work for Chaikin though. A sharpness value less than 1.0 may not decay to 0 if it is averaged with neighboring sharpness values greater than 1.0, so this sharpness prediction can result in the wrong rule being chosen for the next level. A typical case would have the subdivision rules for Chaikin creasing transition from Corner to Crease at one level, then from Crease to Smooth at the next. Hbrs predictive creasing might mistakenly detect the transition as Corner to Smooth at one level, then after properly computing the sharpness values for the next level later, from Crease to Smooth for the next. One of the regression shapes catmark_chakin1 was disabled from the regression suite because of this effect. The differences in shape that trigger its regression failure were investigated and determined to be the result of this issue. From observations thus far these differences are subtle but can be noticeable. Numerical Precision Since its inception, OpenSubdiv has sought to produce results that were numerically consistent to RenderMan. A regression suite to ensure a certain level of accuracy was provided to detect any substantial deviation. At some point in the development of OpenSubdiv, the point was made that numerical accuracy of Hbr could be improved by changing the order of operations and combining the vertex with the lowest coefficient first in one of the subdivision rules. This was applied more thoroughly in the independent implementation of 3.0 there seemed no reason not to. In most cases the relative magnitudes of the coefficients of subdivision and limit masks is clear so no overhead was necessary to detect them. At a certain point though, this greater accuracy came in conflict with the regression suite. It turned out that high-valence vertices could not be computed to within the desired tolerances set within the suite. The summation of many small coefficients for the adjacent vertices first, before the addition of the much larger coefficient for the primary vertex, allowed for the accumulation of precision that was being truncated by adding the much larger coefficient first in the Hbr implementation. With extremely high valence vertices, a difference in magnitude between the most and least significant coefficients of several orders of magnitude is likely, and that has a significant impact on the single-precision floating point computations. The improved accuracy of OpenSubdiv 3.0 can reach a magnitude that will not go undetected. Whether or not this can lead to visual artifacts is unclear. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "compatibility.html" │ │ │ │ │ }, { │ │ │ │ │ + "title": "Contributing to OpenSubdiv", │ │ │ │ │ + "text": "Contributing to OpenSubdiv Contributing to OpenSubdiv 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Contributor License Agreement Understand Git Recommended Git Workflow Sending a Pull Request Contributor License Agreement In order for us to accept code submissions merge git pull-requests, contributors need to sign the Contributor License Agreement CLA. There are two CLAs, one for individuals and one for corporations. As for the end-user license, both are based on Apache. They are found in the code repository individual form , corporate form . Please email the signed CLA to opensubdiv-clapixar.com . Understand Git First, you should familiarize yourself with the Git data model and commands. For small changes you may not need to understand Git deeply, but for larger changes or working with the codebase over a long period of time, it becomes critical to understand more of whats going on under the hood. There are many free resources on the internet, one which weve found useful is the following e-book httpsgithub.compluralsightgit-internals-pdfreleases Recommended Git Workflow Once you have a local development tree cloned and working, you can start making changes. You will need to integrate changes from the source tree as you work the following outlines the workflow used by core OpenSubdiv engineers at Pixar and DreamWorks Fork the repository into your own local copy. This can be done via the GitHub website using the fork button. Clone your fork locally git clone your_fork_url OpenSubdiv.your_name e.g. git clone httpsgithub.comyourusernameOpenSubdiv.git OpenSubdiv.yourusername Setup two remotes, origin and upstream . Origin will be setup as a result of cloning your remote repository, but upstream must be setup manually git remote add upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git Verify your remotes are setup correctly git remote -v Which should look something like origin httpsgithub.comyourusernameOpenSubdiv.git fetch origin httpsgithub.comyourusernameOpenSubdiv.git push upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git fetch upstream httpsgithub.comPixarAnimationStudiosOpenSubdiv.git push Finally, fetch the upstream content this is required for the next step git fetch upstream Setup a new branch for each change. Working with branches in Git is its greatest pleasure, we strongly suggest setting up a new branch for each change which you plan to pull-request. All work is done in the dev branch, so be sure to keep your change in sync with this upstream branch. To begin, start your new branch from the dev branch git checkout -b dev-feature upstreamdev As you are working on your feature, new changes will be merged into the upstream repository, to sync these changes down and preserve your local edits, you can continually rebase your local work git pull --rebase upstream dev Notice the --rebase option here. It updates the current branch to the upstreamdev branch and rebases all edits so they are at the head of your local feature branch. Alternatively, you can rebase all your work at once when your feature is complete. Sending a Pull Request First, rebase and squash your changes appropriately to produce a clean set of changes at the head of your tree. We require changes to be grouped locally to ensure that rolling back changes can be done easily. If youve followed the steps above, your pending change should already be queued up as required. If you have not, you may need to rebase and squash changes at this point. Once the change is clean, push your changes to origin and go to the GitHub website to submit your pull request. Be sure to submit your request against the dev branch. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "tags": "", │ │ │ │ │ + "loc": "contributing.html" │ │ │ │ │ + }, { │ │ │ │ │ "title": "Code Examples", │ │ │ │ │ - "text": "Code Examples Code Examples 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Standalone Viewers OpenSubdiv builds a number of standalone viewers that demonstrate various aspects of the software. OpenGL examples glViewer glFVarViewer glEvalLimit glStencilViewer glPtexViewer glPaintTest glShareTopology DirectX examples dxViewer dxPtexViewer Metal examples mtlViewer mtlPtexViewer Common Command Line Options While the following command line options are common, not all examples support all -- in some cases, certain options are not applicable. -f launches the application in full-screen mode if supported -yup set initial view with Y-axis up Z-up is the default -u apply uniform subdivision to all meshes -a apply adaptive subdivision to create patches for the limit surface -l depth level of uniform or adaptive refinement to apply -c count number of repetitions of the animation loop when supported default of 0 is infinite -anim interpret a given set of Obj files as an animated sequence rather than a set of distinct meshes -catmark apply the Catmark scheme to all meshes in given Obj files default -loop apply the Loop scheme to all meshes in given Obj files -bilinear apply the Bilinear scheme to all meshes in given Obj files objfiles a set of one or more meshes in Obj format requiring a .obj extension that may be distinct meshes or animated versions of a single mesh Common Keyboard Controls Left mouse button drag orbit camera Middle mouse button drag pan camera Right mouse button dolly camera n, p nextprev model 1, 2, 3, ..., 9, 0 specify adaptive isolation or uniform refinement level , - increase decrease tessellation Tab toggle full-screen Esc turn on off the HUD w switch display mode q quit Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Code Examples Code Examples 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Standalone Viewers OpenSubdiv builds a number of standalone viewers that demonstrate various aspects of the software. OpenGL examples glViewer glFVarViewer glEvalLimit glStencilViewer glPtexViewer glPaintTest glShareTopology DirectX examples dxViewer dxPtexViewer Metal examples mtlViewer mtlPtexViewer Common Command Line Options While the following command line options are common, not all examples support all -- in some cases, certain options are not applicable. -f launches the application in full-screen mode if supported -yup set initial view with Y-axis up Z-up is the default -u apply uniform subdivision to all meshes -a apply adaptive subdivision to create patches for the limit surface -l depth level of uniform or adaptive refinement to apply -c count number of repetitions of the animation loop when supported default of 0 is infinite -anim interpret a given set of Obj files as an animated sequence rather than a set of distinct meshes -catmark apply the Catmark scheme to all meshes in given Obj files default -loop apply the Loop scheme to all meshes in given Obj files -bilinear apply the Bilinear scheme to all meshes in given Obj files objfiles a set of one or more meshes in Obj format requiring a .obj extension that may be distinct meshes or animated versions of a single mesh Common Keyboard Controls Left mouse button drag orbit camera Middle mouse button drag pan camera Right mouse button dolly camera n, p nextprev model 1, 2, 3, ..., 9, 0 specify adaptive isolation or uniform refinement level , - increase decrease tessellation Tab toggle full-screen Esc turn on off the HUD w switch display mode q quit Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "code_examples.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Building with CMake", │ │ │ │ │ - "text": "Building with CMake Building with CMake 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Overview Step 1 Dependencies Required Optional Step 2 Configuring CMake Useful Build Options Environment Variables Automated Script Using Intels C Studio XE Using Clang Step 3 Building Build Targets Compiling Linking an OpenSubdiv Application Overview Assuming that you have cloned the source repository and selected an appropriate release branch, the following instructions will walk you through the CMake and configuration and build process. CMake is a cross-platform, open-source build system. CMake controls the compilation process using platform independent configuration files in order to generate Makefiles and workspaces that are native to the platform of choice. The process involves the following steps Locate build the requisite dependencies Configure run CMake to generate Makefiles MSVC solution XCode project Run the build from make MSVC XCode Step 1 Dependencies CMake will adapt the build based on which dependencies have been successfully discovered and will disable certain features and code examples accordingly. Please refer to the documentation of each of the dependency packages for specific build and installation instructions. Required CMake version 3.12 Optional Ptex support features for ptex textures and the ptexViewer example Zlib required for Ptex under Windows CUDA TBB OpenCL DX11 SDK GLFW required for standalone examples and some regression tests Docutils required for reST-based documentation Python Pygments required for Docutils reST styling Doxygen Step 2 Configuring CMake One way to configure CMake is to use the CMake GUI . In many cases CMake can fall back on default standard paths in order to find the packages that OpenSubdiv depends on. For non-standard installations however, a complete set of override variables is available. The following sub-section lists some of these variables. For more specific details, please consult the source of the custom CMake modules in the OpenSubdivcmake folder. Useful Build Options The following configuration arguments can be passed to the CMake command line. - DCMAKE_BUILD_TYPE Debug Release - DCMAKE_INSTALL_PREFIX base path to install OpenSubdiv default Current directory - DCMAKE_LIBDIR_BASE library directory basename default lib - DCUDA_TOOLKIT_ROOT_DIR path to CUDA - DPTEX_LOCATION path to Ptex - DGLFW_LOCATION path to GLFW - DTBB_LOCATION path to Intel s TBB - DICC_LOCATION path to Intel s C Studio XE - DNO_LIB 1 disable the opensubdiv libs build caveat emptor - DNO_EXAMPLES 1 disable examples build - DNO_TUTORIALS 1 disable tutorials build - DNO_REGRESSION 1 disable regression tests build - DNO_PTEX 1 disable PTex support - DNO_DOC 1 disable documentation build - DNO_OMP 1 disable OpenMP - DNO_TBB 1 disable TBB - DNO_CUDA 1 disable CUDA - DNO_OPENCL 1 disable OpenCL - DNO_OPENGL 1 disable OpenGL - DNO_CLEW 1 disable CLEW wrapper library Environment Variables The paths to Ptex, GLFW, other dependencies can also be specified through the following environment variables PTEX_LOCATION , GLFW_LOCATION Automated Script The GUI solution will probably become a burden for active developpers who tend to re-run the configuration step fairly often. A scripted solution can save a lot of time. Here is a typical workflow git clone https github.comPixarAnimationStudiosOpenSubdiv.git folder cd folder mkdir build cd build source .. .. cmake_setup Where cmake_setup is a configuration script. Here is an example CMake configuration script for a full typical windows-based build that can be run in GitShell bintcsh Replace the .. with a full path to the root of the OpenSubdiv source tree if necessary cProgram Files x86CMake 2.8bincmake.exe - G Visual Studio 15 2017 Win64 - D GLFW_LOCATIONstringcProgram Filesglfw-2.7.7.bin.WIN64 - D OPENCL_INCLUDE_DIRSstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommoninc - D _OPENCL_CPP_INCLUDE_DIRSstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommoninc - D OPENCL_LIBRARIESstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommonlibx64OpenCL.lib - D PTEX_LOCATIONstringcUsersopensubdivdemosrcptexx64 .. copy Ptex dependencies Windows only mkdir - p bin Debug , Release cp - f c Users opensubdiv demo src zlib -1.2.7 contrib vstudio vc10 x64 ZlibDllRelease zlibwapi . dll bin Debug cp - f c Users opensubdiv demo src zlib -1.2.7 contrib vstudio vc10 x64 ZlibDllRelease zlibwapi . dll bin Release cp - f c Users opensubdiv demo src ptex x64 lib Ptex . dll bin Debug cp - f c Users opensubdiv demo src ptex x64 lib Ptex . dll bin Release Important Notice that the following scripts start by recursively removing the ..build and ..inst directories. Make sure you modify them to suit your build workflow. Here is a similar script for Nix-based platforms echo Removing build cd .. rm - rf build inst mkdir build cd build echo Running cmake cmake - DPTEX_LOCATION home opensubdiv dev opensource ptex install - DGLFW_LOCATION home opensubdiv dev opensource glfw build - DDOXYGEN_EXECUTABLE home opensubdiv dev opensource doxygen inst bin doxygen - DCMAKE_INSTALL_PREFIX .. inst - DCMAKE_BUILD_TYPE Debug .. Here is a similar script for macOS echo Removing build cd .. rm - rf build inst mkdir build cd build echo Running cmake cmake - DOPENGL_INCLUDE_DIR Applications Xcode . app Contents Developer Platforms MacOSX . platform Developer SDKs MacOSX10 .9 . sdk System Library Frameworks OpenGL . framework Headers - DGLFW_LOCATION Users opensubdiv dev opensource glfw inst - DNO_OMP 1 - DNO_REGRESSION 0 - DCMAKE_INSTALL_PREFIX .. inst - DCMAKE_BUILD_TYPE Debug .. Using Intels C Studio XE OpenSubdiv can be also be built with Intels C compiler icc. The default compiler can be overriden in CMake with the following configuration options - DCMAKE_CXX_COMPILER path to icc executable - DCMAKE_C_COMPILER path to icc executable The installation location of the C Studio XE can be overriden with - DICC_LOCATION path to Intel s C Studio XE Using Clang CMake can also be overriden to use the clang compilers by configuring the following options - DCMAKE_CXX_COMPILER clang - DCMAKE_C_COMPILER clang Step 3 Building CMake provides a cross-platform command-line build cmake -- build . -- target install -- config Release Alternatively, you can use native toolkits to launch the build. The steps differ for each OS Windows launch VC with the solution generated by CMake in your build directory. macOS launch Xcode with the xcodeproj generated by CMake in your build directory Nix run make in your build directory - use the clean target to remove previous build results - use VERBOSE1 for verbose build output Build Targets Makefile-based builds allow the use of named target. Here are some of the more useful target names osd_staticdynamic_CPUGPU The core components of the OpenSubdiv libraries example_name Builds specific code examples by name glViewer, ptexViewer... doc Builds ReST and doxygen documentation doc_html Builds ReST documentation doc_doxy Builds Doxygen documentation Compiling Linking an OpenSubdiv Application Here are example commands for building an OpenSubdiv application on several architectures Linux g -IOPENSUBDIVinclude -c myapp.cpp g myapp.o -LOPENSUBDIVlib -losdGPU -losdCPU -o myapp macOS g -IOPENSUBDIVinclude -c myapp.cpp g myapp.o -LOPENSUBDIVlib -losdGPU -losdCPU -o myapp install_name_tool -add_rpath OPENSUBDIVlib myapp On 64-bit OS-X add -m64 after each g . Windows cl nologo MT TP DWIN32 IOPENSUBDIVinclude -c myapp.cpp link nologo outmyapp.exe LIBPATHOPENSUBDIVlib libosdGPU.lib libosdCPU.lib myapp.obj Note HBR uses the offsetof macro on a templated struct, which appears to spurriously set off a warning in both gcc and Clang. It is recommended to turn the warning off with the -Wno-invalid-offsetof flag. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Building with CMake Building with CMake 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Overview Step 1 Dependencies Required Optional Step 2 Configuring CMake Useful Build Options Environment Variables Automated Script Using Intels C Studio XE Using Clang Step 3 Building Build Targets Compiling Linking an OpenSubdiv Application Overview Assuming that you have cloned the source repository and selected an appropriate release branch, the following instructions will walk you through the CMake and configuration and build process. CMake is a cross-platform, open-source build system. CMake controls the compilation process using platform independent configuration files in order to generate Makefiles and workspaces that are native to the platform of choice. The process involves the following steps Locate build the requisite dependencies Configure run CMake to generate Makefiles MSVC solution XCode project Run the build from make MSVC XCode Step 1 Dependencies CMake will adapt the build based on which dependencies have been successfully discovered and will disable certain features and code examples accordingly. Please refer to the documentation of each of the dependency packages for specific build and installation instructions. Required CMake version 3.12 Optional Ptex support features for ptex textures and the ptexViewer example Zlib required for Ptex under Windows CUDA TBB OpenCL DX11 SDK GLFW required for standalone examples and some regression tests Docutils required for reST-based documentation Python Pygments required for Docutils reST styling Doxygen Step 2 Configuring CMake One way to configure CMake is to use the CMake GUI . In many cases CMake can fall back on default standard paths in order to find the packages that OpenSubdiv depends on. For non-standard installations however, a complete set of override variables is available. The following sub-section lists some of these variables. For more specific details, please consult the source of the custom CMake modules in the OpenSubdivcmake folder. Useful Build Options The following configuration arguments can be passed to the CMake command line. - DCMAKE_BUILD_TYPE Debug Release - DCMAKE_INSTALL_PREFIX base path to install OpenSubdiv default Current directory - DCMAKE_LIBDIR_BASE library directory basename default lib - DCUDA_TOOLKIT_ROOT_DIR path to CUDA - DPTEX_LOCATION path to Ptex - DGLFW_LOCATION path to GLFW - DTBB_LOCATION path to Intel s TBB - DICC_LOCATION path to Intel s C Studio XE - DNO_LIB 1 disable the opensubdiv libs build caveat emptor - DNO_EXAMPLES 1 disable examples build - DNO_TUTORIALS 1 disable tutorials build - DNO_REGRESSION 1 disable regression tests build - DNO_PTEX 1 disable PTex support - DNO_DOC 1 disable documentation build - DNO_OMP 1 disable OpenMP - DNO_TBB 1 disable TBB - DNO_CUDA 1 disable CUDA - DNO_OPENCL 1 disable OpenCL - DNO_OPENGL 1 disable OpenGL - DNO_CLEW 1 disable CLEW wrapper library Environment Variables The paths to Ptex, GLFW, other dependencies can also be specified through the following environment variables PTEX_LOCATION , GLFW_LOCATION Automated Script The GUI solution will probably become a burden for active developpers who tend to re-run the configuration step fairly often. A scripted solution can save a lot of time. Here is a typical workflow git clone https github.comPixarAnimationStudiosOpenSubdiv.git folder cd folder mkdir build cd build source .. .. cmake_setup Where cmake_setup is a configuration script. Here is an example CMake configuration script for a full typical windows-based build that can be run in GitShell bintcsh Replace the .. with a full path to the root of the OpenSubdiv source tree if necessary cProgram Files x86CMake 2.8bincmake.exe - G Visual Studio 15 2017 Win64 - D GLFW_LOCATIONstringcProgram Filesglfw-2.7.7.bin.WIN64 - D OPENCL_INCLUDE_DIRSstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommoninc - D _OPENCL_CPP_INCLUDE_DIRSstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommoninc - D OPENCL_LIBRARIESstringcProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2OpenCLcommonlibx64OpenCL.lib - D PTEX_LOCATIONstringcUsersopensubdivdemosrcptexx64 .. copy Ptex dependencies Windows only mkdir - p bin Debug , Release cp - f c Users opensubdiv demo src zlib -1.2.7 contrib vstudio vc10 x64 ZlibDllRelease zlibwapi . dll bin Debug cp - f c Users opensubdiv demo src zlib -1.2.7 contrib vstudio vc10 x64 ZlibDllRelease zlibwapi . dll bin Release cp - f c Users opensubdiv demo src ptex x64 lib Ptex . dll bin Debug cp - f c Users opensubdiv demo src ptex x64 lib Ptex . dll bin Release Important Notice that the following scripts start by recursively removing the ..build and ..inst directories. Make sure you modify them to suit your build workflow. Here is a similar script for Nix-based platforms echo Removing build cd .. rm - rf build inst mkdir build cd build echo Running cmake cmake - DPTEX_LOCATION home opensubdiv dev opensource ptex install - DGLFW_LOCATION home opensubdiv dev opensource glfw build - DDOXYGEN_EXECUTABLE home opensubdiv dev opensource doxygen inst bin doxygen - DCMAKE_INSTALL_PREFIX .. inst - DCMAKE_BUILD_TYPE Debug .. Here is a similar script for macOS echo Removing build cd .. rm - rf build inst mkdir build cd build echo Running cmake cmake - DOPENGL_INCLUDE_DIR Applications Xcode . app Contents Developer Platforms MacOSX . platform Developer SDKs MacOSX10 .9 . sdk System Library Frameworks OpenGL . framework Headers - DGLFW_LOCATION Users opensubdiv dev opensource glfw inst - DNO_OMP 1 - DNO_REGRESSION 0 - DCMAKE_INSTALL_PREFIX .. inst - DCMAKE_BUILD_TYPE Debug .. Using Intels C Studio XE OpenSubdiv can be also be built with Intels C compiler icc. The default compiler can be overriden in CMake with the following configuration options - DCMAKE_CXX_COMPILER path to icc executable - DCMAKE_C_COMPILER path to icc executable The installation location of the C Studio XE can be overriden with - DICC_LOCATION path to Intel s C Studio XE Using Clang CMake can also be overriden to use the clang compilers by configuring the following options - DCMAKE_CXX_COMPILER clang - DCMAKE_C_COMPILER clang Step 3 Building CMake provides a cross-platform command-line build cmake -- build . -- target install -- config Release Alternatively, you can use native toolkits to launch the build. The steps differ for each OS Windows launch VC with the solution generated by CMake in your build directory. macOS launch Xcode with the xcodeproj generated by CMake in your build directory Nix run make in your build directory - use the clean target to remove previous build results - use VERBOSE1 for verbose build output Build Targets Makefile-based builds allow the use of named target. Here are some of the more useful target names osd_staticdynamic_CPUGPU The core components of the OpenSubdiv libraries example_name Builds specific code examples by name glViewer, ptexViewer... doc Builds ReST and doxygen documentation doc_html Builds ReST documentation doc_doxy Builds Doxygen documentation Compiling Linking an OpenSubdiv Application Here are example commands for building an OpenSubdiv application on several architectures Linux g -IOPENSUBDIVinclude -c myapp.cpp g myapp.o -LOPENSUBDIVlib -losdGPU -losdCPU -o myapp macOS g -IOPENSUBDIVinclude -c myapp.cpp g myapp.o -LOPENSUBDIVlib -losdGPU -losdCPU -o myapp install_name_tool -add_rpath OPENSUBDIVlib myapp On 64-bit OS-X add -m64 after each g . Windows cl nologo MT TP DWIN32 IOPENSUBDIVinclude -c myapp.cpp link nologo outmyapp.exe LIBPATHOPENSUBDIVlib libosdGPU.lib libosdCPU.lib myapp.obj Note HBR uses the offsetof macro on a templated struct, which appears to spurriously set off a warning in both gcc and Clang. It is recommended to turn the warning off with the -Wno-invalid-offsetof flag. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "cmake_build.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "BFR Overview", │ │ │ │ │ - "text": "BFR Overview BFR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Base Face Representation Bfr Evaluation BfrSurfaceFactory BfrSurface Parameterization BfrParameterization Discontinuous Parameterizations Tessellation BfrTessellation Tessellation Rates Differences from Hardware Tessellation More on BfrSurfaceFactory BfrSurfaceFactoryCache Defining a Thread-Safe SurfaceFactory Internal versus External SurfaceFactoryCache Customizing a BfrSurfaceFactory The BfrSurfaceFactoryMeshAdapter Interface Customizing the Subclass Interface Base Face Representation Bfr Bfr is an alternate API layer that treats a subdivision mesh provided by a client as a piecewise parameteric surface primitive . The name Bfr derives from the fact that the concepts and classes of this interface all relate to the base faces of a mesh. Concepts such as parameterization , evaluation and tessellation all refer to and are embodied by classes that deal with a specific face of the original unrefined mesh. The Bfr interfaces allow the limit surface for a single face to be identified and evaluated independently of all other faces without any global pre-processing. While concepts and utilities from the Far interface are used internally, the details of their usage is hidden. There is no need to coordinate adaptive refinement with tables of patches, stencils, Ptex indices, patch maps, etc. The resulting evaluation interface is much simpler, more flexible and more scalable than those assembled with the Far classes -- providing a preferable alternative for many CPU-based use cases. The main classes in Bfr include SurfaceFactory A light-weight interface to a mesh that constructs pieces of limit surface for specified faces of a mesh in the form of Surfaces. Surface A class encapsulating the limit surface of a face with methods for complete parametric evaluation. Parameterization A simple class defining the available parameterizations of faces and for identifying that of a particular face. Tessellation A simple class providing information about a specified tessellation pattern for a given Parameterization. Bfr is well suited to cases where evaluation of the mesh may be sparse, dynamically determined or iterative Newton, gradient descent, etc. It is not intended to replace the cases for which Far has been designed i.e. repeated evaluation of a fixed set of points but is intended to complement them. While simplicity, flexibility and reasonable performance were the main goals of Bfr , its current implementation often outperforms the table-based solutions of Far for many common use cases -- both in terms of execution time and memory use. An area that Bfr does not address, and where Far remains more suited, is capturing a specific representation of the limit surface for external use. Bfr intentionally keeps internal implementation details private to allow future improvements or extensions. Those representation details may be publicly exposed in future releases, but until then, use of Far is required for such purposes. Evaluation Since subdivision surfaces are piecewise parametric surfaces, the main operation of interest is evaluation. Bfr deals with the limit surface of a mesh as a whole by associating pieces of surface with each face of the mesh. These pieces of surface are referred to in the context of Bfr simply as surfaces and represented by BfrSurface. Each face of the mesh has an implicit local 2D parameterization and individual coordinates of that parameterization are used to evaluate its corresponding Surface. In general, 3- and 4-sided faces use the same parameterizations for quad and triangular patches used elsewhere in OpenSubdiv Parameterizations are defined for other faces more details to follow, so Surfaces for all faces can be evaluated given any 2D parametric coordinate of its face. Given an instance of a mesh, usage first requires the creation of a BfrSurfaceFactory corresponding to that mesh -- from which Surfaces can then be created for evaluation. Construction of the SurfaceFactory involves no pre-processing and Surfaces can be created and discarded as needed. The processes of constructing and evaluating Surfaces are described in more detail below. BfrSurfaceFactory Construction of BfrSurfaces requires an instance of BfrSurfaceFactory. An instance of SurfaceFactory is a light-weight interface to an instance of a mesh that requires little to no construction cost or memory. The SurfaceFactory does no work until a Surface is requested for a particular face -- at which point the factory inspects the mesh topology around that face to assemble the Surface. SurfaceFactory is actually a base class that is inherited to provide a consistent construction interface for Surfaces. Subclasses are derived to support a particular class of connected mesh -- to implement the topology inspection around each face required to construct the Surface. Use of these subclasses is very simple given the public interface of SurfaceFactory, but defining such a subclass is not. That more complex use case of SurfaceFactory will be described in detail later with other more advanced topics. In many cases, it is not necessary to explicitly define a subclass of SurfaceFactory, as the tutorials for Bfr illustrate. If already using OpenSubdiv for other reasons, a FarTopologyRefiner will have been constructed to represent the initial base mesh before refinement. Bfr provides a subclass of SurfaceFactory using FarTopologyRefiner as the base mesh ignoring any levels of refinement for immediate use in such cases. For those cases when no connected mesh representation is available at all i.e. only raw, unconnected mesh data exists construction of a FarTopologyRefiner provides a reasonably efficient connected mesh representation see the Far tutorials for construction details, whose provided subclass for SurfaceFactory is then readily available. Given the different interpolation types for mesh data i.e. vertex, varying and face-varying, the common interface for SurfaceFactory provides methods to construct Surfaces explicitly for all data types. So for positions, the methods for vertex data must be used to obtain the desired Surface, while for texture coordinates the methods for face-varying are usually required, e.g. Surface CreateVertexSurface Index faceIndex const Surface CreateVaryingSurface Index faceIndex const Surface CreateFaceVaryingSurface Index faceIndex const The Surfaces created by these construction methods may all be distinct as the underlying representations of the Surfaces and the indices of the data that define them will often differ. For example, the position data may require a bicubic patch while the face-varying texture data may be linear or a different type of bicubic patch given the different interpolation rules for face-varying and the possibility of seams. While the internal representations of the Surfaces constructed for different data interpolation types may differ, since they are all constructed as Surfaces, the functionality used to evaluate them is identical. BfrSurface The Surface class encapsulates the piece of limit surface associated with a particular face of the mesh. The term surface is used rather than patch to emphasize that the Surface may itself be a piecewise parametric surface composed of more than one patch potentially even a complex set of patches. Surface is also a class template selected by floating point precision, and so typically declared as BfrSurfacefloat. Just as a simpler type name is likely to be declared when used, the simple name Surface will be used to refer to it here. And where code fragments may be warranted, float will be substituted for the template parameter for clarity. Once created, there are two steps required to evaluate a Surface preparation of associated data points from the mesh the actual calls to evaluation methods using these data points The latter is straight-forward, but the former warrants a little more explanation. The shape of a Surface for a base face is influenced by the set of data points associated with both the vertices of the face and a subset of those in its immediate neighborhood. These control points are identified when the Surface is initialized and are publicly available for inspection if desired. The control points are sufficient to define the Surface if the face and its neighborhood are regular, but any irregularity an extra-ordinary vertex, crease, etc. usually requires additional, intermediate points to be computed from those control points in order to evaluate the Surface efficiently. Having previously avoided use of the term patch in favor of surface, the term patch points is now used to refer to these intermediate points. Patch points always include the control points as a subset and may be followed by points needed for any additional patches required to represent a more complex Surface. While the patch points are assembled in a local array for direct use by the Surface, the control points can either be gathered and accessed locally or indexed from buffers associated with the mesh for other purposes e.g. computing a bounding box of the Surface Once the patch points for a Surface are prepared, they can be passed to the main evaluation methods with the desired parametric coordinates. As previously noted, since the Surface class is a template for floating point precision, evaluation is supported in single or double precision by constructing a Surface for the desired precision. Evaluation methods are overloaded to obtain simply position or including all first or second derivatives. So preparation and evaluation can be achieved with the following Preparing patch points void PreparePatchPoints float const meshPoints , PointDescriptor meshPointDescriptor , float patchPoints , PointDescriptor patchPointDescriptor const Evaluating position and 1st derivatives void Evaluate float const uv 2 , float const patchPoints , PointDescriptor patchPointDescriptor , float P , float dPdu , float dPdv const The PointDescriptor class here is a simple struct defining the size and stride of the associated array of points. Any use of mesh points, control points or patch points generally requires an accompanying descriptor. Depending on the complexity of the limit surface, this preparation of patch points can be costly -- especially if only evaluating the Surface once or twice. In such cases, it is worth considering evaluating limit stencils, i.e. sets of coefficients that combine the original control vertices of the mesh without requiring the computation of intermediate values. The cost of evaluating stencils is considerably higher than direct evaluation, but that added overhead is often offset by avoiding the use of patch points. Surfaces should be considered a class for transient use as retaining them for longer term usage can reduce their benefits. The relatively high cost of initialization of irregular Surfaces can be a deterrent and often motivates their retention despite increased memory costs. Retaining all Surfaces of a mesh for random sampling is a situation that should be undertaken with caution and will be discussed in more detail later with other advanced topics. Parameterization Each face of a mesh has an implicit local 2D parameterization whose 2D coordinates are used to evaluate the Surface for that face. Bfr adopts the parameterizations defined elsewhere in OpenSubdiv for quadrilateral and triangular patches, for use quadrilateral and triangular faces But the parameterization of a face is also dependent on the subdivision scheme applied to it. Subdivision schemes that divide faces into quads are ultimately represented by quadrilateral patches. So a face that is a quad can be parameterized as a single quad, but other non-quad faces are parameterized as a set of quad sub-faces, i.e. faces resulting from subdivision A triangle subdivided with a quad-based scheme e.g. Catmull-Clark will therefore not have the parameterization of the triangular patch indicated previously, but another defined by its quad sub-faces illustrated above to be described in more detail below. Subdivision schemes that divide faces into triangles are currently restricted to triangles only, so all faces are parameterized as single triangles. If Loop subdivision is extended to non-triangles in future, a parameterization involving triangular sub-faces will be necessary. Note that triangles are often parameterized elsewhere in terms of barycentric coordinates u,v,w where w 1 - u - v . As is the case elsewhere in OpenSubdiv, Bfr considers parametric coordinates as 2D u,v pairs for all purposes. All faces have an implicit 2D local parameterization and all interfaces requiring parametric coordinates consider only the u,v pair. If interaction with some other tool set requiring barycentric coordinates for triangles is necessary, it is left to users to compute the implicit w accordingly. BfrParameterization BfrParameterization is a simple class that fully defines the parameterization for a particular face. An instance of Parameterization is fully defined on construction given the size of a face and the subdivision scheme applied to it where the face size is its number of verticesedges. Since any parameterization of N -sided faces requires N in some form, the face size is stored as a member and made publicly available. Each Surface has the Parameterization of its face assigned internally as part of its construction, and that is used internally by the Surface in many of its methods. The need to deal directly with the explicit details of the Parameterization class is not generally necessary. Often it is sufficient to retrieve the Parameterization from a Surface for use in some other context e.g. passed to BfrTessellation. The enumerated type ParameterizationType currently defines three kinds of parameterizations -- one of which is assigned to each instance on construction according to the properties of the face QUAD Applied to quadrilateral faces with a quad-based subdivision scheme e.g. Catmark or Bilinear. TRI Applied to triangular faces with a triangle-based subdivision scheme e.g. Loop. QUAD_SUBFACES Applied to non-quad faces with a quad-based subdivision scheme -- dividing the face into quadrilateral sub-faces. Parameterizations that involve subdivision into sub-faces, e.g. QUAD_SUBFACES, may warrant some care as they are not continuous. Depending on how they are defined, the sub-faces may be disjoint e.g. Bfr or overlap in parametric space e.g. Ptex. To help these situations, methods to detect the presence of sub-faces and deal with their local parameterizations are made available. Discontinuous Parameterizations When a face does not have a regular parameterization, the division of the parameterization into sub-faces can create complications -- as noted and addressed elsewhere in OpenSubdiv. BfrParameterization defines a quadrangulated sub-face parameterization differently from the Far and Osd interfaces. For an N -sided face, Far uses a parameterization adopted by Ptex. In this case, all quad sub-faces are parameterized over the unit square and require an additional index of the sub-face to identify them. So Ptex coordinates require three values the index and u,v of the sub-face. To embed sub-face coordinates in a single u,v pair, Bfr tiles the sub-faces in disjoint regions in parameter space. This tiling is similar to the Udim convention for textures, where a UDim on the order of sqrtN is used to preserve accuracy for increasing N Note also that the edges of each sub-face are of parametric length 0.5, which results in a total parametric length of 1.0 for all base edges. This differs again from Ptex, which parameterizes sub-faces with edge lengths of 1.0, and so can lead to inconsistencies in parametric scale typically with derivatives across edges of the mesh if not careful. As previously mentioned, care may be necessary when dealing with the discontinuities that exist in parameterizations with sub-faces. This is particularly true if evaluating data at sampled locations of the face and needing to evaluate at other locations interpolated from these. Interpolation between parametric locations, e.g. A, B and C, should be avoided when discontinuous. In many cases, dealing directly with coordinates of the sub-faces is unavoidable, e.g. interpolating Ptex coordinates for sampling of textures assigned explicitly to the sub-faces. Methods are provided to convert from Bfr s tiled parameterization to and from other representations that use a local parameterization for each sub-face. Tessellation Once a Surface can be evaluated it can be tessellated. Given a 2D parameterization, a tessellation consists of two parts a set of parametric coordinates sampling the Parameterization a set of faces connecting these coordinates that covers the entire Parameterization Once evaluated, the resulting set of sample points and the faces connecting them effectively define a mesh for that parameterization. For the sake of brevity both here and in the programming interface, the parametric coordinates or sample points are referred to simply as coords or Coords -- avoiding the term points, which is already a heavily overloaded term. Similarly the faces connecting the coords are referred to as facets or Facets -- avoiding the term face to avoid confusion with the base face of the mesh being tessellated. Bfr provides a simple class to support a variety of tessellation patterns for the different Parameterization types and methods for retrieving its associated coords and facets. In many cases the patterns they define are similar to those of GPU hardware tessellation -- which may be more familiar to many -- but they do differ in several ways, as noted below. BfrTessellation In Bfr a Tessellation is a simple class defined by a Parameterization and a given set of tessellation rates and a few additional options. These two elements define a specific tessellation pattern for all faces sharing that Parameterization. An instance of Tessellation can then be inspected to identify all or subsets of its coords or facets. The process of tessellation in other contexts usually generates triangular facets, but that is not the case with Bfr . While producing triangular facets is the default, options are available to have Tessellation include quads in patterns for parameterizations associated with quad-based subdivision schemes. For simple uniform patterns, these produce patterns that are similar in topology to those resulting from subdivision Tessellation of 4- and 5-sided faces of a quad-based scheme using quadrilateral facets left and triangular right The name Tessellation was chosen rather than Tessellator as it is a passive class that simply holds information define its pattern. It doesnt do much other than providing information about the pattern when requested. A few general properties about the pattern are determined and retained on construction, after which an instance is immutable. So it does not maintain any additional state between queries. In order to provide flexibility when dealing with tessellations of adjacent faces, the coords arising from an instance of Tessellation are ordered and are retrievable in ways to help identify points along edges that may be shared between two or more faces. The coords of a Tessellation are generated in concentric rings, beginning with the outer ring and starting with the first vertex Ordering of coords around boundary for quad and tri parameterizations. Methods of the Tessellation class allow the coords associated with specific vertices or edges to be identified, as well as providing the coords for the entire ring around the boundary separately from those of the interior if desired. While the ordering of coords in the interior is not defined and so not to be relied upon, the ordering of the boundary coords is specifically fixed to support the correlation of potentially shared coords between faces. The Tessellation class is completely independent of the Surface class. Tessellation simply takes a Parameterization and tessellation rates and provides the coords and facets that define its pattern. So Tessellation can be used in any other evaluation context where the Parameterizations are appropriate. Tessellation Rates For a particular Parameterization, the various tessellation patterns are determined by one or more tessellation rates. The simplest set of patterns uses a single tessellation rate and is said to be uniform, i.e. all edges and the interior of the face are split to a similar degree Uniform tessellation of a quadrilateral and triangle with rates of 5 and 8. More complex non-uniform patterns allow the edges of the face to be split independently from the interior of the face. Given rates for each edge, a suitable uniform rate for the interior can be either inferred or specified explicitly. These are typically referred to as the outer rates and the inner rate. The single rate specified for a simple uniform tessellation is essentially the specification of a single inner rate while the outer rates for all edges are inferred as the same. Non-uniform tessellation of a quadrilateral, triangle and 5-sided face with various outer and inner rates. In the case of Parameterizations for quads, it is common elsewhere to associate two inner rates with the opposing edges. So two separate inner rates are available for quad parameterizations -- to be specified or otherwise inferred Quad tessellations with differing inner rates with matching left and varying outer rates right. Differences from Hardware Tessellation Since the specifications for hardware tessellation often leave some details of the patterns as implementation dependent, no two hardware implementations are necessarily the same. Typically there may be subtle differences in the non-uniform tessellation patterns along boundaries, and that is to be executed here. Bfr does provide some obvious additional functionality not present in hardware tessellation and vice versa, e.g. Bfr provides the following not supported by hardware tessellation patterns for parameterizations other than quads and tris e.g. N-sided preservation of quad facets of quad-based parameterizations while hardware tessellation provides the following not supported by Bfr patterns for so-called fractional tessellation non-integer rates The lack of fractional tessellation in Bfr is something that may be addressed in a future release. Where the functionality of Bfr and hardware tessellation overlap, a few other differences are worth noting indexing of edges and their associated outer tessellation rates uniform tessellation patterns for triangles differ significantly For the indexing of edges and rates, when specifying an outer rate associated with an edge, the array index for rate i is expected to correspond to edge i . Bfr follows the convention established elsewhere in OpenSubdiv of labelingindexing edges 0, 1, etc. between vertex pairs 0,1, 1,2, etc. So outer rate 0 corresponds to the edge between vertices 0,1. In contrast, hardware tessellation associates the rate for the edge between vertices 0,1 as outer rate 1 -- its outer rate 0 is between vertices N-1,0. So an offset of 1 is warranted when comparing the two. Outer edge tessellation rates of 1,3,5,7 applied to a quad with Bfr left and GPU tessellation right. For the uniform tessellation of triangles, its well known that the needs of hardware implementation led designers to factor the patterns for triangles to make use of the same hardware necessary for quads. As a result, many edges are introduced into a simple tessellation of a triangle that are not parallel to one of its three edges. Bfr uses patterns more consistent with those resulting from the subdivision of triangles. Only edges parallel to the edges of the triangle are introduced, which creates more uniform facets both edge lengths and area and reduces their number by one third. This can reduce artifacts that sometimes arise with use of the hardware patterns at lower tessellation rates Uniform tessellation of a triangle with Bfr left and GPU tessellation right. These triangular patterns have been referred to as integer spacing for triangular patches in early work on hardware tessellation. But use of these patterns was generally discarded in favor of techniques that split the triangle into three quads -- allowing the hardware solution for quad tessellation to be reused. More on BfrSurfaceFactory The primary function of BfrSurfaceFactory is to identify and construct a representation of the limit surface for a given face of a mesh. It achieves this by inspecting the topology around the given face and constructing a suitable representation encapsulated in a Surface. The regions around a face can be divided into two categories based on their topology those that are regular and those that are not, i.e. those that are irregular. Recalling the illustration from Irregular versus Irregular Features Patches of regular Surfaces Potential patches of irregular Surfaces The representation of the limit surface for regular regions is trivial -- it is a single parametric patch whose basis is determined by the subdivision scheme e.g. uniform bicubic B-spline for Catmull-Clark. In contrast, the representation of the limit surface for an irregular region cannot be accurately represented so simply. It can be far more complex depending on the features present extra-ordinary vertices, creasing of edges, etc.. It may be as simple as a different kind of parametric patch whose points are derived from those of the mesh, or it may often be a set of patches in a hierarchy resulting from local subdivision. Bfr intentionally hides the details of these representations to allow future improvement. The cost of determining and assembling the representations of irregular Surfaces is therefore often significant. Some of the performance benefits of the SurfaceFactory are achieved by having it cache the complexities of the irregular surfaces that it encounters. In many common use cases, awareness and management of this caching is not necessary as illustrated by the tutorials. But the thread-safe construction of Surfaces is one area where some awareness is required. Other use cases that share the cache between meshes are also worth exploring as they can further reduce potentially significant costs. BfrSurfaceFactoryCache The SurfaceFactoryCache is the class used by SurfaceFactory to cache the topological information that it can reuse for other similarly irregular faces of the mesh. Though it is a publicly accessible class, the SurfaceFactoryCache has little to no public interface other than construction made available to support more advanced cases covered later and in most cases it can be completely ignored. Typically an instance of SurfaceFactory has an internal SurfaceFactoryCache member which is used by that factory for its lifetime. Since that cache member is mutable -- potentially updated when an irregular Surface is created -- it does need to be thread-safe if the SurfaceFactory is to be used in a threaded context. To accommodate this need, SurfaceFactoryCache is defined as a base class with an accompanying class template to allow the trivial declaration of thread-safe subclasses template typename MUTEX_TYPE , typename READ_LOCK_GUARD_TYPE , typename WRITE_LOCK_GUARD_TYPE class SurfaceFactoryCacheThreaded public SurfaceFactoryCache ... For example, a local type for a thread-safe cache using stdshared_mutex from C17 could be simply declared as follows include shared_mutex typedef Bfr SurfaceFactoryCacheThreaded std shared_mutex , std shared_lock std shared_mutex , std unique_lock std shared_mutex ThreadSafeCache Such thread-safe cache types are essential when distributing the work of a single SurfaceFactory across multiple threads. They can be encapsulated in the definitions of subclasses of SurfaceFactory or used to define external cache instances for use with any subclass of SurfaceFactory. Defining a Thread-Safe SurfaceFactory The thread-safety of a SurfaceFactory is purely dependent on the thread-safety of the SurfaceFactoryCache that it uses. With caching disabled, any SurfaceFactory is thread-safe but will be far less efficient in dealing with irregular Surfaces. When a subclass of SurfaceFactory is defined discussed in more detail later, one of its responsibilities is to identify and manage an instance of SurfaceFactoryCache for its internal use. Defining such a subclass is a simple matter of declaring a thread-safe SurfaceFactoryCache type as noted above along with a local member of that type to be used by each instance. Given the widespread use of the FarTopologyRefiner in OpenSubdiv, and the lack of a connected mesh representation in many contexts, a subclass of SurfaceFactory is made available to use a TopologyRefiner as a mesh, i.e. the BfrRefinerSurfaceFactory subclass. Since many OpenSubdiv users may make use of the RefinerSurfaceFactory subclass, and they may have different preferences of threading model, the RefinerSurfaceFactory subclass is similarly defined as a class template to enable threading flexibility. In this case, the template is parameterized by the desired type of SurfaceFactoryCache, which embodies the threading specifications as noted above, i.e. template class CACHE_TYPE SurfaceFactoryCache class RefinerSurfaceFactory public ... ... The default template is the base SurfaceFactoryCache which is not thread-safe, but a simple declaration of a thread-safe cache type is sufficient to declare a similarly thread-safe RefinerSurfaceFactory type include opensubdivbfrsurfaceFactoryCache.h Declare thread-safe cache type see stdshared_mutex example above typedef Bfr SurfaceFactoryCacheThreaded ... ThreadSafeCache Declare thread-safe factory type typedef Bfr RefinerSurfaceFactory ThreadSafeCache ThreadSafeFactory The resulting factory type safely allows the construction of Surfaces and their subsequent evaluation and tessellation to be distributed over multiple threads. Internal versus External SurfaceFactoryCache Typical usage of the SurfaceFactoryCache by the SurfaceFactory is to have the factory create an internal cache member to be used for the lifetime of the factory associated with a mesh. But the data stored in the cache is not in any way dependent on the factory or mesh used to create it. So a cache can potentially be shared by multiple factories. While such sharing is possible -- and the Bfr interfaces intentionally permit it -- any exploration should proceed with caution. Greater public knowledge and control of the cache is ultimately necessary to manage its potentially unbounded memory increase, and support in the public interface is currently limited. A cache stored as a member varialbe and managed exclusively by the factory is said to be internal while one managed exclusively by its client is said to be external. In both cases, the factory deals with retrieving data from or adding data to the cache -- only management of the caches ownership differs, and that ownership is never transferred. A subset of the methods of SurfaceFactoryOptions provide the means of specifying the use of an internal or external cache, or no caching at all Assign an external cache to override the internal Options SetExternalCache SurfaceFactoryCache cache Enable or disable caching default is true Options EnableCaching bool on As noted here, specifying an external cache will override use of a factorys internal cache. Disabling caching takes precedence over both, but is generally not practical and exists mainly to aide debugging. The common use of the internal cache is to create a SurfaceFactory and distribute processing of the Surfaces of its faces over multiple threads, or to construct Surfaces for the mesh for any other purpose while the mesh remains in scope. There is no need to deal explicitly with the SurfaceFactoryCache in these cases. Use cases for an external cache are more varied and explicit, including creating a single external cache to process a sequence of meshes on a single thread cache thread-safety not required creating a separate external cache on each thread to process a set of meshes distributed over multiple threads cache thread-safety not required creating a single external cache for multiple meshes distributed over multiple threads cache thread-safety required, and beware of unbounded memory growth here Future extensions to the public interface of SurfaceFactoryCache may be made to support common use cases as their common needs are made clearer. Customizing a BfrSurfaceFactory One of the goals of Bfr is to provide a lightweight interface for the evaluation of Surfaces from any connected mesh representation. In order to do so, the factory needs to gather topological information from that mesh representation. That information is provide to the factory through inheritance a subclass of SurfaceFactory is defined that fulfills all requirements of the factory. It must be made clear that a subclass can only be created from a connected mesh representation, i.e. a representation that includes connectivity or adjacency relationships between its components vertices, faces and edges. Classes for simple containers of mesh topology used for external formats e.g. USD, Alembic, etc. are generally not connected . Many applications construct a connected mesh representation for internal use when loading such mesh data -- using a variety of techniques including half-edges, winged-edges or table-based relationships. There are many choices here that offer a variety of trade-offs depending on usage e.g. fixed vs dynamic topology and so no best solution. Once constructed and available within an application, Bfr strives to take advantage of that representation. As a minimum requirement for supporting a subclass of SurfaceFactory, a connected mesh representation must be able to efficiently identify the incident faces of any given vertex. As noted earlier, when no such representation is available, users can construct a FarTopologyRefiner for their connected mesh and use BfrRefinerSurfaceFactory. There are three requirements of a subclass of SurfaceFactory fulfill the interface required to adapt the connected mesh to the factory provide an internal cache for the factory of the preferred type extend the existing SurfaceFactory interface for the connected mesh type The first of these is the most significant and is the focus here. The second was mentioned previously with the SurfaceFactoryCache and is trivial. The last should also be trivial and is generally optional at minimum the subclass will need a constructor to create an instance of the factory from a given mesh, but anything more is not strictly essential. It is important to note that anyone attempting to write such a subclass must have an intimate understanding of the topological capabilities and limitations of the mesh representation involved. The SurfaceFactory is topologically robust in that it will support meshes with a wide range of degenerate or non-manifold features, but in order to process topology efficiently, a subclass needs to indicate when and where those degeneracies may occur. A simplified implementation of the BfrRefinerSurfaceFactory is provided in the tutorials for illustration purposes. The BfrSurfaceFactoryMeshAdapter Interface The SurfaceFactoryMeshAdapter class defines the interface used to satisfy the topological requirements of the SurfaceFactory. An implementation for a particular mesh class provides the base factory with everything needed to identify the limit surface of a given face from its surrounding topology. The SurfaceFactory actually inherits the SurfaceFactoryMeshAdapter interface but does not implement it -- deferring that to its subclasses -- since separate subclasses of SurfaceFactoryMeshAdapter serve no other purpose. The limit surface for a face is fully defined by the complete set of incident vertices, faces and edges surrounding the face. But it is difficult to accurately and efficiently assemble and represent all of that required information in a single class or query for all possible cases. So the mesh adapter interface provides a suite of methods to allow the factory to gather only what it needs for the Surface required -- which may differ considerably according to whether the Surface is for vertex or face-varying data, linear or non-linear, etc. The virtual methods required can be organized into small groups devoted to particular aspects of construction. A description of the methods and purposes for each group follows, with more details and exact signatures available in the accompanying Doxygen for the SurfaceFactoryMeshAdapter class. Basic Properties of a Face A small set of simple methods indicate whether the SurfaceFactory needs to create a Surface for a face, and if so, how virtual bool isFaceHole Index faceIndex const 0 virtual int getFaceSize Index faceIndex const 0 These are trivial and self-explanatory. Identifying Indices for an Entire Face If the Surface requested turns out to be linearly interpolated e.g. for varying or linear face-varying data indices for the control point data are all assigned to the face and can be trivially identified virtual int getFaceVertexIndices Index faceIndex , Index vertexIndices const 0 virtual int getFaceFVarValueIndices Index faceIndex , FVarID faceVaryingID , Index faceVaryingIndices const 0 Since multiple sets of face-varying data with different topology may be assigned to the mesh, an identifier needs to be specified both in the public interface when requesting a Surface and here when the factory assembles it. How a face-varying identifier is interpreted is completely determined by the subclass through the implementation of the methods that require it. Specifying the Neighborhood Around a Vertex When the Surface requested is not linear, the entire neighborhood around the face must be determined. This is achieved by specifying the neighborhoods around each of the vertices of the face, which the factory then assembles. For the neighborhood of each face-vertex, the factory obtains a complete specification in a simple VertexDescriptor class. An instance of VertexDescriptor is provided and populated with the following method virtual int populateFaceVertexDescriptor Index faceIndex , int faceVertex , VertexDescriptor vertexDescriptor const 0 Within this method, the given VertexDescriptor instance is initialized using a small suite of VertexDescriptor methods that specify the following information about the vertex and its neighborhood whether the neighborhood is manifold ordered counter-clockwise whether the vertex is on a boundary the sizes of all or each incident face the sharpness of the vertex the sharpness of edges of incident faces These methods are specified between Initialize and Finalize methods, so an interior vertex of valence 4 with three incident quads and one incident triangle might be specified as follows int vertexValence 4 vertexDescriptor . Initialize vertexValence vertexDescriptor . SetManifold true vertexDescriptor . SetBoundary false vertexDescriptor . SetIncidentFaceSize 0 , 4 vertexDescriptor . SetIncidentFaceSize 1 , 4 vertexDescriptor . SetIncidentFaceSize 2 , 3 vertexDescriptor . SetIncidentFaceSize 3 , 4 vertexDescriptor . Finalize Specifying the vertex neighborhood as manifold is critical to allowing the factory to inspect the neighborhood efficiently. A manifold vertex has its incident faces and edges ordered in a counter-clockwise orientation and is free of degeneracies. If it is not clear that a vertex is manifold, it should not be set as such or the factorys inspection of associated data will not be correct. Identifying Indices Around a Vertex When the Surface requested is not linear, the indices of control point data for the entire neighborhood of the face are ultimately required, and that entire set is similarly determined by identifying the indices for each of the neighborhoods of the face-vertices virtual int getFaceVertexIncidentFaceVertexIndices Index faceIndex , int faceVertex , Index vertexIndices const 0 virtual int getFaceVertexIncidentFaceFVarValueIndices Index faceIndex , int faceVertex , FVarID faceVaryingID , Index faceVaryingIndices const 0 As was the case with the methods retrieving indices for the entire face, one exists for identifying indices vertex data while another exists to identify indices for a specified set of face-varying data. Customizing the Subclass Interface Once the topological requirements of a subclass have been satisfied for its mesh representation, minor customizations of the inherited interface of SurfaceFactory may be useful. Consider a class called Mesh and its associated subclass of SurfaceFactory called MeshSurfaceFactory. At minimum, a constructor of MeshSurfaceFactory is necessary to construct an instance for a particular instance of mesh. This is typically achieved as follows MeshSurfaceFactory Mesh const mesh , Options const options In addition to the Mesh instance, such a constructor passes a set of Options i.e. SurfaceFactoryOptions to the base SurfaceFactory. Any additional arguments are possible here, e.g. perhaps only a single face-varying UV set is supported, and that might be specified by identifying it on construction. Given that mesh representations often have their own associated classes that internally contain the actual data, it may be useful to provide a few other conveniences to simplify working with a Mesh. For example, if mesh data is stored in a class called MeshPrimvar, a method to construct a Surface from a given MeshPrimvar may be useful, e.g. bool InitPrimvarSurface int faceIndex , MeshPrimvar const meshPrimvar , Surface float surface which would then determine the nature of the MeshPrimvar data interpolated as vertex, varying or face-varying and act accordingly. It may also be worth simplifying the template complexity here if only one precision is ever required. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "BFR Overview BFR Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Base Face Representation Bfr Evaluation BfrSurfaceFactory BfrSurface Parameterization BfrParameterization Discontinuous Parameterizations Tessellation BfrTessellation Tessellation Rates Differences from Hardware Tessellation More on BfrSurfaceFactory BfrSurfaceFactoryCache Defining a Thread-Safe SurfaceFactory Internal versus External SurfaceFactoryCache Customizing a BfrSurfaceFactory The BfrSurfaceFactoryMeshAdapter Interface Customizing the Subclass Interface Base Face Representation Bfr Bfr is an alternate API layer that treats a subdivision mesh provided by a client as a piecewise parameteric surface primitive . The name Bfr derives from the fact that the concepts and classes of this interface all relate to the base faces of a mesh. Concepts such as parameterization , evaluation and tessellation all refer to and are embodied by classes that deal with a specific face of the original unrefined mesh. The Bfr interfaces allow the limit surface for a single face to be identified and evaluated independently of all other faces without any global pre-processing. While concepts and utilities from the Far interface are used internally, the details of their usage is hidden. There is no need to coordinate adaptive refinement with tables of patches, stencils, Ptex indices, patch maps, etc. The resulting evaluation interface is much simpler, more flexible and more scalable than those assembled with the Far classes -- providing a preferable alternative for many CPU-based use cases. The main classes in Bfr include SurfaceFactory A light-weight interface to a mesh that constructs pieces of limit surface for specified faces of a mesh in the form of Surfaces. Surface A class encapsulating the limit surface of a face with methods for complete parametric evaluation. Parameterization A simple class defining the available parameterizations of faces and for identifying that of a particular face. Tessellation A simple class providing information about a specified tessellation pattern for a given Parameterization. Bfr is well suited to cases where evaluation of the mesh may be sparse, dynamically determined or iterative Newton, gradient descent, etc. It is not intended to replace the cases for which Far has been designed i.e. repeated evaluation of a fixed set of points but is intended to complement them. While simplicity, flexibility and reasonable performance were the main goals of Bfr , its current implementation often outperforms the table-based solutions of Far for many common use cases -- both in terms of execution time and memory use. An area that Bfr does not address, and where Far remains more suited, is capturing a specific representation of the limit surface for external use. Bfr intentionally keeps internal implementation details private to allow future improvements or extensions. Those representation details may be publicly exposed in future releases, but until then, use of Far is required for such purposes. Evaluation Since subdivision surfaces are piecewise parametric surfaces, the main operation of interest is evaluation. Bfr deals with the limit surface of a mesh as a whole by associating pieces of surface with each face of the mesh. These pieces of surface are referred to in the context of Bfr simply as surfaces and represented by BfrSurface. Each face of the mesh has an implicit local 2D parameterization and individual coordinates of that parameterization are used to evaluate its corresponding Surface. In general, 3- and 4-sided faces use the same parameterizations for quad and triangular patches used elsewhere in OpenSubdiv Parameterizations are defined for other faces more details to follow, so Surfaces for all faces can be evaluated given any 2D parametric coordinate of its face. Given an instance of a mesh, usage first requires the creation of a BfrSurfaceFactory corresponding to that mesh -- from which Surfaces can then be created for evaluation. Construction of the SurfaceFactory involves no pre-processing and Surfaces can be created and discarded as needed. The processes of constructing and evaluating Surfaces are described in more detail below. BfrSurfaceFactory Construction of BfrSurfaces requires an instance of BfrSurfaceFactory. An instance of SurfaceFactory is a light-weight interface to an instance of a mesh that requires little to no construction cost or memory. The SurfaceFactory does no work until a Surface is requested for a particular face -- at which point the factory inspects the mesh topology around that face to assemble the Surface. SurfaceFactory is actually a base class that is inherited to provide a consistent construction interface for Surfaces. Subclasses are derived to support a particular class of connected mesh -- to implement the topology inspection around each face required to construct the Surface. Use of these subclasses is very simple given the public interface of SurfaceFactory, but defining such a subclass is not. That more complex use case of SurfaceFactory will be described in detail later with other more advanced topics. In many cases, it is not necessary to explicitly define a subclass of SurfaceFactory, as the tutorials for Bfr illustrate. If already using OpenSubdiv for other reasons, a FarTopologyRefiner will have been constructed to represent the initial base mesh before refinement. Bfr provides a subclass of SurfaceFactory using FarTopologyRefiner as the base mesh ignoring any levels of refinement for immediate use in such cases. For those cases when no connected mesh representation is available at all i.e. only raw, unconnected mesh data exists construction of a FarTopologyRefiner provides a reasonably efficient connected mesh representation see the Far tutorials for construction details, whose provided subclass for SurfaceFactory is then readily available. Given the different interpolation types for mesh data i.e. vertex, varying and face-varying, the common interface for SurfaceFactory provides methods to construct Surfaces explicitly for all data types. So for positions, the methods for vertex data must be used to obtain the desired Surface, while for texture coordinates the methods for face-varying are usually required, e.g. Surface CreateVertexSurface Index faceIndex const Surface CreateVaryingSurface Index faceIndex const Surface CreateFaceVaryingSurface Index faceIndex const The Surfaces created by these construction methods may all be distinct as the underlying representations of the Surfaces and the indices of the data that define them will often differ. For example, the position data may require a bicubic patch while the face-varying texture data may be linear or a different type of bicubic patch given the different interpolation rules for face-varying and the possibility of seams. While the internal representations of the Surfaces constructed for different data interpolation types may differ, since they are all constructed as Surfaces, the functionality used to evaluate them is identical. BfrSurface The Surface class encapsulates the piece of limit surface associated with a particular face of the mesh. The term surface is used rather than patch to emphasize that the Surface may itself be a piecewise parametric surface composed of more than one patch potentially even a complex set of patches. Surface is also a class template selected by floating point precision, and so typically declared as BfrSurfacefloat. Just as a simpler type name is likely to be declared when used, the simple name Surface will be used to refer to it here. And where code fragments may be warranted, float will be substituted for the template parameter for clarity. Once created, there are two steps required to evaluate a Surface preparation of associated data points from the mesh the actual calls to evaluation methods using these data points The latter is straight-forward, but the former warrants a little more explanation. The shape of a Surface for a base face is influenced by the set of data points associated with both the vertices of the face and a subset of those in its immediate neighborhood. These control points are identified when the Surface is initialized and are publicly available for inspection if desired. The control points are sufficient to define the Surface if the face and its neighborhood are regular, but any irregularity an extra-ordinary vertex, crease, etc. usually requires additional, intermediate points to be computed from those control points in order to evaluate the Surface efficiently. Having previously avoided use of the term patch in favor of surface, the term patch points is now used to refer to these intermediate points. Patch points always include the control points as a subset and may be followed by points needed for any additional patches required to represent a more complex Surface. While the patch points are assembled in a local array for direct use by the Surface, the control points can either be gathered and accessed locally or indexed from buffers associated with the mesh for other purposes e.g. computing a bounding box of the Surface Once the patch points for a Surface are prepared, they can be passed to the main evaluation methods with the desired parametric coordinates. As previously noted, since the Surface class is a template for floating point precision, evaluation is supported in single or double precision by constructing a Surface for the desired precision. Evaluation methods are overloaded to obtain simply position or including all first or second derivatives. So preparation and evaluation can be achieved with the following Preparing patch points void PreparePatchPoints float const meshPoints , PointDescriptor meshPointDescriptor , float patchPoints , PointDescriptor patchPointDescriptor const Evaluating position and 1st derivatives void Evaluate float const uv 2 , float const patchPoints , PointDescriptor patchPointDescriptor , float P , float dPdu , float dPdv const The PointDescriptor class here is a simple struct defining the size and stride of the associated array of points. Any use of mesh points, control points or patch points generally requires an accompanying descriptor. Depending on the complexity of the limit surface, this preparation of patch points can be costly -- especially if only evaluating the Surface once or twice. In such cases, it is worth considering evaluating limit stencils, i.e. sets of coefficients that combine the original control vertices of the mesh without requiring the computation of intermediate values. The cost of evaluating stencils is considerably higher than direct evaluation, but that added overhead is often offset by avoiding the use of patch points. Surfaces should be considered a class for transient use as retaining them for longer term usage can reduce their benefits. The relatively high cost of initialization of irregular Surfaces can be a deterrent and often motivates their retention despite increased memory costs. Retaining all Surfaces of a mesh for random sampling is a situation that should be undertaken with caution and will be discussed in more detail later with other advanced topics. Parameterization Each face of a mesh has an implicit local 2D parameterization whose 2D coordinates are used to evaluate the Surface for that face. Bfr adopts the parameterizations defined elsewhere in OpenSubdiv for quadrilateral and triangular patches, for use quadrilateral and triangular faces But the parameterization of a face is also dependent on the subdivision scheme applied to it. Subdivision schemes that divide faces into quads are ultimately represented by quadrilateral patches. So a face that is a quad can be parameterized as a single quad, but other non-quad faces are parameterized as a set of quad sub-faces, i.e. faces resulting from subdivision A triangle subdivided with a quad-based scheme e.g. Catmull-Clark will therefore not have the parameterization of the triangular patch indicated previously, but another defined by its quad sub-faces illustrated above to be described in more detail below. Subdivision schemes that divide faces into triangles are currently restricted to triangles only, so all faces are parameterized as single triangles. If Loop subdivision is extended to non-triangles in future, a parameterization involving triangular sub-faces will be necessary. Note that triangles are often parameterized elsewhere in terms of barycentric coordinates u,v,w where w 1 - u - v . As is the case elsewhere in OpenSubdiv, Bfr considers parametric coordinates as 2D u,v pairs for all purposes. All faces have an implicit 2D local parameterization and all interfaces requiring parametric coordinates consider only the u,v pair. If interaction with some other tool set requiring barycentric coordinates for triangles is necessary, it is left to users to compute the implicit w accordingly. BfrParameterization BfrParameterization is a simple class that fully defines the parameterization for a particular face. An instance of Parameterization is fully defined on construction given the size of a face and the subdivision scheme applied to it where the face size is its number of verticesedges. Since any parameterization of N -sided faces requires N in some form, the face size is stored as a member and made publicly available. Each Surface has the Parameterization of its face assigned internally as part of its construction, and that is used internally by the Surface in many of its methods. The need to deal directly with the explicit details of the Parameterization class is not generally necessary. Often it is sufficient to retrieve the Parameterization from a Surface for use in some other context e.g. passed to BfrTessellation. The enumerated type ParameterizationType currently defines three kinds of parameterizations -- one of which is assigned to each instance on construction according to the properties of the face QUAD Applied to quadrilateral faces with a quad-based subdivision scheme e.g. Catmark or Bilinear. TRI Applied to triangular faces with a triangle-based subdivision scheme e.g. Loop. QUAD_SUBFACES Applied to non-quad faces with a quad-based subdivision scheme -- dividing the face into quadrilateral sub-faces. Parameterizations that involve subdivision into sub-faces, e.g. QUAD_SUBFACES, may warrant some care as they are not continuous. Depending on how they are defined, the sub-faces may be disjoint e.g. Bfr or overlap in parametric space e.g. Ptex. To help these situations, methods to detect the presence of sub-faces and deal with their local parameterizations are made available. Discontinuous Parameterizations When a face does not have a regular parameterization, the division of the parameterization into sub-faces can create complications -- as noted and addressed elsewhere in OpenSubdiv. BfrParameterization defines a quadrangulated sub-face parameterization differently from the Far and Osd interfaces. For an N -sided face, Far uses a parameterization adopted by Ptex. In this case, all quad sub-faces are parameterized over the unit square and require an additional index of the sub-face to identify them. So Ptex coordinates require three values the index and u,v of the sub-face. To embed sub-face coordinates in a single u,v pair, Bfr tiles the sub-faces in disjoint regions in parameter space. This tiling is similar to the Udim convention for textures, where a UDim on the order of sqrtN is used to preserve accuracy for increasing N Note also that the edges of each sub-face are of parametric length 0.5, which results in a total parametric length of 1.0 for all base edges. This differs again from Ptex, which parameterizes sub-faces with edge lengths of 1.0, and so can lead to inconsistencies in parametric scale typically with derivatives across edges of the mesh if not careful. As previously mentioned, care may be necessary when dealing with the discontinuities that exist in parameterizations with sub-faces. This is particularly true if evaluating data at sampled locations of the face and needing to evaluate at other locations interpolated from these. Interpolation between parametric locations, e.g. A, B and C, should be avoided when discontinuous. In many cases, dealing directly with coordinates of the sub-faces is unavoidable, e.g. interpolating Ptex coordinates for sampling of textures assigned explicitly to the sub-faces. Methods are provided to convert from Bfr s tiled parameterization to and from other representations that use a local parameterization for each sub-face. Tessellation Once a Surface can be evaluated it can be tessellated. Given a 2D parameterization, a tessellation consists of two parts a set of parametric coordinates sampling the Parameterization a set of faces connecting these coordinates that covers the entire Parameterization Once evaluated, the resulting set of sample points and the faces connecting them effectively define a mesh for that parameterization. For the sake of brevity both here and in the programming interface, the parametric coordinates or sample points are referred to simply as coords or Coords -- avoiding the term points, which is already a heavily overloaded term. Similarly the faces connecting the coords are referred to as facets or Facets -- avoiding the term face to avoid confusion with the base face of the mesh being tessellated. Bfr provides a simple class to support a variety of tessellation patterns for the different Parameterization types and methods for retrieving its associated coords and facets. In many cases the patterns they define are similar to those of GPU hardware tessellation -- which may be more familiar to many -- but they do differ in several ways, as noted below. BfrTessellation In Bfr a Tessellation is a simple class defined by a Parameterization and a given set of tessellation rates and a few additional options. These two elements define a specific tessellation pattern for all faces sharing that Parameterization. An instance of Tessellation can then be inspected to identify all or subsets of its coords or facets. The process of tessellation in other contexts usually generates triangular facets, but that is not the case with Bfr . While producing triangular facets is the default, options are available to have Tessellation include quads in patterns for parameterizations associated with quad-based subdivision schemes. For simple uniform patterns, these produce patterns that are similar in topology to those resulting from subdivision Tessellation of 4- and 5-sided faces of a quad-based scheme using quadrilateral facets left and triangular right The name Tessellation was chosen rather than Tessellator as it is a passive class that simply holds information define its pattern. It doesnt do much other than providing information about the pattern when requested. A few general properties about the pattern are determined and retained on construction, after which an instance is immutable. So it does not maintain any additional state between queries. In order to provide flexibility when dealing with tessellations of adjacent faces, the coords arising from an instance of Tessellation are ordered and are retrievable in ways to help identify points along edges that may be shared between two or more faces. The coords of a Tessellation are generated in concentric rings, beginning with the outer ring and starting with the first vertex Ordering of coords around boundary for quad and tri parameterizations. Methods of the Tessellation class allow the coords associated with specific vertices or edges to be identified, as well as providing the coords for the entire ring around the boundary separately from those of the interior if desired. While the ordering of coords in the interior is not defined and so not to be relied upon, the ordering of the boundary coords is specifically fixed to support the correlation of potentially shared coords between faces. The Tessellation class is completely independent of the Surface class. Tessellation simply takes a Parameterization and tessellation rates and provides the coords and facets that define its pattern. So Tessellation can be used in any other evaluation context where the Parameterizations are appropriate. Tessellation Rates For a particular Parameterization, the various tessellation patterns are determined by one or more tessellation rates. The simplest set of patterns uses a single tessellation rate and is said to be uniform, i.e. all edges and the interior of the face are split to a similar degree Uniform tessellation of a quadrilateral and triangle with rates of 5 and 8. More complex non-uniform patterns allow the edges of the face to be split independently from the interior of the face. Given rates for each edge, a suitable uniform rate for the interior can be either inferred or specified explicitly. These are typically referred to as the outer rates and the inner rate. The single rate specified for a simple uniform tessellation is essentially the specification of a single inner rate while the outer rates for all edges are inferred as the same. Non-uniform tessellation of a quadrilateral, triangle and 5-sided face with various outer and inner rates. In the case of Parameterizations for quads, it is common elsewhere to associate two inner rates with the opposing edges. So two separate inner rates are available for quad parameterizations -- to be specified or otherwise inferred Quad tessellations with differing inner rates with matching left and varying outer rates right. Differences from Hardware Tessellation Since the specifications for hardware tessellation often leave some details of the patterns as implementation dependent, no two hardware implementations are necessarily the same. Typically there may be subtle differences in the non-uniform tessellation patterns along boundaries, and that is to be executed here. Bfr does provide some obvious additional functionality not present in hardware tessellation and vice versa, e.g. Bfr provides the following not supported by hardware tessellation patterns for parameterizations other than quads and tris e.g. N-sided preservation of quad facets of quad-based parameterizations while hardware tessellation provides the following not supported by Bfr patterns for so-called fractional tessellation non-integer rates The lack of fractional tessellation in Bfr is something that may be addressed in a future release. Where the functionality of Bfr and hardware tessellation overlap, a few other differences are worth noting indexing of edges and their associated outer tessellation rates uniform tessellation patterns for triangles differ significantly For the indexing of edges and rates, when specifying an outer rate associated with an edge, the array index for rate i is expected to correspond to edge i . Bfr follows the convention established elsewhere in OpenSubdiv of labelingindexing edges 0, 1, etc. between vertex pairs 0,1, 1,2, etc. So outer rate 0 corresponds to the edge between vertices 0,1. In contrast, hardware tessellation associates the rate for the edge between vertices 0,1 as outer rate 1 -- its outer rate 0 is between vertices N-1,0. So an offset of 1 is warranted when comparing the two. Outer edge tessellation rates of 1,3,5,7 applied to a quad with Bfr left and GPU tessellation right. For the uniform tessellation of triangles, its well known that the needs of hardware implementation led designers to factor the patterns for triangles to make use of the same hardware necessary for quads. As a result, many edges are introduced into a simple tessellation of a triangle that are not parallel to one of its three edges. Bfr uses patterns more consistent with those resulting from the subdivision of triangles. Only edges parallel to the edges of the triangle are introduced, which creates more uniform facets both edge lengths and area and reduces their number by one third. This can reduce artifacts that sometimes arise with use of the hardware patterns at lower tessellation rates Uniform tessellation of a triangle with Bfr left and GPU tessellation right. These triangular patterns have been referred to as integer spacing for triangular patches in early work on hardware tessellation. But use of these patterns was generally discarded in favor of techniques that split the triangle into three quads -- allowing the hardware solution for quad tessellation to be reused. More on BfrSurfaceFactory The primary function of BfrSurfaceFactory is to identify and construct a representation of the limit surface for a given face of a mesh. It achieves this by inspecting the topology around the given face and constructing a suitable representation encapsulated in a Surface. The regions around a face can be divided into two categories based on their topology those that are regular and those that are not, i.e. those that are irregular. Recalling the illustration from Irregular versus Irregular Features Patches of regular Surfaces Potential patches of irregular Surfaces The representation of the limit surface for regular regions is trivial -- it is a single parametric patch whose basis is determined by the subdivision scheme e.g. uniform bicubic B-spline for Catmull-Clark. In contrast, the representation of the limit surface for an irregular region cannot be accurately represented so simply. It can be far more complex depending on the features present extra-ordinary vertices, creasing of edges, etc.. It may be as simple as a different kind of parametric patch whose points are derived from those of the mesh, or it may often be a set of patches in a hierarchy resulting from local subdivision. Bfr intentionally hides the details of these representations to allow future improvement. The cost of determining and assembling the representations of irregular Surfaces is therefore often significant. Some of the performance benefits of the SurfaceFactory are achieved by having it cache the complexities of the irregular surfaces that it encounters. In many common use cases, awareness and management of this caching is not necessary as illustrated by the tutorials. But the thread-safe construction of Surfaces is one area where some awareness is required. Other use cases that share the cache between meshes are also worth exploring as they can further reduce potentially significant costs. BfrSurfaceFactoryCache The SurfaceFactoryCache is the class used by SurfaceFactory to cache the topological information that it can reuse for other similarly irregular faces of the mesh. Though it is a publicly accessible class, the SurfaceFactoryCache has little to no public interface other than construction made available to support more advanced cases covered later and in most cases it can be completely ignored. Typically an instance of SurfaceFactory has an internal SurfaceFactoryCache member which is used by that factory for its lifetime. Since that cache member is mutable -- potentially updated when an irregular Surface is created -- it does need to be thread-safe if the SurfaceFactory is to be used in a threaded context. To accommodate this need, SurfaceFactoryCache is defined as a base class with an accompanying class template to allow the trivial declaration of thread-safe subclasses template typename MUTEX_TYPE , typename READ_LOCK_GUARD_TYPE , typename WRITE_LOCK_GUARD_TYPE class SurfaceFactoryCacheThreaded public SurfaceFactoryCache ... For example, a local type for a thread-safe cache using stdshared_mutex from C17 could be simply declared as follows include shared_mutex typedef Bfr SurfaceFactoryCacheThreaded std shared_mutex , std shared_lock std shared_mutex , std unique_lock std shared_mutex ThreadSafeCache Such thread-safe cache types are essential when distributing the work of a single SurfaceFactory across multiple threads. They can be encapsulated in the definitions of subclasses of SurfaceFactory or used to define external cache instances for use with any subclass of SurfaceFactory. Defining a Thread-Safe SurfaceFactory The thread-safety of a SurfaceFactory is purely dependent on the thread-safety of the SurfaceFactoryCache that it uses. With caching disabled, any SurfaceFactory is thread-safe but will be far less efficient in dealing with irregular Surfaces. When a subclass of SurfaceFactory is defined discussed in more detail later, one of its responsibilities is to identify and manage an instance of SurfaceFactoryCache for its internal use. Defining such a subclass is a simple matter of declaring a thread-safe SurfaceFactoryCache type as noted above along with a local member of that type to be used by each instance. Given the widespread use of the FarTopologyRefiner in OpenSubdiv, and the lack of a connected mesh representation in many contexts, a subclass of SurfaceFactory is made available to use a TopologyRefiner as a mesh, i.e. the BfrRefinerSurfaceFactory subclass. Since many OpenSubdiv users may make use of the RefinerSurfaceFactory subclass, and they may have different preferences of threading model, the RefinerSurfaceFactory subclass is similarly defined as a class template to enable threading flexibility. In this case, the template is parameterized by the desired type of SurfaceFactoryCache, which embodies the threading specifications as noted above, i.e. template class CACHE_TYPE SurfaceFactoryCache class RefinerSurfaceFactory public ... ... The default template is the base SurfaceFactoryCache which is not thread-safe, but a simple declaration of a thread-safe cache type is sufficient to declare a similarly thread-safe RefinerSurfaceFactory type include opensubdivbfrsurfaceFactoryCache.h Declare thread-safe cache type see stdshared_mutex example above typedef Bfr SurfaceFactoryCacheThreaded ... ThreadSafeCache Declare thread-safe factory type typedef Bfr RefinerSurfaceFactory ThreadSafeCache ThreadSafeFactory The resulting factory type safely allows the construction of Surfaces and their subsequent evaluation and tessellation to be distributed over multiple threads. Internal versus External SurfaceFactoryCache Typical usage of the SurfaceFactoryCache by the SurfaceFactory is to have the factory create an internal cache member to be used for the lifetime of the factory associated with a mesh. But the data stored in the cache is not in any way dependent on the factory or mesh used to create it. So a cache can potentially be shared by multiple factories. While such sharing is possible -- and the Bfr interfaces intentionally permit it -- any exploration should proceed with caution. Greater public knowledge and control of the cache is ultimately necessary to manage its potentially unbounded memory increase, and support in the public interface is currently limited. A cache stored as a member varialbe and managed exclusively by the factory is said to be internal while one managed exclusively by its client is said to be external. In both cases, the factory deals with retrieving data from or adding data to the cache -- only management of the caches ownership differs, and that ownership is never transferred. A subset of the methods of SurfaceFactoryOptions provide the means of specifying the use of an internal or external cache, or no caching at all Assign an external cache to override the internal Options SetExternalCache SurfaceFactoryCache cache Enable or disable caching default is true Options EnableCaching bool on As noted here, specifying an external cache will override use of a factorys internal cache. Disabling caching takes precedence over both, but is generally not practical and exists mainly to aide debugging. The common use of the internal cache is to create a SurfaceFactory and distribute processing of the Surfaces of its faces over multiple threads, or to construct Surfaces for the mesh for any other purpose while the mesh remains in scope. There is no need to deal explicitly with the SurfaceFactoryCache in these cases. Use cases for an external cache are more varied and explicit, including creating a single external cache to process a sequence of meshes on a single thread cache thread-safety not required creating a separate external cache on each thread to process a set of meshes distributed over multiple threads cache thread-safety not required creating a single external cache for multiple meshes distributed over multiple threads cache thread-safety required, and beware of unbounded memory growth here Future extensions to the public interface of SurfaceFactoryCache may be made to support common use cases as their common needs are made clearer. Customizing a BfrSurfaceFactory One of the goals of Bfr is to provide a lightweight interface for the evaluation of Surfaces from any connected mesh representation. In order to do so, the factory needs to gather topological information from that mesh representation. That information is provide to the factory through inheritance a subclass of SurfaceFactory is defined that fulfills all requirements of the factory. It must be made clear that a subclass can only be created from a connected mesh representation, i.e. a representation that includes connectivity or adjacency relationships between its components vertices, faces and edges. Classes for simple containers of mesh topology used for external formats e.g. USD, Alembic, etc. are generally not connected . Many applications construct a connected mesh representation for internal use when loading such mesh data -- using a variety of techniques including half-edges, winged-edges or table-based relationships. There are many choices here that offer a variety of trade-offs depending on usage e.g. fixed vs dynamic topology and so no best solution. Once constructed and available within an application, Bfr strives to take advantage of that representation. As a minimum requirement for supporting a subclass of SurfaceFactory, a connected mesh representation must be able to efficiently identify the incident faces of any given vertex. As noted earlier, when no such representation is available, users can construct a FarTopologyRefiner for their connected mesh and use BfrRefinerSurfaceFactory. There are three requirements of a subclass of SurfaceFactory fulfill the interface required to adapt the connected mesh to the factory provide an internal cache for the factory of the preferred type extend the existing SurfaceFactory interface for the connected mesh type The first of these is the most significant and is the focus here. The second was mentioned previously with the SurfaceFactoryCache and is trivial. The last should also be trivial and is generally optional at minimum the subclass will need a constructor to create an instance of the factory from a given mesh, but anything more is not strictly essential. It is important to note that anyone attempting to write such a subclass must have an intimate understanding of the topological capabilities and limitations of the mesh representation involved. The SurfaceFactory is topologically robust in that it will support meshes with a wide range of degenerate or non-manifold features, but in order to process topology efficiently, a subclass needs to indicate when and where those degeneracies may occur. A simplified implementation of the BfrRefinerSurfaceFactory is provided in the tutorials for illustration purposes. The BfrSurfaceFactoryMeshAdapter Interface The SurfaceFactoryMeshAdapter class defines the interface used to satisfy the topological requirements of the SurfaceFactory. An implementation for a particular mesh class provides the base factory with everything needed to identify the limit surface of a given face from its surrounding topology. The SurfaceFactory actually inherits the SurfaceFactoryMeshAdapter interface but does not implement it -- deferring that to its subclasses -- since separate subclasses of SurfaceFactoryMeshAdapter serve no other purpose. The limit surface for a face is fully defined by the complete set of incident vertices, faces and edges surrounding the face. But it is difficult to accurately and efficiently assemble and represent all of that required information in a single class or query for all possible cases. So the mesh adapter interface provides a suite of methods to allow the factory to gather only what it needs for the Surface required -- which may differ considerably according to whether the Surface is for vertex or face-varying data, linear or non-linear, etc. The virtual methods required can be organized into small groups devoted to particular aspects of construction. A description of the methods and purposes for each group follows, with more details and exact signatures available in the accompanying Doxygen for the SurfaceFactoryMeshAdapter class. Basic Properties of a Face A small set of simple methods indicate whether the SurfaceFactory needs to create a Surface for a face, and if so, how virtual bool isFaceHole Index faceIndex const 0 virtual int getFaceSize Index faceIndex const 0 These are trivial and self-explanatory. Identifying Indices for an Entire Face If the Surface requested turns out to be linearly interpolated e.g. for varying or linear face-varying data indices for the control point data are all assigned to the face and can be trivially identified virtual int getFaceVertexIndices Index faceIndex , Index vertexIndices const 0 virtual int getFaceFVarValueIndices Index faceIndex , FVarID faceVaryingID , Index faceVaryingIndices const 0 Since multiple sets of face-varying data with different topology may be assigned to the mesh, an identifier needs to be specified both in the public interface when requesting a Surface and here when the factory assembles it. How a face-varying identifier is interpreted is completely determined by the subclass through the implementation of the methods that require it. Specifying the Neighborhood Around a Vertex When the Surface requested is not linear, the entire neighborhood around the face must be determined. This is achieved by specifying the neighborhoods around each of the vertices of the face, which the factory then assembles. For the neighborhood of each face-vertex, the factory obtains a complete specification in a simple VertexDescriptor class. An instance of VertexDescriptor is provided and populated with the following method virtual int populateFaceVertexDescriptor Index faceIndex , int faceVertex , VertexDescriptor vertexDescriptor const 0 Within this method, the given VertexDescriptor instance is initialized using a small suite of VertexDescriptor methods that specify the following information about the vertex and its neighborhood whether the neighborhood is manifold ordered counter-clockwise whether the vertex is on a boundary the sizes of all or each incident face the sharpness of the vertex the sharpness of edges of incident faces These methods are specified between Initialize and Finalize methods, so an interior vertex of valence 4 with three incident quads and one incident triangle might be specified as follows int vertexValence 4 vertexDescriptor . Initialize vertexValence vertexDescriptor . SetManifold true vertexDescriptor . SetBoundary false vertexDescriptor . SetIncidentFaceSize 0 , 4 vertexDescriptor . SetIncidentFaceSize 1 , 4 vertexDescriptor . SetIncidentFaceSize 2 , 3 vertexDescriptor . SetIncidentFaceSize 3 , 4 vertexDescriptor . Finalize Specifying the vertex neighborhood as manifold is critical to allowing the factory to inspect the neighborhood efficiently. A manifold vertex has its incident faces and edges ordered in a counter-clockwise orientation and is free of degeneracies. If it is not clear that a vertex is manifold, it should not be set as such or the factorys inspection of associated data will not be correct. Identifying Indices Around a Vertex When the Surface requested is not linear, the indices of control point data for the entire neighborhood of the face are ultimately required, and that entire set is similarly determined by identifying the indices for each of the neighborhoods of the face-vertices virtual int getFaceVertexIncidentFaceVertexIndices Index faceIndex , int faceVertex , Index vertexIndices const 0 virtual int getFaceVertexIncidentFaceFVarValueIndices Index faceIndex , int faceVertex , FVarID faceVaryingID , Index faceVaryingIndices const 0 As was the case with the methods retrieving indices for the entire face, one exists for identifying indices vertex data while another exists to identify indices for a specified set of face-varying data. Customizing the Subclass Interface Once the topological requirements of a subclass have been satisfied for its mesh representation, minor customizations of the inherited interface of SurfaceFactory may be useful. Consider a class called Mesh and its associated subclass of SurfaceFactory called MeshSurfaceFactory. At minimum, a constructor of MeshSurfaceFactory is necessary to construct an instance for a particular instance of mesh. This is typically achieved as follows MeshSurfaceFactory Mesh const mesh , Options const options In addition to the Mesh instance, such a constructor passes a set of Options i.e. SurfaceFactoryOptions to the base SurfaceFactory. Any additional arguments are possible here, e.g. perhaps only a single face-varying UV set is supported, and that might be specified by identifying it on construction. Given that mesh representations often have their own associated classes that internally contain the actual data, it may be useful to provide a few other conveniences to simplify working with a Mesh. For example, if mesh data is stored in a class called MeshPrimvar, a method to construct a Surface from a given MeshPrimvar may be useful, e.g. bool InitPrimvarSurface int faceIndex , MeshPrimvar const meshPrimvar , Surface float surface which would then determine the nature of the MeshPrimvar data interpolated as vertex, varying or face-varying and act accordingly. It may also be worth simplifying the template complexity here if only one precision is ever required. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "bfr_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "API Overview", │ │ │ │ │ - "text": "API Overview API Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE API Layers Using the Right Tools Use case 1 Simple refinement Use case 2 GL adaptive tessellation drawing of animating mesh Tutorials and Examples API Layers OpenSubdiv is structured as a set of layered libraries. This structure facilitates operation on a variety of computing resources, and allows developers to only opt-in to the layers and feature sets that they require. From a top-down point of view, OpenSubdiv is comprised of several layers, some public, and some private. Layers list Sdc Subdivision Core Sdc Overview The lowest level layer, implements the core subdivision details to facilitate the generation of consistent results. Most cases will only require the use of simple public types and constants from Sdc. Vtr Vectorized Topological Representation Vtr Overview A suite of classes to provide an intermediate representation of topology that supports efficient refinement. Vtr is intended for internal use only. Far Feature Adaptive Representation Far Overview The central interface that processes client-supplied geometry and turns it into a serialized data representation ready for parallel processing in Osd . Far also provides a fully-featured single-threaded implementation of subdivision interpolation algorithms. Bfr Bace Face Representation Bfr Overview A suite of classes to provide parameterization, evaluation and tessellation on the CPU. Bfr is more flexible and more scalable than Osd but potentially less efficient. Osd OpenSubdiv cross platform Osd Overview A suite of classes to provide parallel subdivision kernels and drawing utilities on a variety of platforms such as TBB, CUDA, OpenCL, GLSL and DirectX. Client mesh data enters the API through the Far layer. Typically, results will be collected from the Osd layer. However, it is possible to use functionality from Far without introducing any dependency on Osd. Although there are several entry-points to provide topology and primitive variable data to OpenSubdiv, eventually everything must pass through the private Vtr and Sdc representations for topological analysis. Using the Right Tools OpenSubdivs tiered interface offers a lot flexibility to make your application both fast and robust. Because navigating through the large collection of classes and features can be challenging, here are use cases that should help sketch the broad lines of going about using subdivisions in your application. General client application requirements Surface Limit For some applications, a polygonal approximation of the smooth surface is enough. Others require C 2 continuous differentiable bi-cubic patches ex deformable displacement mapping, smooth normals and semi-sharp creases... Deforming Surface Applications such as off-line image renderers often process a single frame at a time. Others, such as interactive games need to evaluate deforming character surface every frame. Because we can amortize many computations if the topology of the mesh does not change, OpenSubdiv provides stencil tables in order to leverage subdivision refinement into a pre-computation step. Multi-threading OpenSubdiv also provides dedicated interfaces to leverage parallelism on a wide variety of platforms and API standards, including both CPUs and GPUs. GPU Draw If the application requires interactive drawing on screen, OpenSubdiv provides several back-end implementations, including D3D11 and OpenGL. These back-ends provide full support for programmable shading. Use case 1 Simple refinement The following example shows the most simple case to get your mesh refined uniformly. Define a class for the primvar you want to refine. Its required to have Clear and AddWithWeight functions. struct Vertex void Clear x y z 0 void AddWithWeight Vertex const src , float weight x weight src . x y weight src . y z weight src . z float x , y , z 2. Instantiate a FarTopologyRefiner from the FarTopologyDescriptor . Far TopologyDescriptor desc desc . numVertices the number of vertices desc . numFaces the number of faces desc . numVertsPerFace array of the number of verts per face desc . vertIndicesPerFace array of vert indices Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc Call RefineUniform to refine the topology up to maxlevel. refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel 4. Interpolate vertex primvar data at level using FarPrimvarRefiner Far PrimvarRefiner primvarRefiner refiner Vertex const src coarse vertices Vertex dst refined vertices primvarRefiner . Interpolate level , src , dst The topology at the refined level can be obtained from FarTopologyLevel Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face do something with dst and fverts Done See Far tutorial 1.1 for the complete code example. Use case 2 GL adaptive tessellation drawing of animating mesh The next example is showing how to draw adaptive tessellated patches in GL using OpenSubdiv. The osd layer helps you to interact with GL and other device specific APIs. Also for an efficient refinement of animating mesh on a static topology, we create a stencil table to refine the positions changing over time. The following example code uses an OsdGLMesh utility class which composites a stencil table, patch table, vertex buffer and evaluator in osd layer. You can also use those classes independently. 1. Instantiate a FarTopologyRefiner from the FarTopologyDescriptor , same as usecase 1. Setup OsdMesh. In this example we use b-spline endcap. int numVertexElements 3 x, y, z Osd MeshBitset bits bits . set Osd MeshAdaptive , true set adaptive bits . set Osd MeshEndCapBSplineBasis , true use b-spline basis patch for endcap. Osd GLMeshInterface mesh new Osd Mesh Osd CpuGLVertexBuffer , Far StencilTable , Osd CpuEvaluator , Osd GLPatchTable refiner , numVertexElements , 0 , level , bits 3. Update coarse vertices and refine OsdMeshRefine calls OsdCpuEvaluatorEvalStencils mesh - UpdateVertexBuffer vertex 0 , 0 , nverts mesh - Refine Bind index buffer, PatchParamBuffer and vertex buffer index buffer glBindBuffer GL_ELEMENT_ARRAY_BUFFER , mesh - GetPatchTable - GetPatchIndexBuffer vertex buffer glBindBuffer GL_ARRAY_BUFFER , mesh - BindVertexBuffer glEnableVertexAttribArray 0 glVertexAttribPointer 0 , numVertexElements , GL_FLOAT , GL_FALSE , numVertexElements sizeof float , 0 patch param buffer glActiveTexture GL_TEXTURE0 glBindTexture GL_TEXTURE_BUFFER , mesh - GetPatchTable - GetPatchParamTextureBuffer Draw. Since we use b-spline endcaps in this example, there is only one PatchArray in the patch table. You may need to iterate patch arrays as you use other type of endcap. To configure GLSL program for each patch type, see osd shader interface for more details. Osd PatchArray const patch mesh - GetPatchTable - GetPatchArrays 0 Far PatchDescriptor desc patch . GetDescriptor int numVertsPerPatch desc . GetNumControlVertices 16 for B-spline patches glUseProgram BSplinePatchProgram glPatchParameteri GL_PATCH_VERTICES , numVertsPerPatch glDrawElements GL_PATCHES , patch . GetNumPatches numVertsPerPatch , GL_UNSIGNED_INT , 0 As the mesh animates, repeat from step 3 to update positions, refine, and draw. See glViewer and other examples for more complete usage. Tutorials and Examples For more use cases, please see Tutorials and Examples Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "API Overview API Overview 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE API Layers Using the Right Tools Use case 1 Simple refinement Use case 2 GL adaptive tessellation drawing of animating mesh Tutorials and Examples API Layers OpenSubdiv is structured as a set of layered libraries. This structure facilitates operation on a variety of computing resources, and allows developers to only opt-in to the layers and feature sets that they require. From a top-down point of view, OpenSubdiv is comprised of several layers, some public, and some private. Layers list Sdc Subdivision Core Sdc Overview The lowest level layer, implements the core subdivision details to facilitate the generation of consistent results. Most cases will only require the use of simple public types and constants from Sdc. Vtr Vectorized Topological Representation Vtr Overview A suite of classes to provide an intermediate representation of topology that supports efficient refinement. Vtr is intended for internal use only. Far Feature Adaptive Representation Far Overview The central interface that processes client-supplied geometry and turns it into a serialized data representation ready for parallel processing in Osd . Far also provides a fully-featured single-threaded implementation of subdivision interpolation algorithms. Bfr Bace Face Representation Bfr Overview A suite of classes to provide parameterization, evaluation and tessellation on the CPU. Bfr is more flexible and more scalable than Osd but potentially less efficient. Osd OpenSubdiv cross platform Osd Overview A suite of classes to provide parallel subdivision kernels and drawing utilities on a variety of platforms such as TBB, CUDA, OpenCL, GLSL and DirectX. Client mesh data enters the API through the Far layer. Typically, results will be collected from the Osd layer. However, it is possible to use functionality from Far without introducing any dependency on Osd. Although there are several entry-points to provide topology and primitive variable data to OpenSubdiv, eventually everything must pass through the private Vtr and Sdc representations for topological analysis. Using the Right Tools OpenSubdivs tiered interface offers a lot flexibility to make your application both fast and robust. Because navigating through the large collection of classes and features can be challenging, here are use cases that should help sketch the broad lines of going about using subdivisions in your application. General client application requirements Surface Limit For some applications, a polygonal approximation of the smooth surface is enough. Others require C 2 continuous differentiable bi-cubic patches ex deformable displacement mapping, smooth normals and semi-sharp creases... Deforming Surface Applications such as off-line image renderers often process a single frame at a time. Others, such as interactive games need to evaluate deforming character surface every frame. Because we can amortize many computations if the topology of the mesh does not change, OpenSubdiv provides stencil tables in order to leverage subdivision refinement into a pre-computation step. Multi-threading OpenSubdiv also provides dedicated interfaces to leverage parallelism on a wide variety of platforms and API standards, including both CPUs and GPUs. GPU Draw If the application requires interactive drawing on screen, OpenSubdiv provides several back-end implementations, including D3D11 and OpenGL. These back-ends provide full support for programmable shading. Use case 1 Simple refinement The following example shows the most simple case to get your mesh refined uniformly. Define a class for the primvar you want to refine. Its required to have Clear and AddWithWeight functions. struct Vertex void Clear x y z 0 void AddWithWeight Vertex const src , float weight x weight src . x y weight src . y z weight src . z float x , y , z 2. Instantiate a FarTopologyRefiner from the FarTopologyDescriptor . Far TopologyDescriptor desc desc . numVertices the number of vertices desc . numFaces the number of faces desc . numVertsPerFace array of the number of verts per face desc . vertIndicesPerFace array of vert indices Far TopologyRefiner refiner Far TopologyRefinerFactory Descriptor Create desc Call RefineUniform to refine the topology up to maxlevel. refiner - RefineUniform Far TopologyRefiner UniformOptions maxlevel 4. Interpolate vertex primvar data at level using FarPrimvarRefiner Far PrimvarRefiner primvarRefiner refiner Vertex const src coarse vertices Vertex dst refined vertices primvarRefiner . Interpolate level , src , dst The topology at the refined level can be obtained from FarTopologyLevel Far TopologyLevel const refLastLevel refiner - GetLevel maxlevel int nverts refLastLevel . GetNumVertices int nfaces refLastLevel . GetNumFaces for int face 0 face nfaces face Far ConstIndexArray fverts refLastLevel . GetFaceVertices face do something with dst and fverts Done See Far tutorial 1.1 for the complete code example. Use case 2 GL adaptive tessellation drawing of animating mesh The next example is showing how to draw adaptive tessellated patches in GL using OpenSubdiv. The osd layer helps you to interact with GL and other device specific APIs. Also for an efficient refinement of animating mesh on a static topology, we create a stencil table to refine the positions changing over time. The following example code uses an OsdGLMesh utility class which composites a stencil table, patch table, vertex buffer and evaluator in osd layer. You can also use those classes independently. 1. Instantiate a FarTopologyRefiner from the FarTopologyDescriptor , same as usecase 1. Setup OsdMesh. In this example we use b-spline endcap. int numVertexElements 3 x, y, z Osd MeshBitset bits bits . set Osd MeshAdaptive , true set adaptive bits . set Osd MeshEndCapBSplineBasis , true use b-spline basis patch for endcap. Osd GLMeshInterface mesh new Osd Mesh Osd CpuGLVertexBuffer , Far StencilTable , Osd CpuEvaluator , Osd GLPatchTable refiner , numVertexElements , 0 , level , bits 3. Update coarse vertices and refine OsdMeshRefine calls OsdCpuEvaluatorEvalStencils mesh - UpdateVertexBuffer vertex 0 , 0 , nverts mesh - Refine Bind index buffer, PatchParamBuffer and vertex buffer index buffer glBindBuffer GL_ELEMENT_ARRAY_BUFFER , mesh - GetPatchTable - GetPatchIndexBuffer vertex buffer glBindBuffer GL_ARRAY_BUFFER , mesh - BindVertexBuffer glEnableVertexAttribArray 0 glVertexAttribPointer 0 , numVertexElements , GL_FLOAT , GL_FALSE , numVertexElements sizeof float , 0 patch param buffer glActiveTexture GL_TEXTURE0 glBindTexture GL_TEXTURE_BUFFER , mesh - GetPatchTable - GetPatchParamTextureBuffer Draw. Since we use b-spline endcaps in this example, there is only one PatchArray in the patch table. You may need to iterate patch arrays as you use other type of endcap. To configure GLSL program for each patch type, see osd shader interface for more details. Osd PatchArray const patch mesh - GetPatchTable - GetPatchArrays 0 Far PatchDescriptor desc patch . GetDescriptor int numVertsPerPatch desc . GetNumControlVertices 16 for B-spline patches glUseProgram BSplinePatchProgram glPatchParameteri GL_PATCH_VERTICES , numVertsPerPatch glDrawElements GL_PATCHES , patch . GetNumPatches numVertsPerPatch , GL_UNSIGNED_INT , 0 As the mesh animates, repeat from step 3 to update positions, refine, and draw. See glViewer and other examples for more complete usage. Tutorials and Examples For more use cases, please see Tutorials and Examples Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "api_overview.html" │ │ │ │ │ }, { │ │ │ │ │ "title": "Additional Resources", │ │ │ │ │ - "text": "Additional Resources Additional Resources 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Links Videos Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces 2012 Open Subdivision Technology Review 2012 Autodesk User Group At Anaheim 2013 Why Model with Subdivisions 2013 Meet the Experts The OpenSubdiv Project 2013 Links OpenSubdiv Github Repository OpenSubdiv with Mudbox and Maya Videos Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces 2012 Open Subdivision Technology Review 2012 Autodesk User Group At Anaheim 2013 Why Model with Subdivisions 2013 Meet the Experts The OpenSubdiv Project 2013 Join special guests, Bill Polson, Dirk Van Gelder, Manuel Kraemer, Takahito Tejima, David G. Yu and Dale Ruffolo, from Pixar Animation Studios GPU team, as they show how real time display of subdivision surfaces helps artists be more productive, and how this code is open source and engineered for ease of integration. Generated on 2024-01-08 0940 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ + "text": "Additional Resources Additional Resources 3.5.0 User Docs API Docs Release Notes Forum Github OSD_ARTICLE_TITLE Links Videos Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces 2012 Open Subdivision Technology Review 2012 Autodesk User Group At Anaheim 2013 Why Model with Subdivisions 2013 Meet the Experts The OpenSubdiv Project 2013 Links OpenSubdiv Github Repository OpenSubdiv with Mudbox and Maya Videos Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces 2012 Open Subdivision Technology Review 2012 Autodesk User Group At Anaheim 2013 Why Model with Subdivisions 2013 Meet the Experts The OpenSubdiv Project 2013 Join special guests, Bill Polson, Dirk Van Gelder, Manuel Kraemer, Takahito Tejima, David G. Yu and Dale Ruffolo, from Pixar Animation Studios GPU team, as they show how real time display of subdivision surfaces helps artists be more productive, and how this code is open source and engineered for ease of integration. Generated on 2024-01-08 0943 UTC. User Docs API Docs Release Notes Forum TM 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms of Use", │ │ │ │ │ "tags": "", │ │ │ │ │ "loc": "additional_resources.html" │ │ │ │ │ }, ] │ │ │ │ │ }; │ │ │ ├── ./usr/share/doc/opensubdiv/tutorials.html │ │ │ │ @@ -531,15 +531,15 @@ │ │ │ │ OBJ format for inspection. [code] │ │ │ │ images/hbr_tutorial_2.0.png │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -280,14 +280,14 @@ │ │ │ │ │ the same pyramid shape used in hbr_tutorial_0. We then apply the │ │ │ │ │ Refine() function sequentially to all the faces in the mesh to │ │ │ │ │ generate several levels of uniform subdivision. The resulting data is │ │ │ │ │ then dumped to the terminal in Wavefront OBJ format for inspection. │ │ │ │ │ [code] │ │ │ │ │ [images/hbr_tutorial_2.0.png] │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/using_osd_hbr.html │ │ │ │ @@ -756,15 +756,15 @@ │ │ │ │ vertexBuffer->UpdateData(vtxData+splits[i].second*numVertexElements, splits[i].first, 1); │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -522,14 +522,14 @@ │ │ │ │ │ // Duplicate the vertex data into the split singular vertices │ │ │ │ │ std::vector > const splits = hbrMesh->GetSplitVertices(); │ │ │ │ │ for (int i=0; i<(int)splits.size(); ++i) { │ │ │ │ │ vertexBuffer->UpdateData(vtxData+splits[i].second*numVertexElements, splits │ │ │ │ │ [i].first, 1); │ │ │ │ │ } │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use │ │ │ ├── ./usr/share/doc/opensubdiv/vtr_overview.html │ │ │ │ @@ -392,15 +392,15 @@ │ │ │ │ Tags were added to the base level that are propagated through the refinement │ │ │ │ and these too are dependent on the scheme, but are applied externally.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -238,14 +238,14 @@ │ │ │ │ │ savings are considerable. │ │ │ │ │ Currently there is nothing specific to a subdivision scheme in the refinement │ │ │ │ │ other than the type of topological splitting to apply. The refinement does │ │ │ │ │ subdivide sharpness values for creasing, but that too is independent of scheme. │ │ │ │ │ Tags were added to the base level that are propagated through the refinement │ │ │ │ │ and these too are dependent on the scheme, but are applied externally. │ │ │ │ │ =============================================================================== │ │ │ │ │ -Generated on: 2024-01-08 09:40 UTC. │ │ │ │ │ +Generated on: 2024-01-08 09:43 UTC. │ │ │ │ │ │ │ │ │ │ * User_Docs │ │ │ │ │ * API_Docs │ │ │ │ │ * Release_Notes │ │ │ │ │ * Forum │ │ │ │ │ TM & © 1986 - 2017 PIXAR. ALL RIGHTS RESERVED. Terms_of_Use