I have a weird issue going on and I'm wondering if anyone has come across it before. It has to do with shader variants which I know has been discussed before, but I still haven't found a good explanation for how to best approach variants when it comes to addressables. In any case, on to the isuse:
Our team just recently upgraded our project from 2022.3.16f1 to 2022.3.28f1. The addressables package in use now is 1.21.21 (not sure what it was before, it might have been the same, or it might have changed). We are using URP and the issue is present on a Mac, targeting iOS, however it is not present on a PC targeting Windows.
Previously there were no issues. Now, after building my addressable groups, the total size of all bundles is small (54 MB or so), but when I enter Play Mode, Unity loads what is seemingly a **** of variants for the URP/Lit, URP/Simple Lit, and URP/Terrain/Lit shaders. The URP/Lit shader size according to the Memory Profiler is nearly 5GB.
I have tried two approaches. Adding all used shaders to a common Addressable Group, and creating a Shader Variant Collection that contains the shaders used by my other Groups, and adding it to the common Group. Both of these approaches result in the same issue.
To reiterate, this issue did not happen on 2022.3.16f1. The size of URP/Lit there was around 40MB on builds.
It is very possible one of my other team members changed a setting somewhere or did something else that accidently screwed things up, so if anyone knows of a setting somewhere that might be tweeked to fix this issue, please let me know. Alternatively, maybe this is a known bug on this version of Unity and it would help to upgrade to a newer version (if so, I couldn't find any information online about it).
Any help would be greatly appreciated.