Peel the potatoes and cut them into thin slices about 3mm or so with a knife or potato peeler. Keep aside.
If you use dried porcini, place them in a cup with hot water for 5 minutes. Then drain, strain the water, and combine it with the broth. Rinse the mushrooms, chop with a knife, and set aside.
Clean and slice the mushrooms and set aside.
Preheat the oven to 180C degrees (356F).
Grease the bottom of the baking dish with oil or butter, arrange a layer of potatoes, sprinkle with Parmesan cheese, spread the mushrooms over the surface, a few porcini crumbs here and there, a handful of rice (divide it equally among the layers), a pinch of salt, add a few ladles of broth to which you will have added the soaking water from the porcini, and proceed with another layer.
Repeat the same procedure for each layer until you run out of ingredients. Don't forget to add a pinch of salt for each layer.
Make a final layer of potatoes, sprinkle with Parmesan and oregano or dried thyme, and add a few flakes of butter and more broth if the pan contains it. Set aside a few spoons of it to add while cooking.
Cover the pan with aluminum foil and bake in a preheated oven for 20 minutes. Remove the cover and continue cooking for another 10 minutes. Sink a toothpick into the baking dish and add a couple of ladlefuls of broth if it looks like you need to.
Let stand 10 minutes before serving.