<?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>268070</bug_id>
          
          <creation_ts>2024-01-25 03:01:44 -0800</creation_ts>
          <short_desc>The usage of flat qualifier breaks the WebGL context in Safari</short_desc>
          <delta_ts>2024-01-25 18:06:17 -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>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>268071</dup_id>
          
          <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="Daniel Eke">endanke</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>dino</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2007508</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Eke">endanke</who>
    <bug_when>2024-01-25 03:01:44 -0800</bug_when>
    <thetext>We have run into a regression regarding the usage of the &quot;flat&quot; storage qualifier in GLSL shaders, which causes the browser to lose the WebGL context across several tabs. 
This breaks rendering of any further WebGL content and to recover, the browser needs to be force-closed and opened again.

The issue was reproducible in Safari on multiple iPad models (MK2K3KN/A and MQDW2TY/A) on one iPhone model (MT9G2ZD/A) and across different iOS versions (16.3.1 and 17.3).
On desktop environment we were unable to reproduce it.

The exact conditions are not clear, as the browser can render some frames before it loses the context, but usually it happens within a couple of seconds.

As a minimal example, we&apos;ve set the following property in a vertex shader:

flat out float v_test;
...
v_test = 1.0;

And accessed it in the fragment shader similar to:


flat in float v_test;
...
float alpha = v_test;
glFragColor = vec4(1.0, 1.0, 1.0, alpha);

The repeated usage of these shaders breaks the context in a couple of seconds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2007793</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-01-25 18:05:34 -0800</bug_when>
    <thetext>*** Bug 268071 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2007795</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-01-25 18:06:17 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 268071 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>