Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-112834 Make sure that the render item name stored in HdVP2DrawItem exactly … #1597

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

williamkrick
Copy link
Contributor

matches the name of the MRenderItem.

@@ -61,11 +61,9 @@ HdVP2DrawItem::AddRenderItem(MHWRender::MRenderItem* item, const HdGeomSubset* g
RenderItemData& renderItemData = _renderItems.back();

renderItemData._renderItem = item;
renderItemData._renderItemName = _drawItemName;
renderItemData._renderItemName = item->name();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name stored in the _renderItemData must exactly match the name of the MRenderItem. We use the name to remove the item from the subscene container. If the names do not match we'll leak items into the container and forget about them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I changed the code a bit more so that we don't rely on _renderItemName. That member is meant for debugging only.

@williamkrick williamkrick added ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate labels Jul 23, 2021
@kxl-adsk kxl-adsk merged commit 3f95462 into dev Jul 28, 2021
@kxl-adsk kxl-adsk deleted the krickw/MAYA-112834/keep_render_item_names_in_sync branch July 28, 2021 13:23
JGamache-autodesk added a commit that referenced this pull request Oct 18, 2022
In #1339 code was added to share the selection render item between
reprs. The code did not track usage, so as soon as one of the reprs is
removed, the render item was removed from the subscene as well, leaving
dangling pointers in the remaining reprs.

In #1597 code was added that seem to indicate there was suspicion about
render item issues, but sharing was not identified as the cause.

This PR adds use count tracking to the render item so they only get
removed from the subscene once all reprs have stopped using the shared
render item.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants