vello/piet-gpu/shader
Raph Levien 240f44a228 Implement robust dynamic memory
This is the core logic for robust dynamic memory. There are changes to both shaders and the driver logic.

On the shader side, failure information is more useful and fine grained. In particular, it now reports which stage failed and how much memory would have been required to make that stage succeed.

On the driver side, there is a new RenderDriver abstraction which owns command buffers (and associated query pools) and runs the logic to retry and reallocate buffers when necessary. There's also a fairly significant rework of the logic to produce the config block, as that overlaps the robust memory.

The RenderDriver abstraction may not stay. It was done this way to minimize code disruption, but arguably it should just be combined with Renderer.

Another change: the GLSL length() method on a buffer requires additional infrastructure (at least on Metal, where it needs a binding of its own), so we now pass that in as a field in the config.

This also moves blend memory to its own buffer. This worked out well because coarse rasterization can simply report the size of the blend buffer and it can be reallocated without needing to rerun the pipeline. In the previous state, blend allocations and ptcl writes were interleaved in coarse rasterization, so a failure of the former would require rerunning coarse. This should fix #83 (finally!)

There are a few loose ends. The binaries haven't (yet) been updated (I've been testing using a hand-written test program). Gradients weren't touched so still have a fixed size allocation. And the logic to calculate the new buffer size on allocation failure could be smarter.

Closes #175
2022-07-13 12:34:51 -07:00
..
.clang-format shaders: Add .clang-format and reformat 2022-01-30 16:33:14 +09:00
annotated.h Initial implementation of blend modes 2022-02-28 12:38:14 -05:00
backdrop.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
bbox_clear.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
binning.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
bins.h all: add optional memory checks 2021-02-15 16:07:45 +01:00
blend.h More blend mode fixes 2022-05-17 16:12:05 -07:00
build.ninja Fix blending math 2022-05-13 10:18:29 -07:00
clip_leaf.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
clip_reduce.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
coarse.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
draw_leaf.comp Radial gradients 2022-03-30 20:32:13 -07:00
draw_reduce.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
draw_scan.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
drawtag.h Radial gradients 2022-03-30 20:32:13 -07:00
image.png Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
kernel4.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
mem.h Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
path_coarse.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
pathseg.comp Variable size encoding of draw objects 2022-03-14 16:32:08 -07:00
pathseg.h collapse FillCubic and StrokeCubic into Cubic with flags for fill mode 2021-03-19 12:50:12 +01:00
pathtag.h Path stream processing 2021-12-01 07:33:24 -08:00
pathtag_reduce.comp Adjust workgroup sizes 2021-12-08 11:48:38 -08:00
pathtag_scan.comp shaders: Add .clang-format and reformat 2022-01-30 16:33:14 +09:00
ptcl.h Radial gradients 2022-03-30 20:32:13 -07:00
scene.h Initial implementation of blend modes 2022-02-28 12:38:14 -05:00
setup.h Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
state.h ensure consistent path segment transformation 2021-03-19 12:45:23 +01:00
tile.h ensure consistent path segment transformation 2021-03-19 12:45:23 +01:00
tile_alloc.comp Implement robust dynamic memory 2022-07-13 12:34:51 -07:00
transform_leaf.comp shaders: Add .clang-format and reformat 2022-01-30 16:33:14 +09:00
transform_reduce.comp Adjust workgroup sizes 2021-12-08 11:48:38 -08:00
transform_scan.comp shaders: Add .clang-format and reformat 2022-01-30 16:33:14 +09:00