From 9797a9379c6eb47c591863fb9df07abf3a8b89a9 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 20 Oct 2024 10:15:33 -0700 Subject: [PATCH 1/3] Update 15419_Gpu_readback.md --- .../0.15/release-notes/15419_Gpu_readback.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/release-content/0.15/release-notes/15419_Gpu_readback.md b/release-content/0.15/release-notes/15419_Gpu_readback.md index d551d5a153..30ee9757b7 100644 --- a/release-content/0.15/release-notes/15419_Gpu_readback.md +++ b/release-content/0.15/release-notes/15419_Gpu_readback.md @@ -1,4 +1,14 @@ - - +The new `Readback` component simplifies the tricky process of getting data back from the GPU to the CPU using an observer based API. - +```rust +commands.spawn(Readback::buffer(buffer.clone())).observe( + |trigger: Trigger| { + let data = trigger.event().to_shader_type(); + // ... + }, +); +``` + +When spawned into the main world the `Readback` component will queue a `Handle` or `Handle` to be asynchronously read and copied back from the GPU to CPU in a future frame. + +This is especially useful for debugging, saving GPU-generated data, or performing CPU-side computations with results from the GPU. It’s perfect for scenarios where you need to analyze simulation data, capture rendered frames, or process large datasets on the GPU and retrieve the results for further use on the CPU. From 9c1fa6cb538a98ad2e31ed3ffaa51e18101a2c68 Mon Sep 17 00:00:00 2001 From: charlotte Date: Sun, 20 Oct 2024 11:26:08 -0700 Subject: [PATCH 2/3] Update 15419_Gpu_readback.md --- release-content/0.15/release-notes/15419_Gpu_readback.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release-content/0.15/release-notes/15419_Gpu_readback.md b/release-content/0.15/release-notes/15419_Gpu_readback.md index 30ee9757b7..9c2fac76e3 100644 --- a/release-content/0.15/release-notes/15419_Gpu_readback.md +++ b/release-content/0.15/release-notes/15419_Gpu_readback.md @@ -9,6 +9,8 @@ commands.spawn(Readback::buffer(buffer.clone())).observe( ); ``` -When spawned into the main world the `Readback` component will queue a `Handle` or `Handle` to be asynchronously read and copied back from the GPU to CPU in a future frame. +Normally, manually retrieving data from the GPU involves a lot of boilerplate and careful management of GPU resources. You have to deal with synchronization, ensure the GPU has finished processing, and handle copying data between memory spaces—which isn’t straightforward! + +The new `Readback` component streamlines this process. When spawned into the main world, `Readback` will queue a `Handle` or `Handle` to be asynchronously read and copied back from the GPU to CPU in a future frame where it will trigger a `ReadbackComplete` event containing the raw bytes of the resource. This is especially useful for debugging, saving GPU-generated data, or performing CPU-side computations with results from the GPU. It’s perfect for scenarios where you need to analyze simulation data, capture rendered frames, or process large datasets on the GPU and retrieve the results for further use on the CPU. From a637c6462ae376c1d61eb36edb7382f387f6934d Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Sun, 20 Oct 2024 15:07:55 -0400 Subject: [PATCH 3/3] Hyphen-nit --- release-content/0.15/release-notes/15419_Gpu_readback.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-content/0.15/release-notes/15419_Gpu_readback.md b/release-content/0.15/release-notes/15419_Gpu_readback.md index 9c2fac76e3..9bca2169eb 100644 --- a/release-content/0.15/release-notes/15419_Gpu_readback.md +++ b/release-content/0.15/release-notes/15419_Gpu_readback.md @@ -1,4 +1,4 @@ -The new `Readback` component simplifies the tricky process of getting data back from the GPU to the CPU using an observer based API. +The new `Readback` component simplifies the tricky process of getting data back from the GPU to the CPU using an observer-based API. ```rust commands.spawn(Readback::buffer(buffer.clone())).observe(