Skip to content

Commit 229a25c

Browse files
unhyperbolicpixar-oss
authored andcommitted
HdRenderIndex: Adding new constructor that takes the terminal scene index and does not construct the emulation scene index, the merging scene index and the subsequent scene indices.
The new constructor is for applications that do not need front-end emulation in the render index and take complete responsibility for creating the entire scene index graph (including the scene index plugins). (Internal change: 2379800)
1 parent 8e980f9 commit 229a25c

File tree

4 files changed

+150
-66
lines changed

4 files changed

+150
-66
lines changed

pxr/imaging/hd/changeTracker.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ HdChangeTracker::HdChangeTracker()
4848
, _rprimRenderTagVersion(1)
4949
, _taskRenderTagsVersion(1)
5050
, _emulationSceneIndex(nullptr)
51+
, _disableEmulationAPI(false)
5152
{
5253
/*NOTHING*/
5354
}
@@ -127,6 +128,10 @@ HdChangeTracker::MarkRprimDirty(SdfPath const& id, HdDirtyBits bits)
127128
_emulationSceneIndex->DirtyPrims({{id, locators}});
128129
}
129130
} else {
131+
if (_disableEmulationAPI) {
132+
TF_CODING_ERROR(
133+
"Calling method on HdChangeTracker that requires emulation.");
134+
}
130135
// XXX: During the migration, "DirtyPrimvar" implies DirtyPoints/etc.
131136
if (bits & DirtyPrimvar) {
132137
bits |= DirtyPoints | DirtyNormals | DirtyWidths;
@@ -409,6 +414,10 @@ HdChangeTracker::MarkTaskDirty(SdfPath const& id, HdDirtyBits bits)
409414
_emulationSceneIndex->DirtyPrims({{id, locators}});
410415
}
411416
} else {
417+
if (_disableEmulationAPI) {
418+
TF_CODING_ERROR(
419+
"Calling method on HdChangeTracker that requires emulation.");
420+
}
412421
_MarkTaskDirty(id, bits);
413422
}
414423
}
@@ -496,6 +505,10 @@ HdChangeTracker::MarkInstancerDirty(SdfPath const& id, HdDirtyBits bits)
496505
_emulationSceneIndex->DirtyPrims({{id, locators}});
497506
}
498507
} else {
508+
if (_disableEmulationAPI) {
509+
TF_CODING_ERROR(
510+
"Calling method on HdChangeTracker that requires emulation.");
511+
}
499512
_MarkInstancerDirty(id, bits);
500513
}
501514
}
@@ -623,6 +636,10 @@ HdChangeTracker::MarkSprimDirty(SdfPath const& id, HdDirtyBits bits)
623636
_emulationSceneIndex->DirtyPrims({{id, locators}});
624637
}
625638
} else {
639+
if (_disableEmulationAPI) {
640+
TF_CODING_ERROR(
641+
"Calling method on HdChangeTracker that requires emulation.");
642+
}
626643
_MarkSprimDirty(id, bits);
627644
}
628645
}
@@ -720,6 +737,10 @@ HdChangeTracker::MarkBprimDirty(SdfPath const& id, HdDirtyBits bits)
720737
_emulationSceneIndex->DirtyPrims({{id, locators}});
721738
}
722739
} else {
740+
if (_disableEmulationAPI) {
741+
TF_CODING_ERROR(
742+
"Calling method on HdChangeTracker that requires emulation.");
743+
}
723744
_MarkBprimDirty(id, bits);
724745
}
725746
}
@@ -993,6 +1014,11 @@ HdChangeTracker::MarkAllRprimsDirty(HdDirtyBits bits)
9931014
return;
9941015
}
9951016

1017+
if (_disableEmulationAPI) {
1018+
TF_CODING_ERROR(
1019+
"Calling method on HdChangeTracker that requires emulation.");
1020+
}
1021+
9961022
//
9971023
// This function runs similar to calling MarkRprimDirty on every prim.
9981024
// First it checks to see if the request will set any new dirty bits that
@@ -1286,5 +1312,11 @@ HdChangeTracker::_SetTargetSceneIndex(HdRetainedSceneIndex *emulationSceneIndex)
12861312
_emulationSceneIndex = emulationSceneIndex;
12871313
}
12881314

1315+
void
1316+
HdChangeTracker::_SetDisableEmulationAPI(bool disable)
1317+
{
1318+
_disableEmulationAPI = disable;
1319+
}
1320+
12891321
PXR_NAMESPACE_CLOSE_SCOPE
12901322

pxr/imaging/hd/changeTracker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,9 @@ class HdChangeTracker
655655
// Does not take ownership. The HdRenderIndex manages the lifetime of this
656656
// scene index.
657657
HdRetainedSceneIndex * _emulationSceneIndex;
658+
bool _disableEmulationAPI;
658659
void _SetTargetSceneIndex(HdRetainedSceneIndex *emulationSceneIndex);
660+
void _SetDisableEmulationAPI(bool);
659661

660662
// Private methods which implement the behaviors of their public
661663
// equivalents. The public versions check to see if legacy emulation is

0 commit comments

Comments
 (0)