Skip to content

Cannot Enable VRCLV and GPU Instancing Together #15

@Enverex

Description

@Enverex

As per the title. Doing so causes the shader (metaphira/TableSurface_VRCLV) compilation to fail and go pink.

Shader error in 'metaphira/TableSurface_VRCLV': array reference cannot be used as an l-value; not natively addressable at line 86 (on d3d11)

Compiling Subshader: 0, Pass: FORWARD, Fragment program with DETAIL_CLOTH DIRECTIONAL FOG_EXP INSTANCING_ON INTEGRATE_VRCLV LIGHTPROBE_SH
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
Disabled keywords: DETAIL_OTHER DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON FOG_EXP2 FOG_LINEAR LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SCREEN SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING

With the specific shader code section being (line 86 is the one that starts "unity_SHAr")...

      void LightingStandardVRCLV_GI(SurfaceOutputStandard s, UnityGIInput data, inout UnityGI gi)
      {
         #if defined(INTEGRATE_VRCLV)
            float3 L0, L1r, L1g, L1b;
            LightVolumeSH(data.worldPos, L0, L1r, L1g, L1b);
            unity_SHAr = float4(L1r, L0.r);
            unity_SHAg = float4(L1g, L0.g);
            unity_SHAb = float4(L1b, L0.b);
         #endif
         LightingStandard_GI(s, data, gi);
      }

I'm not aware of any other shaders having this limitation but I don't know enough about shaders in general to resolve it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions