<?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>229404</bug_id>
          <alias>webglcleanup</alias>
          <creation_ts>2021-08-23 03:35:13 -0700</creation_ts>
          <short_desc>WebGL has a lot of #if USE(ANGLE) blocks, making it hard to maintain</short_desc>
          <delta_ts>2024-01-17 02:07:41 -0800</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>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>229402</dependson>
    
    <dependson>229405</dependson>
          <blocked>221664</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Kimmo Kinnunen">kkinnunen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alex</cc>
    
    <cc>dino</cc>
    
    <cc>djg</cc>
    
    <cc>don.olmstead</cc>
    
    <cc>estea</cc>
    
    <cc>fujii</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1786378</commentid>
    <comment_count>0</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2021-08-23 03:35:13 -0700</bug_when>
    <thetext>WebGL has a lot of #if USE(ANGLE) blocks, making it hard to maintain

There are 3 major implementations for WebGL:
- OpenGL
- OpenGL ES
- ANGLE

The WebGL layer should not #ifdef around these variations, rather the differences should be abstracted somehow so that the WebGL implementation is easier to maintain correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786379</commentid>
    <comment_count>1</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2021-08-23 03:40:24 -0700</bug_when>
    <thetext>In my personal opinion, it is only viable to run WebGL correctly with the ANGLE implementation. 

The simplest option to fix this bug, option A, would be to:
1) remove all WebGL-related code that is not inside #if USE(ANGLE).

The other option, option B, would be to:
1) Move GCGL ANGLE implementation to GraphicsContextGLANGLE
2) Move #if !USE(ANGLE) code from WebGL to GraphicsContextGLOpenGL

However, option B has the problem that TextureMapper uses GraphicsContextGLOpenGL, and it&apos;s not entirely clear to me if it&apos;s expected to work on ANGLE and OpenGL or just on OpenGL. If it&apos;s the latter, then the task is a bit simpler. If the former, then it&apos;s more work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786380</commentid>
    <comment_count>2</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2021-08-23 03:42:34 -0700</bug_when>
    <thetext>Hironori, would you have idea what is expected of TextureMapper, and/or who could give opinion on whether or not WebGL should work for non-Cocoa WebKit without ANGLE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786395</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-08-23 05:19:46 -0700</bug_when>
    <thetext>WinCairo finished USE_ANGLE migration. As far as I know, Igalia is working on the migration for GTK and WPE ports. (Bug 225563 comment 6).
WebGL should  work for them without ANGLE until Igalia finishes the migration.

WinCairo is using TextureMapper with ANGLE and GraphicsLayerTextureMapper.
GTK and WPE ports are using TextureMapper with OpenGL and GLES and CoordinatedGraphicsLayer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1788471</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-08-30 03:36:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/82517622&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817512</commentid>
    <comment_count>5</comment_count>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2021-11-23 13:28:09 -0800</bug_when>
    <thetext>(In reply to Fujii Hironori from comment #3)
&gt; WinCairo finished USE_ANGLE migration. As far as I know, Igalia is working
&gt; on the migration for GTK and WPE ports. (Bug 225563 comment 6).
&gt; WebGL should  work for them without ANGLE until Igalia finishes the
&gt; migration.
&gt; 
&gt; WinCairo is using TextureMapper with ANGLE and GraphicsLayerTextureMapper.
&gt; GTK and WPE ports are using TextureMapper with OpenGL and GLES and
&gt; CoordinatedGraphicsLayer.

Yes, we are currently working in a solution with ANGLE as the WebGL backend. We started checking and updating the current code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891917</commentid>
    <comment_count>6</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2022-08-17 04:18:17 -0700</bug_when>
    <thetext>Ping, any progress on removing non-ANGLE WebGL codepaths?
Any place you would need help with that I would be able to contribute?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891926</commentid>
    <comment_count>7</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2022-08-17 04:57:40 -0700</bug_when>
    <thetext>The desire is to make the switch after next release branching. That event is a matter of 1-2 weeks.

In addition to that there&apos;s certain testing environment issues that still need resolving under the GTK port, but that&apos;s possibly addressable after turning ANGLE on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892036</commentid>
    <comment_count>8</comment_count>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2022-08-17 13:36:40 -0700</bug_when>
    <thetext>Could we have a discussion on this plan before moving forward?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892501</commentid>
    <comment_count>9</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2022-08-19 14:31:25 -0700</bug_when>
    <thetext>This is being discussed in the #angle channel of the open source webkit slack workspace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005559</commentid>
    <comment_count>10</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2024-01-17 02:07:41 -0800</bug_when>
    <thetext>Thhe ANGLE ifdef blocks are gone</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>