<?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>248032</bug_id>
          
          <creation_ts>2022-11-17 05:28:28 -0800</creation_ts>
          <short_desc>[WPE][GTK] TextureMapperPlatformLayerDmabuf.cpp:107:5: error: &apos;glEGLImageTargetTexture2DOES&apos; was not declared in this scope</short_desc>
          <delta_ts>2025-10-16 01:23:19 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=248074</see_also>
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>kloczko.tomasz</cc>
    
    <cc>magomez</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>plampe</cc>
    
    <cc>zdobersek</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1913150</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-17 05:28:28 -0800</bug_when>
    <thetext>WebKitGTK 2.39.1 does not build in Fedora rawhide or in GNOME master:

/builddir/build/BUILD/webkitgtk-2.39.1/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerDmabuf.cpp: In member function &apos;void WebCore::TextureMapperPlatformLayerDmabuf::validateTexture()&apos;:
/builddir/build/BUILD/webkitgtk-2.39.1/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerDmabuf.cpp:107:5: error: &apos;glEGLImageTargetTexture2DOES&apos; was not declared in this scope
  107 |     glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

/builddir/build/BUILD/webkitgtk-2.39.1/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp: In static member function &apos;static std::unique_ptr&lt;WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::EGLImageData&gt; WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData(WebCore::DMABufObject&amp;)&apos;:
/builddir/build/BUILD/webkitgtk-2.39.1/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:323:9: error: &apos;glEGLImageTargetTexture2DOES&apos; was not declared in this scope
  323 |         glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, data.image[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

(There might be more such failures.)

My local builds work perfectly fine, though.

Looking in GL/gl.h, I see this:

#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif

This suggests that WebKit needs to define GL_GLEXT_PROTOTYPES before including the header if it wants to get this declaration, but we don&apos;t do that anywhere. I am testing a build with -DGL_GLEXT_PROTOTYPES=1 now to see if it works. As to where we should define this value... I suppose it would need to be at the very top of OpenGLShims.h.

I&apos;m not sure why WebKit builds properly for me locally.

Guess #1: different unified source bundles? WebKit does define GL_GLEXT_PROTOTYPES to 0 in ANGLEHeaders.h. That&apos;s surely intended to turn it off, but actually turns it on because gl.h only checks whether it is defined, not what its value is. That ANGLEHeaders.h contains a warning:

// Note: this file can&apos;t be compiled in the same unified source file
// as others which include the system&apos;s OpenGL headers.

If we were to fail to respect that rule, then it could accidentally make the declaration of glEGLImageTargetTexture2DOES available.

Guess #2: when WebKit builds successfully, it&apos;s not actually including the system GL/gl.h (which seems to be desired), but is instead including ANGLE&apos;s from Source/ThirdParty (by accident?).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913160</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-17 07:07:09 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; As to where we should define this value... I suppose it would
&gt; need to be at the very top of OpenGLShims.h.

This actually fixes the build, so I&apos;ll submit a merge request, though I don&apos;t know if it is the correct solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913161</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-17 07:13:26 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6589</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913175</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-17 08:13:12 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #1)
&gt; This actually fixes the build,

Uh-oh, looks like this doesn&apos;t actually work. I tested this in a GNOME master build on x86_64, but had not confirmed that the build failure actually happens on x86_64. Hmm....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913447</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 07:40:24 -0800</bug_when>
    <thetext>*** Bug 248081 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913465</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 08:38:45 -0800</bug_when>
    <thetext>Presumably bug #248074 is intended to fix this. I am testing it now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913504</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 11:08:43 -0800</bug_when>
    <thetext>This is indeed fixed by https://github.com/WebKit/WebKit/pull/6623.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151567</commentid>
    <comment_count>7</comment_count>
    <who name="Pawel Lampe">plampe</who>
    <bug_when>2025-10-16 00:53:54 -0700</bug_when>
    <thetext>The above PR landed already, can we close this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151579</commentid>
    <comment_count>8</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2025-10-16 01:23:19 -0700</bug_when>
    <thetext>(In reply to Pawel Lampe from comment #7)
&gt; The above PR landed already, can we close this issue?

Yup, let&apos;s close it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>