SpeedTree Billboard Batching Issue

In our project, we copy the content of depth buffer generated by depth pass, to the depth buffer used by rendering opaque objects, trying to utilize Early Z to avoid some cost of executing pixel shader. Everything is OK except some speedtree billboards flicker. Using RenderDoc, I found the content of depth buffer generated by two passes (depth pass and drawing pass) are not the same completely, which is caused by billboard batching:

In detph pass, 7 billboards are splitted to two batches, while in draw pass, they are in one batch. So, one billboard is rendered differently in depth pass and draw pass. In depth pass, this billboard’s scale is stored in world matrix, while in draw pass, the scale is stored in vertex attribute(TEXCOORD1), so it may cause some error.

I have this issue when using OpenVR. Unity version is beta 23.

My question is that is it an expected result or just a bug?

My gut feeling is it’s a bug. We don’t do math calculation when SpeedTree billboards are batched, so no floating point error is expected. Please file us a bugreport and I’ll have a look ASAP.

Here are some screenshots.

Issue:

Normal:

I have submitted the bug report. The case number is 813399.

Can you take a look at this issue?