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

APPLE: Fix crash in skinned animation on Metal #1978

Merged

Conversation

creijon
Copy link
Contributor

@creijon creijon commented Aug 1, 2022

Description of Change(s)

The function HdStCopyComputationGPU::Execute() had a call to GLF_POST_PENDING_GL_ERRORS in it. This macro expands out to include openGL-specific calls such as glGetError() etc. On Metal applications these cause an exception if the GL context wasn't initialised.

This crash was found when performing skinning calculations. See the HumanFemale test model for a reproduction, running in the Apple HydraPlayer sample application from WWDC 2022.

Also removed the include to pxr/imaging/glf/diagnostic.h in pxr/imaging/hdSt/extCompGpuComputation.cpp where it isn't needed.

Suggestion: The file pxr/imaging/glf/diagnostic.h is included in various other places in HdSt files, but it is only used for the GLF_GROUP_FUNCTION macro. I think we should move this macro to the Hd library to remove the dependancy from HdSt onto Glf entirely. It's dangerous to have the glf code included, even if it isn't used. I'm happy to make this change but it should be in a separate PR.

Fixes Issue(s)

  • Crash in macOS applications
  • I have submitted a signed Contributor License Agreement

@creijon creijon changed the title APPLE: Remove openGL specific code from common HdSt function APPLE: Fix crash in skinned animation on Metal Aug 2, 2022
@sunyab
Copy link
Contributor

sunyab commented Aug 4, 2022

Filed as internal issue #USD-7538

@pixar-oss pixar-oss merged commit bb2f334 into PixarAnimationStudios:dev Sep 1, 2022
@creijon creijon deleted the jon/dev/copy_compute_crash branch September 1, 2022 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants