Branch: refs/heads/webkitglib/2.52
  Home:   https://github.com/WebKit/WebKit
  Commit: 2637a296adf71546cfaa5476743e2d200da3faa5
      
https://github.com/WebKit/WebKit/commit/2637a296adf71546cfaa5476743e2d200da3faa5
  Author: Roberto Rodriguez <[email protected]>
  Date:   2026-02-11 (Wed, 11 Feb 2026)

  Changed paths:
    A LayoutTests/webgl/draw-framebuffer-state-sync-on-bind-expected.txt
    A LayoutTests/webgl/draw-framebuffer-state-sync-on-bind.html
    A 
LayoutTests/webgl/read-framebuffer-attachment-preserves-draw-state-expected.txt
    A LayoutTests/webgl/read-framebuffer-attachment-preserves-draw-state.html
    M Source/WebCore/html/canvas/WebGLFramebuffer.cpp
    M Source/WebCore/html/canvas/WebGLFramebuffer.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

  Log Message:
  -----------
  Cherry-pick 307223@main (45661a525863). 
https://bugs.webkit.org/show_bug.cgi?id=307316

    [WebGL] Prevent READ_FRAMEBUFFER operations from corrupting 
DRAW_FRAMEBUFFER state
    https://bugs.webkit.org/show_bug.cgi?id=307316
    rdar://169621664

    Reviewed by Kimmo Kinnunen.

    Calling framebufferTexture2D() on READ_FRAMEBUFFER was unexpectedly 
modifying
    DRAW_FRAMEBUFFER state. The issue was that drawBuffersIfNecessary() 
unconditionally
    called glDrawBuffers(), which always targets DRAW_FRAMEBUFFER - so 
modifying one
    framebuffer's attachments would corrupt whatever was bound to 
DRAW_FRAMEBUFFER.

    Fix by deferring the glDrawBuffers() call: when attachments change while 
bound to
    READ_FRAMEBUFFER, record that sync is pending and apply it when the 
framebuffer is
    later bound for drawing. The fix handles both WebGL 2.0 (separate READ/DRAW 
bindings)
    and WebGL 1.0 with the WEBGL_draw_buffers extension (single FRAMEBUFFER 
binding).

    Tests: webgl/draw-framebuffer-state-sync-on-bind.html
           webgl/read-framebuffer-attachment-preserves-draw-state.html

    * LayoutTests/webgl/draw-framebuffer-state-sync-on-bind-expected.txt: Added.
    * LayoutTests/webgl/draw-framebuffer-state-sync-on-bind.html: Added.
    * 
LayoutTests/webgl/read-framebuffer-attachment-preserves-draw-state-expected.txt:
 Added.
    * LayoutTests/webgl/read-framebuffer-attachment-preserves-draw-state.html: 
Added.
    * Source/WebCore/html/canvas/WebGLFramebuffer.cpp:
    (WebCore::WebGLFramebuffer::isBoundForDrawing const):
    (WebCore::WebGLFramebuffer::applyFilteredDrawBuffers):
    (WebCore::WebGLFramebuffer::syncDrawBuffersState):
    (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
    * Source/WebCore/html/canvas/WebGLFramebuffer.h:
    * Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
    (WebCore::WebGLRenderingContextBase::setFramebuffer):

    Canonical link: https://commits.webkit.org/307223@main

Canonical link: https://commits.webkit.org/305877.69@webkitglib/2.52



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to