Search Issue Tracker

Fixed

Fixed in 2021.3.40f1, 2022.3.33f1, 6000.0.6f1, 7000.0.0a1

Votes

0

Found in

2021.3.37f1

2022.3.22f1

6000.0.0b16

7000.0.0a1

Issue ID

UUM-71342

Regression

Yes

ResolveUsePasses also finds fallback shader passes, and if used asserts about invalid keyword states

--

-

VRChat has encountered a case where ResolveUsePasses is discovering fallback subshader passes and adding them to the results list, and then later selecting those. Making an engine change to only select passes from the targetted shader's subshaders solves the issue, and highlights that the pass was perfectly usable.

For a currently unknown reason I can't reproduce this in a standalone case naturally. The same passes will be selected with both the expected and fallback-pass being added to the shader's pass list, but the standalone happily uses the correct pass. Something in the VRChat project or user-built content is causing the discovered fallback pass to be used instead however.

You can at least force a secondary issue however by forcing selection of the found UsePass result:
# I've attached the shader assets used for these tests. Get those into a project.
# Use the built-in renderer to be consistent with my tests, and VRChat.
# Use the Synergiance/AckToon/Medium shader, which has a UsePass reference to "Synergiance/AckToon/Light/SHADOWCASTER".
# Ensure shadows are in-use.
# Modify the Synergiance/AckToon/Light shader to delete the SHADOWCASTER pass. This'll force it to only find the fallback.
# Play in editor.
# You should see "Incompatible keyword states" errors logged from use of the fallback pass.

This appears to be a regression from [https://github.cds.internal.unity3d.com/unity/unity/commit/5bce1dc16fbb2458d1809a1de43c234f7d75b239]

Prior to this change, fallback shader passes couldn't end up being selected.

 

*Steps to reproduce:*

No standalone repro for the full issue, although I've listed a method above to force what I've seen on VRChat, which results in "Incompatible keyword states" asserts firing.

Since I can't explain the difference in pass selection yet however, I don't want to upload a misleading repro project here.

*Actual results:* 

A fallback shader's pass is selected for UsePass, despite the targetted one being supported and usable. 'Incompatible keyword states' are also logged if a fallback pass is selected.

*Expected results:* 

I'd expect "Synergiance/AckToon/Light/SHADOWCASTER" to not resolve to "Some/Fallback/Shader/SHADOWCASTER" based of UsePass documentation, although it seems a supportable case. It at least shouldn't result in keyword state asserts triggering however.

 

*Reproducible with versions:* 

Seen on 2022.3.22f1

*Not reproducible with versions:* 

*Can’t test with versions:* 
*  

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.