| OpenSubdiv

Loading...
Searching...
No Matches
glComputeEvaluator.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:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
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_GL_COMPUTE_EVALUATOR_H
26#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
27
28#include "../version.h"
29
30#include "../osd/opengl.h"
31#include "../osd/types.h"
32#include "../osd/bufferDescriptor.h"
33
34 namespace OpenSubdiv {
35 namespace OPENSUBDIV_VERSION {
36
37 namespace Far {
38 class PatchTable;
39 class StencilTable;
40 class LimitStencilTable;
41}
42
43 namespace Osd {
44
51 class GLStencilTableSSBO {
52 public:
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
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 private:
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
96 class GLComputeEvaluator {
97 public:
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 <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,
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 <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>
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 <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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 <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,
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 <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>
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 <typename SRC_BUFFER, typename DST_BUFFER,
996 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1070 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1153 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1213 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1277 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1354 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1438 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1543 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1605 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1668 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1735 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1815 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
1902 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 <typename SRC_BUFFER, typename DST_BUFFER,
2010 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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
2057 private:
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
2110 using namespace OPENSUBDIV_VERSION;
2111
2112} // end namespace OpenSubdiv
2113
2114
2115#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
opengl.h
bufferDescriptor.h
OpenSubdiv
Definition limits.h:32
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:33
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:36
OpenSubdiv::OPENSUBDIV_VERSION::Osd
Definition bufferDescriptor.h:34
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::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::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::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
types.h