I came up with an idea to save some texture space by mirroring the corner of a window texture to make the whole window. Now, I could do this using four nested gameobjects, but I wondered if it is possible that I could write a shader that can do this automatically?
No, this would be a procedurally generated mesh. It’s up to you to keep the corners the same size when you regenerate it or modify it via script.
Also note that you would need all nine sections of the texture (no mirroring) in order to create the original example, since the edges and corners are all different.