Closed Bug 1895476 Opened 1 year ago Closed 1 year ago

WebGL2: a lots of writes to bufferSubData in pointer lock mode causes canvas freezes

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 125
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: mowod66703, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

WebGL2: a lots of writes to bufferSubData to preallocated buffer via bufferData in canvas.requestPointerLock() mode causes canvas freezes, if no canvas.requestPointerLock() (or exit from it) canvas is refsresing normally due to current possible fps.

Cannot provide sample code coz it is big, but same code works excellent and with 2x higher FPS in Chrome and Edge browsers

Actual results:

in canvas.requestPointerLock() canvas refreshes with freezes

Expected results:

in canvas.requestPointerLock() canvas should refresh with no freezes (as fps allows)

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: Canvas2D
Product: Firefox → Core

Is it possible to give access to select few mozilla developers to a page that reproduces this bug? Without a reproducible testcase, it would be difficult to identify and fix it.

Flags: needinfo?(mowod66703)

I will try to create reproducible demo

Flags: needinfo?(mowod66703)

I investigated and find out that the problem is when JS rAF loop for draw on WebGL2 is under middle load to draw something on canvas and canvas hast attached to it mousemove event listener and when after that canvas.requestPointerLock() is called - then {movementX, movementY} of MouseEvent received are not smooth, they are "jumping" randomly causing related to code based on these values to work like something is freezing.

Bit complicated to create a demo, because of this happens not in all cases, if load is more or less that this disappears, can someone look at mousemoves how values for {movementX, movementY} in canvas.requestPointerLock() mode are calculated? maybe there obvious bug...

P.S. Im still thinking about how to make stable demo
PPS. This happens using different loads in rAF loop (WebGL2 methods call or even if there is a for loop over 10m iterations with calc some dump test data. so the reason is not WebGL2 itself, it is how mousemove behaves in canvas.requestPointerLock() mode.

Please, can someone look at code for mousemove in canvas.requestPointerLock()?

Attached image normal behaviour

Maybe create new bug? Because of reason is not related to WebGL2 (maybe)

I created new bug with more detailed info, https://bugzilla.mozilla.org/show_bug.cgi?id=1895796

this can be closed

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: