After messing around with it a bit more, I've been able to resolve it by doing the following:
RetroLit.shader:
Line 132 ++ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
Line 548 ++ #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
RetroDepthNormalsPass.hlsl:
Line 4 ++ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
Line 5 ++ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GlobalSamplers.hlsl"
Line 6 ++ #include "RetroSurfaceInput.hlsl"
Line 41-45 ++
void depthNormalsFrag(v2f i, out float4 outNormalWS : SV_TARGET0
#ifdef _WRITE_RENDERING_LAYERS
, out uint outRenderingLayers : SV_TARGET1
#endif
)
Line 62 -- return float4(NormalizeNormalPerPixel(i.normalWS), 0.0f)
Line 62 ++ outNormalWS = float4(NormalizeNormalPerPixel(i.normalWS), 0.0f);
Line 63-65 ++
#ifdef _WRITE_RENDERING_LAYERS
outRenderingLayers = EncodeMeshRenderingLayer();
#endif
Apologies for the horrendous formatting, didn't wanna just drop full files, so did my best to write out all of the changes and where they are
Not sure if this would be helpful at all, or even if it causes any issues anywhere else, but it's got it working for me now!
