<?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>240919</bug_id>
          
          <creation_ts>2022-05-25 12:39:31 -0700</creation_ts>
          <short_desc>Material issues on Mac/iOS with WebGL via Metal</short_desc>
          <delta_ts>2022-05-31 23:48:57 -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>ANGLE</component>
          <version>Safari 15</version>
          <rep_platform>All</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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="Gabby Getz">gabby</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>kpiddington</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1871806</commentid>
    <comment_count>0</comment_count>
    <who name="Gabby Getz">gabby</who>
    <bug_when>2022-05-25 12:39:31 -0700</bug_when>
    <thetext>We&apos;ve received reports of rendering issues with materials in CesiumJS (https://github.com/CesiumGS/cesium/issues/9827), including translucent and dashed materials, on iOS devices using WebGL via Metal.

These were occurring as of the latest Safari 15.5 release.

Disabling order independent translucent in the engine appears to remedy the issue, so we&apos;re working on narrowing the issue down to a specific extension, though we believe it may be related to EXT_color_buffer_float.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871850</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2022-05-25 14:56:25 -0700</bug_when>
    <thetext>Unfortunately this doesn&apos;t reproduce on M1 hardware, so Apple engineers will have to triage it.

Submitter, please tell us any specific iOS device types that demonstrate the failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872720</commentid>
    <comment_count>2</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2022-05-30 04:17:21 -0700</bug_when>
    <thetext>I can repro on iPad Pro 4th gen

https://sandcastle.cesium.com/gallery/Wall.html

observe the blue translucent wall rendered as wire-frame only, no blue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872728</commentid>
    <comment_count>3</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2022-05-30 05:05:34 -0700</bug_when>
    <thetext>Gabby, if it is simple for you to do and you have the time:
- It&apos;d be of great help debugging this if there was a .zip file with one scene that reproduces this, as simple scene as possible, with all the source files that are needed.
- Additionally I notice that it was worked around with disabling the order independent translucency. It would be great if the example disabled this workaround, so that the example would reproduce the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872729</commentid>
    <comment_count>4</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2022-05-30 05:08:15 -0700</bug_when>
    <thetext>iPad Pro 4th gen is Apple5 A12 iOS GPU Family 5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872967</commentid>
    <comment_count>5</comment_count>
      <attachid>459888</attachid>
    <who name="Gabby Getz">gabby</who>
    <bug_when>2022-05-31 07:49:31 -0700</bug_when>
    <thetext>Created attachment 459888
Translucency issue - Cesium minimal scene

Thanks! Attached is a minimal scene with the workaround disabled. It uses a CDN of the unminified CesiumJS library. If you need an example which packages the source code directly, please let me know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873149</commentid>
    <comment_count>6</comment_count>
    <who name="Kyle Piddington">kpiddington</who>
    <bug_when>2022-05-31 15:17:28 -0700</bug_when>
    <thetext>Looks like this a lack of support for GL_EXT_float_blend. Commenting this out causes M1 hardware to stop rendering the squares.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873170</commentid>
    <comment_count>7</comment_count>
    <who name="Kyle Piddington">kpiddington</who>
    <bug_when>2022-05-31 16:40:21 -0700</bug_when>
    <thetext>I think I understand what&apos;s going on:

We&apos;ve added EXT_Color_buffer_float support to the Metal based backend for WebGL. However, Cesium doesn&apos;t consider the limitations of EXT_Color_buffer_float when performing rendering.

Specifically, please note the limitations here:
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_color_buffer_float.txt

By default, EXT_color_buffer_float does not require blending for R32F, RG32F, and RGBA32F textures. You also must check for GL_EXT_float_blend support.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873171</commentid>
    <comment_count>8</comment_count>
    <who name="Kyle Piddington">kpiddington</who>
    <bug_when>2022-05-31 16:42:12 -0700</bug_when>
    <thetext>Contrast this with the OpenGL backend, which has no support for EXT_Color_buffer_float, so OIT.js line 28 (const extensionsSupported = context.colorBufferFloat &amp;&amp; context.depthTexture;) returns false. _translucentMRTSupport, and _translucentMultipassSupport will both be false, so we never create a render pass that requests blending.

I suggest also adding context.floatBlend to the list of extensions required for OIT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873239</commentid>
    <comment_count>9</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2022-05-31 23:48:57 -0700</bug_when>
    <thetext>Just pasting this for my personal use future use:
- OpenGL ES 3.0 states floating-point textures are not color-renderable (render to floating-point texture)
- EXT_color_buffer_float makes floating-point textures color-renderable
- EXT_color_buffer_float requires blending to be disabled when rendering to floating-point textures.
- EXT_float_blend allows blending to be enabled when rendering to floating-point textures.

In WebGL, EXT_float_blend is automatically enabled when enabling EXT_color_buffer_float, but only if EXT_float_blend is supported in the first place.

https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/
https://www.khronos.org/registry/webgl/extensions/EXT_float_blend/
https://www.khronos.org/registry/webgl/specs/latest/1.0/
https://www.khronos.org/registry/webgl/specs/2.0/
https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_float_blend.txt
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_color_buffer_float.txt

Closing as working as intended.
There&apos;s something to be said about Web Inspector being able to identify this, but likely it wouldn&apos;t have helped as this was failing on device and people (including me) rarely look for the errors on device...</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>459888</attachid>
            <date>2022-05-31 07:49:31 -0700</date>
            <delta_ts>2022-05-31 07:49:31 -0700</delta_ts>
            <desc>Translucency issue - Cesium minimal scene</desc>
            <filename>Cesium-Box.html.zip</filename>
            <type>application/zip</type>
            <size>1210</size>
            <attacher name="Gabby Getz">gabby</attacher>
            
              <data encoding="base64">UEsDBBQACAAIAKRVv1QAAAAAAAAAAAAAAAAPABAAQ2VzaXVtLUJveC5odG1sVVgMAAsqlmLzKZZi
9QEUAKVUTVPbMBC951csumBmEjsMMG1DlBlIODDtTDst9OMorDUWlSVXkmNCh//eteWUhB7rgyyv
dt/uvn3y/GD1cXnz49MVlKHSi9G8e4EW5p4zNGwxApiXKGS3oW2FQUBeCucxcNaEYvKWQbZ7WIZQ
T/BXo9acfZ/cXkyWtqpFUHcaGeTWBDQUeX3FUd7jfmy/AzCiQs7WCtvausAG69/QVslQcolrleOk
/xiDMioooSc+Fxr58Rgq8aiqptoxkMueofHo+i9BlXFjY569VmIhEn3uVB2UNTsNrJxoQcCdfUzZ
EBNU0LhYoldNBSus7DyLpngcUcC7nLOOJD/Lsrx3TnNbZdK2Rlsh/WB88JlDjcKjz47TdyfZZaO0
zCL8ren6KRRuDemDZ4t5FnMMCbUyP6F0WPx/vuybomkFn7XxnebeMyB/znzYaPQlYohiybZqmd9Z
uRlK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