
3. ANGLE: Bringing OpenGL ES to the Desktop 531
gence caused by taking different branches may cause differentiated variables to
not have meaningful values for some of the pixels, and thus there’s an undefined
discontinuity in the differentiation. GLSL deals with this by simply stating that
the result is undefined, while for HLSL it causes a compilation error. You can
either use a texture-sampling intrinsic with an explicitly specified LOD value or
“flatten” the branches that contain texture sampling intrinsics. Flattening means
that all pixels execute all code blocks and the desired results are selected after-
ward. Until recently, there was no control ov ...