Added mode code to prevent unneccessary state changes from the deferred render context