Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2020.3.X, 2021.1.X

Votes

1

Found in

2018.4

2019.4

2019.4.9f1

2020.1

2020.2

2021.1

Issue ID

1300770

Regression

No

Editor crashes when changing CustomRenderTexture's material shader if the new shader has a mismatched number of Passes

Texture

-

How to reproduce:
1. Open the attached project named Case_1300770"
2. Select the New Custom Render Texture in the Project Window
3. Under the Material section, change the used shader from Unlit/TestShader to Unlit/Transparent

Expected result: Shader of the Render Texture is changed or an error is thrown if some incompatibilities are present
Actual result: Editor crashes with

Reproducible with: 2018.4.30f1, 2019.4.17f1, 2020.1.17f1, 2020.2.1f1, 2021.1.0a11

Relevant information from the Editor logs:

Assertion failed on expression: 'pass >= 0 && pass < (int)m_Passes.size()'

Material::SetPassFast called with NULL shader pass

Received signal SIGSEGV
Stack trace:
0x00007ff7a3d2ae28 (Unity) ApplyMaterialPassWithCache
0x00007ff7a3d69051 (Unity) Material::SetPassSlowWithShader
0x00007ff7a3ba6cfd (Unity) CustomRenderTextureManager::UpdateCustomRenderTexture
0x00007ff7a3ba6ff7 (Unity) CustomRenderTextureManager::UpdateCustomRenderTextures
0x00007ff7a3ba68e6 (Unity) CustomRenderTextureManager::Update
0x00007ff7a3cbd3b9 (Unity) `InitPlayerLoopCallbacks'::`2'::PostLateUpdateUpdateCustomRenderTexturesRegistrator::Forward
0x00007ff7a3ca644c (Unity) ExecutePlayerLoop
0x00007ff7a3ca6523 (Unity) ExecutePlayerLoop
0x00007ff7a3cab639 (Unity) PlayerLoop
0x00007ff7a441f231 (Unity) PlayerLoopController::UpdateScene
0x00007ff7a441d801 (Unity) Application::TickTimer
0x00007ff7a4818af1 (Unity) MainMessageLoop
0x00007ff7a481c786 (Unity) WinMain
0x00007ff7a6377172 (Unity) __scrt_common_main_seh
0x00007fff68167c24 (KERNEL32) BaseThreadInitThunk
0x00007fff68dcd4d1 (ntdll) RtlUserThreadStart

  1. Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a5

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.