2d shadowcaster closed tilemap

After a lot of struggling, I can’t find a way to make a dynamic shadowcaster on a 2d tilemap.
Problem is, I can’t bake it since the tilemap is dynamic (add / break bloc, terraria like) and procedurally generated.
Since the map is “closed off” (e.g. big closed cave), and the fact that the embedded shadow caster tilemap doesnt work when you are on the inbound side, I can’t make it work. Does anyone has any idea on how to make it work ?
I already have a code to make a custom shape from the classic one, working in real time (cf ugly schematic), but since it add twice as much shadow complexity it can’t run it in real time even with a single light.
Do anyone have suggestion or solution to make it work ?