Bug 230618 - WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
Summary: WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-22 06:12 PDT by Kimmo Kinnunen
Modified: 2021-10-12 05:36 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.61 KB, patch)
2021-10-01 06:49 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (4.69 KB, patch)
2021-10-01 06:54 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch for landing (5.12 KB, patch)
2021-10-02 10:59 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2021-09-22 06:12:41 PDT
WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions

Possibly
        c.enable(c.SCISSOR_TEST);
       
        c.clearColor(0., 1., 0., 0.5);
        c.scissor(0, 0, 300, 50);
        c.clear(c.COLOR_BUFFER_BIT);
        
        c.scissor(125, 50, 50, 50);
        c.clearColor(0., 1., 0., 1.);
        c.clear(c.COLOR_BUFFER_BIT);
        c.scissor(0, 0, 300, 50);
        c.clear(c.COLOR_BUFFER_BIT);
Comment 1 Kenneth Russell 2021-09-22 17:03:04 PDT
Great find - let's try to write a conformance test for this once it's understood.
Comment 2 Radar WebKit Bug Importer 2021-09-29 06:13:13 PDT
<rdar://problem/83668270>
Comment 3 Kimmo Kinnunen 2021-10-01 06:49:18 PDT
Created attachment 439850 [details]
Patch
Comment 4 Kimmo Kinnunen 2021-10-01 06:54:56 PDT
Created attachment 439852 [details]
Patch
Comment 5 Dean Jackson 2021-10-01 13:29:26 PDT
Comment on attachment 439852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439852&action=review

> LayoutTests/ChangeLog:9
> +        done-scissor

?
Comment 6 Kimmo Kinnunen 2021-10-02 10:59:38 PDT
Created attachment 439969 [details]
Patch for landing
Comment 7 Kenneth Russell 2021-10-04 16:27:07 PDT
I defer to Dean's review, but have filed:

Add test for scissor affecting compositing
https://github.com/KhronosGroup/WebGL/issues/3337

to make sure this doesn't get lost, and is handled properly in other browsers.
Comment 8 EWS 2021-10-12 05:36:18 PDT
Committed r283979 (242825@main): <https://commits.webkit.org/242825@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439969 [details].