Simplifying depth flag test