How to use tiled texture with a global mask in unity terrain

Hello,
I have made a unity terrain with a heightmap using the Gaea software.
Additionally, i have exported mask png files that defines where my textures should be.

I innocnetly tried to create a new layer texture with a tiled image and applied my mask in the texture inspector. It obviously doesn’t work at all generating this funny picture :

So i’m wondering how is it possible to do just that, excluding the option to paint manually the texture even with unity masks.

I think i must do a new terrain material that does just that but i (chat GPT i’m not yet a shader guy) could not do it.

If too complicated i can easily turn my terrain into a mesh an do it by shadergraph but again, i don’t know it his will work better.

Do anyone have an idea ? Thanks by advance !

Searched result :