Stop iOS build from stripping STEREO_INSTANCING_ON shader variants?

I’m making a modified version of the Universal Render Pipeline that takes advantage of the STEREO_INSTANCING_ON branches of the URP shaders. It’s working great on desktop, doing exactly what I want it to do, but when building for iOS, it strips these stereo instancing shader variants.

I am looking everywhere for a place to prevent this from happening. I’ve tried, with no success:

  • Turning off Strip Unused Variants
  • Instancing Variants set to Keep All
  • Adding #pragma multi_compile _ STEREO_INSTANCING_ON manually to shaders
  • Turning on XR with a Mock HMD Loader, set to use Single Pass Instanced rendering (I should make a bug report, because this one is broken, it needs the STEREO_INSTANCING_ON variants to work and throws errors+doesn’t render without them)
  • Writing a IPreprocessShaders script which checks for STEREO_INSTANCING_ON in the shaderKeywordSet, with the callbackOrder set to -10000. They show up in my mac desktop builds, but not in iOS, even though I run the script early, which tells me they are stripped from the iOS builds before I can even get to them.
  • Making a Shader Variant Collection to include them, but I have not gotten to this to work. It is still missing shaders even after creating the collection while running the scene in editor. And this feels messy anyway, like I’d never really be able to figure out if I was including all the ones I needed to.

I’m looking to see if there is any way to get these variants into my iOS builds. They are completely necessary for the pipeline I am working on. Thanks for any help in advance!

Hi!
These variants are controlled directly by the engine. There’s no way to add them manually if the engine thinks the target platform doesn’t use them.