Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's very easy to create a crash when creating `Primitives` (e.g a Sphere) in a Custom Pass (HDRP). For example, by doing : `GameObject.CreatePrimitive(PrimitiveType.Sphere);` More context in the description of the PR: https://jira.unity3d.com/browse/UUM-2709 As explained from the JIRA ticket, indeed, this should be an illegal case. It seems to be already the case for many scenarios, since this API is used at many places: `ApiRestrictions::RENDERERSCENE_ADDREMOVE` After adding this restriction code, I can confirm the crash is gone. The behavior (creation of Primitives in a Custom Pass) still works well. Though, when starting the HDRP sample project, an error is logged two times in the Console, because of this code in HDRP: ``` // Because SRP rendering happens too late, we need to force the draw calls to update RegisterLocalVolumetricFogEarlyUpdate.PrepareFogDrawCalls(); ``` Since this DrawCall is triggered in the constructor of the `HDRenderPipeline` class, the newly added `APIRestriction` is triggered. I'm already chatting with @antoineL to determine if we could move this code after the constructor. @torbjorn If think you are the initial reporter / investigator of this crash ? Let me know if you see any drawback regarding this solution. You definitely know this part of the code better than me.
- Loading branch information
ad051f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably mentioned the wrong @torbjorn , I have no association with this project. To my knowledge.