Skip to content
  • Sean Harmer's avatar
    Work around mis-optimisation on QNX/SGX in AA vertex shader · 5846b946
    Sean Harmer authored
    
    
    The new AA algorithm which is implemented in the vertex shader of
    SmoothColorMaterialShader and SmoothTextureMaterialShader exposes
    a driver bug in the glsl compiler/optimiser for the GPU used in
    the BlackBerry PlayBook.
    
    The bug results in the if (scale < 0.0) scale = 1.0 code always
    being executed even when the condition is false. This leads to
    massive corrupion of Image, Rectangle, and BorderImage elements
    when the antialiasing property is enabled.
    
    This commit works around the compiler bug by refactoring the
    vertex shader to explicitly include an else clause. The check for
    negative values is now performed on the numerator only as the
    denominator is dot(dir, dir) which is always positive (square of
    magnitude of dir vector).
    
    This gives the correct behaviour on all platforms (that I have
    access to).
    
    Change-Id: I236542c9b59ff2915e95cbd9300b442be316bba9
    Reviewed-by: default avatarSamuel Rødal <samuel.rodal@digia.com>
    5846b946