Search Issue Tracker

Duplicate

Votes

0

Found in

2018.3.0b7

2018.3.1f1

Issue ID

1116274

Regression

Yes

"GetGfxDevice() should only be called from main thread" error and occasional hard crash with ":SetShaders" > ":ApplyGpuProgram"

Graphics - General

-

Reproduction steps:
1. Open the attached project (OC link).
2. (Optional) Change Editor platform to iOS (higher chance to experience the crash).
3. Play the "LoadGame" scene.
4. Click on the '?' button.

Actual behavior:

Error messages in the Console:
GetGfxDevice() should only be called from main thread
Called Release() on an invalid object:
Serialized stream size doesn't match
Gfx command not handled

Crash call stack (full call stack attached in the edit below):
Thread 31 Crashed:: UnityGfxDeviceWorker
...
7 ??? 0x0000000000000001 0 + 1
8 com.unity3d.UnityEditor5.x 0x000000010079dace GpuProgramMetal::ApplyGpuProgram(GpuProgramParameters const&, unsigned char const*) + 254
9 com.unity3d.UnityEditor5.x 0x00000001007a3d43 MetalContext::SetShaders(GpuProgram**, GpuProgramParameters const**, unsigned char const* const*) + 339
10 com.unity3d.UnityEditor5.x 0x0000000102a55df5 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) + 22965
11 com.unity3d.UnityEditor5.x 0x000000010078ae4c GfxDeviceWorkerAutoreleasePoolProxy + 60
...

Alternative reproduction steps to reproduce the crash:
1. Build and run the attached project.

Reproduced with:
2018.3.0b7, 2019.2.0a2
Metal, OpenGL
Editor, Standalone

Not reproducible with:
2018.2.20f1, 2018.3.0b6

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.