You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ImageSharp.Drawing.WebGPU/WEBGPU_BACKEND.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,13 @@ The public WebGPU surface area around this backend is small and target-first. Mo
21
21
**Recommended types** — the entry points most applications should use:
22
22
23
23
-`WebGPUEnvironment` exposes explicit support probes for the library-managed WebGPU environment
24
-
-`WebGPUWindow<TPixel>` owns a native window and either runs a render loop or returns `WebGPUSurfaceFrame<TPixel>` instances through `TryAcquireFrame(...)`
25
-
-`WebGPUExternalSurface<TPixel>` attaches to a caller-owned native host via `WebGPUSurfaceHost`; the host application owns the UI object and tells the external surface when the drawable framebuffer resizes
26
-
-`WebGPURenderTarget<TPixel>` owns an offscreen native target for GPU rendering, hybrid CPU plus GPU canvases, and readback
24
+
-`WebGPUWindow` owns a native window and either runs a render loop or returns `WebGPUSurfaceFrame` instances through `TryAcquireFrame(...)`
25
+
-`WebGPUExternalSurface` attaches to a caller-owned native host via `WebGPUSurfaceHost`; the host application owns the UI object and tells the external surface when the drawable framebuffer resizes
26
+
-`WebGPURenderTarget` owns an offscreen native target for GPU rendering, hybrid CPU plus GPU canvases, and readback
27
27
28
28
**Advanced types** — interop escape hatches for applications that already own a WebGPU device, queue, or native surface:
29
29
30
-
-`WebGPUDeviceContext<TPixel>` wraps a shared or caller-owned device and queue and creates native-only or hybrid frames and canvases over external textures
30
+
-`WebGPUDeviceContext` is the internal device/queue binding used by targets and surfaces
31
31
-`WebGPUNativeSurfaceFactory` is the low-level escape hatch for caller-owned native targets
32
32
33
33
Those types all exist to get a `DrawingCanvas` over a native WebGPU target. Once the canvas flushes, `WebGPUDrawingBackend` becomes the execution boundary.
@@ -52,7 +52,7 @@ The backend still has to decide:
52
52
53
53
That is why the backend layer exists separately from the staged scene pipeline itself.
54
54
55
-
The raster pipeline solves "how to rasterize this encoded scene on the GPU".
55
+
The raster pipeline solves "how to rasterize this encoded scene on the GPU".
56
56
`WebGPUDrawingBackend` solves "should this flush go there, and how does the system manage that decision cleanly".
57
57
58
58
## The Core Idea
@@ -156,7 +156,7 @@ The expensive staged work is delegated:
156
156
The public object graph around those responsibilities is also separate:
157
157
158
158
-`WebGPUEnvironment` handles explicit support probes
159
-
-`WebGPUWindow<TPixel>`, `WebGPUExternalSurface<TPixel>`, and `WebGPURenderTarget<TPixel>` are the recommended target constructors; `WebGPUDeviceContext<TPixel>` and `WebGPUNativeSurfaceFactory`are advanced interop escape hatches for caller-owned devices or surfaces
159
+
-`WebGPUWindow`, `WebGPUExternalSurface`, and `WebGPURenderTarget` are the public target constructors; `WebGPUNativeSurfaceFactory`remains the low-level interop escape hatch for caller-owned textures
160
160
-`DrawingCanvas` hands a prepared `CompositionScene` to the backend
161
161
162
162
## The Flush Boundary
@@ -267,7 +267,7 @@ The staged scene pipeline itself is described in [`WEBGPU_RASTERIZER.md`](d:/Git
267
267
If you want to understand the backend first, read the code in this order:
268
268
269
269
1.`WebGPUEnvironment.cs`
270
-
2.`WebGPUWindow{TPixel}.cs`, `WebGPUSurfaceFrame{TPixel}.cs`, `WebGPUExternalSurface{TPixel}.cs`, `WebGPUSurfaceHost.cs`, `WebGPURenderTarget{TPixel}.cs`, and `WebGPUDeviceContext{TPixel}.cs`
270
+
2.`WebGPUWindow.cs`, `WebGPUSurfaceFrame.cs`, `WebGPUExternalSurface.cs`, `WebGPUSurfaceHost.cs`, `WebGPURenderTarget.cs`, and `WebGPUDeviceContext.cs`
271
271
3.`WebGPUDrawingBackend.cs`
272
272
4.`WebGPUFlushContext.cs`
273
273
5.`WebGPURuntime.cs`
@@ -285,7 +285,7 @@ The easiest way to keep this backend straight is to remember that it is not the
285
285
If that model is clear, the major types fall into place:
286
286
287
287
-`WebGPUEnvironment` exposes explicit support probes
288
-
-`WebGPUWindow<TPixel>`, `WebGPUExternalSurface<TPixel>`, and `WebGPURenderTarget<TPixel>` are the recommended target types; `WebGPUDeviceContext<TPixel>` and `WebGPUNativeSurfaceFactory`are advanced interop escape hatches
288
+
-`WebGPUWindow`, `WebGPUExternalSurface`, and `WebGPURenderTarget` are the recommended target types; `WebGPUNativeSurfaceFactory`is the advanced interop escape hatch
289
289
-`WebGPUDrawingBackend` orchestrates and decides policy
290
290
-`WebGPUFlushContext` owns one flush's execution state
Copy file name to clipboardExpand all lines: src/ImageSharp.Drawing.WebGPU/WEBGPU_RASTERIZER.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Together, these types turn one prepared flush into a staged GPU scene, schedule
14
14
15
15
This document starts after two earlier boundaries have already been crossed:
16
16
17
-
- public WebGPU setup has already selected or created a native target through `WebGPUWindow<TPixel>`, `WebGPURenderTarget<TPixel>`, `WebGPUDeviceContext<TPixel>`, or `WebGPUNativeSurfaceFactory`
17
+
- public WebGPU setup has already selected or created a native target through `WebGPUWindow`, `WebGPUExternalSurface`, `WebGPURenderTarget`, or `WebGPUNativeSurfaceFactory`
18
18
-`WebGPUDrawingBackend` has already decided that the flush should stay on the GPU path
19
19
20
20
Support probing through `WebGPUEnvironment` also sits outside this document. The rasterizer describes execution of one staged scene, not environment detection or object construction.
0 commit comments