Skip to content

Commit

Permalink
Fix build break (PixarAnimationStudios#108)
Browse files Browse the repository at this point in the history
Fix build break

(cherry picked from commit 739250085c57be6c0af2f7a4a081da574d6fa2c0)
  • Loading branch information
PierreWang committed May 26, 2022
1 parent 62f57da commit e584362
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pxr/imaging/hdSt/simpleText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ HdStSimpleText::Sync(HdSceneDelegate *delegate,

if (updateMaterialTag ||
(GetMaterialId().IsEmpty() && displayOpacity != _displayOpacity)) {
TfToken prevMaterialTag = GetMaterialTag();
HdReprSharedPtr const& curRepr = _GetRepr(reprToken);
HdStDrawItem* drawItem = static_cast<HdStDrawItem*>(curRepr->GetDrawItem(0));
TfToken prevMaterialTag = drawItem->GetMaterialTag();
TfToken newMaterialTag;

// Opinion precedence:
Expand All @@ -112,7 +114,7 @@ HdStSimpleText::Sync(HdSceneDelegate *delegate,
}

if (prevMaterialTag != newMaterialTag) {
SetMaterialTag(newMaterialTag);
drawItem->SetMaterialTag(newMaterialTag);
// Trigger invalidation of the draw items cache of the render pass(es).
HdStMarkMaterialTagsDirty(renderParam);
}
Expand Down Expand Up @@ -148,7 +150,7 @@ HdStSimpleText::_UpdateDrawItem(HdSceneDelegate *sceneDelegate,
/* MATERIAL SHADER (may affect subsequent primvar population) */
if ((*dirtyBits & HdChangeTracker::NewRepr) ||
HdChangeTracker::IsAnyPrimvarDirty(*dirtyBits, id)) {
drawItem->SetMaterialShader(HdStGetMaterialShader(this, sceneDelegate));
drawItem->SetMaterialNetworkShader(HdStGetMaterialNetworkShader(this, sceneDelegate));
}

// Reset value of _displayOpacity
Expand Down Expand Up @@ -488,9 +490,9 @@ HdStSimpleText::_UpdateShadersForAllReprs(HdSceneDelegate *sceneDelegate,
"(%s) - Updating geometric and material shaders for draw "
"items of all reprs.\n", GetId().GetText());

HdStShaderCodeSharedPtr materialShader;
HdSt_MaterialNetworkShaderSharedPtr materialShader;
if (updateMaterialShader) {
materialShader = HdStGetMaterialShader(this, sceneDelegate);
materialShader = HdStGetMaterialNetworkShader(this, sceneDelegate);
}

for (auto const& reprPair : _reprs) {
Expand All @@ -501,7 +503,7 @@ HdStSimpleText::_UpdateShadersForAllReprs(HdSceneDelegate *sceneDelegate,
repr->GetDrawItem(0));

if (updateMaterialShader) {
drawItem->SetMaterialShader(materialShader);
drawItem->SetMaterialNetworkShader(materialShader);
}
if (updateGeometricShader) {
if (!TF_VERIFY(_topology)) return;
Expand Down

0 comments on commit e584362

Please sign in to comment.