Bug 307316

Summary: [WebGL] Prevent READ_FRAMEBUFFER operations from corrupting DRAW_FRAMEBUFFER state
Product: WebKit Reporter: roberto_rodriguez2
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

roberto_rodriguez2
Reported 2026-02-09 00:08:59 PST
rdar://169621664 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 needed and perform it when the framebuffer is later bound to DRAW_FRAMEBUFFER.
Attachments
roberto_rodriguez2
Comment 1 2026-02-09 00:13:06 PST
EWS
Comment 2 2026-02-10 19:12:03 PST
Committed 307223@main (45661a525863): <https://commits.webkit.org/307223@main> Reviewed commits have been landed. Closing PR #58181 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.