Files
UnrealEngineUWP/Engine/Source/Developer/Windows/ShaderFormatD3D
Arciel Rekman d1e2a85fce Keep rewriting unused inputs until they stop changing (UE-115083)
- In a complex material, compiler may not be able to see through the code to discover all unused inputs.

E.g. first pass compilation says that input A is unused, but B and C are used. After we rewrite the code to remove A, the code is simpler and compiler is now able to see that B is also unused.

Since we pass the "used attributes" to the next stage, this creates a mismatch where vertex shader outputs only C, but pixel shader (rewritten based on the first pass results) expects B and C.

- The fixed code will check if the unused inputs changed, and if so, will go back and rewrite the code based on a more complete info.

- This fixes a bug that JonL ran into for which I haven't yet created a JIRA (will do before checkin).

#rb Ben.Ingram, Rolando.Caloca, Jason.Nadro
#review @Lukas.Hermanns, @Rolando.Caloca, @Ben.Ingram, @Jason.Nadro, @Kevin.Ortegren
#jira UE-115083

[CL 16312596 by Arciel Rekman in ue5-main branch]
2021-05-13 10:21:33 -04:00
..