Have a procedural wall, need to add a line at the top

Hello !
I’ve made a script generating random procedural meshes, mainly walls, or mountains.
Here’s what I have

Tried to place texture at every 2 triangles, but it gets kind of messed up at edges.

Tiling or clamping a full texture also doesn’t help.
How can it be done efficiently?
I am thinking about a line renderer at the top vertices, but i don’t know about it’s performance.

Why not to make the line in form of a submesh with a black material?