Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8128955

OpenGL texture shader broken Solid_TextureSecondPassLCD



      On Mac
      fails to compile with:
      ERROR: 0:24: 'any' : no matching overloaded function found
      ERROR: 0:24: '!' : wrong operand type no operation '!' exists that takes an operand of type const float (or there is no acceptable conversion)
      ERROR: 0:24: '' : boolean expression expected
      ERROR: 0:27: 'pow' : no matching overloaded function found
      ERROR: 0:27: '=' : cannot convert from 'const float' to '3-component vector of float'
      ERROR: 0:29: 'pow' : no matching overloaded function found
      ERROR: 0:29: '=' : cannot convert from 'const float' to '3-component vector of float'

      The root of the problem seems to be overloaded operators with seem to compile on some platforms but not on Mac and EGL.

      I found this only by shoving all 176 "stock" shaders through the compile phase to see what broke on different platforms. Did not try it on windows, but did on Mac, Linux (nvidia drivers) and EGL.

      changing the calls for any() and pow() to call the ones shown below seem to help,but I am a noobie at this so am not positive it does the right thing. Also I know that these fragment shaders are the output of a compiler so the change would seem to be needed there. Only Solid_TextureSecondPassLCD seemed to use any() and pow() in this way, so it might just be really broken to start.

              // bool any(float3 x)
              declareFunction(BOOL, "any", FLOAT3, "x");
      This does not match http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml
      which says any(bvec) which is a boolean vector.
              // <ftype> pow(<ftype> x, <ftype> y)
              // <ftype> pow(<ftype> x, float y)

      bool any3(vec3 val) {
              return ((val.x > 0.0) || (val.y > 0.0) || (val.z > 0.0));
      vec3 pow3(vec3 v, float p) {
         vec3 ret;
         ret.x = pow(v.x,p);
         ret.y = pow(v.y,p);
         ret.z = pow(v.z,p);
         return ret;


          Issue Links



              • Assignee:
                thor Thor Johannesson (Inactive)
                ddhill David Hill (Inactive)
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: