<?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>283286</bug_id>
          
          <creation_ts>2024-11-18 01:43:46 -0800</creation_ts>
          <short_desc>[GTK][WPE][Skia] Add GPU synchronization primitives to NativeImage/ImageBuffer for Skia</short_desc>
          <delta_ts>2024-11-18 16:04:48 -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>WPE WebKit</component>
          <version>WebKit Local 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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>283292</dependson>
          <blocked>279618</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nikolas Zimmermann">zimmermann</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2075770</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-11-18 01:43:46 -0800</bug_when>
    <thetext>For the planned threaded GPU rendering mode we need a way to mark
a NativeImage/ImageBuffer &quot;as done&quot;, to inject a fence in the GL
command stream, that we can wait on at a later point in time to
guarantee that all operations finished. Therefore I propose to
add Skia specific functions to ImageBuffer(Backend)/NativeImageBackend:
 
 - finishAcceleratedRenderingAndCreateFence()
 
   Used to notify the underlying SkSurface, that it should flush
   all pending rendering operations and submit the work to the GPU.
   Afterwards inject a fence into the GL command stream, so that we
   we can wait upon completion at a later point, before attempting
   to use the ImageBuffer/NativeImage.

 - waitForAcceleratedRenderingFenceCompletion()

   Performs a &apos;serverWait()&apos; operation on the GLFence, previously
   created by finishAcceleratedRenderingAndCreateFence(). This
   instructs to GPU to await completion of the previous rendering.

finishAcceleratedRenderingAndCreateFence() will be used during
DisplayList recording, whenever an ImageBuffer/NativeImage resource
is used, upon entering the DisplayList::ResourceHeap cache.

waitForAcceleratedRenderingFenceCompletion() will be used during
DisplayList replaying, whenever an ImageBuffer/NativeImage resource
is extracted from the DisplayList::ResourceHeap cache.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075784</commentid>
    <comment_count>1</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-11-18 02:24:33 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/36794</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075986</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-11-18 16:04:45 -0800</bug_when>
    <thetext>Committed 286767@main (774fd3dddd84): &lt;https://commits.webkit.org/286767@main&gt;

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

    </bug>

</bugzilla>