Skip to content

Commit

Permalink
[usdviewq] Workaround apparent PySide6 GL bug
Browse files Browse the repository at this point in the history
Recent versions of PySide6 can apparently leave the
setting of glDepthMask set to false in the GL context.

As a simple workaround we always set glDepthMask to
true before executing GL drawing or picking operations.

Fixes #2996
Fixes #3009

(Internal change: 2330403)
  • Loading branch information
davidgyu authored and pixar-oss committed Jun 11, 2024
1 parent db382f9 commit abb175d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pxr/usdImaging/usdviewq/stageView.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,9 @@ def paintGL(self):
viewProjectionMatrix = Gf.Matrix4f(frustum.ComputeViewMatrix()
* frustum.ComputeProjectionMatrix())

# Workaround an apparent bug in some recent versions of PySide6
GL.glDepthMask(GL.GL_TRUE)

GL.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT)

# ensure viewport is right for the camera framing
Expand Down Expand Up @@ -2175,6 +2178,9 @@ def pick(self, pickFrustum):
# Need a correct OpenGL Rendering context for FBOs
self.makeCurrent()

# Workaround an apparent bug in some recent versions of PySide6
GL.glDepthMask(GL.GL_TRUE)

# update rendering parameters
self._renderParams.frame = self._dataModel.currentFrame
self._renderParams.complexity = self._dataModel.viewSettings.complexity.value
Expand Down

0 comments on commit abb175d

Please sign in to comment.