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

Fix crash when shader validation is enabled. #2421

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

squidbus
Copy link
Contributor

I didn't get any feedback on #2416 whether this would be an acceptable fix, so I'm opening it as a PR in case it's wanted.

Basically it seems that for some reason when Metal shader validation is enabled, there may be a crash due to auto-release pool double-release on an MTLComputePipelineDescriptorInternal, but only when using newComputePipelineStateWithFunction. I'm not sure why this is happening or whether it's an internal Metal bug with the validation layer or MoltenVK's fault, but changing it to create a temporary MTLComputePipelineDescriptor and call newComputePipelineStateWithDescriptor resolves the issue for me.

Copy link
Collaborator

@cdavis5e cdavis5e left a comment

Choose a reason for hiding this comment

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

My only concern is that this wouldn't work on iOS 8, but I suspect there aren't many people who are going to care about that.

@squidbus
Copy link
Contributor Author

My only concern is that this wouldn't work on iOS 8, but I suspect there aren't many people who are going to care about that.

If you're referring to the minimum version for newComputePipelineStateWithDescriptor, it is used for other pipelines already so there's no difference for compatibility using it here as well.

@cdavis5e cdavis5e merged commit bd0a550 into KhronosGroup:main Jan 14, 2025
6 checks passed
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.

2 participants