Implement state wrapping in the GOL shader