Title: [289802] trunk/Source/WebKit
Revision
289802
Author
[email protected]
Date
2022-02-15 05:10:35 -0800 (Tue, 15 Feb 2022)

Log Message

GPUP WebGL: WTF::RefCountedBase::applyRefDerefThreadingCheck() fails due to RemoteGraphicsContextGL::paintPixelBufferToImageBuffer
https://bugs.webkit.org/show_bug.cgi?id=236501

Patch by Kimmo Kinnunen <[email protected]> on 2022-02-15
Reviewed by Antti Koivisto.

No new tests, tested by existing WebGL conformance tests which fail from time to time with the assertion.

Avoid assertion about cross-thread deref on ArrayBufferView owned by PixelBuffer. The PixelBuffer
is passed to RemoteRenderingBackend thread for drawing and then deallocated there. In this use-case
no other referneces to the ArrayBufferView exist and the PixelBuffer is moved, so it is safe to
disable the cross-thread deref assertion.

* GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289801 => 289802)


--- trunk/Source/WebKit/ChangeLog	2022-02-15 12:31:32 UTC (rev 289801)
+++ trunk/Source/WebKit/ChangeLog	2022-02-15 13:10:35 UTC (rev 289802)
@@ -1,3 +1,20 @@
+2022-02-15  Kimmo Kinnunen  <[email protected]>
+
+        GPUP WebGL: WTF::RefCountedBase::applyRefDerefThreadingCheck() fails due to RemoteGraphicsContextGL::paintPixelBufferToImageBuffer
+        https://bugs.webkit.org/show_bug.cgi?id=236501
+
+        Reviewed by Antti Koivisto.
+
+        No new tests, tested by existing WebGL conformance tests which fail from time to time with the assertion.
+
+        Avoid assertion about cross-thread deref on ArrayBufferView owned by PixelBuffer. The PixelBuffer
+        is passed to RemoteRenderingBackend thread for drawing and then deallocated there. In this use-case
+        no other referneces to the ArrayBufferView exist and the PixelBuffer is moved, so it is safe to
+        disable the cross-thread deref assertion.
+
+        * GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
+        (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer):
+
 2022-02-15  Adrian Perez de Castro  <[email protected]>
 
         [GTK][WPE] Inclusion of OpenGLShims.h should not depend on USE(GLX)

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp (289801 => 289802)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp	2022-02-15 12:31:32 UTC (rev 289801)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp	2022-02-15 13:10:35 UTC (rev 289802)
@@ -253,6 +253,11 @@
     Lock lock;
     Condition conditionVariable;
     bool isFinished = false;
+
+    // FIXME: This should not be needed. Maybe ArrayBufferView should be ThreadSafeRefCounted as it is used in accross multiple threads.
+    // The call below is synchronous and we transfer the ownership of the `pixelBuffer`.
+    if (pixelBuffer)
+        pixelBuffer->data().disableThreadingChecks();
     m_renderingBackend->dispatch([&, contextAttributes = m_context->contextAttributes()]() mutable {
         if (auto imageBuffer = m_renderingBackend->remoteResourceCache().cachedImageBuffer(target)) {
             // Here we do not try to play back pending commands for imageBuffer. Currently this call is only made for empty
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to