Bug 222410 - RemoteGraphicsContextGL ReadPixels does not preserve contents for area that is not part of the Framebuffer
Summary: RemoteGraphicsContextGL ReadPixels does not preserve contents for area that i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Cunningham
URL:
Keywords: InRadar
Depends on:
Blocks: webglgpup
  Show dependency treegraph
 
Reported: 2021-02-25 03:47 PST by Kimmo Kinnunen
Modified: 2022-03-08 22:51 PST (History)
4 users (show)

See Also:


Attachments
Patch (15.53 KB, patch)
2022-03-04 10:44 PST, John Cunningham
no flags Details | Formatted Diff | Diff
Patch for Landing (17.06 KB, patch)
2022-03-07 10:44 PST, John Cunningham
no flags Details | Formatted Diff | Diff
Patch for Landing (17.06 KB, patch)
2022-03-08 11:46 PST, John Cunningham
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-02-25 03:47:52 PST
RemoteGraphicsContext ReadPixels does not preserve contents for area that is not written

When readPixels is used with source rectangle that contains areas that are not part of the Framebuffer, then the memory contents of the buffer should not be changed for that part.

E.g. when doing
data[0] = 77;
 readPixels(-1, -1, 10000000, 10000000, .., data)

then data[0] should be preserved as 77 as -1,-1 is not part of the framebuffer being read.

Problem since the webp->gpup does not don't transfer the buffer, but also does not risk the calculations to only populate part of the result buffer.

webgl/2.0.0/conformance/reading/read-pixels-test.html [ Failure ]
webgl/2.0.0/conformance2/reading/read-pixels-pack-parameters.html [ Failure ]
Comment 1 Radar WebKit Bug Importer 2021-03-04 01:34:38 PST
<rdar://problem/75025951>
Comment 2 John Cunningham 2022-03-04 10:44:48 PST
Created attachment 453856 [details]
Patch
Comment 3 Kimmo Kinnunen 2022-03-07 02:56:56 PST
Comment on attachment 453856 [details]
Patch

Looks good.
Can you remove the entry at the bottom of LayoutTests/platform/ios-wk2/TestExpectations

webkit.org/b/234536 webgl/2.0.0/conformance/reading/read-pixels-test.html
Comment 4 John Cunningham 2022-03-07 10:44:49 PST
Created attachment 454000 [details]
Patch for Landing
Comment 5 John Cunningham 2022-03-08 11:46:16 PST
Created attachment 454137 [details]
Patch for Landing
Comment 6 EWS 2022-03-08 22:51:02 PST
Committed r291032 (248206@main): <https://commits.webkit.org/248206@main>

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