-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(replay): Document skipRequestAnimationFrame option for WebGPU canvas snapshots #16011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nvas snapshots WebGPU canvases require the skipRequestAnimationFrame option when using manual snapshotting because WebGPU textures expire after the current task completes, unlike WebGL which can use preserveDrawingBuffer. References: - WebGPU Explainer: https://gpuweb.github.io/gpuweb/explainer/ - gpuweb/gpuweb#2743: WebGPU rejected preserveDrawingBuffer by design - gpuweb/gpuweb#3295: Canvas texture expiry timing Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
inventarSarah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall.
Just two comments from my side -- please have a look :)
|
|
||
| WebGPU works differently from WebGL. The canvas texture returned by `getCurrentTexture()` is only valid until the current task completes - after that, the texture expires and its contents are no longer accessible. This means that by default, when `snapshot()` defers capture to the next animation frame, it will capture an empty or invalid canvas. | ||
|
|
||
| To fix this, pass `skipRequestAnimationFrame: true` to capture the snapshot immediately: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also require setting enableManualSnapshot: true? If so, we could add the 2-step explanation as in the WebGL section to make sure users don't miss it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, yea it does. Good catch!
Co-authored-by: Sarah Mischinger <[email protected]>
Clarify that enableManualSnapshot must be set before using skipRequestAnimationFrame for WebGPU canvas snapshots. Follows the same 2-step pattern as the WebGL section to ensure users don't miss required configuration. Co-Authored-By: Claude <[email protected]>
inventarSarah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍looks great now!
Adds documentation for the
skipRequestAnimationFrameoption when using manual canvas snapshots with WebGPU.WebGPU textures expire after the current task completes, so deferring snapshot capture to the next animation frame results in an empty canvas. This option captures immediately after rendering.
Sources:
Related: getsentry/sentry-javascript#18804