Needed to complete fix for #1874 We can't wait until getMTLComputeEncoder() is called to dirty the state, because this call will be avoided by dirty checks themselves. Those checks are comparing against leftover and now incorrect state since the previous encoder has already ended. It needs to be dirtied on encoder end.