<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>135905</bug_id>
          
          <creation_ts>2014-08-13 14:35:07 -0700</creation_ts>
          <short_desc>ios8 webgl shader compiler thinks that pow(negative_float, 2.0) is zero</short_desc>
          <delta_ts>2019-07-22 21:42:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebGL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="makc">makc.the.great</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>dino</cc>
    
    <cc>gman</cc>
    
    <cc>makc.the.great</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1028910</commentid>
    <comment_count>0</comment_count>
    <who name="makc">makc.the.great</who>
    <bug_when>2014-08-13 14:35:07 -0700</bug_when>
    <thetext>well maybe not compiler.

Steps to Reproduce:
create any shader with x * x and pow (x, 2.0) side by side, you will see a difference.

Expected Results:
x * x is always equal to pow (x, 2.0)

Actual Results:
pow (x, 2.0) is zero when x &lt; 0

Version:
ios 8.0 12A4345d

Configuration:
iPad 3

See this commit
https://github.com/makc/makc.github.io/commit/4221dc9788d2f509caf6427571656681fb3ad442

And the demo that is fixed by it:
http://makc.github.io/three.js/map2globe/demo.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028911</commentid>
    <comment_count>1</comment_count>
    <who name="makc">makc.the.great</who>
    <bug_when>2014-08-13 14:38:25 -0700</bug_when>
    <thetext>I actually have a recording of how that demo looked prior to commit: https://www.youtube.com/watch?v=y5-VwWlFZqo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1555002</commentid>
    <comment_count>2</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2019-07-22 21:42:06 -0700</bug_when>
    <thetext>pow(x &lt; 0, ...) is undefined behavior according to the spec

According to the OpenGL ES GLSL 1.0 spec

https://www.khronos.org/files/opengles_shading_language.pdf

Section 8.2 

genType pow (genType x, genType y) 

Returns x raised to the y power, i.e., x ^ y
Results are undefined if x &lt; 0.
Results are undefined if x = 0 and y &lt;= 0.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>