Fix regression in wildcard includes

DO NOT BLINDLY MERGE. @thatch45 please look at this and make sure that it does not kill kittens, as any changes to render_state should be closely scrutinized.

Resolves #7455.