Skip to content
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

WebGPURenderer: ReadRenderTargetPixelsAsync (RFC) #26326

Merged
merged 10 commits into from
Jun 26, 2023
Merged

Conversation

aardgoose
Copy link
Contributor

The WebGPU renderer doesn't have a readRenderTargetPixels or equivalent api yet. WebGPU readback is async by nature so another API is required, this is a plain equivalent returning a Promise that resolves to a TypedArrayBuffer allocated by WebGPU, rather than the user providing an array to receive the results.

Open issues:

  • Previous discussions of an appropriate async api for WebGL2 rendering, see WebGLRenderer: Async Readback API - WIP #24466 etc.
  • The requirement that the bytesPerRow for the GPUBuffer layout must be a multiple of 256.
  • The returned TypedArrayBuffer is not 'transferable', a restriction that does not apply to user supplied buffers.

@sunag

@sunag sunag added this to the r154 milestone Jun 26, 2023
@sunag sunag requested a review from Mugen87 June 26, 2023 01:32
@sunag
Copy link
Collaborator

sunag commented Jun 26, 2023

@aardgoose Great, I just don't merge it now because the @Mugen87 review is very important for this PR :)

aardgoose and others added 2 commits June 26, 2023 10:59
Co-authored-by: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Co-authored-by: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants