Bug 238328 - WebGL2 occlusion query works only with early depth test
Summary: WebGL2 occlusion query works only with early depth test
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-24 08:58 PDT by Juraj Bleho
Modified: 2022-03-25 02:28 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juraj Bleho 2022-03-24 08:58:05 PDT
When fragment shader uses discard or gl_FragDepth the result of gl.ANY_SAMPLES_PASSED query is dependent on original depth of fragment instead of modified value from shader.
Comment 1 Radar WebKit Bug Importer 2022-03-24 16:08:38 PDT
<rdar://problem/90799725>
Comment 2 Kenneth Russell 2022-03-24 16:12:43 PDT
Can you offer a minimal test case showing the problem? https://github.com/KhronosGroup/WebGL/tree/main/sdk/tests/conformance2/query has a couple of tests that could be extended.

Would you consider filing this on http://crbug.com/angleproject ? Ideally this will be fixed upstream in ANGLE first and then rolled into WebKit. The same problem likely happens on macOS, at least on M1 hardware.
Comment 3 Juraj Bleho 2022-03-25 02:28:10 PDT
In test you mentioned https://github.com/KhronosGroup/WebGL/tree/main/sdk/tests/conformance2/query just add discard into fragment shader. All pixel should be discarded and result should be 0 but it is 1