Elegant way to enable-disable RTX from C++

How do games handle enabling-disabling RTX setting from the Menu? So the ideal flow could be to detect at the beginning/first run if the user has RTX capable (IsRayTracingEnabled() function does this and checks almost everything which can enable RTX). Now despite the machine supporting RTX, there’s a possibility that the user may still choose NOT to use it. In that case, if it’s disabled via the menu, then the game needs to be restarted, but am not sure what all flags to be modified after restarting so that RTX is OFF. Also, if user decides to turn it on, am assuming those same set of flags can be enabled?

Extending to this, if user system doesn’t support RTX, then how do you take the non-RTX path for the game using C++?

Any help would be appreciable.

Thanks.

Did you ever figure this out?

I’m setting up an options menu currently and want to have and RTX on/off setting but cannot seem to find any information on how to set that up.

All other graphics settings are neatly handled by UGameUserSettings which works great - but it’s lacking any RTX settings so I’m at a loss.