mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-09 22:00:06 +00:00
Fixes the bug of glShareTopology. This example mutates patchDescriptor in drawcontext, so it needs a write access.
Adding another GetPatchArray() returning non-const reference. We should think about better API for this.
This commit is contained in:
parent
7462ae20ff
commit
b3f6f52bb9
@ -260,12 +260,12 @@ public:
|
||||
protected:
|
||||
|
||||
TopologyBase(Far::PatchTables const * patchTables) {
|
||||
|
||||
_drawContext = Osd::GLDrawContext::Create(patchTables, 7);
|
||||
}
|
||||
|
||||
void updateVertexBufferStride(int stride) {
|
||||
Osd::DrawContext::PatchArrayVector patchArrays =
|
||||
// modifying patchArrays in drawcontext.
|
||||
Osd::DrawContext::PatchArrayVector &patchArrays =
|
||||
_drawContext->GetPatchArrays();
|
||||
for (int i = 0; i < (int)patchArrays.size(); ++i) {
|
||||
Osd::DrawContext::PatchDescriptor desc = patchArrays[i].GetDescriptor();
|
||||
|
@ -212,6 +212,12 @@ public:
|
||||
return _patchArrays;
|
||||
}
|
||||
|
||||
/// The writable accessor to the internal patch array (tentative).
|
||||
/// We should have a different api something like ConvertPatchArrays().
|
||||
PatchArrayVector &GetPatchArrays() {
|
||||
return _patchArrays;
|
||||
}
|
||||
|
||||
// processes FarPatchArrays and inserts requisite sub-patches for the arrays
|
||||
// containing transition patches
|
||||
static void ConvertPatchArrays(Far::PatchTables::PatchArrayVector const &farPatchArrays,
|
||||
|
Loading…
Reference in New Issue
Block a user