Play a game with optional HDR support that can be toggled in the menu (e.g. Horizon Zero Dawn).
Run shader that changes behavior based on BUFFER_COLOR_SPACE
Turn HDR on/off
Check if shader adapted.
This could cause problems when users are first setting up games, or switching screens. I imagine it might also cause issues if a game starts with an SDR video/menu then goes HDR in-game.
Detect changes and recompile shaders when BUFFER_COLOR_SPACE changes. Include BUFFER_COLOR_SPACE in the hash used when caching shaders.
Note: If you change the game resolution then it can pick up the change, but due to shader caching, if you switch back to a previous resolution it might load shader with wrong cached BUFFER_COLOR_SPACE compiled in.