Updates From Main
improvements in state management. this should fix a lot of old bugs in dx9 backend :)