Weird Shader Error and SRP Batch failure with Hybrid renderer v2 enable

After I switch to HRV2, I found a weird shader error massage :

Shader error in 'HDRP/LitTessellation': 'SampleDirectionalLightmap': cannot implicitly convert from 'Texture2D' to 'Texture2DArray' at Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinGIUtilities.hlsl(77) (on d3d11)

Compiling Vertex program with LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON LOD_FADE_CROSSFADE DOTS_INSTANCING_ON DECALS_3RT _TESSELLATION_DISPLACEMENT _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE _DISPLACEMENT_LOCK_TILING_SCALE _MAPPING_TRIPLANAR _NORMALMAP_TANGENT_SPACE _NORMALMAP _MASKMAP _HEIGHTMAP
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHTMAP_FULL_HDR
Disabled keywords: _SURFACE_TYPE_TRANSPARENT DEBUG_DISPLAY SHADOWS_SHADOWMASK DECALS_OFF DECALS_4RT LIGHT_LAYERS INSTANCING_ON _ALPHATEST_ON _ALPHATOMASK_ON _DEPTHOFFSET_ON _DOUBLESIDED_ON _PIXEL_DISPLACEMENT _PIXEL_DISPLACEMENT_LOCK_OBJECT_SCALE _TESSELLATION_PHONG _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR _EMISSIVE_MAPPING_BASE _MAPPING_PLANAR _REQUIRE_UV2 _REQUIRE_UV3 _BENTNORMALMAP _EMISSIVE_COLOR_MAP _ENABLESPECULAROCCLUSION _SPECULAR_OCCLUSION_NONE _SPECULAR_OCCLUSION_FROM_BENT_NORMAL_MAP _TANGENTMAP _ANISOTROPYMAP _DETAIL_MAP _SUBSURFACE_MASK_MAP _THICKNESSMAP _IRIDESCENCE_THICKNESSMAP _SPECULARCOLORMAP _TRANSMITTANCECOLORMAP _DISABLE_DECALS _DISABLE_SSR _ADD_PRECOMPUTED_VELOCITY _ENABLE_GEOMETRIC_SPECULAR_AA _ENABLE_FOG_ON_TRANSPARENT _MATERIAL_FEATURE_SUBSURFACE_SCATTERING _MATERIAL_FEATURE_TRANSMISSION _MATERIAL_FEATURE_ANISOTROPY _MATERIAL_FEATURE_CLEAR_COAT _MATERIAL_FEATURE_IRIDESCENCE _MATERIAL_FEATURE_SPECULAR_COLOR UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

This error happened randomly, and the shader with such an error will not be batched in srp batcher..... If this happened to HDRP/Lit, our drawcall will be 10x more.....

Reimport .shader file or redo save to .shadergraph file can solve my problem temporality.

I'm using 2020.3 + HDRP 10.5,... and sorry for my English

Did you delete the Library folder after switching to HRV2 ? Stale shader cache data is a known problem when switching from HRV1 to HRV2. HRV1 is no longer maintained, so this issue is probably never going to be fixed.

I haven't found anything about that in the documentation. So I'm going to ask for an update to make sure people know that they have to delete the Library folder when updating to HRV2.

However, If you can reproduce the issue even after deleting the Library folder, please report a bug with a repro case.

Removing the library only helps to solve the issue temporarily, Ill try my best to make a reproduce repo.

Thanks!

Emmm… im sure shader is broken after addressables build if there is a scene object with baked light included. Im still trying to find out why my srp batcher is broken… In my mini repo srp batcher works fine with the error