Maya crashes when toggling single view and four view with texture mode on
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Describe the bug**
Hi,
Our artists reported they turned on texture mode on perspective view and when toggling single view and four view would cause Maya to crash.
This one is hard to reproduce, we have tried our best to simplify the repro steps with the Alab scene.
**Steps to reproduce**
Steps to reproduce the behavior:
1. Launch Maya and load the Alab USD scene
2. On the perspective view, turn on 'Textured'
3. **Repeatedly** pressing the space bar **quickly** to toggle single view and four view, hover the mouse cursor at the meantime (claim: this is not the usual workflow in production but we found that it's a sufficient way to reproduce the problem)
4. Maya would crash at some point
Stack trace:
```
OGSMayaConsolidationInfo::UpdateTargetEffectParameterImpl(OGS::Objects::UString*)
OGSShaderManager::EffectInstanceUpdated(OGS::Devices::EffectInstance*, OGS::Objects::UString*)
Autodesk::Maya::OpenMaya20230000::MHWRender::MShaderInstance::setParameter(Autodesk::Maya::OpenMaya20230000::MString const&, float)
pxrInternal_v0_23__pxrReserved__::HdVP2Material::CompiledNetwork::_UpdateShaderInstance(pxrInternal_v0_23__pxrReserved__::HdSceneDelegate*, pxrInternal_v0_23__pxrReserved__::HdMaterialNetwork const&)
pxrInternal_v0_23__pxrReserved__::HdVP2Material::CompiledNetwork::Sync(pxrInternal_v0_23__pxrReserved__::HdSceneDelegate*, pxrInternal_v0_23__pxrReserved__::HdMaterialNetworkMap const&)
pxrInternal_v0_23__pxrReserved__::HdVP2Material::Sync(pxrInternal_v0_23__pxrReserved__::HdSceneDelegate*, pxrInternal_v0_23__pxrReserved__::HdRenderParam*, unsigned int*)
pxrInternal_v0_23__pxrReserved__::Hd_PrimTypeIndex::SyncPrims(pxrInternal_v0_23__pxrReserved__::HdChangeTracker&, pxrInternal_v0_23__pxrReserved__::HdRenderParam*)
pxrInternal_v0_23__pxrReserved__::HdRenderIndex::SyncAll(std::vector, std::allocator > >*, std::unordered_map, std::allocator > >*)
pxrInternal_v0_23__pxrReserved__::HdEngine::Execute(pxrInternal_v0_23__pxrReserved__::HdRenderIndex*, std::vector, std::allocator > >*)
pxrInternal_v0_23__pxrReserved__::ProxyRenderDelegate::_Execute(Autodesk::Maya::OpenMaya20230000::MHWRender::MFrameContext const&)
pxrInternal_v0_23__pxrReserved__::ProxyRenderDelegate::update(Autodesk::Maya::OpenMaya20230000::MHWRender::MSubSceneContainer&, Autodesk::Maya::OpenMaya20230000::MHWRender::MFrameContext const&)
/LD_LIBRARY_PATH/libOpenMayaRender.so(+0xe26ef) [0x7f3891c5d6ef]
OGSSubSceneItem::update()
OGSMayaSubSceneManager::UpdateAllSubScenes()
/LD_LIBRARY_PATH/libOGSMayaBridge.so(+0x1fb86d) [0x7f38e032886d]
/LD_LIBRARY_PATH/libOGSMayaBridge.so(+0x1fae78) [0x7f38e0327e78]
OGSApplicationBridge::UpdateScene(OGSApplicationUpdateCallback&)
OGSMayaRenderer::updateScene(OGSApplicationUpdateCallback&, bool*)
OGSMayaBaseRenderer::performSceneRender(OGSMayaSceneOperation*, unsigned long, bool*)
/LD_LIBRARY_PATH/libOGSMayaBridge.so(+0x1f176b) [0x7f38e031e76b]
/LD_LIBRARY_PATH/libOGSMayaBridge.so(+0x1f8189) [0x7f38e0325189]
TidleRefreshCmd::refreshOGSRender(T3dView*, bool, bool, TdisplayAppearance, bool, bool, bool)
TidleRefreshCmd::refresh(T3dView*, TdisplayAppearance, bool, bool, bool, bool, bool, bool)
TtoolRefresh::refreshFast(T3dView*)
T3dView::doUpdate(Tevent const&)
T3dPort::OnPaint()
QWidget::event(QEvent*)
QApplicationPrivate::notify_helper(QObject*, QEvent*)
QApplication::notify(QObject*, QEvent*)
/LD_LIBRARY_PATH/libExtensionLayer.so(+0x33fc9a) [0x7f38d7e8fc9a]
QCoreApplication::notifyInternal2(QObject*, QEvent*)
QWidgetPrivate::sendPaintEvent(QRegion const&)
QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags, QPainter*, QWidgetRepaintManager*)
QWidgetPrivate::paintOnScreen(QRegion const&)
/LD_LIBRARY_PATH/libQt5Widgets.so.5(+0x1c5d24) [0x7f38d6d89d24]
/LD_LIBRARY_PATH/libQt5Widgets.so.5(+0x1c66d0) [0x7f38d6d8a6d0]
QApplicationPrivate::notify_helper(QObject*, QEvent*)
QApplication::notify(QObject*, QEvent*)
/LD_LIBRARY_PATH/libExtensionLayer.so(+0x33fc9a) [0x7f38d7e8fc9a]
QCoreApplication::notifyInternal2(QObject*, QEvent*)
```
**Expected behavior**
Expect no crash when toggling views.
**Attachments**
https://github.com/user-attachments/assets/8aecee4b-7472-43fe-bcb9-74963988eb00
**Specs (if applicable):**
- OS & version : CentOS 7.8
- Compiler & version GCC 6.3
- Maya version : 2023.3
- Maya USD commit SHA: Official v0.28.0
- Pixar USD commit SHA: Official 23.02/22.5
**Additional context**
I noticed that when turning on texture mode on perspective view, the top/front/side views have texture mode off, I *suspect* [`frameContext.getDisplayStyle()`](https://github.com/Autodesk/maya-usd/blob/635216ee38965198c594f3ccac9e716d35d60d56/lib/mayaUsd/render/vp2RenderDelegate/proxyRenderDelegate.cpp#L1143C51-L1143C66) inside `ProxyRenderDelegate::_Execute()` returns different values for perspective view and other views, which is causing the [material dirtiness](https://github.com/Autodesk/maya-usd/blob/635216ee38965198c594f3ccac9e716d35d60d56/lib/mayaUsd/render/vp2RenderDelegate/proxyRenderDelegate.cpp#L1190-L1196) being on and off too frequently, that triggering material resync more often than needed and Maya crashes at some point.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.