25 #ifndef OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
26 #define OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H
28 #include "../version.h"
29 #include "../far/patchTable.h"
30 #include "../osd/nonCopyable.h"
31 #include "../osd/mtlCommon.h"
36 namespace OpenSubdiv {
37 namespace OPENSUBDIV_VERSION {
41 class MTLLegacyGregoryPatchTable
42 :
private NonCopyable<MTLLegacyGregoryPatchTable>
45 ~MTLLegacyGregoryPatchTable();
47 template<
typename DEVICE_CONTEXT>
48 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable
const* farPatchTable, DEVICE_CONTEXT context) {
49 return Create(farPatchTable, context);
52 static MTLLegacyGregoryPatchTable* Create(Far::PatchTable
const* farPatchTable, MTLContext* context);
54 void UpdateVertexBuffer(id<MTLBuffer> vbo,
int numVertices,
int numVertexElements, MTLContext* context);
56 id<MTLBuffer> GetVertexBuffer()
const
61 id<MTLBuffer> GetVertexValenceBuffer()
const
63 return _vertexValenceBuffer;
66 id<MTLBuffer> GetQuadOffsetsBuffer()
const
68 return _quadOffsetsBuffer;
74 return _quadOffsetsBase[1];
75 return _quadOffsetsBase[0];
79 id<MTLBuffer> _vertexBuffer;
80 id<MTLBuffer> _vertexValenceBuffer;
81 id<MTLBuffer> _quadOffsetsBuffer;
82 int _quadOffsetsBase[2];
88 using namespace OPENSUBDIV_VERSION;
92 #endif // OPENSUBDIV3_OSD_MTL_LEGACY_GREGORY_PATCH_TABLE_H