It should not make any difference. There are no “cash registers” any more.
All modern cash registers are actually data terminals with cash drawers now. The computer will apply all the discounts you earned regardless of the order in which you present them to the cashier.
Basically I agree that it shouldn’t make any difference, but once in a great while it does matters.
For example, if you are barely over the price to qualify for a store special (e.g.. buy $15 on frozen food, get $5 off).
In that case you would want to first use the store card, to knock it from $15 to $10, then you can use your coupons for the individual products next. Otherwise, your coupons may lower your total below the $15 original required purchase.
Most of the time it doesn’t matter. However, as a habit of mine I like to wait until after they ring up everything before giving either, to see how much they think all that stuff is supposedly worth.