I am profiling the web build, and I have some questions.
I have a question about captures. Shader in the memory capture can take an insane amount of memory. Lit shader takes about 0.70 GB, and textures is usualy very small (50 MB) despite there is quite a lot of textures used in the scene. When I make the Editor capture it is the other way around. Textures take about 1 GB and shaders 100 MB. Is it possible that in the build, textures are counted inside shaders?
Last thing, I web build captures, I see the warning about the System Allocator being used. How can I change that? I can’t see anything in the memory settings.
In the Editor your capture tends to include way more Textures that are present in the Editor but won’t make it into the build.
As for the amount of shader memory usage, that’s usually down to an explosion of shader variants that get included into the build and can be reduced with shader variant stripping.
And I might be mistaken but I think Web builds and iOS builds might always use the System Allocator. I should really doublecheck that and remove the warning for snapshots from platforms where that’s the case…
There are 8k variants of Lit shader, but what was puzzling me was the low value of Texture2D in the profiler for the web build. There are quite a lot of textures and four 4k light maps, but those lightmaps take only 1.4 kB in the memory profiler.