Ok I missed that it was a runtime thing that you wanted. The best thing I can think of is using distance to nearest surface and then shrinking the instance to a scale of 0,0,0 when its near a surface by remapping for example the dstance 0.5->2 meters to a scaling value of 0->1. they would then scale down as they approach the buildings. Would not require rebuilding of the grass instance buffer either.
The reason that it is so performant is that it can pre build the hierarchical data structure, build a buffer and cull based on that structure. if it rebuilds it every frame then you wont get the benefit of the fast rendering and culling.