<?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>314719</bug_id>
          
          <creation_ts>2026-05-13 03:16:40 -0700</creation_ts>
          <short_desc>[WPE][GTK] Atlas textures use spec-violating glTexImage2D(internal=GL_RGBA, format=GL_BGRA), render black on strict GLES drivers</short_desc>
          <delta_ts>2026-05-21 01:39:11 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>315035</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alejandro G. Castro">alex</reporter>
          <assigned_to name="Alejandro G. Castro">alex</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2210462</commentid>
    <comment_count>0</comment_count>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2026-05-13 03:16:40 -0700</bug_when>
    <thetext>SkiaGPUAtlas allocates BitmapTextures with the UseBGRALayout flag, which is meant to give them BGRA storage. BitmapTexture::allocateTexture() and BitmapTexture::reset() currently call:

      glTexImage2D(target, 0, GL_RGBA, w, h, 0, textureFormat(), UNSIGNED_BYTE, nullptr);

where textureFormat() returns GL_BGRA for UseBGRALayout textures. So the actual call for atlas textures is:

      glTexImage2D(target, 0, GL_RGBA, w, h, 0, GL_BGRA, UNSIGNED_BYTE, nullptr);

This combination is undefined per the EXT_texture_format_BGRA8888 spec, which mandates internalFormat == format == GL_BGRA_EXT:

      https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_format_BGRA8888.txt

Driver behaviour observed:

    * Mesa (Intel/AMD/llvmpipe): permissive — accepts the call. Downstream rendering happens to come out correct because TextureMapper&apos;s shaders swizzle BGRA→RGBA at sample time.

    * Adreno (Pixel 7, Android arm64): strict — rejects every upload with GL_INVALID_OPERATION (0x502). Confirmed by glGetError() instrumentation: 100% of atlas uploads fail. The texture is left in undefined state, and SkImages::BorrowTextureFrom(..., kRGBA_8888_SkColorType, ...) reading from undefined storage renders solid black on subsequent FALLBACK direct-draws.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210467</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2026-05-13 03:45:57 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64834</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211632</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-17 23:33:11 -0700</bug_when>
    <thetext>Committed 313395@main (b47541a2e001): &lt;https://commits.webkit.org/313395@main&gt;

Reviewed commits have been landed. Closing PR #64834 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211633</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-17 23:34:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/177318630&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211779</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2026-05-18 12:14:28 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 315035</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2212075</commentid>
    <comment_count>5</comment_count>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2026-05-19 09:31:01 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/65193</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2212860</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-21 01:39:09 -0700</bug_when>
    <thetext>Committed 313653@main (1f31db09ec64): &lt;https://commits.webkit.org/313653@main&gt;

Reviewed commits have been landed. Closing PR #65193 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>