Added additional state checks to avoid unnecessary pos changes or draw calls